Processing method and electronic equipment
By dynamically controlling the switching of intelligent agents between modes inside and outside the target application, the problem of the inability of intelligent agents to migrate across applications is solved, achieving seamless connection of intelligent agent services and continuity of user experience, and improving workflow efficiency across applications and environments.
Patent Information
- Application Number
- CN202511787652.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-02-27
AI Technical Summary
Existing intelligent agents are typically confined to their host applications and cannot be migrated across applications, leading to service interruptions and a fragmented user experience, thus reducing the efficiency and accuracy of intelligent agent applications.
By responding to the trigger command, the target application is launched, its working status is obtained in real time, and the target agent is dynamically controlled to switch between the first mode and the second mode based on this status. In the first mode, the agent provides services within the target application, and in the second mode, it provides services outside the target application.
It enables seamless switching of intelligent agents in different application environments, improves workflow continuity and overall efficiency across applications and environments, and ensures seamless service integration and continuous user experience.
Smart Images

Figure CN121579098A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of agents, and more particularly, to a processing method and an electronic device. BACKGROUND
[0002] With the popularization of artificial intelligence agent technology, agents have been widely integrated into various application programs of electronic devices, such as browsers, office application programs, and the like, to improve user operation efficiency. However, existing agents are usually limited to running within their host applications, and their functions and interactions are limited to the application environment. When a user switches to another application, the agent cannot follow the migration, resulting in service interruption, the need to reconfigure the context environment or user usage information, and the like, which reduces the efficiency and accuracy of agent applications. SUMMARY
[0003] Therefore, the present application provides the following technical solutions:
[0004] A processing method, comprising:
[0005] in response to a trigger instruction, starting a target application;
[0006] obtaining a working state of the target application;
[0007] based on the working state of the target application, controlling a target agent of the target application to switch between a first mode and a second mode;
[0008] wherein, in the first mode, the target agent has the ability to obtain first content within the target application and provide a first intelligent service based on the first content; in the second mode, the target agent has the ability to obtain second content outside the target application and provide a second intelligent service based on the second content.
[0009] Optionally, the target agent includes a first agent and a second agent, the first agent runs in the first mode, and the second agent runs in the second mode, wherein, based on the working state of the target application, controlling the target agent of the target application to switch between the first mode and the second mode, comprises:
[0010] in response to the working state of the target application being a first working state, enabling the first agent;
[0011] in response to the working state of the target application being a second working state, enabling the second agent;
[0012] The first working state represents that the target application is in an interactive running state; and the second working state represents that the target application is in a non-interactive running state.
[0013] Optionally, the second agent has the capability of interacting with a third agent other than the target application, and the enabling the second agent in response to the working state of the target application being the second working state comprises:
[0014] starting the second agent after the task configuration information of the first agent is configured to the second agent in response to the working state of the target application being the second working state.
[0015] The second agent is configured to receive user input information, send the user input information to a third agent other than the target application after the user input information is fused with the task configuration information, and receive and present response information of the third agent.
[0016] Optionally, the controlling the target agent of the target application to switch between a first mode and a second mode based on the working state of the target application comprises:
[0017] controlling the target agent to load a first function module set to run in the first mode in response to the working state of the target application being a first working state.
[0018] controlling the target agent to load a second function module set to run in the second mode in response to the working state of the target application being a second working state.
[0019] The first working state represents that the target application is in an interactive running state; the second working state represents that the target application is in a non-interactive running state; and the first function module set is different from the second function module set.
[0020] Optionally, the second function module set comprises a target function module for interacting with an external agent other than the target application, and the controlling the target agent to load the second function module set to run in the second mode comprises:
[0021] loading the target function module.
[0022] transmitting task context data generated by the target agent in the first mode to the target function module.
[0023] sending the task context data and current user input information to the external agent through the target function module, and receiving response information returned by the external agent.
[0024] Optionally, the target agent running in the first mode has a first permission set, the first permission set representing that the target agent can access internal resources of the target application; the target agent running in the second mode has a second permission set, the second permission set representing that the target agent can access operating system level resources and application resources outside the target application; wherein the method further comprises:
[0025] in response to the target agent being in the second mode, receiving a privileged operation request initiated by the target agent; wherein the privileged operation request requires a permission beyond the permission range defined by the second permission set;
[0026] generating prompt information corresponding to the privileged operation request;
[0027] executing the privileged operation request based on feedback information corresponding to the prompt information.
[0028] Optionally, the obtaining the working state of the target application comprises:
[0029] collecting environment feature data of an electronic device where the target application is located;
[0030] matching the environment feature data with a target state rule set;
[0031] in response to obtaining a matching result, determining the working state of the target application based on the matching result;
[0032] in response to not obtaining a matching result, performing state recognition on the environment feature data through a state recognition model to determine the working state of the target application;
[0033] wherein the state recognition model represents a model for predicting the current working state of the target application according to the association between historical environment feature data of the electronic device and user behavior patterns.
[0034] A processing method, comprising:
[0035] in response to a trigger instruction, starting a target application;
[0036] obtaining a working state of the target application;
[0037] based on the working state of the target application, controlling an agent of the target application to separate from a running environment constructed by the target application and access a running environment constructed by a first program;
[0038] controlling the agent of the target application to separate from the running environment constructed by the first program and restore to the running environment constructed by the target application;
[0039] The first program includes one of the following: an operating system, and an application program other than the target application.
[0040] Optionally, the controlling the agent of the target application to separate from the running environment of the target application and access to the running environment of the first program based on the working state of the target application comprises:
[0041] In response to the working state of the target application being in the second working state, recording task execution state data of the agent of the target application in the running environment of the target application;
[0042] The task execution state data is encapsulated to obtain target data;
[0043] In the running environment of the first program, a container for carrying the agent is created;
[0044] The target data is parsed in the container to enable the agent to access the running environment of the first program.
[0045] An electronic device comprises:
[0046] A memory for storing a computer program, the computer program comprising at least a first computer program and a second computer program;
[0047] A processor for executing the first computer program to achieve:
[0048] In response to a trigger instruction, starting the target application; obtaining the working state of the target application; based on the working state of the target application, controlling the target agent of the target application to switch between a first mode and a second mode; wherein in the first mode, the target agent has the ability to obtain first content in the target application and provide a first intelligent service based on the first content; in the second mode, the target agent has the ability to obtain second content outside the target application and provide a second intelligent service based on the second content;
[0049] The processor is further configured to execute the second computer program to achieve:
[0050] In response to the trigger instruction, the target application is started; a working state of the target application is obtained; based on the working state of the target application, the agent of the target application is controlled to separate from a running environment constructed by the target application and access a running environment constructed by the first program; the agent of the target application is controlled to separate from the running environment constructed by the first program and restore to the running environment constructed by the target application; the first program comprises one of the following: an operating system and an application program other than the target application. BRIEF DESCRIPTION OF DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of the provided drawings.
[0052] Figure 1 A flowchart of a processing method provided by the embodiment of the present application is shown;
[0053] Figure 2 A flowchart of a processing method provided by the embodiment of the present application is shown;
[0054] Figure 3 A schematic diagram of a double-agent interaction intermediary architecture provided by the embodiment of the present application is shown;
[0055] Figure 4 A flowchart of a processing method based on a single-agent dynamic reconstruction architecture provided by the embodiment of the present application is shown;
[0056] Figure 5 A flowchart of a processing method provided by the embodiment of the present application is shown;
[0057] Figure 6 A flowchart of a processing method provided by the embodiment of the present application is shown;
[0058] Figure 7 A schematic diagram of an in-browser agent user interface provided by the embodiment of the present application is shown;
[0059] Figure 8 A schematic diagram of an operating system agent user interface provided by the embodiment of the present application is shown. DETAILED DESCRIPTION
[0060] With reference to the drawings and embodiments of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.
[0061] The terms "first" and "second" and the like in the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not set to the listed steps or units, but can include steps or units not listed.
[0062] The embodiments of the present application provide a processing method and an electronic device. The processing method can solve the problem of fragmented user experience caused by the single application environment of an intelligent agent. The target application is started in response to a trigger instruction, the working state of the target application is obtained in real time, and the target intelligent agent is switched between a first mode and a second mode based on the working state. The first mode enables the intelligent agent to obtain the internal content of the target application and provide corresponding intelligent services, and the second mode enables the intelligent agent to obtain the external content of the target application and provide extended intelligent services. The method enables the intelligent agent to break through the constraints of application boundaries, seamlessly switch its service capabilities according to the current working scene and environment of the user, effectively solves the problems of service interruption and operation fragmentation, and improves the continuity and overall efficiency of cross-application and cross-environment workflows.
[0063] In the embodiments of the present application, the intelligent agent represents a software entity that can carry an artificial intelligence model, understand user intent, and provide interactive services. As a digital assistant of the user, the intelligent agent has the ability of environment perception, task execution, and continuous dialogue. The processing method can be widely applied to various scenarios that require continuous work across applications and environments. For example, when the user is browsing information in a browser, the intelligent agent runs in the first mode to provide services such as web page summarization and translation based on the internal content of the browser. When the user switches the focus of work to the desktop of the operating system, the intelligent agent automatically switches to the second mode to provide services such as file organization and application startup based on external resources of the system, thereby realizing seamless connection of intelligent agent services and efficient continuation of user workflows.
[0064] Referring to Figure 1 , a flowchart of a processing method provided by an embodiment of the present application is shown. The method can include the following steps:
[0065] S101, starting a target application in response to a trigger instruction.
[0066] S102. Obtain the working status of the target application.
[0067] S103. Based on the working state of the target application, control the target agent of the target application to switch between the first mode and the second mode.
[0068] In step S101, the trigger command refers to a user operation or system event that can initiate the target application, including user-initiated operations (such as clicking the application icon, entering a shortcut key, or using voice commands) and system trigger events (such as linked application launches or scheduled launches). The target application is a computer application (such as a browser, office software, or design tools) that integrates the target intelligent agent and has the basic environment for intelligent agent mode switching. The user initiates the command through a preset trigger method. After receiving the command, the system launches the target application through the application launch interface. When the target application starts, the basic environment required for the intelligent agent's operation is initialized synchronously, including loading the intelligent agent's core framework, creating a data storage area, and establishing a communication link with the system, providing a runtime environment for the intelligent agent application. For example, if a user needs to use a browser to view web pages and subsequently process local files, double-clicking the desktop browser icon will trigger the system to launch the browser. When the browser starts, the core runtime environment of the target intelligent agent is initialized, including loading the intelligent agent's core algorithm library and creating a user session storage directory, providing a data foundation for the subsequent operation and mode switching of the intelligent agent.
[0069] In step S102, the working state of the target application is a state identifier representing the running mode of the target application, such as a first working state and a second working state. The first working state can represent an interactive running state, such as when the user is operating or paying attention to the target application. Correspondingly, the second state can represent a non-interactive running state, such as when the target application is minimized and the user is not currently using it, or when the target application is running in the background but not closed, or when the target application is directly closed. Environmental characteristic data of the electronic device where the target application is located can be collected through the operating system of the electronic device, including whether the application window has focus, the process processor or memory usage, and whether the user has input operations. The environmental characteristic data is matched with a preset set of target state rules. If a match is successful, the working state is directly determined; if a match is unsuccessful, a state recognition model is used for prediction, and the working state of the target application is finally output. For example, when the target application is a browser application on an electronic device, if the user is browsing a webpage in the browser, i.e., there is window focus or the user is frequently scrolling the page, it indicates that the browser is in the first working state. When the user clicks the browser minimize button, i.e., the window loses focus or the process is running in the background, it indicates that the browser is in the second working state. By determining the working status of the target application, the accuracy of working status identification can be ensured, providing a precise basis for the switching of intelligent agent modes and avoiding problems such as misjudgment of the switching timing.
[0070] In step S103, the target agent is an intelligent service module integrated in the target application and has dual-mode running capability. The target agent includes at least a first mode and a second mode. The first mode is a running mode of the agent adapted to an in-application scenario and has the capability of obtaining in-application first content (such as web page content, document data, in-application interface information, etc.) and providing first intelligent services (such as content analysis, translation, editing assistance, etc.). The second mode is a running mode of the agent adapted to an out-of-application scenario and has the capability of obtaining out-of-application second content (such as desktop files, other application data, system resource information, etc.) and providing second intelligent services (such as file management, cross-application collaboration, system operation assistance, etc.).
[0071] The operating system or processing system of the electronic device triggers the mode switching logic of the target agent according to the working state of the target application. If the target application is in a first working state, the target agent is controlled to switch to the first mode, the function components and permission configurations related to in-application services are loaded, in-application user operations are listened to, and first intelligent services are provided. If the target application is in a second working state, the target agent is controlled to switch to the second mode, the function components and permission configurations related to out-of-application services are loaded, out-of-application environmental events and user inputs are listened to, second intelligent services are provided, and the continuity of task context is ensured through a data synchronization mechanism during the switching process. For example, when a user edits an online document in a browser (i.e., the browser is in the first working state), the target agent switches to the first mode, obtains the document content as the first content, and provides first intelligent services such as grammar correction and format optimization. When the user minimizes the browser (i.e., the browser is in the second working state), the target agent switches to the second mode, obtains desktop local files as the second content, and provides second intelligent services such as file content extraction and document format conversion.
[0072] The embodiments of the present application provide a processing method. The target application is started in response to a trigger instruction, the working state of the target application is obtained, and the target agent of the target application is controlled to switch between a first mode and a second mode based on the working state of the target application. The flexible adaptation of the target agent to in-application or out-of-application scenarios is achieved, the application boundary limitation problem and the service terminal problem of a general agent are solved. Through the functional differentiation of the first mode and the second mode, the service accuracy and efficiency of the agent in different scenarios are achieved. The switching logic based on the working state of the target application conforms to the operation habit of the user, the seamless connection of services is achieved, and the user experience effect is improved.
[0073] The following sections detail three core implementation methods of this processing approach from the perspectives of agent implementation and system architecture. The first implementation employs a dual-agent independent deployment and switching architecture, achieving service migration through two agent instances corresponding to the application's internal and external environments respectively, along with a state synchronization mechanism. The second implementation is based on an interactive mediation architecture, where an agent with dedicated external communication collaborates with an external agent to complete tasks. The third implementation uses a single-agent dynamic reconfiguration architecture, dynamically loading different functional module sets onto the same agent instance to adapt to environmental changes. These three implementations achieve the core technical goal of ensuring agent-based cross-environment service continuity at different levels.
[0074] In one embodiment of this application, Figure 1 The target agent in the processing method shown includes a first agent and a second agent. The first agent operates in a first mode, and the second agent operates in a second mode. For the processing method corresponding to the form of this target agent, see [link to relevant documentation]. Figure 2 This may include the following steps:
[0075] S201. In response to the trigger command, the target application is invoked.
[0076] S202. Obtain the working status of the target application.
[0077] S203. Based on the working state of the target application, control the switching between the first intelligent agent and the second intelligent agent of the target application.
[0078] The first intelligent agent of the target application has the ability to obtain first content within the target application and provide a first intelligent service based on the first content; the second intelligent agent of the target application has the ability to obtain second content outside the target application and provide a second intelligent service based on the second content. In this application architecture where the target intelligent agent includes both the first and second intelligent agents, Figure 1 The process of controlling the target agent of the target application to switch between the first mode and the second mode based on the working state of the target application in the illustrated embodiment is as follows: Figure 2 In the illustrated embodiment, step S203 involves starting a first intelligent agent in response to the target application's working state being a first working state, and starting a second intelligent agent in response to the target application's working state being a second working state. The first working state indicates that the target application is in an interactive running state, and the second working state indicates that the target application is in a non-interactive running state.
[0079] The first agent and the second agent of the target application run in independent execution environments and realize information synchronization through a data sharing channel. In response to the first working state, the system starts the first agent, loads service function modules (such as document editing assistance, content proofreading, application internal data analysis, etc.) in the application, configures a first permission set (such as application internal data reading, application internal interface calling, etc.), at this time the first agent obtains first content by listening to application internal user operations and provides corresponding first intelligent services. In response to the second working state, the system starts the second agent, loads service function modules (such as file management, external data acquisition, cross-application collaboration, etc.) outside the application, configures a second permission set (such as desktop file access, system event listening, etc.), at this time the second agent obtains second content by listening to application external environment events and provides corresponding second intelligent services. At the same time, the task context of the first agent is synchronized through the data sharing channel to ensure service continuity.
[0080] In Figure 2 In the embodiment shown, the process of controlling the switching between the first agent of the target application and the second agent of the target application based on the working state of the target application includes: in response to running the first agent of the target application, synchronizing first configuration information from the first running environment of the first agent to the second running environment of the second agent. In response to the working state of the target application, the first agent of the target application is switched to the second agent, and the second configuration information corresponding to the current execution task of the second agent in the first agent is transmitted from the first running environment to the second running environment.
[0081] The first agent runs in a first running environment and has the ability to obtain first content (such as web page content in a browser, tab page data, etc.) in the target application and provide first intelligent services (such as web page analysis, translation, form auxiliary filling, etc.) based on the first content. The second agent runs in a second running environment and has the ability to obtain second content (such as desktop files, other application data, etc.) outside the target application and provide second intelligent services (such as file management, system configuration guidance, etc.) based on the second content. The switching process includes two stages of pre-synchronization (i.e. first configuration information synchronization) and main synchronization (i.e. second configuration information transmission), wherein the first configuration information is basic metadata for the second agent to complete service initialization and user identity authentication, such as the first configuration information including user identity, user preference settings, session security token, task identifier of the current core task, etc., and the second configuration information is context data required for the second agent to take over the current execution task, such as the second configuration information including complete conversation history, detailed data content involved in the current task, etc. In this way, through the synchronization process of the first configuration information and the second configuration information, the purpose of no data loss and no task interruption during the switching process of the first agent and the second agent can be achieved.
[0082] In an embodiment, in response to the first agent running the target application, the process of synchronizing the first configuration information from the first running environment of the first agent to the second running environment of the second agent comprises: in response to the first agent running the target application, and in the case that the working state of the target application meets the first condition, obtaining the first configuration information; performing encapsulation processing on the first configuration information, so that the processed first configuration information meets the configuration format of the second agent. The processed first configuration information is transmitted from the first running environment of the first agent to the running environment of the second agent, so that the second agent parses the processed first configuration information and loads the parsed first configuration information to the second running environment.
[0083] The first condition represents a preset scene condition triggering the synchronization of the first configuration information, which can be a trigger condition for the working state of the target application to be switched, including a trigger condition that the working state of the target application is about to be switched, such as the window focus of the target application being about to be transferred (e.g., the user triggering the Alt+Tab shortcut key), the frequency of calling a specific function interface reaching a threshold (e.g., the web page translation interface being called not less than 3 times within 5 minutes), the user starting an application external associated operation (e.g., clicking a desktop file icon), etc. The encapsulation processing performed on the first configuration information is a structured conversion and standardization processing of the first configuration information according to a preset format (e.g., a lightweight data exchange format JSON), which ensures that the data format is compatible with the configuration parsing requirements of the second agent, and improves the efficiency and security of data transmission. The first running environment is a built-in running environment of the target application to which the first agent belongs, such as a browser process space, an application internal sandbox, etc., which has application internal resource access permission and is isolated from the second running environment. Correspondingly, the second running environment represents an independent running environment to which the second agent belongs, such as a desktop process container, a system-level sandbox, etc., which has application external resource access permission and can receive and parse the first configuration.
[0084] For example, in response to the first agent being in a running state, the system collects the working state data (such as window focus change) of the target application in real time through the environment monitoring module, and matches it with the preset first condition. When it is monitored that the data meets the first condition, the first configuration information synchronization process is triggered. After the first agent receives the synchronization trigger instruction, it extracts the first configuration information, such as basic identity information (user account ID), personalized configuration information (such as user preset interface layout), and task association data (such as the task ID currently being executed, task start time), from the configuration database of the first running environment through the internal data interface. After the extraction of the first configuration information is completed, preliminary verification can be performed to eliminate invalid or expired information, such as invalid session tokens. Then, the verified first configuration information is packaged in a preset standardized format, such as data structuring in a hierarchical structure of "identity information - preference configuration - task data", serialized packaging in JSON format, and adjusting field naming and data types (such as converting timestamps to string format) according to the configuration parsing rules of the second agent to ensure compatibility. The packaged data can also be compressed to reduce data transmission volume. Through the preset cross-process communication link, a secure data transmission channel is established between the first running environment and the second running environment, and the first agent sends the packaged and compressed first configuration information to the second agent through the secure channel, and can also attach a data verification code. After the second agent receives the data, it first performs decompression processing, then verifies the data integrity through the verification code, and if the verification fails, it requests retransmission, parses the packaged data according to the preset format, extracts core information such as user identity, preference settings, and task ID, converts it to an internal data structure recognizable by the second running environment, loads the parsed first configuration information into the configuration cache of the second running environment, and completes service initialization. For example, based on the user identity and session token, identity authentication is completed; the interface layout and function parameters are initialized according to the user preference settings.
[0085] Correspondingly, in response to the first agent switching to the second agent based on the working state control of the target application, the process of transmitting the second configuration information corresponding to the second agent's current task from the first running environment to the second running environment includes: in response to the working state of the target application meeting the second condition, recording the current task state of the first agent to obtain second configuration information containing context data corresponding to the current task state; using the data sharing transmission channel between the first agent and the second agent to transmit the second configuration information from the first running environment to the second running environment, so that the second agent analyzes the second configuration information in the second running environment and updates the configuration of the second agent based on the analysis result.
[0086] The second condition is a core scene condition for triggering the first intelligent agent to switch to the second intelligent agent, representing that the target application has completed the state switching, including that the target application window focus has been transferred to an external application (such as a browser minimized), the target application has entered a background running mode, the user has started an application external task operation (such as double-clicking a desktop document), etc., which is a trigger signal for starting the second configuration information transmission. The second configuration information is the core context data for ensuring seamless task takeover by the second intelligent agent, including the complete conversation history record of the current task executed by the first intelligent agent, the task execution progress (such as the translation completion ratio, summary paragraph marking), the detailed data content associated with the task (such as web text, form information), the user operation trajectory (such as highlighting, editing and modifying records), etc. The data sharing transmission channel is a special communication link previously established between the first intelligent agent and the second intelligent agent, which can have the characteristics of efficient and secure data transmission. The second configuration information represents the context corresponding to the current task state of the first intelligent agent, which fully snapshots the task execution process, captures dynamic data and static configuration, and ensures that the second configuration information can completely restore the task scene. After the second intelligent agent analyzes the second configuration information, it integrates it into its own running environment through configuration update, adjusts the function modules, task queue and parameter settings, and realizes seamless connection with the task state of the first intelligent agent.
[0087] Specifically, in response to the working state of the target application satisfying the second condition (such as the target application window focus being transferred to an external application or entering a background running mode), the system immediately sends a task migration and switching instruction to the first intelligent agent. After receiving the instruction, the first intelligent agent suspends the current execution task to avoid state changes, then captures the full context data of the task (including complete conversation history, task progress markers, associated data content and user operation trajectory) through internal data interfaces, integrates and generates the second configuration information according to the preset structure and ensures its integrity through hash verification, then activates the special data sharing transmission channel previously established between the first intelligent agent and the second intelligent agent, such as using a fragmentation transmission mechanism to send the second configuration information in sequence and ensuring transmission reliability through packet-by-packet confirmation and timeout retransmission. After receiving all data packets, the second intelligent agent reorganizes and verifies the full data, parses and extracts the core fields according to the preset format and converts them into internal data structures, then integrates the parsed context data into its own running environment, loads the conversation history, locates the task breakpoint, imports the associated data and adapts to the user's operation preferences, completes the configuration update, and automatically activates and enters the task ready state, realizing seamless connection with the task state of the first intelligent agent. The user can directly continue to execute the unfinished task outside the target application, or apply the task information corresponding to the first intelligent agent to continue the associated task processing in the environment of the second intelligent agent.
[0088] In the process of switching the first agent and the second agent, dynamic privilege allocation is also needed. Correspondingly, based on the working state of the target application, the first agent of the target application is switched with the second agent of the target application, including: in response to enabling the first agent, determining a first running environment corresponding to the first agent; based on the environment characteristics of the first running environment, configuring a first permission set for the first agent; in response to enabling the second agent, determining a second running environment corresponding to the second agent; based on the environment characteristics of the second running environment, configuring a second permission set for the first agent. Wherein, the first permission set represents a permission set that the first agent is allowed to access the internal resources of the target application, and the second permission set represents a permission set that the second agent is allowed to access the operating system level resources, and the permission range of the second permission set is greater than that of the first permission set.
[0089] The embodiment includes dynamic privilege allocation in the process of agent switching. The first running environment represents the exclusive running environment of the first agent, that is, the built-in environment of the target application (such as browser process space, application internal sandbox), and the environment characteristics are only able to call internal interfaces of the application, access local cache of the application, and be isolated from external system resources. The second running environment is the independent running environment of the second agent (such as desktop process container, system level sandbox), and the environment characteristics are able to interact with the operating system kernel, access multi-application resources, and have cross-process communication capability. The first permission set is the permission set configured for the first agent, which is only allowed to access internal resources of the target application (such as browser, office software), including DOM element reading permission corresponding to internal pages of the application, internal cache data access permission, internal built-in function interface calling permission, etc., and is prohibited to access system level resources outside the application, thereby ensuring the safety of internal data of the application. The second permission set is the permission set configured for the second agent, and the permission range covers operating system level resources and external resources of the application, including desktop file reading and writing permission, system event listening permission, application program starting and management permission, system configuration viewing permission, etc., which meets the needs of the second agent to provide services outside the application.
[0090] Specifically, when the system determines to enable the first agent based on the target application working state, first, the first running environment corresponding to the first agent is located, and the core features (such as application internal process ID, resource access range, interface call restriction) of the environment are collected through the environment monitoring module; similarly, when the second agent is enabled, the second running environment is located and the environment features (such as desktop process identification, system resource access interface availability) are collected. According to the features of the first running environment application internal isolation, the system configures the first permission set for the first agent through the permission management module, and clearly authorizes the range to be the internal resources of the application, and at the same time, all system-level resource access interfaces are shielded; according to the features of the second running environment cross-application interaction, the second permission set is configured, the operating system-level resource access permission is opened, and the permission boundary is strictly limited (such as only allowing to read and write user-specified directory files, and prohibiting modification of system core configuration). When the agent is switched, the system automatically triggers the permission recycling and granting process: the permission set of the currently running agent (such as the first agent) is recycled, and the corresponding second permission set is granted to the agent to be enabled (such as the second agent), such as the permission switching is executed through the system permission interface, and the real-time effectiveness of the permission change is ensured. After the permission allocation, the system continuously monitors the permission use behavior of the agent, and if it is detected that the agent attempts to access resources outside the permission set (such as the first agent attempts to read desktop files), the operation can be immediately blocked and the log is recorded, and it is ensured that the permission is not abused. In this embodiment, the permission switching is automatically executed, and manual configuration by the user is not required, ensuring the seamless of the agent switching process and improving the user experience.
[0091] Further, during the running of the second agent based on the second permission set, the method further comprises: receiving a privileged operation request initiated by the second agent; generating prompt information corresponding to the privileged request; and executing the privileged operation request based on feedback information corresponding to the prompt information. The permission required by the privileged operation request exceeds the permission range defined by the second permission set. For example, when the second agent runs within the range of the second permission set, it initiates a high-risk operation request that exceeds the defined range of the permission set, including modifying system core configuration (such as firewall rules, network settings), accessing sensitive directories (such as system disk core folders, user privacy data directories), and batch modifying application external data, etc. Such operations may affect system stability or data security. The informative information generated by the system for the privileged operation request, i.e. the prompt information, needs to clearly indicate the operation content, potential risks and impact range, so as to ensure that the user makes a decision after fully knowing, for example, the prompt information is "whether to allow the agent to modify the system network configuration? The operation may cause network connection interruption". The feedback information for the prompt information refers to the response of the user to the prompt information, including confirmation execution and rejection execution, which is the direct basis for the system to execute the privileged operation request.
[0092] For example, taking the processing of a privileged operation request by the desktop second agent (running based on a second set of permissions, including desktop file read-write and application startup management) as an example, the user uses the desktop second agent to organize local office documents, and needs to modify the application association configuration file under the system disk directory in batches (the access permission of the directory exceeds the second set of permissions). The second agent initiates an operation request to access the system disk directory and modify the configuration file; the system permission monitoring module detects that the required permission of the request exceeds the second set of permissions, determines that it is a privileged operation request, suspends execution and captures the request details, determines that it is “medium risk” (modifying the application configuration file may cause the application to run abnormally, and the operation is reversible) through the risk assessment model; the system generates a prompt information, such as “the agent needs to access the system disk directory and modify the application configuration file (medium risk), which may cause some applications to run abnormally. Do you allow the execution?” The prompt information is displayed to the user through a desktop pop-up window. After the user views the prompt information, confirms that the operation is required for office work and knows the risk, clicks the “Confirm” button (i.e., generates feedback information), the system temporarily grants the second agent the permission, and the second agent completes the configuration file modification. The system immediately recovers the temporary privilege, and records the operation log (including operation time, content, and user authorization record); if the user clicks “Reject” due to risk, the system terminates the operation and returns a response to the second agent, and the agent prompts the user “due to insufficient permissions, the operation cannot be completed. Please handle it manually or re-authorize” and the like. In this way, the operation risk and impact are explicitly informed through the prompt information, ensuring the user's right to know and decision-making power, and avoiding losses caused by agent misoperation or abuse of permissions.
[0093] Under the dual-agent architecture of the embodiments of the present application, by deploying independent agent instances that focus on the application environment and the external environment respectively, and performing accurate switching based on the working state of the target application, professional division of labor of service capabilities and on-demand allocation of resources are realized. Since the first agent and the second agent can be independently run and optimized, they can each deeply adapt to their specific environment, the first agent focuses on in-application tasks, and the second agent can focus on system-level operations, thereby significantly improving the execution efficiency and accuracy of single tasks. The switching mechanism ensures that when the user's focus shifts between the application and the external environment, the intelligent service can smoothly take over without being aware of it, and the user does not need to manually restart or reconfigure the assistant, ensuring the continuity of the core workflow and the experience effect.
[0094] In another embodiment of the present application, an agent processing method based on an interactive intermediary architecture is provided. In this embodiment, a first agent is used to process tasks and content within a target application, and a second agent is an agent with interactive intermediary functions. The core capability of the second agent can not be to directly process complex tasks, but to serve as a bridge for communication and collaboration with external agents (such as system-level AI services or agents of other applications). This architecture aims to securely and efficiently interface the in-application agent with external more powerful and specialized intelligent services, thereby ensuring the lightweight nature of the application itself while providing users with extended intelligent service capabilities.
[0095] In this embodiment, Figure 1 The target agent corresponding to the illustrated embodiment includes a first agent and a second agent, wherein the first agent operates in a first mode, and the second agent operates in a second mode. The second agent has the ability to interact with a third agent outside the target application. In response to the working state of the target application being a second working state, the process of starting the second agent includes: in response to the working state of the target application being a second working state, configuring the task configuration information of the first agent to the second agent, and then starting the second agent. At this time, the second agent is configured to receive user input information, fuse the user input information with the task configuration information, and then send it to the third agent outside the target application, and receive and present the response information of the third agent.
[0096] Referring to Figure 3 , which shows a schematic diagram of a dual-agent interactive intermediary architecture provided by an embodiment of the present application. In Figure 3 , the first agent 301 of the target application has the ability to obtain first content within the target application and provide first intelligent services based on the first content. The second agent 302 of the target application has the ability to interact with the third agent 303 outside the target application. Based on the working state of the target application, the first agent and the second agent of the target application are switched. In response to the working state of the target application being a first working state, the first agent of the target application is started; in response to the working state of the target application being a second working state, the task configuration information of the first agent is configured to the second agent, and then the second agent is started. The first working state represents that the target application is in an interactive running state, and the second working state represents that the target application is in a non-interactive running state.
[0097] The first intelligent agent is an intelligent agent running inside the target application, mainly to obtain the first content (such as webpage text, document data, and application interface information) inside the target application, and to provide the first intelligent service (such as content analysis, translation, and editing assistance), focusing on the scene demand inside the application. The second intelligent agent has cross-application interaction capability, mainly communicates with the third intelligent agent outside the target application, receives the task configuration information of the first intelligent agent, realizes the transmission of task context and the docking of external service, and is the link hub of the internal and external services of the target application. The third intelligent agent is an external intelligent agent service module or system outside the target application, such as a cloud data analysis intelligent agent, a professional knowledge base intelligent agent, and a third-party tool intelligent agent, which can provide special intelligent services outside the target application. The task-related data generated by the first intelligent agent when running inside the target application serves as the task configuration information, including task type, execution progress, user preference, and processed data, which is the context basis for the interaction between the second intelligent agent and the third intelligent agent.
[0098] The system of the electronic device identifies the working state of the target application, and if it is determined that the target application is in the first working state, the system starts the first intelligent agent, and further can close the second intelligent agent or put it in a dormant state. The first intelligent agent loads the in-application service module, obtains the first content inside the application, and provides the first intelligent service. If it is determined to be in the second working state, the system triggers intelligent agent switching, suspends the non-core tasks of the first intelligent agent, and can retain its running state. The first intelligent agent transmits the task configuration information to the second intelligent agent through a preset data sharing channel, and the second intelligent agent receives and analyzes and verifies it, stores it in the local cache, and completes its configuration initialization. After the second intelligent agent is started, it identifies the user's core demand based on the task configuration information, establishes a connection with the third intelligent agent through a standardized communication protocol, sends the task configuration information and the user's subsequent input to the third intelligent agent after fusion, and returns the response result after the third intelligent agent performs special processing (such as data analysis and resource retrieval). The second intelligent agent arranges the result and presents it to the user, or synchronizes it to the first intelligent agent for subsequent use. When the target application switches back to the first working state, the system triggers the second intelligent agent to sleep, restarts the first intelligent agent, and the second intelligent agent returns the interaction result with the third intelligent agent and the new task data to the first intelligent agent, ensuring task continuity. In this application architecture, the second intelligent agent is used as an interaction intermediary to solve the communication barrier between the target application and the external intelligent agent, expand the service boundary of the application, and enable users to obtain one-stop intelligent service without switching between multiple platforms.
[0099] Further, in response to the working state of the target application being the second working state, the second agent receives user input information; the user input information is fused with the task configuration information to obtain fused information. Based on the fused information, an external interaction request is generated; the external interaction request and the fused information are sent to a third agent outside the target application, so that the third agent responds to the user input information based on the fused information. Correspondingly, the second agent presents response information of the third agent responding to the user input information.
[0100] The user input information represents a demand instruction initiated by the user on the second agent interaction interface (such as a desktop independent window or a pop-up window), and can include text input, voice instruction, function selection, etc. The task configuration information is task-related data obtained from the first agent, such as task type, processed data, user preference, task progress, etc., and is a key basis for the second agent to understand the user demand context. The second agent can integrate the user input information and the task configuration information into structured data as the fused information, so that the fused information includes not only the current user demand but also the historical task context, which can ensure that the third agent accurately understands the demand background. It should be noted that the second agent can also have a certain intent analysis function, that is, the second agent can determine the related functions outside the target application that the user may need to execute according to the current input or operation of the user, so that in the case of multiple external agents, the second agent can accurately identify which external agent to interact with. Subsequently, the standardized request instruction generated by the second agent based on the fused information contains request type, fused information, response format requirement, etc., which is used to establish communication with the third agent and deliver the demand. The processing result returned by the third agent in response to the external interaction request, including data report, resource link, operation suggestion, etc., needs to be arranged by the second agent before being presented to the user.
[0101] For example, a user is retrieving travel information in a browser (i.e., a target application), at this time the user visits a travel blog in the browser and wakes up the first intelligent agent. The interaction information input by the user into the first intelligent agent can include extracting the recommended scenic spots and food in the blog. The first intelligent agent successfully parses the web page using its first set of permissions (such as the permission to access the internal DOM content of the browser) and extracts the relevant scenic spot and food information. The task configuration information at this time includes these scenic spot and food information. When the user minimizes the interface of the browser and prepares to start planning a specific itinerary. The electronic device system detects that the browser has turned into a non-interactive running state, and can perform switching, i.e., synchronizing the task configuration information of the first intelligent agent to the second intelligent agent, starting the second intelligent agent, at this time the second intelligent agent can present its corresponding interaction window in the form of an independent floating window on the desktop. The user issues a new instruction to the second intelligent agent in the desktop environment, such as planning a travel itinerary to A place. The second intelligent agent fuses the user's new input (planning the itinerary) with the received task configuration information (collected scenic spots and food), generates an external interaction request, and the second intelligent agent uses its second set of permissions (such as including cross-process communication capabilities) to send this request to a third intelligent agent (for example, a more powerful artificial intelligence planning engine deployed in the cloud) that is specifically responsible for complex planning tasks through a secure channel. The third intelligent agent receives the fused information and fully utilizes its data analysis capabilities to generate a detailed itinerary plan. The third intelligent agent returns the generated itinerary plan as response information to the second intelligent agent. The second intelligent agent receives it and displays the itinerary plan information in its corresponding interface. The user ultimately obtains the complete itinerary planning information generated by the third intelligent agent in the second intelligent agent window on the desktop. In this way, through the division of labor and cooperation of the interaction intermediary architecture, complex cross-domain tasks are handed over to professional external intelligent agents for processing, realizing the unlimited expansion and on-demand calling of intelligent service capabilities. While ensuring the lightweight and security of the application ontology, it provides users with seamless continuous service experience, effectively solving the problem of single intelligent agent function limitation and environment dependence.
[0102] In the application scenario of the interaction intermediary architecture including the first intelligent agent and the second intelligent agent, the processing method further includes: the first intelligent agent is configured to run under a first set of permissions, and the first set of permissions allows the first intelligent agent to access first content of the target application. The second intelligent agent is configured to run under a second set of permissions, and the second set of permissions allows the second intelligent agent to perform cross-process communication with application processes other than the operating system and the target application. Wherein, the first intelligent agent and the second intelligent agent run in execution environments isolated from each other.
[0103] In the dual-agent interaction mediation architecture, the first permission set is configured for the first agent, which only opens access permissions to internal resources of the target application, such as the first agent in the browser can read the webpage DOM element, call the built-in translation interface of the application, but cannot access the desktop file or system registry, to ensure that the data in the application is not stolen by the external environment. The second permission set is mainly for cross-process communication needs, allowing the second agent to establish a communication link with the operating system kernel and third-party applications outside the target application, such as the desktop second agent can interact with the cloud third agent through the relevant communication protocol, or call the system file management process, but can limit its permission to modify the system core configuration. At the same time, the first agent and the second agent run in isolated execution environments from each other, each having independent process space, memory area and data storage directory, such as the first agent running in the browser sandbox, and the second agent deployed in a desktop independent container. They only transmit task configuration information through a pre-set encrypted data channel to avoid resource preemption or data leakage between processes.
[0104] In this way, when the target application starts, the system allocates an independent sub-process within the application for the first agent and a desktop-level isolated container for the second agent, and sets the first and second permission sets through the system namespace and sandbox mechanism to define the resource access boundary. When the agent switches, the permission set automatically adapts to the execution environment without the need for manual user configuration, and the isolated environment ensures that the abnormality of any agent will not affect the normal operation of the other agent or the target application. Thus, the precise division of permissions meets the in-application service needs of the first agent and the cross-process interaction needs of the second agent, and the execution environment isolation builds a security barrier, effectively preventing permission abuse and data leakage, while avoiding resource conflicts between the two agents when running, ensuring the stability and reliability of the architecture.
[0105] Under this interaction mediation architecture, when the user requests to perform a high-risk operation beyond the second permission set of the second agent through the second agent, the system will start a dynamic privilege management process. For example, when the user wants to save the itinerary just generated to a target folder, the second agent has cross-process communication capabilities, but since its permission set does not include direct file system write permissions, it will identify this operation as a privilege request. After receiving the privilege request, the security subsystem generates an authorization prompt interface containing operation details, clearly informing the user of the file creation path and operation type to be performed. After obtaining the user's explicit authorization through biometric features or confirmation buttons, the request is forwarded to a trusted service process that has system-level file management permissions. The service process proxies the file saving operation in a separate secure context and returns the execution result to the second agent after completion. This achieves strong functional expansion while strictly adhering to the corresponding permission restrictions, effectively preventing the risk of permission abuse or malicious code propagation.
[0106] In the processing method corresponding to the two-agent interaction mediation architecture, two independent agents respectively focusing on internal processing of the application and external coordination are deployed, so that the first agent is used for internal task processing of the user application, and the second agent is used for interaction with external agents. In this way, the deep optimization of each agent is realized through functional decoupling. The first agent can focus on improving the content analysis accuracy, and the second agent focuses on the efficiency of cross-process communication. Secondly, a security isolation barrier is established to physically isolate the internal operation of the application processing untrusted content and the external interaction involving system resources, effectively containing the spread of security risks. Through the interface of the second agent, various external intelligent services can be flexibly accessed, greatly enriching the system function boundary, realizing the extension of intelligent service capabilities, and improving the interaction experience of the user application agent.
[0107] In another embodiment of the embodiments of the present application, a processing method based on a single-agent dynamic reconstruction architecture is also provided. Unlike the scheme of using multiple independent agents of the target application, this embodiment mainly adapts to environmental changes through dynamic reconstruction of the functions of a single agent instance. The agent can be a unified software entity, which can exhibit different service capabilities inside and outside the target application by loading different sets of functional modules, thereby realizing intelligent expansion of the service range.
[0108] In the application architecture, referring to Figure 4 which shows a flowchart of a processing method based on a single-agent dynamic reconstruction architecture. The processing method can include:
[0109] S401, in response to a trigger instruction, starting the target application.
[0110] S402, obtaining the working state of the target application.
[0111] S403, based on the working state of the target application, controlling the target agent of the target application to run based on the target function, so that the target agent has the ability to interact with agents other than the target application.
[0112] Among them, the target agent of the target application has the ability to obtain the first content of the target application and provide the first intelligent service based on the first content.
[0113] In Figure 4In the corresponding embodiment, the target function required by the target intelligent agent running through the working state switching of the target application realizes the dynamic reconstruction of the same intelligent agent capability. When the electronic device where the target application is located detects that the target application is in an interactive running state, the first function module set is automatically loaded for the intelligent agent, so that it processes internal application tasks. When it is perceived that the application is switched to a non-interactive running state (i.e., a second working state), the second function module set is dynamically switched to, so that the target intelligent agent has the ability to interact with the external environment. This intelligent function switching mechanism based on the environment state not only ensures the accurate matching of service supply and user scenarios, but also maintains the continuity of user cognition by keeping the intelligent agent subject unchanged, thereby realizing the best balance between resource efficiency and user experience at the technical architecture level.
[0114] Corresponding to Figure 1 The processing process of switching the target intelligent agent of the target application between the first mode and the second mode based on the working state of the target application in the embodiment shown includes: in response to the working state of the target application being a first working state, controlling the target intelligent agent to load a first function module set to run in the first mode; in response to the working state of the target application being a second working state, controlling the target intelligent agent to load a second function module set to run in the second mode; wherein the first working state represents that the target application is in an interactive running state; the second working state represents that the target application is in a non-interactive running state. The first function module set and the second function module set are different.
[0115] In the single-intelligent-agent dynamic reconstruction application scenario provided in this embodiment, the core mechanism of mode switching lies in the runtime dynamic loading of the function module set. When the target application is in an interactive running state (i.e., a first working state, such as a browser window in a foreground active state), the intelligent agent is controlled to load a first function module set. The module set includes a web page content parser, a DOM operation interface, and other components that focus on processing internal application resources, so that the intelligent agent runs in the first mode and provides intelligent services such as page summary and highlight marking within the application. When it is detected that the target application is switched to a non-interactive running state (i.e., a second working state, such as a minimized browser window or a browser window losing focus), the capability reconstruction process of the intelligent agent is triggered, that is, a second function module set is loaded. The second module set includes a cross-process communication manager, an external API calling interface, and other components, so that the same intelligent agent instance immediately has the ability to interact with the operating system and other application intelligent agents, thereby seamlessly switching to the second mode. In this way, the resource efficiency of the single-intelligent-agent architecture is maintained, and the flexible expansion of cross-environment service capability is realized.
[0116] Furthermore, the second functional module set includes target functional modules that interact with external intelligent agents outside the target application. The process of controlling the target intelligent agent to load the second functional module set to run in the second mode includes: loading the target functional modules; transmitting the task context data generated by the target intelligent agent in the first mode to the target functional modules; sending the task context data and the user's current input information to the external intelligent agent through the target functional modules, and receiving the response information returned by the external intelligent agent.
[0117] The second functional module set is a collection of modular components adapted to the second mode of the target intelligent agent (i.e., for services outside the target application). It may include target functional modules and auxiliary modules such as those for external data processing and interactive interface rendering. The target functional module is the core component in the second functional module set used for interaction with external intelligent agents. It possesses capabilities such as cross-process communication, data format adaptation, and request sending and response receiving, and is a key functional module for achieving service integration with external intelligent agents. Task context data refers to the associated data generated by the target intelligent agent during runtime in the first mode, such as user session history, task execution progress, processed in-application content, and user preference settings. It serves as the basis for ensuring the continuity of external interaction. Furthermore, both the first and second functional module sets are configured with functional modules that allow guest access to a shared storage area. This shared storage area stores the target intelligent agent's user session history data and task context data.
[0118] In response to the detection that the target application is in its second working state (non-interactive running state), the second functional module set is loaded, the target functional module is initialized first, the connection parameters for the cross-process communication protocol and external intelligent agent are configured, and the interaction preparation is completed. Then, the task context data generated in the first mode is extracted from the shared storage area of the target intelligent agent, and after data encapsulation, it is transmitted to the target functional module. After receiving the data, the target functional module performs data parsing and integrity verification to build an interaction foundation that includes historical task background. The target functional module receives the user's current input information (such as demand instructions and operation requests) through its own interactive interface, merges it with the task context data, and generates an interaction request. The request is sent to the matched external intelligent agent through a preset secure communication channel, and the merged complete data is transmitted synchronously, while the response of the external intelligent agent is monitored in real time. After receiving the response information returned by the external intelligent agent, the target functional module organizes it according to the user's preferred display format (such as text summary, visual chart, and executable operation instructions), and presents it to the user through the interactive interface adapted to the second mode (such as a desktop independent window). At the same time, it supports writing the response results back to the shared data cache to provide data support for subsequent switching back to the first mode.
[0119] Further, in the application architecture, the processing method further includes: dynamically adjusting the resource access permission of the target agent based on the working state of the target application, wherein, in response to the target agent being controlled to run based on the target function, the resource access permission of the target agent is the system permission required for cross-process communication. In the processing process, based on the real-time working state (such as the first working state or the second working state) of the target application, the resource access permission of the target agent is automatically allocated, recycled or switched, so as to realize dynamic permission adjustment of the target agent, ensure that the permission is accurately matched with the current running mode and function demand of the target agent, and solve the problems of permission redundancy or deficiency.
[0120] In the processing method based on the single-agent dynamic reconstruction architecture in the embodiments of the present application, the single agent is enabled to have the ability to dynamically load different function module sets. The architecture enables the agent to seamlessly switch between the first mode of focusing on processing internal tasks of the application and the second mode of having external coordination ability according to the working state of the target application. This method replaces multi-instance switching with runtime function reconstruction, which not only eliminates the complexity of state synchronization, but also maintains the coherence of user experience. Finally, the extension of intelligent service capabilities across environment boundaries is realized while simplifying the system architecture and optimizing resource utilization, and the user experience effect is improved.
[0121] It should be noted that in the embodiments of the present application, the processing method is mainly described based on the above three application architectures, but is not limited to these application architectures, and can also be applied to other system architectures through the form adaptation or capability reconstruction of the agent. The embodiments of the present application do not describe them one by one. Figure 1
[0122] In the above three application architectures, dynamic permission management can be included, when the agent corresponding to the target application performs an operation that exceeds its current permission boundary, an interactive link of user confirmation is introduced, and when the agent is switched, the corresponding permission set and function set can also be dynamically loaded. Correspondingly, when determining the working state of the target application, the efficiency and intelligence of the solution for the working state recognition task in the architecture can be provided by combining the determinacy of rule matching and the inference ability of the machine learning model.
[0123] Specifically, in the embodiments of the present application, the target agent running in the first mode has a first permission set, and the first permission set represents that the target agent can access internal resources of the target application. The target agent running in the second mode has a second permission set, and the second permission set represents that the target agent can access operating system level resources and application resources outside the target application. Correspondingly, the processing method further includes: in response to the target agent being in the second mode, receiving a privileged operation request initiated by the target agent, generating prompt information corresponding to the privileged operation request, and executing the privileged operation request based on feedback information corresponding to the prompt information. Wherein, the permission required by the privileged operation request exceeds the permission range defined by the second permission set.
[0124] In the embodiments, a fine security control system is constructed through permission management. The first permission set limits the access range of the target agent in the first mode to internal resources of the target application (such as browser cache, page DOM element), and the second permission set grants the ability to access operating system level resources (such as file system, registry) and external application resources in the second mode. When the agent in the second mode initiates a privileged operation request (such as modifying a system critical setting or accessing protected user data) that exceeds its permission boundary, the system triggers a security interception process, first generates relevant prompt information to explicitly provide the operation content and potential risks to the user, and then executes the corresponding operation based on the explicit authorization feedback of the user. In this way, through dynamic permission allocation of the target agent in different modes and privileged operation prompting, the unification of function expansion and security control is realized. Both ensure that the agent can flexibly obtain the corresponding level of operation permission to complete complex tasks according to environmental needs, and effectively prevent the risk of exceeding authority through strict permission boundaries and user confirmation mechanisms.
[0125] In the embodiments of the present application, referring to Figure 5 which shows a flowchart for determining the working state of a target application according to an embodiment of the present application. The process can include the following steps:
[0126] S501, environmental feature data of an electronic device where the target application is located is collected.
[0127] S502, the environmental feature data is matched with a target rule set to obtain a matching result, and step S503 is executed if a matching result is obtained, and step S504 is executed if no matching result is obtained.
[0128] S503, the working state of the target application is determined based on the matching result.
[0129] S504, the state recognition model is used to recognize the state of the environmental feature data to determine the working state of the target application.
[0130] The state recognition model is used to predict the current working state of the target application according to the relevance of historical environment feature data of the electronic device and user behavior patterns. The environment feature data represents a multi-dimensional data set of the target application running state and user operation behavior, including application running state data (such as window focus state, process activity, processor occupancy, function interface call record, etc.) and user operation data (such as user input operation, touch operation, voice instruction, etc.). Correspondingly, the environment feature data can also include an environment event sequence, that is, an event stream arranged in time sequence. For example, this can be a time sequence of user operations within a certain time period, such as mouse click browser-browser window activation-no operation within 5 seconds-press shortcut key, etc., which can better reflect the real intention and context of the user than a single event. The target rule set is an experience-based rule library, each rule contains matching conditions of environment feature data and corresponding working state (first working state or second working state), supporting fast matching of common scenarios. The state recognition model is a prediction model based on a machine learning algorithm, trained through the association of historical environment feature data and user behavior patterns, and has the ability to predict the working state of complex scenarios.
[0131] Specifically, the multi-dimensional environment feature data of the electronic device where the target application is located can be collected in real time by the environment monitoring module of the electronic device, such as obtaining the application window focus state through the window management interface, collecting the process activity and resource occupancy rate through the process management interface, recording the function interface call situation through the application monitoring module, and capturing the user operation behavior through the input device interface. The collected data is arranged into a standardized data set in a pre-set format for subsequent matching or recognition. The standardized environment feature data set is input into the rule engine, and each rule in the target rule set is traversed for condition matching. If the data set meets all the matching conditions of a rule (such as the window focus being in the application foreground and the user operation frequency being greater than 10 times within 5 minutes, etc.), the matching result is obtained directly, and the current state of the target application is determined based on the working state corresponding to the rule; if the data set does not meet all the matching conditions of any rule, it is determined that no matching result is obtained, and the model prediction link is entered. The environment feature data set that is not matched successfully is preprocessed and input into the state recognition model. The model calculates the probability of the target application being in the first working state and the second working state based on the user behavior pattern association rules obtained through training, and outputs the state as the final result if the probability of a certain state is higher than a pre-set threshold (such as 0.8); if both are lower than the threshold, the current working state is maintained and the data set is recorded for model iteration optimization. In this way, the dual-engine architecture of rule matching and model prediction is adopted, the rule matching quickly handles common scenarios, the model prediction covers complex scenarios, and the efficiency and accuracy of the working state determination of the target application are improved.
[0132] In order to realize seamless running and service connection of the agent of the target application across programs and across scenes, the embodiment of the present application provides a processing scheme for agent cross-environment migration, which completes the separation, access and recovery of the agent between the target application and other program running environments through environment perception and accurate control. Referring to Figure 6 which shows a flowchart of another processing method provided by the embodiment of the present application, which can include the following steps:
[0133] S601, in response to a trigger instruction, starting the target application.
[0134] S602, obtaining the working state of the target application.
[0135] S603, based on the working state of the target application, controlling the agent of the target application to separate from the running environment constructed by the target application and access to the running environment constructed by the first program.
[0136] S604, controlling the agent of the target application to separate from the running environment constructed by the first program and restore to the running environment constructed by the target application.
[0137] Among them, the first program includes one of the following: operating system, application program other than the target application. The running environment represents the basic software environment carrying the running of the agent, including the exclusive environment (such as browser sandbox, application built-in process space) constructed by the target application and the external environment (such as operating system level container, process container of other application) constructed by the first program, which has independent resource allocation, permission control and running dependency configuration capability. Agent separation refers to the process of cutting off the resource association and process binding of the agent and the original running environment (such as the running environment of the target application), releasing the memory, interface handle and other resources occupied by the original environment, so that the agent becomes an independent running unit that can migrate across environments. Correspondingly, the agent access can refer to the process of creating a container suitable for the agent in the target running environment (such as the running environment corresponding to the first program), loading the required running dependencies, importing the core program and task state data of the agent, and making the agent normally run in the new environment.
[0138] Specifically, in response to the trigger instruction, the target application is started, the core running environment of the agent is initialized synchronously, including allocating process resources, loading dependent libraries, creating a task data cache area, and ensuring that the agent has basic running capabilities. Then the working state of the target application (such as the target application being in interactive running or non-interactive running) can be obtained through the dual-engine mechanism of rule matching and model prediction. When it is determined that the working state is non-interactive running, the cross-environment migration process is triggered; when it is determined that the working state is interactive running, the agent can be triggered to recover from the first program environment to the target application environment. The current non-core task of the agent can be paused first, the task execution state data (including configuration parameters, progress information, and user session) is recorded and encapsulated. Then the process association between the agent and the target application environment is cut off, the application internal resources are released, an independent container is created in the first program environment, the matching running dependencies and resource limits are configured, the encapsulated task data is transmitted to the container and parsed, and the agent access and state recovery are completed. When the target application switches back to the interactive running state, the system records the new task data of the agent in the first program environment, cuts off the association between the agent and the first program container, recovers the original running configuration in the target application environment, synchronizes the new task data to the target application environment, and completes the agent regression and recovery of the service in the target application. The processing method provided by the embodiment of the application realizes running environment adaptation and service continuity by dynamically migrating the agent instance and its complete running state between different application program containers, thereby improving the experience effect of the user application agent.
[0139] When the processing method is applied to the application architecture of double-agent independent deployment (that is, the application scenario corresponding to the embodiment of the application) Figure 2 Through the ordered switching and data intercommunication of the two independent agents, seamless migration of the internal and external services of the application is realized. The agent of the target application includes a first agent and a second agent. The first agent has the ability to obtain first content in the target application and provide first intelligent services based on the first content. The second agent has the ability to obtain second content outside the target application and provide second intelligent services based on the second content.
[0140] When the target application is in an interactive running state, the first intelligent agent (adapted to the internal environment of the target application) runs in the built-in running environment (such as a browser sandbox or an application-specific process space) constructed by the target application, mainly processes the first content (such as web page text or document data) in the target application, and provides the first intelligent service (such as translation or analysis). At this time, the second intelligent agent (adapted to the external environment of the application) can be in a dormant state, and its corresponding first program running environment (in the operating system container or other application container) only completes basic initialization and does not load the core functional module. Then, through rule matching and model prediction, it is determined that the target application switches to a non-interactive running state, triggering a cross-environment migration process, that is, starting the state data synchronization of the first intelligent agent, and transmitting the first configuration information (such as user identity, preference setting, and task ID) and the second configuration information (such as task progress and context data) to the second intelligent agent through an encrypted channel. Subsequently, the second intelligent agent is activated from the dormant state, and completes the core module loading and configuration analysis in the running environment constructed by the first program, and at the same time allocates a second permission set (such as cross-process communication and system resource access permission) to it. The first intelligent agent is suspended after data synchronization is completed, and the state is frozen, waiting for the return instruction, thereby reducing power consumption. The second intelligent agent runs independently in the first program environment, obtains the second content (such as desktop files or external application data) outside the application according to the cross-application access capability of the environment, provides the second intelligent service, and during the period, if new task data is generated, it will be synchronized to the frozen state of the first intelligent agent in real time, ensuring data consistency. When the target application switches back to the interactive running state, the system triggers reverse migration, that is, the second intelligent agent synchronizes the new task data to the first intelligent agent, and further can enter a low-power state such as dormancy, and the first intelligent agent recovers from the frozen state, loads the latest task data in the target application environment, and continues to provide intelligent services within the application, completing the migration closed loop.
[0141] The processing method is applied to the scenario of a two-intelligent-agent interactive intermediary architecture (that is, the application scenario corresponding to the embodiments). Figure 3 The intelligent agent of the target application includes a first intelligent agent and a second intelligent agent, and the second intelligent agent has the ability to interact with a third intelligent agent outside the target application. By migrating the intelligent agent interacting with the outside to the first program environment, the collaborative linkage with the external intelligent agent is realized.
[0142] Specifically, when the target application is in interactive running state, the first agent processes in-application tasks within the application's built-in environment. The second agent (i.e., the agent communicating with the target application from outside) only completes basic initialization within the target application environment and does not initiate external interaction functions. It can synchronize the first agent's task configuration information (such as task type, user requirements, and processed data) through a data sharing channel. When the target application switches to a non-interactive running state, it triggers the second agent's cross-environment migration. It creates an independent running container in the first program (such as an operating system or other application), configuring the runtime dependencies (such as communication protocols and data encryption) and permissions (such as inter-process communication and network access permissions) required for interaction. Then, the second agent is separated from the target application environment, and the core program and synchronized task configuration information are transmitted to the first program container through a secure channel to complete access and initialization. After migration, the second agent acts as an interaction intermediary in the first program environment, receiving user input information through its own interface, merging it with task configuration information to generate external interaction requests, and sending them to external agents through standardized protocols. After receiving response information from external agents, it organizes and presents it to the user or synchronizes it to the first agent for data synchronization when switching back to the first agent. When the target application returns to the interactive running state, the second agent synchronizes the external interaction results and task data to the first agent, separates from the first program environment, and can further enter a low-power sleep state. The first agent loads the synchronized data and continues to provide services in the application's internal environment, realizing a seamless connection between in-application processing, external interaction, and in-application return.
[0143] This method is applied to application scenarios of single-agent dynamic reconfiguration architecture (i.e.) Figure 4 In the application scenarios corresponding to the embodiments, the working state of the target application is adapted through the separation, access, and dynamic loading of modules of the intelligent agent in different environments, thereby improving the user experience. Specifically, the intelligent agent of the target application under this architecture has the ability to obtain first content within the target application and provide a first intelligent service based on the first content. Furthermore, it can operate based on the target function, enabling it to interact with intelligent agents outside the target application.
[0144] Specifically, when the target application is in an interactive running state, the agent runs in the built-in environment of the target application, loads the first function module set, configures the first permission set (such as including application internal resource access permission), processes the application internal task, and stores the task context data in the shared cache area. In response to the target application switching to a non-interactive running state, cross-environment migration is triggered. First, the agent can pause the current task, encapsulate the task context data (such as session history, progress mark, and user preference) in the shared cache, then separate from the target application environment, and release the application internal resource. An independent container of the adaptive agent is created in the first program environment, and the running dependencies (such as interpreter and core library) compatible with the original application environment are configured, the encapsulated data and the agent core program are transmitted to the container and parsed. After the agent completes the access in the first program container, the first function module set can be unloaded or frozen, and the second function module set (such as containing external interaction target function module) is loaded, and the system synchronously adjusts the permission set, and grants cross-process communication and external resource access permission. Based on the loaded module and the restored task data, the agent provides application external services (such as interacting with external agents and accessing desktop resources) in the first program environment. When the target application returns to the interactive running state, the agent pauses the application external service, records the new task data and encapsulates, separates from the first program environment, and freezes the second function module set. Re-access in the target application environment, load the first function module set and the first permission set, synchronize the new task data to the shared cache, restore the application internal service, and realize seamless switching of the same agent in different environments and different function modes.
[0145] In Figure 6 On the basis of the embodiment shown, wherein based on the working state of the target application, the process of controlling the agent of the target application to separate from the running environment constructed by the target application and access the running environment constructed by the first program can include: in response to the working state of the target application being in the second working state, recording task execution state data of the agent of the target application in the target application running environment. The task execution state data is encapsulated to obtain target data. In the running environment of the first program, a container for carrying the agent is created. The target data is parsed in the container to enable the agent to access the running environment constructed by the first program.
[0146] The task execution state data is associated data generated by the agent when running in the target application running environment, including task basic information, execution progress, configuration parameters, user session information, and processed data. The encapsulation processing is to serialize, structure, integrate and compress the task execution state data according to the preset standard format (such as JSON), to ensure that the data format is uniform, the transmission is efficient, and the parsing requirements of the first program running environment can be adapted. The container refers to an independent running carrier created in the first program running environment, which has a dedicated process space, memory area, runtime dependency (such as interpreter, library file) and permission configuration, can isolate the core resources of the agent and the first program, and ensure the running stability and security.
[0147] Specifically, in response to the target application being in the second working state, the system sends a state recording instruction to the agent, the agent can pause the current non-core task, extract the task execution state data from the configuration database and shared cache of the target application running environment through the internal data interface, and then perform preliminary verification on the data to eliminate invalid and expired information. Then the verified task execution state data can be encapsulated in a preset standardized format. The processing system of the electronic device can establish communication with the first program and request to create an independent container for carrying the agent in its running environment. After the first program responds to the request, the container parameters are configured according to the running requirements of the agent, the container creation is completed and is in a ready state. Then the target data is transmitted from the target application environment to the container in the first program environment through a preset cross-environment secure communication channel. After receiving the target data, the container can verify the data integrity through the hash check code, and if the verification fails, it requests retransmission; after the verification is passed, the encapsulated format is parsed, each field of the task execution state data is extracted, and the internal data structure recognizable by the container is converted.
[0148] Based on the parsed task execution state data, the container of the first program initializes the running state of the agent, such as loading the core program of the agent, restoring the task progress, configuring the user preference parameters, and rebuilding the user session, so that the agent has consistent running capability in the container as in the target application environment; after access is completed, the container returns an access success signal to the system, and the agent starts in the first program environment and is in a ready state, which can provide external application service.
[0149] In this way, through the recording and encapsulation of the task execution state data, the running state of the agent after cross-environment migration can be completely restored, the service is seamlessly connected, the user does not need to reinitiate the task or configure the parameters, and the experience continuity is improved. Then the creation of the independent container provides an isolated running environment for the agent, which avoids the occupation or interference of the agent to the core resources of the first program, reduces the security risk through precise permission configuration, and improves the running stability and security.
[0150] Correspondingly, the embodiment of the present application also includes: in the running interface of the first program, rendering the user interface component of the agent according to the interface mode of the first program to obtain a target user interface. When the first program is an operating system, the target user interface represents a system-level display window independent of an application window; when the first program is an application program other than the target application, the target user interface is embedded in the main interface of the application program other than the target application.
[0151] The embodiment of the present application reconstructs and adapts the user interface component of the agent according to the interface characteristics of the target running environment. The interface mode represents the specific requirements of the target running environment for the user interface, including layout specifications, visual styles, and interaction logic. The operating system environment and the application program environment can have different interface modes. The system-level display window represents a floating interface component independent of any application program main window, and can have system-level features such as always being on top and being freely draggable. The embedded component represents a user interface element integrated into the main interface of the host application program as a sub-window or a function panel.
[0152] When the agent accesses a new running environment, the type and interface specification requirements of the current environment are identified. According to the environment type, the corresponding interface rendering engine is called, such as enabling the system-level window manager to create an independent floating window for the operating system environment, and calling the user interface framework of the application for embedded integration for the application program environment. The core functional components of the agent (such as the dialogue interface and the function button) are rearranged and visually redrawn according to the interaction paradigm of the target environment. The interaction state and display content of the agent are restored in the newly created interface container.
[0153] For example, as shown in Figure 7 , a schematic diagram of an agent user interface in a browser is shown. When the agent runs in a browser environment, its user interface is embedded in the right side of the browser window in the form of a sidebar, forming a unified application interface with web page content. At this time, the agent adopts the interface mode of the browser and can provide web page translation, content summary, and other functions highly related to web browsing. Referring to Figure 8 , a schematic diagram of an operating system agent user interface is shown. When the agent migrates to an operating system environment, the interface is reconstructed as an independent floating window. The window has standard system window control elements (minimize, maximize, and close buttons), the layout is adjusted to a card-style design more suitable for desktop interaction, and the function modules are also converted to system-level service portals such as file management and application startup. It and the current application in the electronic device, such as the notebook editing interface of the document record, together form the system desktop. Through the interface mode adaptive rendering in the embodiment of the present application, the agent can present an interaction experience matching the native interface in different first program environments, reducing the user learning cost and improving the convenience of use.
[0154] In the embodiment of the application, the agent controlling the target application is separated from the running environment constructed by the first application and restored to the running environment constructed by the target application, including: in response to the working state of the target application being the first working state, recording the task configuration information of the agent corresponding to the current running environment of the first program; determining target information associated with the target application in the task configuration information; synchronizing the target information to the running environment constructed by the target application, so that the agent is restored to the running environment constructed by the target application.
[0155] The embodiment relates to the reverse migration process of the agent from the external environment to the target application. When the system detects that the target application is restored to the interactive state, the migration process is started. First, the current task state of the agent in the external environment is captured, and the core context information related to the target application is screened out. Then, the information is synchronized back to the original application environment and re-embedded into the agent interface. The state continuity and task integrity of the agent in the environment migration process are realized. When the user returns to the application, the previous work flow can be immediately continued, and the task interruption and repeated operation caused by the environment switching are effectively eliminated.
[0156] In the embodiment corresponding to the environment migration architecture, the specific implementation process also includes the processing processes such as the dynamic permission allocation, the privileged operation prompt, and the double-engine state recognition based on rules and machine learning as described above. Since the technical features have been described in detail in the foregoing embodiments, the working principles and beneficial effects thereof in the present architecture are basically the same. To avoid repetition, details are not described herein again.
[0157] In the embodiment of the application, an electronic device is also provided, and the electronic device comprises:
[0158] The memory is configured to store a computer program, and the computer program comprises at least a first computer program and a second computer program.
[0159] The processor is configured to execute the first computer program to implement the following steps.
[0160] In response to a trigger instruction, the target application is started; the working state of the target application is obtained; and the target agent of the target application is switched between a first mode and a second mode based on the working state of the target application. In the first mode, the target agent has the ability to obtain first content in the target application and provide a first intelligent service based on the first content. In the second mode, the target agent has the ability to obtain second content outside the target application and provide a second intelligent service based on the second content.
[0161] The processor is further configured to execute the second computer program to implement the following steps.
[0162] In response to the trigger instruction, the target application is started; a working state of the target application is obtained; based on the working state of the target application, the agent of the target application is controlled to separate from the running environment constructed by the target application and access to the running environment constructed by the first program; the agent of the target application is controlled to separate from the running environment constructed by the first program and restore to the running environment constructed by the target application; wherein the first program includes one of the following: an operating system, an application program other than the target application.
[0163] The browser in the present application provides an embodiment for the present application, including but not limited to the browser. The application program includes the switching of the agent between the first mode and the second mode; wherein in the first mode, the agent has the ability to obtain the first content in the application and provide the first intelligent service based on the first content; in the second mode, the agent has the ability to obtain the second content outside the application and provide the second intelligent service based on the second content, which is within the scope of the present application.
[0164] It should be noted that the specific implementation of the processor in the present embodiment can refer to the corresponding content in the foregoing, which will not be described in detail here.
[0165] In another embodiment of the present application, a readable storage medium is also provided, which stores a computer program, and the computer program is executed by a processor to realize the processing method as described above.
[0166] The embodiments in the specification are described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same and similar parts of each embodiment can be referred to each other. For the device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the related parts can be referred to the method part.
[0167] The skilled person can further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed in the present text can be realized in electronic hardware, computer software or combination of both. In order to clearly show the interchangeability of hardware and software, the composition and steps of each example have been described in the above description. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0168] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0169] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A processing method, comprising: In response to a trigger command, launch the target application; Obtain the working status of the target application; Based on the working state of the target application, control the target agent of the target application to switch between the first mode and the second mode; In the first mode, the target intelligent agent has the ability to obtain first content within the target application and provide a first intelligent service based on the first content; In the second mode, the target intelligent agent has the ability to obtain second content outside the target application and to provide second intelligent services based on the second content.
2. The method according to claim 1, wherein the target intelligent agent includes a first intelligent agent and a second intelligent agent, the first intelligent agent operates in the first mode, and the second intelligent agent operates in the second mode, wherein, The step of controlling the target agent of the target application to switch between a first mode and a second mode based on the working state of the target application includes: In response to the target application's working state being a first working state, the first intelligent agent is activated; In response to the target application's operating state being a second operating state, the second intelligent agent is activated; The first working state indicates that the target application is in an interactive running state; the second working state indicates that the target application is in a non-interactive running state.
3. The method according to claim 2, wherein the second intelligent agent has the ability to interact with a third intelligent agent other than the target application, and the step of activating the second intelligent agent in response to the target application's working state being a second working state includes: In response to the target application's working state being the second working state, the task configuration information of the first agent is configured to the second agent, and then the second agent is started. The second intelligent agent is configured to receive user input information, merge the user input information with the task configuration information, and send it to a third intelligent agent outside the target application; and receive and present the response information of the third intelligent agent.
4. The method according to claim 1, wherein controlling the target agent of the target application to switch between a first mode and a second mode based on the working state of the target application includes: In response to the target application's working state being a first working state, the target intelligent agent is controlled to load a first set of functional modules to run in the first mode; In response to the target application's working state being a second working state, the target intelligent agent is controlled to load a second set of functional modules to run in a second mode; Wherein, the first working state indicates that the target application is in an interactive running state; the second working state indicates that the target application is in a non-interactive running state; the first functional module set is different from the second functional module set.
5. The method according to claim 4, wherein the second functional module set includes target functional modules that interact with an external intelligent agent other than the target application, and controlling the target intelligent agent to load the second functional module set to run in a second mode includes: Load the target functional module; The task context data generated by the target agent in the first mode is transmitted to the target functional module; The target function module sends the task context data and the user's current input information to the external intelligent agent and receives the response information returned by the external intelligent agent.
6. The method according to claim 1, wherein the target agent running in the first mode has a first permission set, the first permission set indicating that the target agent can access the internal resources of the target application; The target agent running in the second mode has a second set of permissions, which indicates that the target agent can access operating system-level resources and application resources outside the target application; wherein... The method further includes: In response to the target agent being in the second mode, a privileged operation request initiated by the target agent is received; wherein the privileged operation request requires permissions that exceed the permission range defined by the second permission set; Generate the prompt message corresponding to the privileged operation request; The privileged operation request is executed based on the feedback information corresponding to the prompt information.
7. The method according to claim 1, wherein obtaining the working state of the target application includes: The environmental characteristic data of the electronic device where the target application is located were collected; The environmental feature data is matched with the target state rule set; In response to obtaining a matching result, the working status of the target application is determined based on the matching result; In response to the lack of a matching result, the environmental feature data is identified using a state recognition model to determine the working state of the target application; The state recognition model is a model used to predict the current working state of a target application based on the correlation between historical environmental feature data of electronic devices and user behavior patterns.
8. A processing method, comprising: In response to a trigger command, launch the target application; Obtain the working status of the target application; Based on the working state of the target application, the intelligent agent of the target application is controlled to separate from the running environment constructed by the target application and access the running environment constructed by the first program; The intelligent agent controlling the target application is separated from the runtime environment constructed by the first program and restored to the runtime environment constructed by the target application; The first program includes one of the following: an operating system, or an application other than the target application.
9. The method according to claim 1, wherein controlling the agent of the target application to detach from the runtime environment constructed by the target application and access the runtime environment constructed by the first program based on the working state of the target application includes: In response to the target application being in a second working state, the task execution status data of the target application's agent in the target application's operating environment is recorded; The task execution status data is encapsulated to obtain the target data; In the runtime environment of the first program, a container is created to house the intelligent agent; The target data is parsed in the container so that the agent can be connected to the runtime environment built by the first program.
10. An electronic device, comprising: A memory for storing computer programs, the computer programs including at least a first computer program and a second computer program; A processor is configured to execute the first computer program to achieve: In response to a trigger command, the target application is launched; the working state of the target application is obtained; based on the working state of the target application, the target intelligent agent of the target application is controlled to switch between a first mode and a second mode; wherein, in the first mode, the target intelligent agent has the ability to obtain first content within the target application and provide a first intelligent service based on the first content; in the second mode, the target intelligent agent has the ability to obtain second content outside the target application and provide a second intelligent service based on the second content; The processor is further configured to execute the second computer program to achieve: In response to a trigger command, the target application is launched; the working state of the target application is obtained; based on the working state of the target application, the intelligent agent of the target application is controlled to detach from the running environment constructed by the target application and access the running environment constructed by the first program; the intelligent agent of the target application is controlled to detach from the running environment constructed by the first program and return to the running environment constructed by the target application; wherein, the first program includes one of the following: an operating system, or an application program other than the target application.