Task execution method, device and electronic device

By setting up first and second execution environments in electronic devices and utilizing cross-environment communication connections to achieve local execution of coding tasks, the real-time and reliability issues caused by coding tasks relying on network transmission are resolved, thereby improving coding efficiency.

CN123048154APending Publication Date: 2026-11-06VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611432426.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-15
Publication Date
2026-11-06

AI Technical Summary

Technical Problem

In existing technologies, when users perform coding tasks through electronic devices, they need to rely on network transmission to external computing devices, which makes coding efficiency greatly affected by the network and results in poor real-time performance and reliability.

Method used

In an electronic device, first and second execution environments are set up. The first execution environment runs a general-purpose intelligent agent, and the second execution environment runs a Linux coding intelligent agent. Local execution of coding tasks is achieved through cross-environment communication connections, reducing network dependence.

Benefits of technology

It improves the real-time performance and reliability of coding tasks, reduces latency and instability caused by network transmission, and ensures the efficient completion of coding tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123048154A_ABST
    Figure CN123048154A_ABST
Patent Text Reader

Abstract

The application discloses a task execution method and device and electronic equipment, and relates to the technical field of artificial intelligence. The method comprises the following steps: receiving instruction information input by a user through a first intelligent agent running in a first execution environment; in the case that the instruction information indicates a coding task, sending the instruction information to a second intelligent agent running in a second execution environment, and executing the coding task based on the instruction information through the second intelligent agent; and outputting an execution result of the coding task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of artificial intelligence technology, specifically relating to a task execution method, apparatus, and electronic device. Background Technology

[0002] With the rapid development of artificial intelligence technology, users' demand for interacting with intelligent agents through natural language to complete code writing and application generation is growing.

[0003] In related technologies, when users perform coding tasks on electronic devices, they typically need to connect to an external computing device (such as a personal computer or cloud server) via a network interface. The user inputs instructions on the electronic device, which are transmitted over the network to the coding tool or coding agent running on the external computing device. After the external computing device executes the coding task, it returns the processing results of the code or application to the electronic device.

[0004] However, in the above method, the encoding task needs to be transmitted to an external device via the network for execution. The encoding efficiency is greatly affected by the network, resulting in poor real-time performance and reliability of task execution. Summary of the Invention

[0005] The purpose of this application is to provide a task execution method, apparatus, and electronic device that can improve the real-time performance and reliability of coding task execution.

[0006] In a first aspect, embodiments of this application provide a task execution method, the method comprising: receiving instruction information input by a user through a first intelligent agent running in a first execution environment; if the instruction information indicates an encoding task, sending the instruction information to a second intelligent agent running in a second execution environment, and executing the encoding task through the second intelligent agent based on the instruction information; and outputting the execution result of the encoding task.

[0007] Secondly, embodiments of this application provide a task execution device, which includes: a receiving module, configured to receive instruction information input by a user through a first intelligent agent running in a first execution environment; a processing module, configured to send the instruction information to a second intelligent agent running in a second execution environment when the instruction information indicates an encoding task, and execute the encoding task through the second intelligent agent based on the instruction information; and output the execution result of the encoding task.

[0008] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, wherein the memory stores programs or instructions executable on the processor, and the programs or instructions, when executed by the processor, implement the steps of the method described in the first aspect.

[0009] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.

[0010] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the method as described in the first aspect.

[0011] In a sixth aspect, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the method described in the first aspect.

[0012] In this embodiment, the electronic device receives user-inputted instruction information through a first intelligent agent running in a first execution environment; if the instruction information indicates an encoding task, the instruction information is sent to a second intelligent agent in a second execution environment, and the second intelligent agent executes the encoding task based on the instruction information; the execution result of the encoding task is output. With this solution, the electronic device can complete the encoding task locally without relying on external computing devices, reducing latency and instability caused by network transmission, thereby improving the real-time performance and reliability of the encoding task execution. Attached Figure Description

[0013] Figure 1 This is an interactive schematic diagram of the task execution system provided in the embodiments of this application;

[0014] Figure 2 A flowchart illustrating the task execution method provided in this application embodiment;

[0015] Figure 3 This is a schematic diagram of the structure of the task execution device provided in the embodiments of this application;

[0016] Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application;

[0017] Figure 5 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0018] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0019] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0020] The terms "at least one," "at least one of," etc., used in the specification and claims of this application refer to any one, any two, or a combination of two or more of the included items. For example, at least one of a, b, and c can mean: "a," "b," "c," "a and b," "a and c," "b and c," and "a, b, and c," where a, b, and c can be single or multiple. Similarly, "at least two" refers to two or more items, and its meaning is similar to that of "at least one."

[0021] The video recording method provided in this application can be executed by a task execution device, which can be an electronic device, or a functional module or functional entity within an electronic device. The following description uses an electronic device executing the task execution method as an example to illustrate the task execution method provided in this application.

[0022] The task execution method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.

[0023] The task execution method provided in this application can be applied to scenarios where coding tasks are performed via electronic devices.

[0024] A specific application scenario is as follows: A user needs to write program code, but lacks programming skills or their current electronic device does not have installed development tools. The user inputs the voice command "Write me an application code" into a general-purpose agent via an electronic device (such as a mobile phone). The electronic device receives this command through the general-purpose agent, recognizes that the command belongs to a coding task, and then sends the command information to the coding agent in a second execution environment. The coding agent generates the application's code file based on the command information and stores the code file in a shared directory. The electronic device displays the code generation result returned by the coding agent in the user's session interface.

[0025] Another specific application scenario is when a user needs to modify existing project files. The user inputs the command "Change the login method in the project to mobile phone number verification" into the general agent via an electronic device. The electronic device receives this command through the general agent and determines that it belongs to a coding task. The electronic device mounts the project directory as a shared directory to the second execution environment. The coding agent modifies the login settings in the project files according to the command, saves the modified files to the shared directory, and displays the modified files in the user's session interface.

[0026] The task execution method provided in this application aims to solve the problems of long processing time, high token consumption, and insufficient user control caused by repeated execution of general agent inference and tool selection when users complete coding tasks through general agents in the Android system. At the same time, it solves the problem that independent coding agents released for desktop Linux systems are difficult to run and access project files in Android mobile terminals.

[0027] Figure 1 This is a schematic diagram illustrating the interaction of a task execution system provided in an embodiment of this application. For example... Figure 1 As shown, the task execution system includes a user interface, a main system (first execution environment), and a second system (second execution environment).

[0028] For example, the user interface serves as the entry point for users to interact with electronic devices, receiving user-input instructions and displaying the execution results returned by the intelligent agent. The main system is the first execution environment, in which a main intelligent agent (i.e., the first intelligent agent) runs. The main intelligent agent receives user-input instructions and processes them through an intelligent agent loop. The intelligent agent loop includes keyword recognition and tool invocation. Keyword recognition is used to initially filter the instruction information to determine whether it contains coded keywords. If coded keywords are detected, the main intelligent agent sends the instruction information to an intent judgment model for intent recognition. Cloud-based rapid recognition is an optional module, used to send instruction information to the cloud for rapid intent recognition when needed, thereby improving recognition speed. The main intelligent agent also supports tool invocation for handling non-coded daily tasks. The second system is the second execution environment, which can be a GNU / Linux environment. A coding intelligent agent (i.e., the second intelligent agent) runs in the second system. The coding intelligent agent is a native PC version of a coding intelligent agent, such as Claude, Codex, or OpenCode. The coding agent receives instructions from the main system and executes coding tasks based on these instructions, including code generation, project modification, and application building. When executing business logic, the coding agent can invoke appropriate tools (such as compilers, build tools, and package managers) to complete specific coding operations. The user interface may also include a pass-through mode button, which allows the user to toggle pass-through mode on or off. In pass-through mode, the main agent switches from session mode to pass-through mode, so that subsequent user-input instructions are no longer processed by the main agent but are directly sent to the coding agent in the second system via a cross-environment communication connection for processing, thus enabling direct and continuous interaction between the user and the coding agent.

[0029] In this embodiment, an Android first execution environment running a general-purpose intelligent agent and a GNU / Linux second execution environment running an independent coding intelligent agent are set up in the same mobile terminal. The two intelligent agents are connected through cross-environment communication channels such as Socket and vsock. When a coding requirement is identified, the session is switched to the coding intelligent agent pass-through mode, so that subsequent user input bypasses the large model inference and tool selection process of the general-purpose intelligent agent and is directly sent to the Linux coding intelligent agent. The returned content is then presented on the original session interface on the Android side. At the same time, by mounting a shared directory, the coding intelligent agent can directly read and modify local project files.

[0030] It should be noted that the task execution method provided in this application embodiment can also be applied to other scenarios where electronic devices need to complete coding tasks locally, such as automated testing and project maintenance, and this application embodiment does not impose any limitations on this.

[0031] Figure 2 This is a flowchart illustrating the task execution method provided in the embodiments of this application, as shown below. Figure 2 As shown, the task execution method may include the following steps 201 to 203:

[0032] Step 201: The electronic device receives the instruction information input by the user through the first intelligent agent.

[0033] The aforementioned instruction information indicates the tasks to be executed.

[0034] In some embodiments of this application, the above instruction information includes task description information.

[0035] In some embodiments of this application, the electronic device includes a first execution environment and a second execution environment, wherein a first intelligent agent runs in the first execution environment and a second intelligent agent runs in the second execution environment.

[0036] In some embodiments of this application, the first execution environment can be an Android system environment, and the first intelligent agent can be a general-purpose intelligent agent in an electronic device, such as a voice assistant or AI assistant. The first intelligent agent serves as the interaction entry point between the user and the electronic device, used to receive user-input instructions and perform preliminary processing on the instructions.

[0037] In some embodiments of this application, the second execution environment uses the GNU C library, and the second intelligent agent is a Linux-coded intelligent agent capable of running in the second execution environment.

[0038] In some embodiments of this application, the second execution environment uses the GNU C library (glibc), and the second intelligent agent is a Linux-coded intelligent agent capable of running in the second execution environment.

[0039] In some embodiments of this application, the second execution environment employs glibc, enabling it to be compatible with and run various software distributed for desktop Linux systems. Exemplarily, the second execution environment can be implemented using Linux containers (such as LXC), virtual machines (such as QEMU), chroot environments, or Linux systems running in parallel with Android.

[0040] In some embodiments of this application, the second intelligent agent is a Linux coding intelligent agent capable of running in a second execution environment. For example, the Linux coding intelligent agent can be coding intelligent agent software such as Claude, Codex, and OpenCode, which are distributed for desktop Linux systems. It should be noted that the coding intelligent agent software relies on glibc and a complete Linux user-space runtime environment and cannot run directly on Android systems that use the Bionic C library.

[0041] Understandably, by setting up a second execution environment using glibc in electronic devices and running Linux coding agents in that environment, professional coding agents that could originally only run on desktop Linux systems can now run locally on electronic devices (such as mobile terminals), thereby expanding the coding capabilities of electronic devices and enabling them to complete professional coding tasks without relying on external computing devices.

[0042] It should be noted that the second execution environment and the first execution environment are independent of each other. For example, the second execution environment can be a GNU / Linux execution environment, and the second intelligent agent can be a professional coding intelligent agent running in this environment, such as coding intelligent agent software released for desktop Linux systems, such as Claude, Codex, or OpenCode.

[0043] In some embodiments of this application, the electronic device receives instruction information input by the user through a first intelligent agent. The instruction information is information input by the user to the electronic device through voice, text or other interactive means, which instructs the user to perform a coding task that the electronic device expects the electronic device to perform.

[0044] For example, a user can input "help me write a calculator application" via voice or "generate webpage code" via text input box. Once received by the electronic device, the aforementioned voice or text information serves as the instruction.

[0045] The following example illustrates the method provided in the embodiments of this application through a specific scenario.

[0046] Step 202: When the electronic device receives an instruction message indicating an encoding task, it sends the instruction message to the second intelligent agent and the second intelligent agent executes the encoding task based on the instruction message.

[0047] In some embodiments of this application, the above-mentioned coding tasks include at least one of the following: code generation tasks, application generation tasks, project modification tasks, code review tasks, defect repair tasks, or automated testing tasks, etc., which are software development-related tasks.

[0048] For example, if the user inputs the instruction "Help me write a calculator application", then the coding task is an application generation task, which belongs to the coding task; if the user inputs the instruction "How is the weather today", then the coding task is a weather query task, which does not belong to the coding task.

[0049] In some embodiments of this application, the electronic device can use an intent determination model to perform semantic recognition on instruction information to determine whether the instruction information indicates an encoding task. The specific implementation of determining whether instruction information indicates an encoding task will be described in detail in subsequent embodiments.

[0050] In some embodiments of this application, when it is determined that the instruction information indicates an encoding task, the electronic device sends the instruction information to a second intelligent agent in the second execution environment, and the second intelligent agent executes the encoding task based on the instruction information.

[0051] It should be noted that the second agent is capable of handling specialized coding tasks such as code generation, project modification, and application building. If the instruction information indicates a coding task, the second agent, rather than the first agent, will execute the task, thereby ensuring the professionalism of the coding task.

[0052] It is understandable that sending instruction information from the first execution environment to the second execution environment can be achieved through cross-environment communication. The specific implementation of cross-environment communication will be described in detail in subsequent embodiments.

[0053] In some embodiments of this application, after receiving instruction information, the second intelligent agent executes a coding task based on the instruction information.

[0054] For example, if the instruction is "Help me write a calculator application", the second agent generates the code file for the calculator application based on the instruction. If the instruction is "Change all login methods in the project to mobile phone number verification", the second agent modifies the login logic in the project file based on the instruction and generates the modified file.

[0055] Step 203: The electronic device outputs the execution result of the encoding task.

[0056] In some embodiments of this application, the above execution result is the result returned by the second intelligent agent after performing the coding task.

[0057] In some embodiments of this application, the execution result of the encoding task may include at least one of streaming text, task status, or file modification information.

[0058] For example, if the coding task is an application generation task, the execution result may include a prompt message "Code generated, please check" and the generated code file. If the coding task is a project modification task, the execution result may include task status information "Modification completed".

[0059] In some embodiments of this application, the electronic device can display the execution results on a task interface for the user to view.

[0060] In some embodiments of this application, the task interface can be the conversational interface of the first intelligent agent, that is, the same interface on which the user inputs instruction information, so that the user can view the execution process and results of the coding task without switching interfaces, thus maintaining the continuity of the interaction.

[0061] The following example illustrates the task execution method provided in this application through a specific scenario.

[0062] For example, a user inputs the voice command "Write me a calculator application" into the voice assistant interface of an electronic device. The electronic device receives this command information through the voice assistant (i.e., the first intelligent agent), which indicates the coding task as "Generate a calculator application." The electronic device identifies this coding task as an application generation task, i.e., a coding task, using an intent judgment model. Next, the electronic device sends the command information to the coding intelligent agent (i.e., the second intelligent agent) in the second execution environment. The coding intelligent agent generates the code file for the calculator application based on the command information. The electronic device receives a "Code generated" prompt from the coding intelligent agent and displays this prompt in the voice assistant interface. Simultaneously, the user can retrieve the generated code file from the shared directory.

[0063] The task execution method provided in this application embodiment involves an electronic device receiving user-input instruction information through a first intelligent agent running in a first execution environment; when the instruction information indicates an encoding task, the instruction information is sent to a second intelligent agent in a second execution environment, and the second intelligent agent executes the encoding task based on the instruction information; the execution result of the encoding task is then output. With this solution, the electronic device can complete the encoding task locally without relying on external computing devices, reducing latency and instability caused by network transmission, thereby improving the real-time performance and reliability of the encoding task execution.

[0064] In some embodiments of this application, before the second intelligent agent executes the encoding task based on instruction information in step 202 above, the task execution method provided in this application embodiment may further include the following steps 204 and 205:

[0065] Step 204: If the electronic device does not start the second execution environment, it starts the second execution environment.

[0066] Step 205: If the second agent is not started, the electronic device starts the second agent in the second execution environment.

[0067] In some embodiments of this application, when an electronic device determines that the instruction information indicates an encoding task, it can check the running status of the second execution environment and start the second execution environment if the second execution environment is not started.

[0068] In some embodiments of this application, the second execution environment can be in a standby state by default after the electronic device is powered on, or it can be started only after an encoding task is detected, in order to reduce resource consumption. For example, when the electronic device is powered on for the first time, the second execution environment can be in a non-started state to save system resources. When the user initiates an encoding task for the first time, the electronic device starts the second execution environment.

[0069] In some embodiments of this application, after starting the second execution environment, the electronic device can check the operating status of the second intelligent agent. If the second intelligent agent is not started, the electronic device starts the second intelligent agent in the second execution environment.

[0070] It should be noted that the second intelligent agent can be started by default after the second execution environment starts, or it can be started by an electronic device.

[0071] In some embodiments of this application, the electronic device can load the program file of the second intelligent agent in the second execution environment, initialize the running parameters of the second intelligent agent, and enable the second intelligent agent to enter a state that can receive instructions and execute tasks, that is, start the second intelligent agent.

[0072] It should be noted that the startup of the second execution environment and the second intelligent agent can be performed at any time after the coding task is identified and before the instruction information is sent to the second intelligent agent. For example, the electronic device can start the second execution environment and the second intelligent agent after determining that the instruction information instructs the coding task, thereby reducing user waiting time.

[0073] The following example illustrates the method provided in the embodiments of this application through a specific scenario.

[0074] For example, after determining that the user-input instruction "Help me write a calculator application" is a coding task, the electronic device detects that the second execution environment is currently not started. The electronic device starts the second execution environment, launches a coding agent within the second execution environment, and then sends the instruction information to the coding agent to execute the coding task.

[0075] In this embodiment, before the electronic device executes the encoding task through the second intelligent agent, it starts the second execution environment if the second execution environment is not started, and starts the second intelligent agent within the second execution environment if the second intelligent agent is not started. This scheme allows the electronic device to start the second execution environment and the second intelligent agent only when needed, ensuring the normal execution of the encoding task while avoiding unnecessary resource consumption and achieving rational utilization of system resources.

[0076] In some embodiments of this application, before the second intelligent agent executes the encoding task based on instruction information in step 202 above, the task execution method provided in this application embodiment may further include the following step A1:

[0077] Step A1: The electronic device mounts the shared directory in the first execution environment to the second execution environment.

[0078] The shared directory includes the project files corresponding to the coding tasks.

[0079] In some embodiments of this application, the shared directory may include project files corresponding to one or more coding tasks. For example, taking multiple coding tasks including application generation tasks, webpage generation tasks, and backend code modification tasks as an example, the shared directory may include project files for application generation tasks, webpage generation tasks, backend code modification tasks, etc. When executing a specific coding task subsequently, the electronic device can access the project files of that coding task from the shared directory through a second coding agent in the second execution environment to execute the coding task accordingly.

[0080] In some embodiments of this application, the shared directory is a storage space shared by the electronic device between a first execution environment and a second execution environment. It is mounted in the second execution environment, and the shared directory includes project files corresponding to coding tasks. For example, project files may include code files, configuration files, resource files, and other files related to the coding task.

[0081] In some embodiments of this application, the shared directory can be determined in a first execution environment and mounted to a second execution environment. For example, in the first execution environment, the shared directory corresponds to a directory path in the file system of the electronic device; in the second execution environment, the shared directory is mounted as an accessible directory path, enabling a second agent in the second execution environment to access project files through that path.

[0082] Understandably, by using a shared directory, the second agent can directly read, create, modify, and save project files without having to transmit file content packet by packet through inter-process communication, thereby improving the efficiency of file operations.

[0083] It should be noted that the shared directory can be provided through binding mount, shared volume or other file system mapping methods, and this application embodiment does not limit this.

[0084] In some embodiments of this application, the process of executing the encoding task by the second intelligent agent based on instruction information in step 202 above may include the following steps 202a and 202b:

[0085] Step 202a: The electronic device accesses the project file corresponding to the coding task from the shared directory through the second intelligent agent.

[0086] Step 202b: The electronic device processes the project file according to the instruction information through the second intelligent agent and generates the execution result of the coding task.

[0087] The shared directory mentioned above is mounted on the second execution environment, and the shared directory includes the project files corresponding to the coding task.

[0088] In some embodiments of this application, the second intelligent agent accesses the project files corresponding to the coding task from a shared directory. For example, if the coding task is a project modification task, the project files corresponding to the coding task are all the code files for that project modification task. The second intelligent agent reads these code files from the shared directory for analysis and modification. If the coding task is an application generation task, the project files corresponding to the coding task can be pre-created empty folders and / or files in the shared directory, and the second intelligent agent generates the application's code files in those folders.

[0089] In some embodiments of this application, the second intelligent agent processes the project file according to instruction information.

[0090] For example, the above processing includes operations such as code generation, code modification, code deletion, file creation, and file renaming.

[0091] In some embodiments of this application, the second intelligent agent generates the execution result of the coding task after processing the project file.

[0092] In some embodiments of this application, the execution result is used to indicate the execution result of the coding task, which may include at least one of streaming text, task status, or file modification information.

[0093] In this embodiment, the second intelligent agent accesses the project file corresponding to the coding task from the shared directory, processes the project file according to the instruction information, and generates the execution result of the coding task. Through this scheme, the coding intelligent agent can directly manipulate the project file in the shared directory mounted on the second execution environment, thereby improving the overall task execution efficiency.

[0094] In some embodiments of this application, after step 201 described above, the task execution method provided in this application may further include steps 206 and 207:

[0095] Step 206: The electronic device performs keyword recognition on the instruction information through the first intelligent agent;

[0096] Step 207: When the electronic device recognizes that the instruction information contains the first keyword, it inputs the instruction information into the intent judgment model and uses the intent judgment model to identify whether the instruction information indicates an encoding task.

[0097] In some embodiments of this application, after receiving instruction information input by the user through a first intelligent agent, the electronic device determines whether the instruction information indicates an encoding task.

[0098] In some embodiments of this application, the electronic device can determine whether it is an encoding task by the following steps: the first intelligent agent performs keyword recognition on the instruction information, and if the instruction information contains the first keyword, the instruction information is sent to the intent judgment model, and the intent judgment model identifies whether the instruction information indicates an encoding task.

[0099] In some embodiments of this application, the first keyword is an encoding-related keyword, such as programming, code generation, application generation, webpage generation, application creation, project modification, etc.

[0100] In some embodiments of this application, the intent determination model can be a trained machine learning model used to perform deep semantic recognition of instruction information in order to determine whether the encoding task indicated by the instruction information belongs to the encoding task.

[0101] For example, the intent determination model can employ a lightweight natural language understanding model based on the Transformer architecture. This model is pre-trained and capable of classifying the intent of user input instructions and outputting task type labels. For example, task type labels may include "coding task," "schedule management task," "information query task," etc.

[0102] In some embodiments of this application, after receiving instruction information, the first intelligent agent performs keyword matching on the instruction information to preliminarily determine whether the instruction may be related to the coding task. For example, the first intelligent agent can use regular expression matching to detect whether the instruction information contains preset keywords such as "programming," "code generation," "application generation," "webpage generation," "create application," or "modify project." If the instruction information contains any of these keywords, it is preliminarily determined that the instruction may be related to the coding task.

[0103] Understandably, keyword recognition, as an initial screening tool, can quickly identify instructions that do not belong to the encoding task, avoiding sending non-encoded instructions to the intent judgment model and thus reducing unnecessary computational overhead. For example, if the user inputs the instruction "How's the weather today?", this instruction does not contain any encoded keywords, so there is no need to send it to the intent judgment model for further recognition.

[0104] In some embodiments of this application, when the first intelligent agent recognizes that the instruction information contains a first keyword, the electronic device sends the instruction information to the intent judgment model.

[0105] In some embodiments of this application, after receiving instruction information, the intent determination model performs semantic parsing on the instruction information and outputs an identification result indicating whether the encoding task belongs to the encoding task category. For example, if the instruction information is "Help me write a calculator application," and the intent determination model identifies the encoding task as an application generation task, then it determines that the task belongs to the encoding task category.

[0106] The following example illustrates the method provided in the embodiments of this application through a specific scenario.

[0107] For example, a user inputs the voice command "Help me write a calculator application." After the electronic device receives this command information through a first intelligent agent, the first agent performs keyword recognition on the command information, detecting that it contains the keywords "write" and "application." These keywords match the preset keyword "application generation," belonging to the encoding-related keywords. Next, the first intelligent agent sends the command information to the intent determination model. The intent determination model performs semantic analysis on the command information, identifying the user's intent as "generate a calculator application," and the corresponding task type as an "application generation task," belonging to the encoding task. The intent determination model returns the recognition result to the electronic device, and the electronic device determines that the instruction indicates an encoding task.

[0108] In this embodiment, the electronic device uses a first intelligent agent to perform keyword recognition on the instruction information. If the instruction information contains a first keyword, it sends the instruction information to an intent determination model. The intent determination model then identifies whether the instruction information indicates an encoding task. Through this scheme, the electronic device can determine whether the current task is encoding based on keyword recognition and the intent determination model, thereby improving the efficiency and accuracy of encoding task identification.

[0109] In some embodiments of this application, before sending the instruction information to the second intelligent agent in step 202 above, the task execution method provided in this application may further include the following step 208:

[0110] Step 208: The electronic device establishes a cross-environment communication connection between the first execution environment and the second execution environment.

[0111] For example, in conjunction with step 208 above, the process of sending instruction information to the second intelligent agent in step 202 above may include the following step 202a:

[0112] Step 202a: The electronic device sends the instruction information received by the first intelligent agent to the second intelligent agent through the cross-environment communication connection.

[0113] In some embodiments of this application, the electronic device may establish a cross-environment communication connection between the first execution environment and the second execution environment before sending instruction information to the second intelligent agent.

[0114] In some embodiments of this application, the electronic device can establish a cross-environment communication connection between a first execution environment and a second execution environment through a cross-environment communication module.

[0115] In some embodiments of this application, the cross-environment communication module runs in a first execution environment and is used to establish a cross-environment communication connection between the first execution environment and a second execution environment.

[0116] In some embodiments of this application, the electronic device can establish the cross-environment communication connection through a socket, or through a virtual machine socket (vsock), or through shared memory, message queues, or local remote procedure calls (RPC).

[0117] In some embodiments of this application, after a cross-environment communication connection is established, the cross-environment communication module in the electronic device sends the instruction information received by the first intelligent agent to the second intelligent agent in the second execution environment through the cross-environment communication connection.

[0118] For example, when a user inputs the instruction "Help me write a calculator application", the instruction is first received by the first intelligent agent. After determining that the coding task has been indicated and switching to the pass-through mode, the cross-environment communication module sends the instruction to the second intelligent agent through the established cross-environment communication connection.

[0119] The following example illustrates the method provided in the embodiments of this application through a specific scenario.

[0120] For example, a user inputs the command "Write me a calculator app" through the voice assistant of an electronic device. The voice assistant (i.e., the first intelligent agent) receives the command, and the electronic device determines that the encoding task indicated by the command is an encoding task. Next, the cross-environment communication module in the Android system environment establishes a cross-environment communication connection between the Android system environment (i.e., the first execution environment) and the Linux system environment (i.e., the second execution environment) via a socket. Then, the cross-environment communication module in the Android system environment sends the command received by the voice assistant to the encoding intelligent agent (i.e., the second intelligent agent) in the Linux container environment through this cross-environment communication connection.

[0121] In some embodiments of this application, the electronic device can switch the session mode of the first intelligent agent to the transparent transmission mode through the session routing module.

[0122] In some embodiments of this application, the session routing module runs in a first execution environment and is used to manage the session state between the user and the first intelligent agent.

[0123] It should be noted that the pass-through mode can be understood as a conversational interaction mode. In the pass-through mode, the user's subsequent input instructions are no longer processed by the first intelligent agent, but are sent directly to the second intelligent agent.

[0124] In some embodiments of this application, the session routing module stores transparent state information, which indicates whether the current session is in transparent mode. If so, the session routing module directly routes subsequent user input instructions to the second agent instead of sending them to the first agent for processing.

[0125] For example, in conjunction with the above example, when the user subsequently adds the instruction "add a button to the calculator", the session routing module directly sends the supplementary instruction to the coded agent through the cross-environment communication connection based on the transparent state information, instead of sending it to the general agent for processing.

[0126] In this embodiment, the electronic device establishes a cross-environment communication connection between a first execution environment and a second execution environment through a cross-environment communication module, and sends the instruction information received by the first intelligent agent to the second intelligent agent through the cross-environment communication connection. Through this scheme, the electronic device can realize data interaction between the user and the second intelligent agent.

[0127] In some embodiments of this application, step 203 may include steps 203a and 203b:

[0128] Step 203a: The electronic device receives the execution result returned by the second intelligent agent through the cross-environment communication connection. The execution result includes at least one of streaming text, task status, or file modification information.

[0129] Step 203b: The electronic device displays the execution results on the task interface.

[0130] In some embodiments of this application, the execution result includes at least one of streaming text, task status, file modification information, or task result. In other words, the execution result is information generated by the second agent after performing the coded task, used to describe the execution process and execution result.

[0131] For example, the aforementioned streaming text refers to the natural language description generated in real time by the second agent during the encoding process, which may include progress prompts for code generation, descriptions of currently executed actions, etc.

[0132] For example, the task status is used to indicate the execution status of the encoding task, and it may include status information such as "in execution", "completed", and "execution failed". For example, when the second agent completes the encoding task, the returned task status is "completed".

[0133] For example, file modification information is used to instruct the second agent on the modification operations performed on the project file, which may include the modified file name, the number of lines modified, newly added files, deleted files, etc.

[0134] For example, the task result can be the encoded information ultimately generated by the coding agent, such as the code file of the generated calculator application.

[0135] In some embodiments of this application, the task interface can be the conversation interface of the first intelligent agent, i.e., the same interface where the user inputs command information, or it can be an independent encoding task result display interface, or it can be other interfaces, such as a notification bar interface. This application does not limit this.

[0136] The following example illustrates the method provided in the embodiments of this application through a specific scenario.

[0137] For example, the user inputs the instruction "Generate a calculator application," and the second agent begins executing the application generation task. The cross-environment communication module receives the execution results returned by the second agent in real time via a cross-environment communication connection, including streaming text such as "Creating project…", "Generating code…", etc. The electronic device displays the aforementioned streaming text in the task interface to present the execution progress of the coding task. Then, after the second agent completes the generation of the calculator application code, the electronic device receives the task status "Completed" returned by the second agent, along with the generated calculator application code file, and displays the task status and code file in the task interface.

[0138] In this embodiment, the electronic device receives the execution result returned by the second intelligent agent through a cross-environment communication connection and displays the execution result on the task interface. This scheme allows the electronic device to present the process information and execution result of the second intelligent agent performing the coded task to the user in real time, improving human-computer interaction performance.

[0139] The task execution method provided in this application will be described below through specific embodiments.

[0140] This embodiment provides a task execution method. The mobile terminal runs an Android environment and a GNU / Linux environment; the general-purpose intelligent agent runs in the Android environment, and the coded intelligent agent runs in the GNU / Linux environment. Exemplarily, the task execution method may include the following steps:

[0141] Step 301: Identify the relevant keywords for encoding.

[0142] For example, after receiving the user's current input, the general-purpose agent in the Android environment performs keyword recognition on the input. For instance, regular expressions can be used to determine whether the user input contains keywords related to programming, code generation, application generation, webpage generation, creating an application, or modifying a project. (Background information reduced)

[0143] For example, if no coded keywords are identified, the user input is passed to the general intelligent agent's original reasoning-tool call loop for processing; if coded keywords are identified, the process proceeds to step 302.

[0144] Step 302: Confirm coding requirements.

[0145] For example, the Android environment sends the user's current input to the intent determination model, which then determines whether the input belongs to a coding task or an application-generated task.

[0146] For example, if the judgment result is negative, the user input is handed over to the general intelligent agent for processing; if the judgment result is positive, the process proceeds to step 303.

[0147] Step 303: Prepare the GNU / Linux execution environment.

[0148] For example, the Android environment checks whether the GNU / Linux execution environment and the coded agent on the same mobile terminal are available.

[0149] For example, if the GNU / Linux execution environment is not already running, the GNU / Linux execution environment is started or woken up; if the coding agent is not already running, the coding agent is started in the GNU / Linux execution environment.

[0150] For example, the GNU / Linux execution environment uses glibc and can run desktop Linux-based intelligent agent software adapted to the instruction set of mobile terminal processors. The GNU / Linux execution environment can be implemented through Linux containers, virtual machines, chroot environments, or a Linux system running in parallel with the Android system.

[0151] Step 304: Establish cross-environment communication connection.

[0152] For example, a cross-environment communication module in the Android environment establishes a bidirectional communication connection with a communication service in the GNU / Linux environment.

[0153] For example, when the GNU / Linux execution environment is implemented using containers, chroot, or a parallel Linux system, a communication connection can be established via Socket; when the GNU / Linux execution environment is implemented using a virtual machine, a communication connection can be established via vsock.

[0154] For example, the Android environment sends user input, session task identifier, and task control information (task status) to the GNU / Linux environment via a communication connection, and receives text content and task status returned by the coded agent.

[0155] Step 305: Mount the project directory.

[0156] For example, the Android environment provides a shared directory to the GNU / Linux execution environment based on the project directory specified by the user or the project directory corresponding to the coding task.

[0157] For example, the GNU / Linux execution environment mounts a shared directory as the working directory of a coding agent, enabling the coding agent to read, create, or modify project files in the working directory.

[0158] For example, the file access scope of the coding agent is restricted to a shared directory to prevent the coding agent from accessing Android system files or user data that are not related to the current coding task.

[0159] Step 306: Switch to the coded intelligent agent pass-through mode.

[0160] For example, the Android environment switches the current user session processing state to the coded agent pass-through mode and sets the pass-through mode switch to the on state on the user session interface.

[0161] For example, the Android environment sends the current round of user input to a coded agent in the GNU / Linux environment via a cross-environment communication connection.

[0162] For example, in pass-through mode, the session routing module in the Android environment sends subsequent user input directly to the coded agent based on the saved pass-through state, instead of sending subsequent input to the large model of the general agent for intent reasoning and tool selection.

[0163] Step 307: Return the processing result of the coded agent.

[0164] For example, the coding agent performs code generation, file modification, or application generation tasks based on user input and returns the processed content through cross-environment communication connections.

[0165] For example, the Android environment receives streaming text, task status, or file modification results returned by the coding agent and displays them directly on the original user session interface, allowing the user to view the implementation process of the coding agent and continue to send supplementary requests or correction information to the coding agent.

[0166] Step 308: Exit the coded intelligent agent pass-through mode.

[0167] After completing a coding task or application generation task, the user can exit the coding agent pass-through mode by turning off the pass-through mode switch in the user session interface.

[0168] For example, the Android environment updates the processing state of the current session, stops sending subsequent user input directly to the coded agent in the GNU / Linux environment, and resumes processing subsequent user input by the general agent in the Android environment.

[0169] For example, after exiting the pass-through mode, the coding agent in the GNU / Linux environment can continue running, pause running, or terminate running according to preset policies, and the modified project files are retained in the shared directory.

[0170] The task execution method provided in this application enables the coding agent, which is designed for desktop Linux systems, to run locally on the mobile terminal by setting up both an Android runtime environment and a GNU / Linux execution environment on the same mobile terminal. This helps reduce reliance on remote PCs and cloud servers. After identifying coding requirements, the system switches the session to a coding agent pass-through mode, allowing subsequent user input to bypass the large model inference and tool selection process of the general agent, thus reducing interaction time and token consumption. The coding agent directly reads and modifies project files through a mounted shared directory, reducing the transmission and synchronization of project files between the mobile terminal and remote devices. Simultaneously, users can view the coding process and promptly supplement or correct requirements within the original session interface on the Android device, thereby improving the controllability and interaction efficiency of the coding task.

[0171] It should be noted that each of the above method embodiments, or various possible implementations of each method embodiment, can be executed individually or in combination of any two or more. The specific implementation can be determined according to actual usage requirements, and this application embodiment does not impose any restrictions on this.

[0172] The task execution method provided in this application can be executed by a task execution device. This application uses the example of a task execution device executing the task execution method to illustrate the task execution device provided in this application.

[0173] Figure 3This is a schematic diagram of a task execution device provided in an embodiment of this application. The task execution device includes a first execution environment and a second execution environment. A first intelligent agent runs in the first execution environment, and a second intelligent agent runs in the second execution environment. Figure 3 As shown, the task execution device 600 includes a receiving module 601 and a processing module 602, wherein: the receiving module 601 is used to receive instruction information input by the user through the first intelligent agent; the processing module 602 is used to send the instruction information received by the receiving module to the second intelligent agent when the instruction information indicates an encoding task, and to execute the encoding task by the second intelligent agent based on the instruction information; the processing module 602 is also used to output the execution result of the encoding task.

[0174] The task execution device provided in this application embodiment receives user-input instruction information through a first intelligent agent running in a first execution environment; when the instruction information indicates an encoding task, the device sends the instruction information to a second intelligent agent in a second execution environment, and the second intelligent agent executes the encoding task based on the instruction information; and outputs the execution result of the encoding task. With this solution, the task execution device can complete the encoding task processing locally without relying on external computing devices, reducing latency and instability caused by network transmission, thereby improving the real-time performance and reliability of encoding task execution.

[0175] In some embodiments of this application, the processing module is further configured to start the second execution environment before the second intelligent agent executes the encoding task based on the instruction information, provided that the second execution environment has not been started.

[0176] The processing module is further configured to start the second intelligent agent in the second execution environment if the second intelligent agent is not started.

[0177] In some embodiments of this application, the processing module is further configured to mount a shared directory in the first execution environment to the second execution environment; wherein the shared directory includes project files corresponding to the coding task.

[0178] In some embodiments of this application, the processing module is specifically used for:

[0179] The second intelligent agent accesses the project file corresponding to the coding task from the shared directory.

[0180] The second intelligent agent processes the project file according to the instruction information to generate the execution result of the coding task;

[0181] The shared directory is mounted on the second execution environment, and the shared directory includes the project files corresponding to the coding task.

[0182] In some embodiments of this application, the processing module is further configured to perform keyword recognition on the instruction information input by the user through the first intelligent agent after receiving the instruction information input by the user through the first intelligent agent;

[0183] The processing module is further configured to, when it is recognized that the instruction information contains a first keyword, input the instruction information into an intent judgment model, and use the intent judgment model to identify whether the instruction information indicates an encoding task.

[0184] In some embodiments of this application, the processing module is further configured to establish a cross-environment communication connection between the first execution environment and the second execution environment before sending the instruction information to the second intelligent agent;

[0185] The processing module is specifically used to send the instruction information received by the first intelligent agent to the second intelligent agent through the cross-environment communication connection.

[0186] In some embodiments of this application, the processing module is specifically used to receive the execution result returned by the second intelligent agent through the cross-environment communication connection, wherein the execution result includes at least one of streaming text, task status, or file modification information;

[0187] The processing module is specifically used to display the execution results on the task interface.

[0188] In some embodiments of this application, the second execution environment uses the GNU C library, and the second intelligent agent is a Linux-coded intelligent agent capable of running in the second execution environment.

[0189] The task execution device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the device.

[0190] The task execution device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system.

[0191] The task execution apparatus provided in this application embodiment can implement the various processes implemented in the method embodiment of the task execution method, and will not be described again here to avoid repetition.

[0192] Optionally, such as Figure 4 As shown, this application embodiment also provides an electronic device 700, including a processor 701 and a memory 702. The memory 702 stores a program or instructions that can run on the processor 701. When the program or instructions are executed by the processor 701, they implement the various steps of the above-described task execution method embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.

[0193] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.

[0194] Figure 5 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application.

[0195] The electronic device 100 includes, but is not limited to, components such as: radio frequency unit 101, network module 102, audio output unit 103, input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, and processor 110.

[0196] Those skilled in the art will understand that the electronic device 100 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 110 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 5 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.

[0197] The user input unit 107 is used to receive instruction information input by the user through the first intelligent agent; the processor 110 is used to send the instruction information received by the user input unit 107 to the second intelligent agent when the instruction information indicates an encoding task, and to execute the encoding task by the second intelligent agent based on the instruction information; the processor 110 is also used to output the execution result of the encoding task.

[0198] The electronic device provided in this application embodiment receives user-input instruction information through a first intelligent agent running in a first execution environment; when the instruction information indicates an encoding task, the electronic device sends the instruction information to a second intelligent agent in a second execution environment, and the second intelligent agent executes the encoding task based on the instruction information; and outputs the execution result of the encoding task. With this solution, the electronic device can complete the encoding task processing locally without relying on external computing devices, reducing latency and instability caused by network transmission, thereby improving the real-time performance and reliability of the encoding task execution.

[0199] In some embodiments of this application, the processor 110 is further configured to start the second execution environment before the second intelligent agent executes the encoding task based on the instruction information, in the absence of the second execution environment being started;

[0200] The processor 110 is further configured to start the second intelligent agent in the second execution environment if the second intelligent agent is not started.

[0201] In some embodiments of this application, the processor 110 is further configured to mount a shared directory in the first execution environment to the second execution environment; wherein the shared directory includes project files corresponding to the coding task.

[0202] In some embodiments of this application, the processor 110 is specifically used for:

[0203] The second intelligent agent accesses the project file corresponding to the coding task from the shared directory.

[0204] The second intelligent agent processes the project file according to the instruction information to generate the execution result of the coding task;

[0205] The shared directory is mounted on the second execution environment, and the shared directory includes the project files corresponding to the coding task.

[0206] In some embodiments of this application, the processor 110 is further configured to perform keyword recognition on the instruction information input by the user through the first intelligent agent after receiving the instruction information input by the user through the first intelligent agent;

[0207] The processor 110 is further configured to, when it is recognized that the instruction information contains a first keyword, input the instruction information into an intent judgment model, and use the intent judgment model to identify whether the instruction information indicates an encoding task.

[0208] In some embodiments of this application, the processor 110 is further configured to establish a cross-environment communication connection between the first execution environment and the second execution environment before sending the instruction information to the second intelligent agent;

[0209] The processor 110 is specifically used to send the instruction information received by the first intelligent agent to the second intelligent agent through the cross-environment communication connection.

[0210] In some embodiments of this application, the processor 110 is specifically configured to receive the execution result returned by the second intelligent agent through the cross-environment communication connection, the execution result including at least one of streaming text, task status, or file modification information;

[0211] The processor 110 is specifically used to display the execution results on the task interface.

[0212] In some embodiments of this application, the second execution environment uses the GNU C library, and the second intelligent agent is a Linux-coded intelligent agent capable of running in the second execution environment.

[0213] It should be understood that, in this embodiment, the input unit 104 may include a graphics processing unit (GPU) 1041 and a microphone 1042. The GPU 1041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 107 includes at least one of a touch panel 1071 and other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.

[0214] The memory 109 can be used to store software programs and various data. The memory 109 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 109 may include volatile memory or non-volatile memory, or it may include both volatile and non-volatile memory. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 109 in the embodiments of this application includes, but is not limited to, these and any other suitable types of memory.

[0215] Processor 110 may include one or more processing units; optionally, processor 110 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 110.

[0216] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described task execution method embodiments and achieve the same technical effects. To avoid repetition, they will not be described again here.

[0217] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0218] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described task execution method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0219] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0220] This application provides a computer program product that is stored in a storage medium and executed by at least one processor to implement the various processes of the task execution method embodiments described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0221] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0222] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0223] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. A task execution method, characterized in that, Applied to an electronic device, the electronic device including a first execution environment and a second execution environment, wherein a first intelligent agent runs in the first execution environment and a second intelligent agent runs in the second execution environment, the method includes: The first intelligent agent receives the instruction information input by the user; When the instruction information indicates an encoding task, the instruction information is sent to the second intelligent agent, and the second intelligent agent executes the encoding task based on the instruction information; Output the execution result of the encoding task.

2. The method according to claim 1, characterized in that, Before the second intelligent agent executes the encoding task based on the instruction information, the method further includes: Mount the shared directory in the first execution environment to the second execution environment; The shared directory includes project files corresponding to the coding tasks.

3. The method according to claim 2, characterized in that, The step of executing the encoding task by the second intelligent agent based on the instruction information includes: The second intelligent agent accesses the project file corresponding to the coding task from the shared directory. The second intelligent agent processes the project file according to the instruction information to generate the execution result of the coding task.

4. The method according to claim 1, characterized in that, Before sending the instruction information to the second intelligent agent, the method further includes: Establish a cross-environment communication connection between the first execution environment and the second execution environment; Sending the instruction information to the second intelligent agent includes: The instruction information received by the first intelligent agent is sent to the second intelligent agent through the cross-environment communication connection.

5. The method according to claim 4, characterized in that, The output of the encoding task includes: Through the cross-environment communication connection, the execution result returned by the second agent is received, and the execution result includes at least one of streaming text, task status, or file modification information; The execution results are displayed on the task interface.

6. A task execution device, characterized in that, The task execution device includes a first execution environment and a second execution environment. A first intelligent agent runs in the first execution environment, and a second intelligent agent runs in the second execution environment. The device includes: A receiving module is used to receive instruction information input by the user through the first intelligent agent; The processing module is configured to send the instruction information received by the receiving module to the second intelligent agent when the instruction information indicates an encoding task, and to have the second intelligent agent execute the encoding task based on the instruction information; The processing module is also used to output the execution result of the encoding task.

7. The apparatus according to claim 6, characterized in that, The processing module is further configured to mount a shared directory in the first execution environment to the second execution environment before executing the encoding task based on the instruction information by the second intelligent agent, wherein the shared directory includes project files corresponding to the encoding task.

8. The apparatus according to claim 7, characterized in that, The processing module is specifically used for: The second intelligent agent accesses the project file corresponding to the coding task from the shared directory. The second intelligent agent processes the project file according to the instruction information to generate the execution result of the coding task; The shared directory is mounted on the second execution environment, and the shared directory includes the project files corresponding to the coding task.

9. The apparatus according to claim 6, characterized in that, The processing module is further configured to establish a cross-environment communication connection between the first execution environment and the second execution environment before sending the instruction information to the second intelligent agent; The processing module is specifically used to send the instruction information received by the first intelligent agent to the second intelligent agent through the cross-environment communication connection.

10. The apparatus according to claim 9, characterized in that, The processing module is specifically used to receive the execution result returned by the second intelligent agent through the cross-environment communication connection. The execution result includes at least one of streaming text, task status, or file modification information. The processing module is specifically used to display the execution results on the task interface.

11. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the steps of the task execution method as described in any one of claims 1 to 5.