Task processing methods and electronic devices

By binding tasks and user input information in the MCP architecture, generating information identifiers and trimming the tool list, the problems of time-consuming and misselected tool selection in large language models are solved, task execution efficiency and user experience are optimized, and more efficient resource utilization and personalized interaction are achieved.

CN123114689APending Publication Date: 2026-11-17BEIKE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Under the MCP architecture, as the number of tools increases and business processes become more complex, the time spent on tool selection in the large language model increases significantly, which can easily lead to misselection or omission, resulting in a decrease in task execution success rate and waste of resources. Furthermore, the lack of unified management of task status and user preference memory affects user experience.

Method used

By binding tasks with user input information, generating information identifiers, and tailoring the tool list according to the current processing status, unnecessary tool selections are reduced. By combining serialization parameters and information identifier management, the tool selection process is optimized, and task status and user preferences are updated in real time.

Benefits of technology

It reduced the error rate and time spent in tool selection, improved user experience and satisfaction, optimized system performance and resource utilization, and enabled more personalized user interaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123114689A_ABST
    Figure CN123114689A_ABST
Patent Text Reader

Abstract

This disclosure provides a task processing method and an electronic device. The task processing method includes: receiving t-th user input information of a task sent by a terminal, wherein the task includes at least one subtask, the t-th user input information corresponds to the t-th subtask, and t is an integer greater than or equal to 1; obtaining a tool list from a processor server based on the t-th user input information; the processor server is used to process the task; querying the current task information from the task server; the task server is used to store the task information; deleting at least one tool from the tool list based on the current task information to obtain an updated tool list; sending the updated tool list to the processor server; receiving the t-th sub-processing result sent by the processor server; the t-th sub-processing result is the result of the processor server processing the t-th subtask based on the tool corresponding to the updated tool list; and sending the t-th sub-processing result to the terminal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to a task processing method, electronic device, and program product. Background Technology

[0002] Currently, in the field of artificial intelligence technology, with the rapid improvement of Large Language Model (LLM) capabilities, an increasing number of complex business automation and natural language-driven task execution systems are being implemented based on the Model Context Protocol (MCP) architecture. Under the MCP architecture, the agent interacts with the server by calling external tools to translate user natural language commands into specific business operations, completing long tasks such as document generation, data processing, and report creation.

[0003] In related technologies, when conducting multi-turn dialogues and task processing, systems typically provide a full list of tools to a large language model for selection. However, as the number of tools increases and business processes become more complex, the time required for the large language model to make the correct selection from a large number of tools increases significantly, and problems such as incorrect or missed tool selections are prone to occur, directly affecting the success rate of task execution and user experience. Furthermore, adding irrelevant tools to the model's inference context also wastes a large amount of token resources, thereby increasing system operating costs and latency. Summary of the Invention

[0004] This disclosure provides a task processing method and an electronic device.

[0005] According to one aspect of this disclosure, a task processing method is provided, applied to a server, comprising: The system receives the t-th user input information of a task sent by a terminal, the task including at least one subtask, the t-th user input information corresponding to the t-th subtask, and t being an integer greater than or equal to 1; obtains a tool list from a processor server based on the t-th user input information; the processor server is used to process the task; queries the current task information of the task server; the task server is used to store task information; deletes at least one tool from the tool list based on the current task information to obtain an updated tool list; sends the updated tool list to the processor server; receives the t-th sub-processing result sent by the processor server, the t-th sub-processing result being the result of the processor server processing the t-th subtask based on the tool corresponding to the updated tool list; and sends the t-th sub-processing result to the terminal.

[0006] According to one technical solution, by binding tasks with user input information and obtaining the current processing status of the task for each user input, at least one tool that is not needed to handle the remaining tasks is removed from the tool list based on the current processing status. This reduces the number of tools that need to be selected to handle the remaining tasks, thereby reducing the error rate and time consumption of tool selection, and thus greatly improving user experience and satisfaction.

[0007] According to at least one embodiment of this disclosure, the method further includes: Generate an information identifier for the t-th user input information; send the information identifier to the terminal.

[0008] According to at least one embodiment of this disclosure, the method further includes: obtaining initial parameters for each tool; serializing the initial parameters for each tool to obtain serialized parameters for each tool; generating a parameter identifier corresponding to the serialized parameters for each tool; and storing the serialized parameters and parameter identifier for each tool to a message server.

[0009] According to at least one embodiment of this disclosure, obtaining a tool list from a processor server based on the t-th user input information includes: generating an acquisition instruction based on the t-th user input information; sending the acquisition instruction to the processor server; and receiving the tool list sent by the processor server.

[0010] According to at least one embodiment of this disclosure, querying the current task information of a task server includes: sending a first query instruction to the task server; receiving current task information sent by the task server, wherein the current task information is obtained by the task server querying the task information based on the first query instruction, and the current task information represents the current processing status of the task.

[0011] According to at least one embodiment of this disclosure, deleting at least one piece of tool information from the tool list based on the current task information to obtain an updated tool list includes: Based on the current task information, at least one completed subtask is obtained; the tool information corresponding to each completed subtask is obtained; the tool information corresponding to each completed subtask is deleted from the tool list to obtain the updated tool list.

[0012] According to at least one embodiment of this disclosure, sending the t-th sub-processing result to the terminal includes: obtaining at least one message fragment based on the t-th sub-processing result; writing the at least one message fragment to the message server; receiving a read instruction sent by the terminal, the read instruction including an information identifier and an index of the t-th user input information, the index indicating the starting position for the message server to read the message fragment; generating a second query instruction based on the read instruction; sending the second query instruction to the message server; receiving a query result sent by the message server, the query result including at least one message fragment, the message fragment including at least one of text, components, and operation instructions; and sending the query result to the terminal.

[0013] According to at least one embodiment of this disclosure, obtaining at least one message fragment based on the t-th sub-processing result includes: generating an update instruction based on the t-th sub-processing result; sending the update instruction to the task server; receiving an update result sent by the task server; and obtaining at least one message fragment based on the update result.

[0014] According to at least one embodiment of this disclosure, writing at least one message fragment to a message server includes: generating a write instruction based on at least one message fragment; sending at least one message fragment and the write instruction to the message server; and receiving a write result sent by the message server, wherein the write result indicates that the message server has completed writing at least one message fragment.

[0015] According to at least one embodiment of this disclosure, the method further includes: receiving a request from the terminal to obtain user historical input information; sending a third query instruction to the task server based on the request; receiving the current task information sent by the task server; obtaining the kth information identifier of the task in chronological order based on the current task information, wherein the task is associated with k information identifiers, and k is an integer greater than or equal to 1; and sending the kth information identifier to the terminal.

[0016] According to another aspect of this disclosure, a task processing method is provided, applied to a client, comprising: responding to a user's input operation on a display interface, sending the t-th user input information of a task to a server, the task including at least one subtask, the t-th user input information corresponding to the t-th subtask, where t is an integer greater than or equal to 1; and receiving the t-th sub-processing result sent by the server, the t-th sub-processing result being the result of processing the t-th subtask.

[0017] According to at least one embodiment of this disclosure, the method further includes: receiving an information identifier of the t-th user input information sent by the server; sending the information identifier of the t-th user input information and an index to the server, the index indicating the starting position for a message server to read the message fragment, the message server storing the message fragment; receiving a query result sent by the server; the query result including at least one message fragment, the message fragment including at least one of text, components, and operation instructions; updating a page on a display interface based on the query result, the page including a result subpage, a dialogue subpage, and an interactive subpage, the result subpage displaying the first t sub-processing results, the dialogue subpage displaying the first t user input information, and the interactive subpage providing the user with at least one option to change the content of the result subpage.

[0018] According to at least one embodiment of this disclosure, the method further includes: In response to a user's re-entry into the display interface corresponding to the task, a request to obtain the user's historical input information is sent to the server; the k-th information identifier of the task is received from the server, wherein the task is associated with k information identifiers, and k is an integer greater than or equal to 1; the page corresponding to the k-th information identifier is displayed on the display interface.

[0019] According to another aspect of this disclosure, an electronic device is provided, comprising: a memory storing execution instructions; and a processor executing the execution instructions stored in the memory, causing the processor to perform a task processing method according to any embodiment of this disclosure.

[0020] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements a task processing method according to any embodiment of this disclosure. Attached Figure Description

[0021] The accompanying drawings illustrate exemplary embodiments of the present disclosure and, together with the description thereof, serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.

[0022] Figure 1 This is a schematic diagram illustrating an application scenario of a task processing method according to one embodiment of the present disclosure.

[0023] Figure 2 This is a schematic diagram of the overall interactive flow of a task processing method according to one embodiment of the present disclosure.

[0024] Figure 3This is a flowchart illustrating a method for obtaining information identifiers according to one embodiment of this disclosure.

[0025] Figure 4 This is a flowchart illustrating a method for setting initial parameters for a processing tool according to one embodiment of the present disclosure.

[0026] Figure 5 This is a flowchart illustrating step S130 of one embodiment of the present disclosure.

[0027] Figure 6 This is a flowchart illustrating step S140 of one embodiment of the present disclosure.

[0028] Figure 7 This is a flowchart illustrating step S150 of one embodiment of the present disclosure.

[0029] Figure 8 This is a flowchart illustrating step S190 of one embodiment of the present disclosure.

[0030] Figure 9 This is a flowchart illustrating step S191 of one embodiment of the present disclosure.

[0031] Figure 10 This is a flowchart illustrating step S192 of one embodiment of the present disclosure.

[0032] Figure 11 This is a schematic diagram of the interaction process after a user re-enters the display interface according to one embodiment of this disclosure.

[0033] Figure 12 This is a schematic flowchart illustrating the display of the t-th sub-processing result on the terminal side according to one embodiment of this disclosure.

[0034] Figure 13 This is a schematic diagram of the structure of a page according to one embodiment of this disclosure.

[0035] Figure 14 This is a schematic structural block diagram of a task processing apparatus applied to a server according to one embodiment of the present disclosure.

[0036] Figure 15 This is a schematic structural block diagram of a task processing device applied to a terminal according to one embodiment of the present disclosure.

[0037] Figure 16 This is a schematic structural block diagram of an electronic device according to one embodiment of the present disclosure. Detailed Implementation

[0038] The present disclosure will now be described in further detail with reference to the accompanying drawings and examples. It should be understood that the specific examples described herein are for illustrative purposes only and are not intended to limit the scope of the disclosure. Furthermore, it should be noted that, for ease of description, only the parts relevant to the present disclosure are shown in the accompanying drawings.

[0039] It should be noted that, where there is no conflict, the embodiments and features described in this disclosure can be combined with each other. The technical solutions of this disclosure will now be described in detail with reference to the accompanying drawings and embodiments.

[0040] Among related technologies, task agent systems based on the MCP architecture have at least the following technical problems.

[0041] Firstly, during task execution, some tools, such as file generation and data report rendering, require the transmission of large parameter objects containing long texts or complex structures. Related technologies typically transmit the complete parameter content directly between interfaces or repeatedly serialize and deserialize it, resulting in high network transmission overhead and slow interface response speeds, severely restricting system performance in real-time interactive scenarios.

[0042] Secondly, when dealing with multi-step, long-cycle tasks, there is a lack of a unified management and dynamic perception mechanism for the current status of the task. The available tool set or operation interface cannot be dynamically adjusted according to the task execution progress, resulting in insufficient process control capabilities. This can easily lead to users performing inappropriate operations during task execution, increasing the risk of system anomalies and business logic confusion.

[0043] Thirdly, the management of user preference memory and dialogue history is rather chaotic, lacking a sophisticated long-term and short-term memory coordination mechanism, making it difficult to continuously understand user intentions, style preferences and historical decisions in multi-round dialogues, resulting in a lack of personalization and continuity in model responses.

[0044] To address this, this disclosure proposes the following technical solution, in which user dialogue is bound to tasks. When a user engages in dialogue with the system, a unique identifier corresponding to the user's input is generated, and the current processing status of the task is queried based on this input. Tools that have already been used or are clearly not going to be used again are eliminated based on the current processing status, thereby reducing the probability of errors in the large language model when selecting the necessary tools for task processing and shortening the response time.

[0045] To facilitate description and make the technical solutions of this disclosure easier to understand, the terminology of this disclosure will be explained before describing the technical solutions of this disclosure.

[0046] 1. Encryption Algorithm: A hash algorithm is used to perform one-way hash calculation on the serialized parameters, or a globally unique identifier generation algorithm is used to generate a fixed-length parameter identifier.

[0047] 2. Server-Sent Events (SSE) Connection: A lightweight real-time communication technology based on the HTTP protocol. Using SSE long-lived connections, the terminal listens for events related to message fragments being pushed by the server.

[0048] 3. MCP Architecture: This mainly consists of a host, a server, and a terminal. The host receives user input and displays the processing results. The terminal interacts with the server. The server manages and registers tools that can be called by the large language model. Tools are executable modules with specific functions, such as preparation, generation, and stop generation functions.

[0049] Figure 1 This is a schematic diagram illustrating an application scenario of a task processing method according to one embodiment of this disclosure. For example... Figure 1 The application scenarios shown can include terminals and servers.

[0050] The terminal can be an electronic device such as a mobile phone or tablet computer.

[0051] The server can be a local server or a cloud server.

[0052] The terminal connects to the server via a wired or wireless network.

[0053] Figure 2 This is a schematic diagram of the overall interaction flow of a task processing method according to one embodiment of this disclosure. For example... Figure 2 As shown, the method includes steps S110 to S190.

[0054] In step S110, the user enters the t-th user input information on the display interface.

[0055] In step S120, the terminal sends the t-th user input information of the task to the server.

[0056] The user input describes the user's needs. A task can be processed in multiple rounds based on the user's input, with each round processing a subtask. A task includes at least one subtask, and the t-th user input corresponds to the t-th subtask. Processing a subtask yields a sub-processing result. t is an integer greater than or equal to 1.

[0057] The user enters information on the display interface, and the terminal responds accordingly. For example, if the user enters "Generate a presentation," the terminal replies, "Okay, I will create a presentation for you."

[0058] In step S130, the server obtains the list of tools on the processor server based on the t-th user input information.

[0059] The processor server is used to process tasks.

[0060] In step S140, the server queries the current task information of the task server.

[0061] The task server is used to store task information.

[0062] In some examples, when the server receives a user input message, it doesn't immediately create a new task. Instead, it checks if a task corresponding to that user input message already exists. If the task already exists, it queries the task's current information to obtain its current processing status. If the task doesn't exist, it creates a new task, generates a unique task identifier for that task, and associates the user input message with the newly created task's task identifier.

[0063] In step S150, the server deletes at least one tool from the tool list based on the current task information to obtain an updated tool list.

[0064] The tool list stores at least one piece of tool information, with each piece of information corresponding to a specific tool. The server invokes the large language model of the external agent to delete at least one piece of tool information from the tool list, resulting in an updated tool list. After pruning the tool list, the large language model outputs the result. The server retrieves the retained tool information from the output and, based on this retained information, obtains the updated tool list.

[0065] In some examples, some tools have already been used during task processing and will not be used again when processing the remaining tasks. Therefore, to reduce errors and time wasted in selecting appropriate tools later, at least one tool is removed from the tool list before processing the remaining tasks. This reduces the selection of unnecessary tools during subsequent tool selection, thereby lowering the probability of incorrect tool selection and reducing the time spent on tool selection, significantly improving user experience and satisfaction.

[0066] In step S160, the server sends the updated tool list to the processor server.

[0067] In step S170, the server receives the t-th sub-processing result sent by the processor server.

[0068] The t-th sub-processing result is the result of the processor server processing the t-th sub-task based on the corresponding tool in the updated tool list.

[0069] Since step S150 only performs an initial screening of all tools in the tool list, the updated tool list may still contain some tools that are not needed for processing the remaining tasks. Therefore, before executing the remaining tasks, the processor server will, based on actual needs, call the large language model of the external agent to further screen the tool information in the updated tool list to select the most suitable tool.

[0070] In step S180, the server sends the t-th sub-processing result to the terminal.

[0071] The server also sends the t-th sub-processing result to the large language model.

[0072] In step S190, the terminal displays the t-th sub-processing result on the display interface.

[0073] This disclosure provides a task processing method that associates tasks with user input information and obtains the current processing status of the task for each user input. Based on the current processing status, at least one tool that is not needed for processing the remaining tasks is removed from the tool list, thereby reducing the number of tools that need to be selected to process the remaining tasks, thus reducing the error rate and time consumption of tool selection. Furthermore, it maintains the user's long-term memory and the short-term memory of the dialogue, and can inject the short-term memory of the dialogue and the user's profile during the dialogue, thereby helping the large language model output results that are more consistent with the user's personality, and thus greatly improving the user experience and satisfaction.

[0074] Figure 3 This is a flowchart illustrating a method for obtaining information identifiers according to one embodiment of this disclosure. Figure 3 As shown, the method includes steps S310 to S320.

[0075] In step S310, the information identifier of the t-th user input information is generated.

[0076] The information identifier is an information serial number. The information serial number includes, but is not limited to, letters and numbers.

[0077] In step S320, the information identifier is sent to the terminal.

[0078] When a terminal inputs information via the intelligent agent controller's dialogue interface, the server immediately generates a corresponding information identifier and returns it to the terminal. Simultaneously, the server submits the processing of the input information to a thread pool for asynchronous processing. This processing includes, but is not limited to, task processing based on the input information and updating the task status.

[0079] The above technical solution asynchronously separates user requests from responses based on those requests and generates a unique identifier for the user input. This identifier is returned to the terminal, allowing it to retrieve the sub-processing results of the corresponding task. Furthermore, in scenarios involving multiple rounds of user dialogue, the server can use the identifier to distinguish between user input from different rounds or at different times, and the corresponding sub-processing results, thus preventing data corruption.

[0080] Figure 4 This is a flowchart illustrating a method for setting initial parameters for a processing tool according to one embodiment of this disclosure. Figure 4 As shown, the method includes steps S410 to S440.

[0081] In step S410, the initial parameters of each tool are obtained.

[0082] The tool information includes its name and parameter identifiers. Each tool has multiple initial parameters, such as template parameters and document parameters. In related technologies, directly transmitting the tool's initial parameters to the large language model leads to significant time consumption in tool selection. This is because each time a tool list deletion operation is performed, the server needs to interact with the large language model, requiring repeated transmission of the tool's initial parameters. Since some tools have extremely complex initial parameters, directly transmitting the name and initial parameters to the large language model results in XML format, i.e., updating the tool list in XML format, also requires outputting a large number of tokens. The time consumption of the deletion operation is determined by the amount of tokens output by the large language model; that is, the larger the amount of tokens output by the large language model, the longer the tool selection time, and vice versa.

[0083] In step S420, the initial parameters of each tool are serialized to obtain the serialization parameters of each tool.

[0084] To reduce the output latency of the large language model and thus reduce the time consumption of the deletion operation, this disclosure packages all the initial parameters of each tool into an object before calling the large language model of the external agent, and serializes the object to obtain serialized parameters.

[0085] In step S430, parameter identifiers corresponding to the serialization parameters of each tool are generated.

[0086] The parameter identifier is a parameter sequence number. The parameter sequence number includes, but is not limited to, letters and numbers.

[0087] A unique parameter identifier is obtained for each serialized parameter through an encryption algorithm. This parameter identifier is used to identify the serialized parameter corresponding to the tool. This abstracts complex initial parameters into a simple parameter identifier. Therefore, when deleting items from the tool list, the server no longer needs to transmit a large number of initial parameters to the large language model; it only needs to transmit the parameter identifiers corresponding to the initial parameters. Thus, when the large language model outputs results in XML format, it only needs to consume the names of the remaining tools and the corresponding tokens for the parameter identifiers. This significantly reduces the number of tokens required for the large language model's output and lowers latency.

[0088] In step S440, the serialization parameters and parameter identifiers of each tool are stored in the message server.

[0089] The above technical solution abstracts the initial parameters of the tools into simple parameter identifiers. When deleting a tool from the list, the server transmits the tool's name and parameter identifier to the large language model, thereby reducing the number of lexical units required for the output of the large language model and lowering latency.

[0090] Figure 5 This is a flowchart illustrating step S130 of one embodiment of this disclosure. Figure 5 As shown, the method includes steps S131 to S133.

[0091] In step S131, an acquisition instruction is generated based on the t-th user input information.

[0092] In step S132, the acquisition instruction is sent to the processor server.

[0093] In step S133, the list of tools sent by the processor server is received.

[0094] The tools list includes the names and parameter identifiers of all the tools needed to complete a task.

[0095] In the above technical solution, the processor server sends all the tool information required to process a task to the server based on the acquisition instruction.

[0096] Figure 6 This is a flowchart illustrating step S140 of one embodiment of this disclosure. Figure 6 As shown, the method includes steps S141 to S142.

[0097] In step S141, a first query command is sent to the task server.

[0098] The first query instruction includes the information identifier of the t-th user input information.

[0099] In step S142, the current task information sent by the task server is received.

[0100] Among them, the current task information is obtained by the task server based on the first query command to query the task information, and the current task information represents the current processing status of the task.

[0101] Each user input corresponds to either the entire task or a part of a task. The specific correspondence is determined by the content of the user input. The current processing status is that a portion of the task has been completed, and the portion of the task corresponding to the t-th user input is pending processing.

[0102] The above technical solution stores task information on the task server, making it easy to query the current processing status of the task in real time.

[0103] Figure 7 This is a flowchart illustrating step S150 of one embodiment of this disclosure. Figure 7 As shown, the method includes steps S151 to S153.

[0104] In step S151, at least one completed subtask is obtained based on the current task information.

[0105] In step S152, the tool information corresponding to each completed subtask is obtained.

[0106] In step S153, the tool information corresponding to each completed subtask is deleted from the tool list to obtain an updated tool list.

[0107] Because different subtasks use different tools, tools for completed subtasks will not be used when processing unprocessed subtasks. Therefore, before processing tools for unprocessed subtasks, the tool information for tools that will not be used can be removed from the tool list to avoid selecting unnecessary tools. For example, when the task is to generate a presentation, the tool list includes, but is not limited to, preparation tool information, generation tool information, and stop generation tool information. When the preparation and generation subtasks have been completed, the preparation and generation tools will not be used during the processing of unprocessed subtasks. Therefore, removing the preparation and generation tool information from the tool list results in an updated tool list. The updated tool list includes, but is not limited to, stop generation tool information, but excludes preparation and generation tool information.

[0108] After receiving the updated tool list, the processor server invokes the large language model in the external agent to select tools from the updated tool list based on the large language model and outputs the selection result. The processor server retrieves at least one tool information from the selection result. For each tool information, the processor server calls the corresponding serialized parameters based on the parameter identifier in the tool information, and then deserializes the serialized parameters to obtain the initial parameters. Based on the initial parameters of each tool, the t-th subtask is processed to obtain the t-th sub-processing result. By simplifying the initial parameters to parameter identifiers, the latency caused by the large language model selecting tools from the updated tool list is reduced.

[0109] The above technical solution, based on the current task information, obtains the completed subtasks and removes the tool information corresponding to the completed subtasks from the tool list, resulting in an updated tool list. The number of tools in the updated tool list is less than the number of tools in the original tool list, thereby reducing the number of tools the large language model needs to select subsequently. This reduces the probability of the large language model selecting the wrong tool and the latency caused by the large language model's tool selection.

[0110] Figure 8 This is a flowchart illustrating step S190 of one embodiment of this disclosure. Figure 8 As shown, the method includes steps S191 to S197.

[0111] In step S191, at least one message fragment is obtained based on the t-th sub-processing result.

[0112] Message slices are generated during the processing of the t-th subtask and are part of the t-th sub-processing result. The t-th sub-processing result can be divided into multiple message slices according to preset rules. For example, it can be divided into multiple message slices based on data type or data length. When the t-th sub-processing result is output in a streaming format, each output may consist of one message slice, or the size of the output data may be smaller than the size of a message slice. In this case, the data output at this time is also encapsulated into a message slice.

[0113] In step S192, at least one message fragment is written to the message server.

[0114] Each message fragment in at least one message fragment is written to the message queue of the message server in chronological order. Each message fragment has a timestamp. Writing in chronological order means writing each message fragment to the message queue of the message server according to its timestamp, thus improving access performance.

[0115] In step S193, a read command is sent by the receiving terminal.

[0116] The read instruction includes the information identifier and index of the t-th user input information. The index indicates the starting position of the message server's read message fragment. After receiving the message fragment, the terminal updates the index and generates the next read instruction based on the updated index.

[0117] In step S194, a second query instruction is generated based on the read instruction.

[0118] The second query instruction includes the information identifier and index of the t-th user input information.

[0119] In step S195, the second query command is sent to the message server.

[0120] In step S196, the query result sent by the message server is received.

[0121] The query results include at least one message fragment, which comprises at least one of the following: text, components, and operation instructions. The text is the generated text content. Components include, but are not limited to, deleting and adding components. Operation instructions include, but are not limited to, downloading and modifying.

[0122] The message server reads message fragments starting from the indexed starting position based on the second query command.

[0123] In step S197, the query results are sent to the terminal.

[0124] The server uses a streaming method to send messages in segments to the terminal one by one, ensuring a real-time user interaction experience.

[0125] In the above technical solution, message fragments are written to the message queue of the message server according to the time sequence. Combined with information identifiers and indexes, message fragments are read in time sequence, thus not only ensuring the correctness of the time sequence of sub-processing results but also enabling breakpoint resumption. Streaming message fragmentation also avoids a large number of message blocks and duplicate transmissions, making it suitable for high-concurrency scenarios. Furthermore, the structure of text, components, and operation instructions is defined, enabling the server's output to completely control the page content of the terminal's display interface, simplifying the interaction between the terminal and the server and making long tasks easier to implement.

[0126] Figure 9 This is a flowchart illustrating step S191 of one embodiment of this disclosure. Figure 9 As shown, the method includes steps S1911 to S1914.

[0127] In step S1911, an update instruction is generated based on the t-th sub-processing result.

[0128] In step S1912, the update command is sent to the task server.

[0129] In step S1913, the update result sent by the task server is received.

[0130] In step S1914, at least one message fragment is obtained based on the update result.

[0131] In the above technical solution, after each subtask is completed, the task information in the task server is updated to update the current task information to the latest state.

[0132] Figure 10 This is a flowchart illustrating step S192 of one embodiment of this disclosure. Figure 10 As shown, the method includes steps S1921 to S1923.

[0133] In step S1921, a write instruction is generated based on at least one message fragment.

[0134] The write instructions include, but are not limited to, storage format and storage location.

[0135] In step S1922, at least one message fragment and a write command are sent to the message server.

[0136] In step S1923, the write result sent by the message server is received.

[0137] The write result indicates that the message server has completed the write of at least one message fragment.

[0138] The above technical solution, through the interactive confirmation mechanism between the server and the message server, ensures the reliability and integrity of writing message fragments to the message server, and avoids the terminal being unable to obtain complete processing results due to write failure.

[0139] In the above embodiments, in scenarios where a task is completed based on input from at least one user, the user inputs information in real time on the display interface to inform the system of their needs for the same task. The system processes a sub-task or task based on each user's input. The technical solution of this disclosure will be further explained below based on a scenario where the user exits the display interface corresponding to the task and then re-enters the display interface.

[0140] Figure 11 This is a schematic diagram of the interaction flow after a user re-enters the display interface according to one embodiment of this disclosure. Figure 11 As shown, the method includes steps S1110 to S1170.

[0141] In step S1110, the user re-enters the display interface corresponding to the task.

[0142] In step S1120, the terminal sends a request to the server to obtain the user's historical input information.

[0143] The user's historical input information is stored on the message server. Both the message server and the task server are implemented using a relational database (MySQL). Persistent storage of user historical input information, message fragments, and task information achieves session state persistence.

[0144] In step S1130, the server sends a third query instruction to the task server based on the request. This third query instruction includes a task identifier. The task server queries the current task information of the corresponding task based on the task identifier. The task information includes all information about the task from its creation to the current time.

[0145] In step S1140, the server receives the current task information sent by the task server.

[0146] In step S1150, the server obtains the kth information identifier of the task according to the time sequence based on the current task information.

[0147] The task is associated with k information identifiers, where k is an integer greater than or equal to 1.

[0148] The current task information includes at least one information identifier. When a user re-enters an existing task, the system queries the last generated information identifier for that task—that is, the last information identifier generated when the user exited the task. This last information identifier can be determined based on its timestamp. The last information identifier is associated with the task processing status at the time the user exited the task.

[0149] In step S1160, the server sends the kth information identifier to the terminal.

[0150] In step S1170, the terminal displays the page corresponding to the kth information identifier on the display interface.

[0151] The terminal restores the page corresponding to the k-th information identifier on the display interface. This page includes the content displayed when the user exits the task.

[0152] The above technical solution allows users to quickly locate and restore previous pages by using their historical input information when they re-enter an existing task without entering any new information. This achieves persistent storage of users' historical input information and historical pages, ensuring that they are not lost when users exit the task, thus improving user experience and satisfaction.

[0153] Figure 12This is a schematic flowchart illustrating the display of the t-th sub-processing result on the terminal side according to one embodiment of this disclosure. Figure 12 As shown, the method includes steps S1210 to S1240.

[0154] In step S1210, the information identifier of the t-th user input information sent by the server is received.

[0155] In step S1220, the information identifier and index of the t-th user input information are sent to the server.

[0156] The terminal establishes an SSE connection with the server based on the message interface, and incrementally retrieves new message fragments starting from the indexed position using a polling method, and pushes them to the user in real time.

[0157] In step S1230, the query result sent by the server is received.

[0158] In step S1240, the display interface is updated based on the query results.

[0159] The page includes a results subpage, a dialogue subpage, and an interaction subpage. The results subpage displays the first t sub-processing results, the dialogue subpage displays the first t user inputs, and the interaction subpage provides the user with at least one option to modify the content of the results subpage. Users can input information either through a conversation or by triggering options on the interaction subpage.

[0160] The above technical solution, because the task is processed in multiple stages, allows the terminal to update the displayed page in real time based on each received message segment, enabling real-time interaction with the user and ensuring a smooth user experience. Furthermore, the page displays dialogue content, interactive content, and results, allowing users to understand the task's progress in real time and make further inputs or interact with the terminal based on the interactive content as needed, thus improving the user experience.

[0161] Figure 13 This is a schematic diagram of the structure of a page according to one embodiment of this disclosure.

[0162] like Figure 13As shown, the page comprises three parts: a results subpage, a dialogue subpage, and an interaction subpage. The results subpage displays the content of a presentation. The dialogue subpage displays the user's dialogue and the large language model's responses based on that dialogue. The interaction subpage displays multiple options, including several template buttons. Users can switch between templates and then click the "Generate" button to complete their input. The server updates the presentation template on the results subpage based on the user's input, thus enabling template switching based on user input.

[0163] In other examples, the message interface has a timeout control mechanism. If the query result is not received from the server within the timeout period, the terminal will resend the information identifier and index of the last message to the server through the message interface.

[0164] When the processor server calls the large language model of the external agent to filter the updated tool list, if it receives an error message from the large language model, it will re-filter the updated tool list. When the processor server receives an error message about the sub-processing result, it will reprocess the corresponding sub-task or task.

[0165] Some tasks may encounter exceptions during processing, causing the system to freeze and fail to run normally. To solve this problem, this document provides a script to periodically clean up abnormal tasks.

[0166] The above technical solution improves the system's fault tolerance.

[0167] This disclosure also provides a task processing device 1400 for use in a server. Figure 14 This is a schematic structural block diagram of a task processing apparatus applied to a server according to one embodiment of the present disclosure. Figure 14 As shown, the device includes: The communication module 1410 is used to receive the t-th user input information of a task sent by the terminal. The task includes at least one subtask, and the t-th user input information corresponds to the t-th subtask, where t is an integer greater than or equal to 1; Communication module 1410 is used to obtain the list of tools on the processor server based on the t-th user input information, and the processor server is used to process tasks; The query module 1420 is used to query the current task information of the task server; the task server is used to store task information. The deletion module 1430 is used to delete at least one tool from the tool list based on the current task information, thereby obtaining an updated tool list; Communication module 1410 is used to send the updated tool list to the processor server; Communication module 1410 is used to receive the t-th sub-processing result sent by the processor server; the t-th sub-processing result is the result of the processor server processing the t-th sub-task based on the tools in the updated tool list; The communication module 1410 is used to send the t-th sub-processing result to the terminal.

[0168] The specific implementation process of the functions and roles of each module in the above-mentioned device is detailed in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here. The execution subject of the task processing method in the specific embodiments of this disclosure can be a server (including a local server or a cloud server).

[0169] This disclosure also provides a task processing device 1400 for a terminal. Figure 14 This is a schematic structural block diagram of a task processing device applied to a terminal according to one embodiment of the present disclosure. Figure 15 As shown, the device includes: The response module 1510 is used to respond to the user's input operation on the display interface and send the t-th user input information of the task to the server. The task includes at least one subtask, and the t-th user input information corresponds to the t-th subtask, where t is an integer greater than or equal to 1. The receiving module 1520 is used to receive the t-th sub-processing result sent by the server. The t-th sub-processing result is the result of processing the t-th sub-task.

[0170] The specific implementation process of the functions and roles of each module in the above-mentioned device is detailed in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here. The execution subject of the task processing method in the specific embodiments of this disclosure can be a terminal.

[0171] Therefore, based on any of the above embodiments, this disclosure also provides an electronic device that can execute the task processing method of any of the embodiments described above.

[0172] Figure 16 This is a schematic structural block diagram of an electronic device according to one embodiment of the present disclosure.

[0173] The hardware architecture of the electronic device 1000 can be implemented using a bus architecture. The bus architecture can include any number of interconnect buses and bridges, depending on the specific application of the hardware and overall design constraints. Bus 1100 connects various circuits, including one or more processors 1200, memory 1300, and / or hardware modules. Bus 1100 can also connect various other circuits 1400, such as peripheral devices, voltage regulators, power management circuits, external antennas, etc.

[0174] Bus 1100 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, this diagram uses only one connection line, but this does not imply that there is only one bus or one type of bus.

[0175] For ease of explanation, certain steps of the above method are described in relation to modules. It should be understood that the corresponding module performing one or more steps of the above method may be one or more hardware modules specifically configured to perform the corresponding step, or implemented by a processor configured to perform the corresponding step, or stored in a computer-readable medium for implementation by a processor, or implemented by some combination thereof.

[0176] This disclosure also provides a readable storage medium storing a computer program that, when executed by a processor, is used to implement the methods described above. A "readable storage medium" can be any means capable of containing, storing, communicating, propagating, or transmitting a program for use by or in conjunction with an instruction execution system, apparatus, or device. More specific examples of a readable storage medium include: an electrical connection with one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and portable read-only memory (CDROM), etc.

[0177] This disclosure also provides a computer program product, the methods of which can be implemented wholly or partially through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented wholly or partially as a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instructions are loaded and executed, all or part of the processes or functions of this disclosure are performed.

[0178] Computer programs or instructions can be stored in a readable storage medium or transferred from one readable storage medium to another. For example, the computer program or instructions can be transferred from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. The readable storage medium can be any available medium capable of access, or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium, such as a floppy disk, hard disk, or magnetic tape; an optical medium, such as a digital video optical disc; or a semiconductor medium, such as a solid-state drive. The computer-readable storage medium can be a volatile or non-volatile storage medium, or it can include both volatile and non-volatile types of storage media.

[0179] Those skilled in the art will understand that embodiments of this disclosure can be provided as methods, systems, or computer program products. Therefore, this disclosure can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this disclosure can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0180] This disclosure is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus, and computer program products according to this disclosure. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0181] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0182] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0183] Those skilled in the art should understand that the above embodiments are merely for illustrating the present disclosure and are not intended to limit the scope of the disclosure. Those skilled in the art can make other changes or modifications based on the above disclosure, and these changes or modifications still fall within the scope of the present disclosure.

Claims

1. A task processing method, characterized in that, Applied to servers, including: The receiving terminal sends the t-th user input information of a task, wherein the task includes at least one subtask, the t-th user input information corresponds to the t-th subtask, and t is an integer greater than or equal to 1; The processor server obtains a list of tools based on the t-th user input information; the processor server is used to process the task. Query the current task information of the task server; the task server is used to store task information. Based on the current task information, delete at least one tool from the tool list to obtain an updated tool list; Send the list of update tools to the processor server; Receive the t-th sub-processing result sent by the processor server, where the t-th sub-processing result is the result of the processor server processing the t-th sub-task based on the tool corresponding to the update tool list; The t-th sub-processing result is sent to the terminal.

2. The method as described in claim 1, characterized in that, The method further includes: Generate the information identifier for the t-th user input information; Send the information identifier to the terminal; Optionally, the method further includes: Obtain the initial parameters for each of the tools; The initial parameters of each tool are serialized to obtain the serialized parameters of each tool; Generate parameter identifiers corresponding to the serialization parameters of each tool; The serialization parameters and parameter identifiers of each tool are stored in the message server.

3. The method as described in claim 1, characterized in that, The list of tools for obtaining the processor server based on the t-th user input information includes: Generate an acquisition instruction based on the t-th user input information; The acquisition command is sent to the processor server; Receive the tool list sent by the processor server.

4. The method as described in claim 1, characterized in that, Query the current task information on the task server, including: Send a first query command to the task server; The task server receives current task information sent by the task server. The current task information is obtained by the task server querying the task information based on the first query instruction. The current task information represents the current processing status of the task.

5. The method as described in claim 1, characterized in that, Based on the current task information, at least one tool item is deleted from the tool list to obtain an updated tool list, including: Based on the current task information, at least one completed subtask is obtained; Obtain the tool information corresponding to each completed subtask; The tool information corresponding to each completed subtask is removed from the tool list to obtain the updated tool list.

6. The method as described in claim 2, characterized in that, Sending the t-th sub-processing result to the terminal includes: At least one message fragment is obtained based on the t-th sub-processing result; Write at least one of the message fragments to the message server; The terminal sends a read instruction, which includes the information identifier and index of the t-th user input information, and the index indicates the starting position of the message server reading the message fragment. A second query instruction is generated based on the read instruction; Send the second query command to the message server; Receive query results sent by the message server, the query results including at least one message fragment, the message fragment including at least one of text, components and operation instructions; The query results are sent to the terminal; Optionally, obtaining at least one message fragment based on the t-th sub-processing result includes: An update instruction is generated based on the t-th sub-processing result; Send the update command to the task server; Receive the update result sent by the task server; At least one message fragment is obtained based on the update result; Optionally, writing at least one of the message fragments to the message server includes: A write instruction is generated based on at least one of the aforementioned message fragments; Send at least one of the message fragments and the write command to the message server; The message server receives a write result, which indicates that the message server has completed writing at least one message fragment.

7. The method as described in claim 1, characterized in that, The method further includes: Receive a request from the terminal to obtain the user's historical input information; Based on the request, a third query instruction is sent to the task server; Receive the current task information sent by the task server; Based on the current task information, the kth information identifier of the task is obtained in chronological order, and the task is associated with k information identifiers, where k is an integer greater than or equal to 1; The kth information identifier is sent to the terminal.

8. A task processing method, characterized in that, Applied to the client side, including: In response to a user's input operation on the display interface, the t-th user input information of the task is sent to the server. The task includes at least one subtask, and the t-th user input information corresponds to the t-th subtask, where t is an integer greater than or equal to 1. Receive the t-th sub-processing result sent by the server, where the t-th sub-processing result is the result of processing the t-th sub-task.

9. The method as described in claim 8, characterized in that, The method further includes: Receive the information identifier of the t-th user input information sent by the server; The information identifier and index of the t-th user input information are sent to the server. The index indicates the starting position of the message server reading the message fragment. The message server is used to store the message fragment. Receive the query result sent by the server; the query result includes at least one message fragment, and the message fragment includes at least one of the following: text, component, and operation instruction; The display interface updates the page based on the query results. The page includes a result subpage, a dialogue subpage, and an interaction subpage. The result subpage is used to display the first t sub-processing results. The dialogue subpage is used to display the first t user input information. The interaction subpage is used to provide the user with at least one option, which is used to change the content of the result subpage. Optionally, the method further includes: In response to a user's re-entry into the display interface corresponding to the task, a request to obtain the user's historical input information is sent to the server. Receive the kth information identifier of the task sent by the server, wherein the task is associated with k information identifiers, where k is an integer greater than or equal to 1; The page corresponding to the kth information identifier is displayed on the display interface.

10. An electronic device, characterized in that, include: The memory stores execution instructions; as well as A processor that executes execution instructions stored in the memory, causing the processor to perform the task processing method according to any one of claims 1 to 9.