Task execution method, device and system based on model context protocol
By selecting tool information that matches the target object in the model context protocol service, the problems of high computing resource consumption and low task accuracy in the existing technology are solved, and more efficient and accurate task execution is achieved.
Patent Information
- Application Number
- CN202510863958.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2025-09-16
AI Technical Summary
The existing task execution method based on MCP architecture consumes high computing resources, has long execution time and economic cost, and has low task execution accuracy, making it difficult to meet user needs.
By determining the associated tool-related information in the model context protocol service based on the object properties of the target object, the matching tool information is sent to the model end, reducing the tagging resource usage of large models and improving the accuracy and reliability of task execution.
It reduces the computing resource consumption of information related to large model processing tools, improves the accuracy and reliability of task execution, and reduces computing overhead and time costs.
Smart Images

Figure CN120653465A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to technical fields such as cloud services, large models, and model context protocol services. Background Art
[0002] MCP (Model Context Protocol) is a standardized protocol that can be used for artificial intelligence models to communicate with external data sources and tools to ensure that artificial intelligence models can securely access relevant tools and data resources. Summary of the Invention
[0003] The present disclosure provides a task execution method, device, system, electronic device and storage medium based on a model context protocol.
[0004] According to one aspect of the present disclosure, a task execution method based on a model context protocol is provided, comprising: in response to receiving a task request related to a target object, determining tool-related information associated with object properties of the target object in a model context protocol service; sending tool-related information to a model end where a large model is deployed, and receiving target-related information determined from the tool-related information based on the large model; based on the target-related information, calling a target tool for the model context protocol service to execute a target task related to the task request, and obtaining a task execution result.
[0005] According to another aspect of the present disclosure, a task execution method based on a model context protocol is provided, comprising: in response to receiving specified tool attribute information sent by a host side, determining tool-related information associated with object attributes from preset tool-related information for a model context protocol service based on the specified tool attribute information, and a target object related to the host side having object attributes; and sending tool-related information to the host side; wherein the host side, in response to receiving a task request related to the target object, determines tool-related information associated with the object attributes of the target object in the model context protocol service; sends tool-related information to a model side that deploys a large model, and receives target-related information determined from the tool-related information based on the large model; based on the target-related information, calls the target tool for the model context protocol service to execute the target task related to the task request, and obtains a task execution result.
[0006] According to another aspect of the present disclosure, a task execution system based on a model context protocol is provided, including: a first service end, configured to: in response to receiving specified tool attribute information sent by a host end, determine tool-related information associated with object attributes from preset tool-related information for a model context protocol service based on the specified tool attribute information, and a target object related to the host end has object attributes; and send tool-related information to the host end; a host end, configured to: in response to receiving a task request related to the target object, determine tool-related information associated with the object attributes of the target object in the model context protocol service; send tool-related information to a model end that deploys a large model, and receive target-related information determined from the tool-related information based on the large model; based on the target-related information, call the target tool for the model context protocol service to execute the target task related to the task request, and obtain a task execution result.
[0007] According to another aspect of the present disclosure, a task execution device based on a model context protocol is provided, including: a first determination module, for determining tool-related information associated with object properties of a target object in a model context protocol service in response to receiving a task request related to a target object; a first sending module, for sending tool-related information to a model end where a large model is deployed, and receiving target-related information determined from the tool-related information based on the large model; a calling module, for calling a target tool for the model context protocol service, based on the target-related information, to execute a target task related to the task request, and obtain a task execution result.
[0008] According to another aspect of the present disclosure, a task execution device based on a model context protocol is provided, including: a second determination module for determining, in response to receiving specified tool attribute information sent by a host side, tool-related information associated with object attributes from preset tool-related information for a model context protocol service based on the specified tool attribute information, and a target object related to the host side has object attributes; and a second sending module for sending tool-related information to the host side; wherein, in response to receiving a task request related to the target object, the host side determines the tool-related information associated with the object attributes of the target object in the model context protocol service; sends the tool-related information to the model side that deploys the large model, and receives target-related information determined from the tool-related information based on the large model; based on the target-related information, calls the target tool for the model context protocol service to execute the target task related to the task request to obtain a task execution result.
[0009] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method provided according to an embodiment of the present disclosure.
[0010] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method provided according to an embodiment of the present disclosure.
[0011] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, which implements the method provided according to the embodiment of the present disclosure when executed by a processor.
[0012] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.
[0014] Figure 1 Schematically illustrates an exemplary system architecture to which a task execution method and apparatus based on a model context protocol can be applied according to an embodiment of the present disclosure;
[0015] Figure 2 Schematically shows a flow chart of a task execution method based on a model context protocol according to an embodiment of the present disclosure;
[0016] Figure 3 Schematically illustrates a schematic diagram of the principle of determining tool-related information according to an embodiment of the present disclosure;
[0017] Figure 4 The following schematically shows an interactive process diagram of a task execution method according to an embodiment of the present disclosure;
[0018] Figure 5 Schematically shows a structural block diagram of a first server according to another embodiment of the present disclosure;
[0019] Figure 6 The following schematically illustrates an interactive process diagram of a task execution method according to another embodiment of the present disclosure;
[0020] Figure 7 Schematically shows a flowchart of a task execution method based on a model context protocol according to another embodiment of the present disclosure;
[0021] Figure 8 Schematically shows an architecture diagram of a task execution system based on a model context protocol according to the present disclosure;
[0022] Figure 9 Schematically shows a block diagram of a task execution device based on a model context protocol according to an embodiment of the present disclosure;
[0023] Figure 10 Schematically shows a block diagram of a task execution device based on a model context protocol according to another embodiment of the present disclosure; and
[0024] Figure 11 A schematic block diagram of an example electronic device that can be used to implement the task execution method based on the model context protocol according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0025] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0026] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved comply with the provisions of relevant laws and regulations, take necessary confidentiality measures, and do not violate public order and good morals.
[0027] The inventors discovered that application products that provide services based on the MCP architecture typically consume significant computing resources to execute tasks, resulting in high computational overhead, high time and financial costs for task execution, and issues such as low task execution accuracy, making it difficult to meet actual user needs.
[0028] The embodiments of the present disclosure provide a task execution method, device, and system based on a model context protocol. The task execution method based on the model context protocol includes: in response to receiving a task request related to a target object, determining tool-related information associated with the object attributes of the target object in a model context protocol service; sending tool-related information to a model end that deploys a large model, and receiving target-related information determined from the tool-related information based on the large model; based on the target-related information, calling a target tool for the model context protocol service to execute a target task related to the task request, and obtaining a task execution result.
[0029] According to an embodiment of the present disclosure, by calling the tool-related information associated with the object attributes in the model context protocol service based on the object attributes of the target object, it is possible to select tool-related information such as tools and data resources that are suitable for executing the target task based on the user's configuration requirements, thereby avoiding sending the full amount of tool-related information configured in the model context protocol service to the model side for the big model to perform semantic understanding and tool screening, thereby reducing the amount of markup (or token) resources input to the big model and reducing the computing power resources occupied by the big model for processing tool-related information. At the same time, by providing the big model on the model side with target-related information that matches the requirements of the target object, it is possible to reduce the probability that the big model selects a tool with a low degree of relevance to the target task to execute the target task, so that the target tool corresponding to the target-related information can be more accurately adapted to execute the target task, and then by calling the target tool to execute the target task, it is possible to reduce computing power resource consumption and improve task execution accuracy and reliability.
[0030] Figure 1 An exemplary system architecture to which a method and apparatus for executing a task based on a model context protocol can be applied according to an embodiment of the present disclosure is schematically shown.
[0031] It should be noted that Figure 1 The examples shown are merely examples of system architectures to which the embodiments of the present disclosure may be applied, to help those skilled in the art understand the technical content of the present disclosure, but do not imply that the embodiments of the present disclosure may not be applied to other devices, systems, environments, or scenarios. For example, in another embodiment, an exemplary system architecture to which the method and apparatus for executing a task based on a model context protocol may be applied may include a terminal device, but the terminal device may implement the method and apparatus for executing a task based on a model context protocol provided by the embodiments of the present disclosure without interacting with a server.
[0032] like Figure 1 As shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.
[0033] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as knowledge reading applications, web browser applications, search applications, instant messaging tools, email clients, and / or social platform software (for example only).
[0034] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0035] Server 105 may be a server that provides various services, such as a background management server (for example only) that supports content browsed by users using terminal devices 101, 102, and 103. The background management server may analyze and process received data such as user requests, and feed back processing results (e.g., web pages, information, or data obtained or generated based on user requests) to the terminal device.
[0036] It should be noted that the task execution method based on the model context protocol provided in the embodiment of the present disclosure can generally be executed by the terminal device 101, 102, or 103. Correspondingly, the task execution apparatus based on the model context protocol provided in the embodiment of the present disclosure can also be set in the terminal device 101, 102, or 103.
[0037] Alternatively, the task execution method based on the model context protocol provided in the embodiment of the present disclosure may also be generally executed by the server 105. Accordingly, the task execution device based on the model context protocol provided in the embodiment of the present disclosure may generally be set in the server 105. The task execution method based on the model context protocol provided in the embodiment of the present disclosure may also be executed by a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the task execution device based on the model context protocol provided in the embodiment of the present disclosure may also be set in a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105.
[0038] For example, the terminal devices 101, 102, and 103 can receive input information of the target object, and encapsulate the input information into a task request and send it to the server 105. The server 105 determines the tool-related information associated with the object attribute in the model context protocol service based on the object attribute of the target object, and sends the tool-related information to the model end where the large model is deployed, and receives the target-related information from the model end. The server can call the target tool of the user model context service to execute the target task that matches the task request based on the target-related information, obtain the task execution result, and send the task execution result to the terminal devices 101, 102, and 103. Alternatively, the tool-related information associated with the object attribute in the model context protocol service can be determined based on a server or server cluster that communicates with the server 105, and the tool-related information can be sent to the model end where the large model is deployed, and the target-related information can be received from the model end, and the task execution result can be sent to the terminal device at the same time.
[0039] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.
[0040] To facilitate understanding of the embodiments of this disclosure, the following correspondence between Chinese and English technical terms can be used to understand the content of these embodiments. The Model Context Protocol service, also known as the MCP Server in English, can be used to provide context, tools, and prompt information to the MCP client. The host side can be configured with the MCP Host and MCP Client, which can be applications used to interact between the MCP Server and the large model.
[0041] Figure 2 The flowchart of the task execution method based on the model context protocol according to an embodiment of the present disclosure is schematically shown.
[0042] like Figure 2 As shown, the task execution method based on the model context protocol includes operations S210 to S230. It should be noted that the execution subject of the task execution method provided in the embodiment of the present disclosure can be a host end, for example, it can be applied to the host end that deploys the MCP application.
[0043] In operation S210 , in response to receiving a task request associated with a target object, tool-related information associated with an object property of the target object in a model context protocol service is determined.
[0044] In operation S220 , tool-related information is sent to the model end where the large model is deployed, and target-related information determined from the tool-related information based on the large model is received.
[0045] In operation S230 , based on the target related information, a target tool for the model context protocol service is called to execute the target task related to the task request, and obtain a task execution result.
[0046] According to embodiments of the present disclosure, a task request may be a request indicating that a target object needs to invoke a large model to execute a target task. For example, a task request may include task requirement information. Task requirement information may be textual, such as "What will the weather be like in City A tomorrow?" or in other modalities, such as images or voice. Embodiments of the present disclosure do not limit the specific data type of task requirement information.
[0047] According to an embodiment of the present disclosure, object attributes may include an identifier representing the target object, such as a login name, account name, etc. used for the target object, or other types of information such as a physical address of the host side, as long as it can represent the target object.
[0048] It should be noted that the acquisition of information involved in any embodiment of the present disclosure, including but not limited to information such as object attributes, is obtained under the condition of obtaining authorization from the relevant user or subject, and the purpose of information acquisition is informed in advance, and necessary encryption measures are adopted to avoid information leakage, meet the requirements of relevant laws and regulations and do not violate public order and good morals.
[0049] According to an embodiment of the present disclosure, object attributes can be determined based on a task request. For example, the object attributes can be determined based on the account name carried in the task request. The model context protocol service (or MCP service) can be a service resource that provides tool-related information such as tool description information and prompt information to the host side. The model context protocol service may include multiple preset tool-related information, and the preset tool-related information is used to describe tool capability information such as the functions and parameter requirements of the preset tools or preset data resources. The tool-related information can be tool description information related to a specified tool among multiple preset tools. The specified tool in the model context protocol service has a mapping relationship with the object attributes. The tool-related information of the specified tool can be configured based on the task requirements of the target object. For example, the tool-related information having a mapping relationship with the object attributes can be determined based on the target object's interactive operation with respect to a specified tool among multiple preset tools in the model context protocol service.
[0050] In some embodiments, the tool-related information includes at least one of the following: tool description information, data resource description information.
[0051] Tool description information can be used to describe the function, parameter rules and other functional information of the specified tool.
[0052] For example, the tool description information may be information used to describe the geographic location parameter rules, query interface name, geographic range attributes, and other information used to describe the function of the weather query tool.
[0053] Data resource description information can be used to describe the data resource's address, directory, permission requirements, data type, and other information related to the data resource's functionality. The macro model can execute the corresponding task by processing the target data retrieved from the data resource. The data resource corresponding to the data resource description information can be used by the target tool, for example, an image storage resource accessed by an image acquisition tool. Alternatively, the data resource can be used by the macro model, for example, as a prompt word data resource for input into the macro model.
[0054] According to an embodiment of the present disclosure, the model side can be a server side for deploying a large model. The large model can use a token to convert tool-related information into embedded features as prompt information to perform semantic understanding of the tool-related information specified by the target object, so as to determine the target-related information for executing the target task for the task request from the tool-related information. The target-related information may include tool description information of the target tool for executing the target task, or may also include data resource description information of the target data resource for executing the target task.
[0055] According to the embodiments of the present disclosure, tool-related information associated with object properties is sent to the model side, which can avoid the big model from performing semantic understanding of the preset tool-related information of the full set of preset tools in the model context protocol service, occupying too many token resources. At the same time, the big model can improve the accuracy of understanding the functions of the specified tool by processing the tool-related information required by the target object, and avoid the big model selecting tools or data resources that do not match the needs of the target object to perform the target task, thereby affecting the accuracy of the execution results. The big model can then output target-related information to more accurately select target tools and target data resources for the target task, thereby improving the accuracy and reliability of the task execution results of the target task.
[0056] According to an embodiment of the present disclosure, the host side can call the target tool to execute the target task by sending target-related information to the first service side of the deployment model context protocol service, or the host side can directly call the target tool to execute the target task through the target-related information to improve the calling flexibility of the target tool.
[0057] In some embodiments, the target task can be determined based on the big model through semantic understanding of the request content carried in the task request information. For example, the big model can determine multiple target tasks such as cloud server login tasks, permission authentication tasks, image recognition tasks and deduplication tasks based on the text requirement information carried in the task request information "Please help me deduplicate the photos in the cloud album". The target-related information can also include task-related information such as the tool name, tool execution parameters, and target tool calling order of the target tool used to execute multiple target tasks.
[0058] In some embodiments, sending the tool-related information to the model side that deploys the large model may include: sending the tool-related information and the request content carried in the task request to the model side.
[0059] According to an embodiment of the present disclosure, the model side can obtain target-related information by using a large model to perform semantic understanding on the request content and tool-related information. The large model can use the description information of the tool or data resource represented by the tool-related information as a prompt word to fully semantically understand the task requirements of the target object represented by the request content, and determine the target tool and target data resource that semantically matches the task requirements represented by the request content based on the semantic understanding results. At the same time, the large model can also output the execution parameters of the target task, the target tool calling sequence, and other calling parameter data for calling the target tool based on the semantic understanding process, so as to improve the accuracy of the target task execution by sending target-related information related to the execution of the target task, including the calling parameter data, to the host side.
[0060] In some embodiments, the task execution method based on the model context protocol may also include: responding to a service configuration request of the target object, determining specified tool attribute information from preset tool attribute information based on the intent information carried in the service configuration request; sending the specified tool attribute information to the first server; and receiving tool-related information from the first server.
[0061] The first server can be used to maintain tool-related information that has a mapping relationship with each of the multiple object attributes, so as to determine the tools and data resources associated with the object attributes in the model context protocol service.
[0062] According to embodiments of the present disclosure, the intent information carried in a service configuration request can indicate a target object's need to establish a mapping relationship between tools and data resources in an MCP service. For example, the intent information can be directed to interacting with an option element corresponding to preset tool A1 for MCP service A in an interactive interface. The preset tool attribute information of preset tool A1 can be determined as the specified tool attribute information required by the target object.
[0063] For another example, the target object may also determine intent information through other methods such as voice interaction and text input interaction, and determine the specified tool attribute information based on the intent information. The embodiments of the present disclosure will not be described in detail here.
[0064] According to an embodiment of the present disclosure, preset tool attribute information represents information related to preset tools used in a model context service. The preset tool attribute information may represent tool description information of a preset tool used in a model context service, or data resource description information of a preset data resource used in a model context service. For example, the preset tool attribute information may include the tool names of multiple preset tools used in MCP service A.
[0065] By determining the attribute information of the designated tool to be selected by the target object from the preset tool attribute information based on the intent information, for example, the tool names of designated tool A1 and designated tool A2 selected by the target object can be determined from the tool names of multiple preset tools for MCP service A as the designated tool attribute information. Based on the tool names of designated tool A1 and designated tool A2 as designated tool attribute information, tool-related information such as tool description information for designated tool A1 and designated tool A2 can be determined from the server configuring MCP service A or from the first server.
[0066] According to embodiments of the present disclosure, the data volume of tool-related information is smaller than the data volume of preset tool-related information. For example, for the 10 preset tools in MCP service A, the tool-related information associated with object properties can be the tool description information for designated tool A1 and designated tool A2. Thus, in response to a task request from a target object, only the tool description information for designated tool A1 and designated tool A2 from MCP service A is sent to the model side. This enables the large model to select designated tool A1 as the target tool and use the tool name of designated tool A1 as the target tool name, while processing only the tool description information for designated tool A1 and designated tool A2. By sending the target tool name and tool execution parameters to the host side, the host side can execute the target task by calling designated tool A1 and obtain the task execution result. Consequently, the large model can be called to execute the task while using fewer marking resources reserved for the large model, improving task execution efficiency and accuracy. Furthermore, by reducing marking resource usage, the large model can reduce the amount of data processing required to execute the target task, thereby lowering the computational overhead required to execute the target task.
[0067] In some embodiments, the first server determines tool-related information from preset tool-related information based on specified tool attribute information. For example, the first server can determine the model context protocol service name and the specified tool name specified for the target object from the specified storage area to obtain tool-related information corresponding to the specified tool attribute name.
[0068] In some embodiments, the first server may also send a request carrying specified tool attribute information to the second server of the configuration model context protocol service to obtain tool-related information corresponding to the specified tool attribute name from the second server.
[0069] In one embodiment, the first server may send tool-related information associated with the object attributes to the host for the target object in response to the task request.
[0070] In one embodiment, the first server may send tool-related information associated with the object attributes to the host for the target object before receiving the task request.
[0071] Figure 3 The schematic diagram schematically shows the principle of determining tool-related information according to an embodiment of the present disclosure.
[0072] like Figure 3 As shown, the Model Context Protocol services registered on the first server may include MCP Service A and MCP Service B. MCP Service A is associated with three preset tools: Preset Tool A1, Preset Tool A2, and Preset Tool A3. MCP Service B is associated with Preset Data Resources B1 and Preset Data Resources B2. MCP Service A and MCP Service B can each call preset tools or data resources to perform tasks.
[0073] The host side can configure a model online text protocol application for the target object, and the target object inputs intent information through the model online text protocol application. The host side enables the first server side to obtain the intent information by sending a service configuration request to the first server side. Based on the intent information, the first server side can determine that the specified tool attribute information that needs to be configured for the target object includes the name fields of the preset tool A2, preset tool A3 and preset data resource B1. The first server side establishes a mapping relationship between the name fields of the preset tool A2, preset tool A3 and preset data resource B1 and the object attribute fields of the target object through the specified tool attribute information in the intent information. The first server side can also send the tool description information of the preset tool A2 and the preset tool A3, as well as the data description information of the preset data resource B1 as tool related information associated with the object attribute fields of the target object to the host side, so that the host side can determine the tool related information through the object attributes.
[0074] based on Figure 3As shown, it can be determined that when the target object responds to the user's task request through the host side, the tool description information of the preset tool A2 and the preset tool A3, as well as the data description information of the preset data resource B1 can be sent to the model side, avoiding occupying a large amount of marking resources used for large models on the model side, thereby reducing the resource occupation for large models.
[0075] In some embodiments, based on the intent information carried by the service configuration request, determining the specified tool attribute information from the preset tool attribute information may include: determining the specified tool attribute information corresponding to the interaction intent carried by the service configuration request from the preset tool attribute information used for the model context service.
[0076] According to an embodiment of the present disclosure, the interaction intention is determined based on the interaction operation performed on the display element, and the display element characterizes the preset tool attribute information.
[0077] For example, the display element can be any type of element such as a tab element, an icon element, etc., which represents the preset tool attribute information such as the preset tool name of the model context protocol service in the interactive interface.
[0078] In one embodiment, the target object determines the intent information representing the specified tool attribute information by performing an interactive operation on the display element, and sends the intent information to the first server. The first server can determine the tool-related information from the corresponding model context protocol service based on the specified tool attribute information represented by the intent information, and send the tool-related information that matches the intent information to the host. The host can select the tool-related information that the large model can semantically understand in the model context protocol service based on the interactive operation on the display element, and call the target tool to perform the target task. In this way, the amount of marking resources occupied by the large model can be reduced based on the interactive operation of the target object, and the large model can be helped to perform a preliminary screening of the preset tools and preset data resources in the model context protocol through the interactive operation, so as to improve the screening accuracy of the target tools and target data resources related to the target-related information, and improve the accuracy and efficiency of the execution of the target task.
[0079] In some embodiments, determining the specified tool attribute information from the preset tool attribute information based on the intent information carried by the service configuration request may also include: using the tool description information related to the preset tool attribute information as a prompt word, using a large model to perform tool requirement detection on the intent information to obtain the specified tool attribute information.
[0080] For example, the big model can process the tool descriptions of each of the 100 preset tool attributes in MCP service A, along with the target user's input intent: "A tool is needed to query and remind users of the weather in City A." Using these 100 tool descriptions as prompts, the big model can be controlled to semantically understand the intent and the tool descriptions representing the functions and capabilities of the preset tools. This allows the big model to identify three specific tools from the 100 preset tools that are capable of performing the functions of "city weather query," "event reminder," and "message encapsulation." This allows the big model to determine the three specific tool attributes from the 100 preset tool attributes.
[0081] According to an embodiment of the present disclosure, when the number of model context protocol services or the number of preset tool-related information for model context protocol services is large, it is difficult for the target object to accurately select the specified tool name or specified tool performance description information that is adapted to the demand intention through interactive operations. By utilizing the big model to process the tool description information and intention information of the preset tool attributes, the specified tool attribute information that can meet the demand intention of the target object can be determined from the preset tool attribute information of one or more model context protocol services. This can help the target object to quickly filter out the tool-related information that needs to be understood and filtered by the big model, thereby reducing the target object's learning cost for interactive operations on the model context protocol services and improving the overall execution efficiency of the target task.
[0082] In some embodiments, the host can use target-related information to call multiple target tools to execute multiple intermediate tasks within a target task, thereby obtaining multiple intermediate execution results. The host can then send these intermediate execution results to the model side, where the large model can be used to semantically understand the intermediate execution results and the request content. The large model then outputs feedback information that meets the requirements of the target object as the execution result of the target task.
[0083] In some embodiments, based on target-related information, calling the target tool for the model context protocol service to execute the target task related to the task request may also include: determining a first tool call request based on the target-related information, sending the first tool call request to the second service end of the configured model context protocol service; and sending at least one first intermediate execution result to the model end, and the model end uses the large model to process the first intermediate execution result to obtain the task execution result.
[0084] According to an embodiment of the present disclosure, the first tool call request is used to call a first target tool to execute at least one first intermediate task and obtain a first intermediate execution result.
[0085] For example, MCP service A configured on the second server can parse the first tool call request to determine target-related information and, based on the target-related information, call tool A to execute the first intermediate task, obtaining a first intermediate execution result. The second server sends the first intermediate execution result to the host, which then sends the first intermediate execution result to the model. This controls the large model to process the first intermediate execution result and other intermediate execution results obtained by executing intermediate tasks with other target tools to output the task execution result.
[0086] In one example, the first intermediate task may be to call an object detection tool through MCP service A to perform object detection on a preset image, and the first intermediate execution result may be the name of a building represented by the preset image.
[0087] In some embodiments, the first tool call request includes a specified command attribute, the first target tool includes a specified command script corresponding to the specified command attribute, and the second server determines the specified command script in response to the first tool call request carrying the specified command attribute.
[0088] According to an embodiment of the present disclosure, the specified command attribute may be, for example, a script name of the specified command script, a command identifier, or other fields or identifiers that can represent the specified command script.
[0089] In some embodiments, calling the first target tool to execute at least one first intermediate task and obtaining a first intermediate execution result may include: receiving a specified command script from the second server, and executing a specified command based on the specified command script to obtain a command execution result.
[0090] For example, the second server determines the specified command name as the specified command attribute by parsing the first tool call request, and encapsulates the specified command script corresponding to the specified command name as a target message and sends it to the host side, so that the host side can directly pull the specified command script from the second server side.
[0091] According to an embodiment of the present disclosure, by executing a specified command based on a specified command script received from a second server, a command execution result is obtained as a first intermediate execution result. After the host obtains the command execution result, the specified command can be exited to avoid occupying the task process on the host. This can prevent the host from controlling the task process occupancy generated by the model context protocol service configured on the second server calling the target tool to execute the specified command by occupying at least one task process, reduce the task process occupancy on the host side during the execution of the target task, reduce the amount of computing resources, cache resources and other device resources consumed by the host side for maintaining the task process, and improve the device operation efficiency on the host side.
[0092] In one example, the designated command script may be a command line for executing a designated command of "renaming expired files stored in a designated directory on the host side to AAAA". The host side sends a first tool request to the second server side to pull the designated command script to the host side for local execution. The designated command can be exited in time after renaming the expired files in the designated directory, thereby avoiding the task process for maintaining the target tool called by the MCP service from being occupied for a long time.
[0093] Figure 4 The interactive process diagram of the task execution method according to an embodiment of the present disclosure is schematically shown.
[0094] like Figure 4 As shown, the application scenario may include a target object, an MCP application, a local MCP service module, a model end, and a first service end. The host end may be configured with the MCP application and the local MCP service module.
[0095] In step S1.1, the target object starts the local MCP service module by operating the MCP application.
[0096] In step S1.2, the local MCP service module generates a script service configuration request based on the script configuration information received by the MCP application. The script service configuration request is sent to the first server to determine the specific command script that needs to be configured for the target object. The first server sends the specific command script to the local MCP service module, which awaits invocation by the MCP application.
[0097] In step S1.3, the MCP application on the host side sends object attribute information to the local MCP service module for permission authentication.
[0098] In step S1.4, the local MCP service module sends a service configuration request to the first server, so that the first server can determine tool-related information associated with the object attributes based on the intent information.
[0099] In step S1.5, the first server sends tool-related information associated with the object attributes to the MCP application on the host.
[0100] In step S2.1, the target object sends a task request to the MCP application on the host side.
[0101] In step S2.2, the MCP application on the host side sends tool-related information associated with object properties to the model side. The big model on the model side determines target-related information based on the request content and tool-related information.
[0102] In step S2.3, the model side sends target related information to the MCP application on the host side.
[0103] In step S2.4, the MCP application generates a first tool call request based on the specified command attribute in the target related information, and sends the first tool call request to the local MCP service module.
[0104] In step S2.5, the local MCP service module executes the specified command by executing the specified command script, obtaining the command execution result. Then, step S2.6 is executed to return the command execution result to the MCP application. After executing step S2.5, the task process for the specified command can be exited.
[0105] In step S2.7, the intermediate execution result including the command execution result is sent to the model side.
[0106] In step S2.8, the model side sends the task execution result obtained by the large model through semantic understanding of the intermediate execution result of the target tool to the MCP application on the host side. The MCP application on the host side executes step 2.9 to send feedback information determined based on the task execution result to the target object.
[0107] It should be noted that Figure 4 In the embodiment shown, the local MCP service module can serve as a second server to respond to the first tool call request. The host-side MCP application can be understood as an MCP Host application (also called an MCP host application) or an MCP client application.
[0108] In some embodiments, based on target-related information, calling the target tool for the model context protocol service to execute the target task related to the task request may also include: based on the first protocol rule, determining the first tool call request according to the target-related information, and sending the first tool call request to the first service end; and sending at least one second intermediate execution result to the model end, and the model end processes the second intermediate execution result through the large model to obtain the task execution result.
[0109] In some embodiments, the first service end may perform protocol conversion on the first tool call request to obtain a second tool call request that matches a second protocol rule for the designated tool resource end, and send the second tool call request to the designated tool resource end. The designated tool resource end may be a target tool for target-related information indication. The designated resource end calls the second target tool based on the target-related information carried in the second tool call request to execute at least one second intermediate task and obtain a second intermediate execution result.
[0110] For example, the designated tool resource end may be a weather query server end that configures an HTTP protocol rule interface, and the second target tool may be a weather query tool configured by the designated tool resource end. Since the host end determines the first tool call request through the MCP protocol rule as the first protocol rule, it is difficult for the designated tool resource end to directly parse the first tool call request to determine the target information. Therefore, a network proxy service function can be provided by the second server end, and the first tool call request corresponding to the MCP protocol rule is converted into a protocol rule to obtain a second tool call request carrying target-related information, so that the weather query server end can parse the second tool call request based on the HTTP protocol to obtain target-related information indicating the weather query tool. The weather query server end queries the weather information according to the location parameters and time parameters indicated by the target-related information by calling the weather query tool, and obtains the weather query result as the second intermediate result.
[0111] It should be understood that the first server can receive a second feedback request from the weather query server, which carries the weather query result. The first server converts the protocol rules of the second feedback request into a first feedback request that satisfies the MCP protocol rules and sends the first feedback request to the host, enabling the host to parse the first feedback request and obtain the weather query result as the second intermediate execution result. The host sends the weather query result to the model, enabling the large model to perform semantic understanding and analysis of the multiple intermediate execution results to obtain the task execution result.
[0112] Figure 5 The structural block diagram of the first server according to another embodiment of the present disclosure is schematically shown.
[0113] like Figure 5 As shown, the first server may include a configuration management component and a service proxy component. Among them, three different host terminals are host terminal A, host terminal B and host terminal C, which are respectively used to respond to requests from different target objects. The service proxy component includes an authority authentication unit, a log detection unit and a protocol conversion unit. The authority authentication unit is used to authenticate the object attribute identifiers sent by different host terminals to determine the object attributes of the target objects corresponding to different host terminals. In addition, the authority authentication unit can also be used to perform proxy service authentication on the second server and the designated tool resource terminal. The second server can be configured with multiple model context protocol services such as MCP service A and MCP service B. The designated tool resource terminal can be, for example, an open resource interface service resource.
[0114] The configuration management component is configured to determine a mapping relationship between object attributes and specified tool attribute information in the Model Context Protocol service based on a service configuration request sent to the host. The component then sends tool-related information associated with the object attributes to the corresponding host. Furthermore, the configuration management component may also establish a mapping relationship between a specified command script in the script configuration unit and the object attributes based on the specified command attribute in the intent information, and send the specified command script to the local MCP service module on the host.
[0115] The protocol conversion unit is used to send the first tool call request from the host end to the second server end, or to perform protocol conversion on the first tool call request based on the protocol rules to determine the second tool call request, and to send the second tool call request to the designated tool resource end to execute multiple intermediate tasks, so that the large model on the model end can determine the task execution result by processing multiple intermediate execution results.
[0116] Figure 6 The figure schematically shows an interactive process diagram of a task execution method according to another embodiment of the present disclosure.
[0117] like Figure 6 As shown, the application scenario may include a target object, a host side, a model side, a first server side, a second server side, and a designated tool resource side. The host side may configure an MCP application for the target object.
[0118] In step S61.1, the host sends specified tool attribute information to the first server. The specified tool attribute information may be determined based on a service configuration request of a target object.
[0119] In step S61.2, the first server determines the tool-related information associated with the object attributes from the corresponding model context protocol service based on the specified tool attribute information, and establishes a mapping relationship between the object attributes and the tool-related information.
[0120] In step S61.3, tool-related information (also called a list of tools) is sent to the host.
[0121] In step S62.1, the target object sends a task request to the host.
[0122] In step S62.2, the host side sends the tool-related information to the model side, and the model side uses the big model to determine the target-related information based on the request content and the tool-related information.
[0123] In step S62.3, the model side sends target related information to the host side.
[0124] In step S62.4, the host sends a permission authentication request to the first server, and the first server performs permission authentication on the object attributes of the target object to obtain a permission authentication result.
[0125] In step S62.5, the first server sends the permission authentication result to the host.
[0126] In step S62.6, the host sends a tool call request carrying target-related information to the first server.
[0127] In step S62.7, the first server, based on the target tool indicated by the tool call request, is the target tool in the model context protocol service of the second server, and can interact with the second server based on the MCP protocol rules to call the target tool and obtain the first intermediate execution result.
[0128] In step S62.8, the first server, based on the target tool indicated by the tool call request as the target tool of the specified tool resource end, calls the target tool of the specified tool resource end based on the HTTP protocol rules to execute the second intermediate task and obtains the second intermediate execution result.
[0129] For example, the first server parses the tool call request, generates a second tool call request based on the parsed parameter mapping information, path information, designated tool resource end address, and other information, and calls the target tool by sending the second tool call request to the designated tool resource end.
[0130] In step S62.9, the first server returns multiple intermediate execution results to the host.
[0131] In step S62.10, the host side sends multiple intermediate execution results to the model side, and the model side controls the large model to process the multiple intermediate execution results to obtain the task execution result.
[0132] In step S62.11, the model side sends the task execution result to the host side.
[0133] In step S62.12, the host sends feedback information determined based on the task execution result to the target object.
[0134] Based on the model context protocol-based task execution method applied to the host side provided in the above embodiments, embodiments of the present disclosure also provide a model context protocol-based task execution method applicable to the first server side. This model context protocol-based task execution method applicable to the first server side will be described below with reference to the accompanying drawings and specific embodiments.
[0135] Figure 7The flowchart of a task execution method based on a model context protocol according to another embodiment of the present disclosure is schematically shown. The task execution method of this embodiment can be applied to the first server.
[0136] like Figure 7 As shown, the task execution method based on the model context protocol includes operations S710 and S720.
[0137] In operation S710 , in response to receiving designated tool attribute information sent by the host side, tool related information associated with an object attribute is determined from preset tool related information for a model context protocol service based on the designated tool attribute information.
[0138] According to an embodiment of the present disclosure, the target object related to the host side has object attributes.
[0139] In operation S720, tool-related information is sent to the host.
[0140] According to an embodiment of the present disclosure, the host side determines the tool-related information associated with the object properties of the target object in the model context protocol service in response to receiving a task request related to the target object; sends the tool-related information to the model side that deploys the large model, and receives the target-related information determined from the tool-related information based on the large model; based on the target-related information, calls the target tool for the model context protocol service to execute the target task related to the task request, and obtains the task execution result.
[0141] According to an embodiment of the present disclosure, the task execution method of the model context protocol may also include: receiving a first tool call request from the host end; performing protocol conversion on the first tool call request to obtain a second tool call request that matches the second protocol rule for the specified tool resource end, and sending the second tool call request to the specified tool resource end; sending a second intermediate execution result from the specified resource end to the host end.
[0142] According to an embodiment of the present disclosure, the first call request carries target related information.
[0143] According to an embodiment of the present disclosure, the designated resource end calls the second target tool to execute at least one second intermediate task based on the target-related information carried in the second tool call request, and obtains a second intermediate execution result.
[0144] According to an embodiment of the present disclosure, the host side sends at least one second intermediate execution result to the model side, and the model side processes the second intermediate execution result through the large model to obtain the task execution result.
[0145] It should be noted that the task execution method applicable to the first server involved in the embodiments of the present disclosure can refer to the task execution method applicable to the host in the above embodiments, and the embodiments of the present disclosure will not be repeated here.
[0146] Based on the task execution method based on the model context protocol provided in the above embodiments, an embodiment of the present disclosure further provides a task execution system based on the model context protocol.
[0147] Figure 8 The following schematically shows an architecture diagram of a task execution system based on a model context protocol according to the present disclosure.
[0148] like Figure 8 As shown, the task execution system 800 based on the model context protocol includes: a first server 810 and a host 820 .
[0149] The first service end 810 is configured to: in response to receiving the specified tool attribute information sent by the host end, determine the tool-related information associated with the object attribute from the preset tool-related information for the model context protocol service based on the specified tool attribute information, and the target object related to the host end has the object attribute; and send the tool-related information to the host end.
[0150] The host side 820 is configured to: in response to receiving a task request related to a target object, determine the tool-related information associated with the object properties of the target object in the model context protocol service; send the tool-related information to the model side where the large model is deployed, and receive the target-related information determined from the tool-related information based on the large model; based on the target-related information, call the target tool used for the model context protocol service to execute the target task related to the task request, and obtain the task execution result.
[0151] Figure 9 The block diagram of a task execution device based on a model context protocol according to an embodiment of the present disclosure is schematically shown.
[0152] like Figure 9 As shown, the task execution device 900 based on the model context protocol includes: a first determining module 910 , a first sending module 920 and a calling module 930 .
[0153] The first determining module 910 is configured to determine, in response to receiving a task request related to a target object, tool-related information associated with an object property of the target object in the model context protocol service.
[0154] The first sending module 920 is configured to send tool-related information to the model end where the large model is deployed, and receive target-related information determined from the tool-related information based on the large model.
[0155] The calling module 930 is used to call the target tool for the model context protocol service based on the target related information to execute the target task related to the task request and obtain the task execution result.
[0156] According to an embodiment of the present disclosure, the task execution device further includes: a designated tool attribute information determining module, a designated tool attribute information sending module, and a first receiving module.
[0157] A designated tool attribute information determination module is used to determine, in response to receiving a service configuration request related to the target object, designated tool attribute information from preset tool attribute information based on the intent information carried by the service configuration request, wherein the preset tool attribute information represents preset tool related information used for the model context service, and the data volume of the tool related information is smaller than the data volume of the preset tool related information.
[0158] The designated tool attribute information sending module is configured to send the designated tool attribute information to the first server, wherein the first server determines the tool related information from the preset tool related information based on the designated tool attribute information.
[0159] The first receiving module is used to receive tool-related information from the first server.
[0160] According to an embodiment of the present disclosure, based on the intent information carried in the service configuration request, determining the specified tool attribute information from the preset tool attribute information includes: using the tool description information related to the preset tool attribute information as a prompt word, using a large model to perform tool requirement detection on the intent information to obtain the specified tool attribute information.
[0161] According to an embodiment of the present disclosure, determining the specified tool attribute information from the preset tool attribute information based on the intention information carried by the service configuration request includes: determining the specified tool attribute information corresponding to the interaction intent carried by the service configuration request from the preset tool attribute information for the model context service, wherein the interaction intent is determined based on the interaction operation performed on the display element, and the display element represents the preset tool attribute information.
[0162] According to an embodiment of the present disclosure, the calling module includes: a first determining unit and a first sending unit.
[0163] The first determination unit is used to determine a first tool call request based on target-related information, and send the first tool call request to the second server end of the configuration model context protocol service, wherein the first tool call request is used to call the first target tool to execute at least one first intermediate task and obtain a first intermediate execution result.
[0164] The first sending unit is used to send at least one first intermediate execution result to the model end, and the model end uses the large model to process the first intermediate execution result to obtain a task execution result.
[0165] According to an embodiment of the present disclosure, the first tool call request includes a specified command attribute, the first target tool includes a specified command script corresponding to the specified command attribute, and the second server determines the specified command script in response to receiving the first tool call request carrying the specified command attribute; calling the first target tool to execute at least one first intermediate task, and obtaining a first intermediate execution result includes: receiving the specified command script from the second server, and executing the specified command based on the specified command script to obtain a command execution result.
[0166] According to an embodiment of the present disclosure, the calling module includes: a second determining unit and a second sending unit.
[0167] The second determination unit is used to determine the first tool call request based on the first protocol rule and target-related information, and send the first tool call request to the first server end, wherein the first server end calls the second target tool of the specified resource end based on the first tool call request to execute at least one second intermediate task and obtain a second intermediate execution result.
[0168] The second sending unit is used to send at least one second intermediate execution result to the model end, and the model end processes the second intermediate execution result through the large model to obtain the task execution result.
[0169] According to an embodiment of the present disclosure, the first sending module includes a third sending unit.
[0170] The third sending unit is used to send tool-related information and request content carried in the task request to the model side, wherein the model side uses the big model to perform semantic understanding of the request content and tool-related information to obtain target-related information.
[0171] According to an embodiment of the present disclosure, the tool-related information includes at least one of the following: tool description information and data resource description information.
[0172] Figure 10 A block diagram of a task execution device based on a model context protocol according to another embodiment of the present disclosure is schematically shown.
[0173] like Figure 10 As shown, the task execution device 100 based on the model context protocol includes: a second determination module 1010 and a second sending module 1020.
[0174] The second determination module 1010 is used to determine the tool-related information associated with the object attribute from the preset tool-related information for the model context protocol service in response to receiving the specified tool attribute information sent by the host side, based on the specified tool attribute information, and the target object related to the host side has the object attribute.
[0175] The second sending module 1020 is used to send tool-related information to the host side; wherein, in response to receiving a task request related to the target object, the host side determines the tool-related information associated with the object attributes of the target object in the model context protocol service; sends the tool-related information to the model side where the large model is deployed, and receives target-related information determined from the tool-related information based on the large model; based on the target-related information, calls the target tool used for the model context protocol service to execute the target task related to the task request, and obtains the task execution result.
[0176] According to an embodiment of the present disclosure, the task execution device based on the model context protocol further includes: a first tool call request receiving module, a conversion module and an intermediate execution result sending module.
[0177] The first tool call request receiving module is configured to receive a first tool call request from a host end, where the first call request carries target related information.
[0178] A conversion module is used to perform protocol conversion on the first tool call request, obtain a second tool call request that matches the second protocol rule used for the specified tool resource end, and send the second tool call request to the specified tool resource end. The specified resource end calls the second target tool to execute at least one second intermediate task based on the target-related information carried by the second tool call request, and obtains a second intermediate execution result.
[0179] The intermediate execution result sending module is used to send the second intermediate execution result from the specified resource end to the host end, wherein the host end sends at least one second intermediate execution result to the model end, and the model end processes the second intermediate execution result through the large model to obtain the task execution result.
[0180] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0181] According to an embodiment of the present disclosure, an electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method described above.
[0182] According to an embodiment of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause a computer to execute the method described above.
[0183] According to an embodiment of the present disclosure, a computer program product includes a computer program, and when the computer program is executed by a processor, the computer program implements the method described above.
[0184] Figure 11 A schematic block diagram of an example electronic device that can be used to implement a task execution method based on a model context protocol in an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0185] like Figure 11 As shown, device 1100 includes a computing unit 1101, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1102 or a computer program loaded from a storage unit 1108 into a random access memory (RAM) 1103. RAM 1103 may also store various programs and data required for the operation of device 1100. Computing unit 1101, ROM 1102, and RAM 1103 are connected to each other via a bus 1104. An input / output (I / O) interface 1105 is also connected to bus 1104.
[0186] Various components in device 1100 are connected to I / O interface 1105, including an input unit 1106, such as a keyboard and mouse; an output unit 1107, such as various types of displays and speakers; a storage unit 1108, such as a magnetic disk and optical disk; and a communication unit 1109, such as a network card, a modem, a wireless communication transceiver, etc. Communication unit 1109 allows device 1100 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0187] Computing unit 1101 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of computing unit 1101 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Computing unit 1101 performs the various methods and processes described above, such as the task execution method based on the model context protocol. For example, in some embodiments, the task execution method based on the model context protocol can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 1108. In some embodiments, part or all of the computer program can be loaded and / or installed onto device 1100 via ROM 1102 and / or communication unit 1109. When the computer program is loaded into RAM 1103 and executed by computing unit 1101, one or more steps of the task execution method based on the model context protocol described above can be performed. Alternatively, in other embodiments, the computing unit 1101 may be configured to execute the task execution method based on the model context protocol in any other appropriate manner (for example, by means of firmware).
[0188] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0189] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0190] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fibers, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0191] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0192] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0193] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.
[0194] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not a limitation herein.
[0195] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.
Claims
1. A task execution method based on a model context protocol, comprising: In response to receiving a task request associated with a target object, determining tool-related information associated with an object property of the target object in a model context protocol service; Sending the tool-related information to the model end where the large model is deployed, and receiving target-related information determined from the tool-related information based on the large model; Based on the target related information, a target tool for the model context protocol service is called to execute a target task related to the task request to obtain a task execution result.
2. The method according to claim 1, wherein The method further comprises: In response to receiving a service configuration request related to the target object, determining, based on intent information carried in the service configuration request, specified tool attribute information from preset tool attribute information, the preset tool attribute information representing preset tool related information for the model context service, the tool related information having a smaller data volume than the preset tool related information; Sending the designated tool attribute information to the first server, wherein the first server determines the tool-related information from the preset tool-related information based on the designated tool attribute information; and Receive the tool-related information sent by the first server.
3. The method according to claim 2, wherein: The determining, based on the intent information carried in the service configuration request, the specified tool attribute information from the preset tool attribute information, includes: Based on the tool description information related to the preset tool attribute information as a prompt word, the tool requirement detection is performed on the intention information using the large model to obtain the specified tool attribute information.
4. The method according to claim 2, wherein: The determining, based on the intent information carried in the service configuration request, the specified tool attribute information from the preset tool attribute information, includes: From the preset tool attribute information for the model context service, determine the specified tool attribute information corresponding to the interaction intent carried by the service configuration request, wherein the interaction intent is determined based on the interaction operation performed on the display element, and the display element represents the preset tool attribute information.
5. The method according to claim 1, wherein The calling of a target tool for the model context protocol service to execute a target task related to the task request based on the target related information includes: Determining a first tool call request based on the target related information, and sending the first tool call request to a second server configured with the model context protocol service, wherein the first tool call request is used to call a first target tool to execute a first intermediate task and obtain a first intermediate execution result; and The first intermediate execution result is sent to the model end, and the model end uses the large model to process the first intermediate execution result to obtain the task execution result.
6. The method according to claim 5, wherein: The first tool call request includes a specified command attribute, the first target tool includes a specified command script corresponding to the specified command attribute, and the second server determines the specified command script in response to receiving the first tool call request carrying the specified command attribute; Calling the first target tool to execute the first intermediate task and obtaining the first intermediate execution result includes: The designated command script sent by the second server is received, and a designated command is executed based on the designated command script to obtain a command execution result.
7. The method according to claim 1, wherein The calling of a target tool for the model context protocol service to execute a target task related to the task request based on the target related information includes: Determining a first tool call request based on the target related information based on the first protocol rule, and sending the first tool call request to the first server, wherein the first server calls a second target tool on the specified resource end based on the first tool call request to execute at least one second intermediate task and obtain a second intermediate execution result; and The second intermediate execution result is sent to the model end, and the model end processes the second intermediate execution result through the large model to obtain the task execution result.
8. The method according to claim 1, wherein The sending of the tool-related information to the model side where the large model is deployed includes: The tool-related information and the request content carried in the task request are sent to the model side, so that the model side can perform semantic understanding of the request content and the tool-related information through the large model to obtain the target-related information.
9. The method according to claim 1, wherein The tool-related information includes at least one of the following: Tool description information and data resource description information.
10. A task execution method based on a model context protocol, comprising: In response to receiving the specified tool attribute information sent by the host side, determining, based on the specified tool attribute information, tool related information associated with an object attribute from the preset tool related information for the model context protocol service, the target object associated with the host side having the object attribute; as well as Sending the tool-related information to the host end; Among them, the host side determines the tool-related information associated with the object attributes of the target object in the model context protocol service in response to the task request related to the target object; sends the tool-related information to the model side that deploys the large model, and receives target-related information determined from the tool-related information based on the large model; based on the target-related information, calls the target tool used for the model context protocol service to execute the target task related to the task request, and obtains the task execution result.
11. The method according to claim 10, wherein: The method further comprises: receiving a first tool call request from the host end, where the first call request carries the target related information; performing protocol conversion on the first tool call request to obtain a second tool call request that matches a second protocol rule for the designated tool resource end, and sending the second tool call request to the designated tool resource end; the designated resource end, based on target-related information carried in the second tool call request, calls a second target tool to execute a second intermediate task, and obtains a second intermediate execution result; The second intermediate execution result from the designated resource end is sent to the host end, wherein the host end sends the second intermediate execution result to the model end, and the model end processes the second intermediate execution result through the large model to obtain the task execution result.
12. A task execution system based on a model context protocol, comprising: The first server is configured to: in response to receiving the specified tool attribute information sent by the host, determine, based on the specified tool attribute information, tool related information associated with an object attribute from the preset tool related information for the model context protocol service, where the target object associated with the host has the object attribute; and send the tool related information to the host; The host side is configured to: in response to receiving a task request related to the target object, determine tool-related information associated with the object attribute of the target object in the model context protocol service; Sending the tool-related information to the model end where the large model is deployed, and receiving target-related information determined from the tool-related information based on the large model; Based on the target related information, a target tool for the model context protocol service is called to execute a target task related to the task request, and obtain a task execution result.
13. A task execution device based on a model context protocol, comprising: a first determining module configured to, in response to receiving a task request associated with a target object, determine tool-related information associated with an object attribute of the target object in a model context protocol service; A first sending module is configured to send the tool-related information to a model terminal where the large model is deployed, and receive target-related information determined from the tool-related information based on the large model; The calling module is used to call the target tool for the model context protocol service based on the target related information to execute the target task related to the task request and obtain the task execution result.
14. A task execution device based on a model context protocol, comprising: a second determining module for, in response to receiving the specified tool attribute information sent by the host side, determining, based on the specified tool attribute information, tool related information associated with an object attribute from the preset tool related information for the model context protocol service, the object attribute being possessed by the target object associated with the host side; as well as A second sending module is used to send the tool related information to the host end; Among them, the host side determines the tool-related information associated with the object attributes of the target object in the model context protocol service in response to the task request related to the target object; sends the tool-related information to the model side that deploys the large model, and receives target-related information determined from the tool-related information based on the large model; based on the target-related information, calls the target tool used for the model context protocol service to execute the target task related to the task request, and obtains the task execution result.
15. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 11.
16. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 11.
17. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 11.
Citation Information
Cited By
MCP function calling method and device, equipment, storage medium and computer program product
CN121277648A
Model context protocol service scheduling method and system and storage medium
CN121309678A
Security enhancement method and device related to model context protocol, and medium
CN121396489A
Service systematization providing method and device based on model context protocol
CN121441989A