Method and system for managing and controlling context protocol function of local model
By implementing centralized management of the local model context protocol function on network-attached storage devices, the problems of data leakage and network latency in large-scale language model integration are solved. It also provides flexible operations for function registration, deactivation, and deregistration, enhancing the stability of the system and the efficiency of function invocation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-20
- Publication Date
- 2026-04-17
AI Technical Summary
In the process of integrating large-scale language models with external tools, the existing model has problems such as data leakage risk, high network latency, unstable cloud status due to reliance on function calls, and lack of unified management and collaborative work.
Centralized management of local model context protocol functions is achieved through network-attached storage devices, including function registration, deactivation, and deregistration. Intent recognition and function invocation are performed using local large models, and a unified MCP function registry and adaptation modules are provided to achieve efficient localized interaction.
It improves the response speed of function registration, deactivation and deregistration, reduces the risk of data leakage, enhances the stability and reliability of the system, and achieves accurate and efficient function calls.
Smart Images

Figure CN121880339A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication control technology, and in particular to a method and system for controlling the local model context protocol function. Background Technology
[0002] In the integration of large language models (LLMs) with external tools and functions, the Model Context Protocol (MCP) is a commonly used implementation method. Especially in network attached storage (NAS) application scenarios, there are currently two representative integration modes, but they have both revealed varying degrees of shortcomings in practical applications.
[0003] One mode is the cloud-based big data model integration mode. In this mode, users issue commands through a dialog box with a cloud-based big data model service (such as ChatGPT, Claude, etc.), which are then sent to the cloud. When the cloud-based big data model needs to access resources or functions in the NAS, it communicates with the NAS via predefined APIs or webhooks. After receiving the request from the cloud, the NAS performs the corresponding operation locally, such as calling the local music service to perform search and playback functions. However, this mode has some problems. On the one hand, all user commands and private data in the NAS need to be uploaded to the cloud for processing, which exposes the data to the risk of leakage. On the other hand, the entire request-response chain is relatively long, introducing unnecessary network latency and preventing efficient local interaction. Moreover, the function calls in this mode are entirely dependent on the capabilities of the cloud-based big data model and the network connection status. If there is a network outage or the cloud service becomes unavailable, all MCP-based intelligent interaction functions will immediately become invalid.
[0004] Another model is the loosely integrated local large model model. In this model, a large language model that can run locally is deployed within the NAS device. Individual applications or services can adapt to the large model independently. They do this by modifying the large model's prompts or by directly exposing private APIs to the large model, allowing the large model to "sense" and call some of the application's functions. However, this integration method has the following problems: each application needs to integrate with the large model separately, lacking a unified management and discovery mechanism; the functions are isolated from each other, making collaborative work difficult; and the large model cannot perceive all available capabilities in the NAS system in real time, resulting in untimely updates to function status and defects such as function call failures or errors. Summary of the Invention
[0005] This invention provides a method and system for managing the local model context protocol function, which can achieve unified management of the MCP function based on NAS and improve the response and execution efficiency of the MCP function.
[0006] The first aspect of this invention discloses a method for managing the local model context protocol function. The method is applied to a network attached storage device (NETD), and the NETD is communicatively connected to an electronic device with an application installed. The electronic device accesses the NETD through the application. The method includes: When an interaction request transmitted by the application through the first interface is detected, the request item of the interaction request is determined, and the request item includes function registration, function deactivation or function cancellation; The system performs a function registration operation corresponding to the requested item according to the function registration process, or a function deactivation operation corresponding to the requested item according to the function deactivation process, or a function deregistration operation corresponding to the requested item according to the function deregistration process, to obtain a response result for the requested item. The response result is then transmitted back to the first interface through the second interface, so that the response result can be returned to the application through the first interface. The response result includes a function registration result for the function registration, a function deactivation result for the function deactivation, or a function deregistration result for the function deregistration. When a function call request triggered by a client is detected, the system performs an intent recognition operation, a function matching operation against a preset function list, a function call operation against an application endpoint, and a call result receiving operation on the function call request according to a preset local large model, to obtain the function call result for the function call request, and returns the function call result to the client; wherein, the preset function list is provided to the local large model through the network attached storage device.
[0007] As an optional implementation, in the first aspect of the present invention, when the requested item is the function registration, the interaction request includes at least the application ID corresponding to the application, the function name corresponding to the function to be registered, the function description, and the target parameters corresponding to the call parameter list, execution endpoint, and authentication information; and the first interface is a function registration interface or a standard API library interface. The step of performing the function registration operation corresponding to the requested item according to the function registration process includes: Perform parameter validation operations on all the target parameters included in the interaction request to obtain parameter validation results for all the target parameters; When the parameter verification result indicates that the verification is successful, the target parameter and the enabled status of the function to be registered are updated in the preset MCP function registry. The first update information corresponding to the MCP function registry is determined as the function registration result for the interaction request.
[0008] As an optional implementation, in the first aspect of the present invention, the method further includes: When the requested item is the function registration, the first update information is sent to a preset local large model adaptation module to trigger the local large model adaptation module to obtain the updated MCP function registry through a preset internal interface, and to configure or update the MCP function registry to the local large model; or, The local large model adaptation module periodically polls the MCP function registry, and when it determines that there are information changes in the MCP function registry, it configures or updates the MCP function registry to the local large model.
[0009] As an optional implementation, in the first aspect of the present invention, when the requested item is to disable the function, the first interface is a function disable interface; when the requested item is to cancel the function, the first interface is a function cancel interface. The step of performing the function deactivation operation corresponding to the requested item according to the function deactivation procedure includes: The deactivation information corresponding to the currently deactivated function is determined based on the interaction request; the deactivation information includes at least the name of the first function corresponding to the currently deactivated function; Based on the deactivation information, the function status of the currently deactivated function in the preset MCP function registry is adjusted to the deactivated state; and the second update information of the changed MCP function registry is determined as the function deactivation result for the interaction request; The step of performing the function cancellation operation corresponding to the requested item according to the function cancellation process includes: The cancellation information corresponding to the current cancellation function is determined based on the interaction request; the cancellation information includes at least the name of the second function corresponding to the current cancellation function. The currently deregistered function is deleted from the preset MCP function registry based on the deregistration information; and the third update information of the MCP function registry after the change is determined as the function deregistration result for the interaction request.
[0010] As an optional implementation, in the first aspect of the present invention, the method further includes: The preset local large model adaptation module pulls the MCP function registry and determines whether there are any changes in registry information between the MCP function registry and its corresponding previous MCP function registry. When the judgment result is yes, the local large model adaptation module updates the MCP function registry to the local large model. When the judgment result is negative, unmodified information is generated for the MCP function registry and the previous MCP function registry. The unmodified information is used to indicate that no registry information changes were detected between the MCP function registry and the previous MCP function registry.
[0011] As an optional implementation, in the first aspect of the present invention, the step of performing an intent recognition operation, a function matching operation against a preset function list, a function call operation against an application endpoint, and a call result receiving operation on the function call request according to a preset local large model, to obtain a function call result for the function call request, includes: The intent recognition operation is performed on the function call request according to the preset local big model to obtain the intent recognition result for the function call request; and the target call function matching the intent recognition result is determined from the function list recorded by the local big model. Generate a call request for the target function based on the local large model, and send the call request to its corresponding application endpoint; The application endpoint parses the call request to obtain a parsing result for the call request, the parsing result including at least the execution endpoint where the target call function is located; and forwards the call request to the execution endpoint to trigger the execution endpoint to call the target call function according to the call request; The application endpoint receives the function execution result of the execution endpoint in response to the call request, and returns the function execution result to the local large model; the function execution result received by the local large model is determined as the function call result of the function call request.
[0012] As an optional implementation, in the first aspect of the present invention, the application endpoint is the client, or a function call service preset by the network attached storage device; The execution result of the function is used at least to indicate that the execution endpoint successfully called the target function, or to indicate that the execution endpoint failed to call the target function. Returning the function call result to the client includes: Based on the local large model, the function call result is converted into information in the form of natural language to obtain output information for the function call result, and the output information is displayed on the corresponding display interface of the client.
[0013] A second aspect of this invention discloses a management system for a local model context protocol function. The system is applied to a network attached storage device (NETD), and the NETD is communicatively connected to an electronic device with an application installed. The electronic device accesses the NETD through the application. The system includes: The determining module is used to determine the request items of the interaction request when the application transmits an interaction request through the first interface. The request items include function registration, function deactivation, or function cancellation. The item response module is used to perform a function registration operation corresponding to the requested item according to the function registration process, or to perform a function deactivation operation corresponding to the requested item according to the function deactivation process, or to perform a function deactivation operation corresponding to the requested item according to the function deactivation process, so as to obtain an item response result for the requested item; A transmission module is used to transmit the event response result back to the first interface through the second interface, so as to return the event response result to the application through the first interface; wherein, the event response result includes a function registration result for the function registration, or a function deactivation result for the function deactivation, or a function deregistration result for the function cancellation; The function call response module is used to, when a function call request triggered by a client is detected, perform an intent recognition operation, a function matching operation against a preset function list, a function call operation against an application endpoint, and a call result receiving operation on the function call request according to a preset local large model, so as to obtain a function call result for the function call request; wherein, the preset function list is provided to the local large model through the network attached storage device; The transmission module is also used to return the function call result to the client.
[0014] As an optional implementation, in the second aspect of the present invention, when the requested item is the function registration, the interaction request includes at least the application ID corresponding to the application, the function name corresponding to the function to be registered, the function description, and the target parameters corresponding to the call parameter list, execution endpoint, and authentication information; and the first interface is a function registration interface or a standard API library interface. The specific methods by which the event response module performs the function registration operation corresponding to the requested event according to the function registration process include: Perform parameter validation operations on all the target parameters included in the interaction request to obtain parameter validation results for all the target parameters; When the parameter verification result indicates that the verification is successful, the target parameter and the enabled status of the function to be registered are updated in the preset MCP function registry. The first update information corresponding to the MCP function registry is determined as the function registration result for the interaction request.
[0015] As an optional implementation, in a second aspect of the invention, the system further includes: The notification module is used to send the first update information to a preset local large model adaptation module when the requested item is the registration of the function, so as to trigger the local large model adaptation module to obtain the updated MCP function registry through a preset internal interface, and configure or update the MCP function registry to the local large model; or, the local large model adaptation module periodically polls the MCP function registry, and when it determines that there are information changes in the MCP function registry, configures or updates the MCP function registry to the local large model.
[0016] As an optional implementation, in a second aspect of the present invention, when the request is to disable the function, the first interface is a function disable interface; when the request is to cancel the function, the first interface is a function cancel interface. The specific methods by which the event response module executes the function deactivation operation corresponding to the requested event according to the function deactivation process include: The deactivation information corresponding to the currently deactivated function is determined based on the interaction request; the deactivation information includes at least the name of the first function corresponding to the currently deactivated function; Based on the deactivation information, the function status of the currently deactivated function in the preset MCP function registry is adjusted to the deactivated state; and the second update information of the changed MCP function registry is determined as the function deactivation result for the interaction request; The specific methods by which the event response module performs the function cancellation operation corresponding to the requested event according to the function cancellation process include: The cancellation information corresponding to the current cancellation function is determined based on the interaction request; the cancellation information includes at least the name of the second function corresponding to the current cancellation function. The currently deregistered function is deleted from the preset MCP function registry based on the deregistration information; and the third update information of the MCP function registry after the change is determined as the function deregistration result for the interaction request.
[0017] As an optional implementation, in a second aspect of the invention, the system further includes: The update module is used to pull the MCP function registry from the preset local large model adaptation module and determine whether there are any changes in the registry information of the MCP function registry compared to its corresponding previous MCP function registry. The update module is also used to update the MCP function registry to the local large model when the judgment result is yes; The update module is further configured to generate unmodified information for the MCP function registry and the previous MCP function registry when the judgment result is negative. The unmodified information is used to indicate that no registry information changes were detected between the MCP function registry and the previous MCP function registry.
[0018] As an optional implementation, in the second aspect of the present invention, the function call response module performs an intent recognition operation, a function matching operation against a preset function list, a function call operation against the application endpoint, and a call result receiving operation on the function call request according to a preset local large model, and obtains the function call result for the function call request in the following specific ways: The intent recognition operation is performed on the function call request according to the preset local big model to obtain the intent recognition result for the function call request; and the target call function matching the intent recognition result is determined from the function list recorded by the local big model. Generate a call request for the target function based on the local large model, and send the call request to its corresponding application endpoint; The application endpoint parses the call request to obtain a parsing result for the call request, the parsing result including at least the execution endpoint where the target call function is located; and forwards the call request to the execution endpoint to trigger the execution endpoint to call the target call function according to the call request; The application endpoint receives the function execution result of the execution endpoint in response to the call request, and returns the function execution result to the local large model; the function execution result received by the local large model is determined as the function call result of the function call request.
[0019] As an optional implementation, in the second aspect of the present invention, the application endpoint is the client, or a function call service preset by the network attached storage device; The execution result of the function is used at least to indicate that the execution endpoint successfully called the target function, or to indicate that the execution endpoint failed to call the target function. The transmission module returns the function call result to the client in the following specific ways: Based on the local large model, the function call result is converted into information in the form of natural language to obtain output information for the function call result, and the output information is displayed on the corresponding display interface of the client.
[0020] A third aspect of the present invention discloses a network attached storage device, which is communicatively connected to an electronic device, the electronic device having an application installed thereon; the electronic device accesses the network attached storage device through the application. The network-attached storage device integrates a management system for the local model context protocol function as described in the second aspect of the present invention, and is used to execute the management method for the local model context protocol function as described in any one of the first aspects of the present invention.
[0021] A fourth aspect of the present invention discloses a control device for a local model context protocol function, the device comprising a network attached storage device as described in a third aspect of the present invention; the device performs a request-response operation on an interaction request triggered by the network attached storage device according to a control method for a local model context protocol function as described in any one of the first aspects of the present invention.
[0022] Compared with the prior art, the present invention has the following beneficial effects: This invention provides a method for managing the local model context protocol function. By implementing this invention, the local model context protocol function is centrally managed through a network attached storage device, enabling flexible and convenient operation of function registration, deactivation, and deregistration. This avoids data leakage problems associated with data migration to the cloud and reduces network latency caused by cloud migration, improving the response speed for function registration, deactivation, and deregistration. Furthermore, it enables accurate and efficient function invocation by leveraging a large local model. At the same time, the overall system stability and reliability are enhanced through centralized management and the use of local models. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 This is a flowchart illustrating a method for managing the local model context protocol function disclosed in an embodiment of the present invention; Figure 2This is a flowchart illustrating another method for managing the local model context protocol function disclosed in an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of a local model context protocol function control system disclosed in an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of another local model context protocol function control system disclosed in an embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of a network-attached storage device disclosed in an embodiment of the present invention; Figure 6 This is a schematic diagram of the structure of another local model context protocol function control system disclosed in an embodiment of the present invention; Figure 7 This is a schematic diagram of the interface for responding to a function call request as disclosed in an embodiment of the present invention; Figure 8 This is a schematic diagram of the interface for disabling the corresponding interactive request for the response function, as disclosed in an embodiment of the present invention. Detailed Implementation
[0025] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0026] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or end that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or ends.
[0027] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0028] This invention discloses a method and system for managing the local model context protocol (MTP) function. By centrally managing the MTP function through a network-attached storage device, it enables flexible and convenient operation of function registration, deactivation, and deregistration. This avoids data leakage issues associated with cloud data migration and reduces network latency, improving response speed for function registration, deactivation, and deregistration. Furthermore, it leverages a large local model to achieve accurate and efficient function invocation. Simultaneously, the centralized management and use of the local model enhance the overall system's stability and reliability. These will be described in detail below.
[0029] Example 1 Please see Figure 1 , Figure 1 This is a flowchart illustrating a method for managing the local model context protocol function disclosed in an embodiment of the present invention. Figure 1 The described method for managing the local model context protocol function can be applied to a network attached storage device (NAT), where the NAT communicates with an electronic device that has an application installed. The electronic device accesses the NAT through the application. This embodiment of the invention is not limited to this. Figure 1 As shown, the management method for this local model context protocol function may include the following operations: 101. When an interaction request transmitted by an application through the first interface is detected, the request item of the interaction request is determined. The request item may include function registration, function deactivation, or function cancellation.
[0030] In this embodiment of the invention, a network-attached storage device (NAS) serves as the core control terminal, communicating with electronic devices that have applications installed. This eliminates the need for additional cloud processing, enabling efficient responses to application interaction requests based on the local NAS device. Therefore, unlike cloud-dependent data responses, this NAS-based interaction request response eliminates the risk of data leakage, and by reducing cloud dependency, unnecessary network latency is minimized, thereby improving response efficiency for interaction requests.
[0031] In this embodiment of the invention, specifically, when an interaction request transmitted by an application through the first interface is detected, the requested item can be accurately determined, covering function registration, function deactivation, or function deregistration. This communication and control method allows applications to flexibly initiate different types of function control requests to the NAS according to actual needs, without complex operating procedures or additional hardware support. For example, when an application needs to add a local model context protocol function, it only needs to send a function registration request through the first interface, and the NAS can perform the corresponding operation according to the preset function registration process, greatly simplifying the function registration process and thus improving development efficiency and user experience.
[0032] 102. Perform the function registration operation corresponding to the requested item according to the function registration process, or perform the function deactivation operation corresponding to the requested item according to the function deactivation process, or perform the function deactivation operation corresponding to the requested item according to the function deactivation process, and obtain the item response result for the requested item.
[0033] In this embodiment of the invention, the event response result includes the function registration result for function registration, the function deactivation result for function deactivation, or the function cancellation result for function cancellation.
[0034] 103. Transmit the event response result back to the first interface through the second interface, so as to return the event response result to the application through the first interface.
[0035] In this embodiment of the invention, step 103 provides feedback on the results of the interactive request. Whether the function registration is successful, the function is deactivated, or the function is deregistered, the application can quickly receive feedback and perform subsequent operations based on the results, thus improving the overall management and control process.
[0036] 104. When a function call request triggered by a client is detected, the function call request is subjected to an intent recognition operation, a function matching operation against a preset function list, a function call operation against an application endpoint, and a call result receiving operation, respectively, according to the preset local large model, to obtain the function call result for the function call request.
[0037] In this embodiment of the invention, the preset function list is provided to the local large model via a network-attached storage device.
[0038] 105. Return the function call result to the client.
[0039] In this embodiment of the invention, based on the interaction process between the network attached storage device and the application in the electronic device implemented in steps 101-103, and based on steps 104-105, the functional interaction between the network attached storage device, the local large model, and the application corresponding to the electronic device can also be realized.
[0040] In this embodiment of the invention, it should be noted that the interaction request detection in step 101 and the function call request detection in step 104 can be executed synchronously or asynchronously. Synchronous execution means that the detection of the interaction request and the function call request can be performed simultaneously, but there is a difference in the order of execution of the subsequent response steps. That is, if steps 101 and 104 need to be executed simultaneously, to avoid errors in the function call of step 104, step 104 should be executed only after steps 101-103 are completed.
[0041] In this embodiment of the invention, for a function call request triggered by a client, after the local large model identifies the user's intent through intent recognition, it can perform a function matching operation on the function list provided by the network attached storage device, thereby accurately locating the target function to be called, and then accessing the application endpoint where the target function is located. In this control flow, the network attached storage device acts as an auxiliary database for locally maintaining the function list, enabling the local large model to quickly match the target function to be called without accessing the cloud.
[0042] In the embodiments of this invention, please refer to Figure 5 , Figure 6 This is a schematic diagram of the structure of another local model context protocol function management system disclosed in the embodiments of the present invention, such as... Figure 6 As shown, in practical applications, an MCP function management service module can be set up, corresponding to... Figure 6 The MCP function management service (core hub) is a system-level service (Daemon) that runs resident on the NAS operating system. This MCP function management service module is the execution subject for the schemes corresponding to steps 101-105 above, thereby realizing the control of the local model context protocol function in the network attached storage device.
[0043] In this embodiment of the invention, optionally, the MCP function management service module includes an MCP function registry and multiple external interfaces. The MCP function registry is a dynamic, structured database or an in-memory data structure. The external interfaces can be RESTful APIs or gRPC-based interfaces. These multiple external interfaces are used to interact with applications and local large-scale models, respectively.
[0044] In a further optional embodiment of the present invention, the MCP function management service module can communicate with the application (corresponding to) via an internal network loop or a local inter-process communication (IPC) mechanism (Unix Socket, D-Bus). Figure 6 This is a connection to the application layer (in the application layer). It then receives registration, deactivation, and deregistration requests from applications.
[0045] In this embodiment of the invention, optionally, the MCP function management service module and the local large model can connect through internal API calls, thereby responding to the query requests of the local large model for the MCP function registry, such as a query request for the list of currently available functions included in the MCP function registry.
[0046] In this embodiment of the invention, optionally, such as Figure 6 As shown, the local large model can include the model body of the local large model (corresponding to...) Figure 6The model consists of a local large model service and a local large model adaptation module (hereinafter referred to as the adaptation module). The model body and the adaptation module are integrated through the model's tool calling specifications (such as OpenAI's Function Calling and Google's ToolUse).
[0047] In this embodiment of the invention, the adaptation module is used to periodically poll or listen for change notifications from the MCP function management service module through a subscription / publishing mechanism to obtain the latest function registry status, and inject the obtained function list and / or a format (such as JSON Schema) that the function registry status model body can understand into the context of the model body.
[0048] In this embodiment of the invention, the adaptation module may run as a plugin or an independent process. Then, when the local large model interacts with the MCP function management service module, the MCP function management service module and the adaptation module actually connect and call each other through the internal API.
[0049] In this embodiment of the invention, optionally, the electronic device with the application installed may include an application interface module, which is provided to the NAS application developer in the form of a software development kit (SDK) or a standard API library. Subsequently, when the MCP function management service module interacts with the application, it essentially communicates with the remote MCP function management service module by calling the interface of the application interface module via a network HTTP request or IPC mechanism.
[0050] In this embodiment of the invention, this centralized management approach enables unified management and allocation of system resources, avoiding resource conflicts and system instability issues that may arise from function management being distributed across multiple devices or applications. For example, when multiple applications simultaneously initiate function registration or call requests, the NAS can process them in an orderly manner according to preset priorities and resource allocation strategies, ensuring that the system does not crash due to overload. Furthermore, the MCP function management service module enables unified management of all MCP functions and standardization of all interfaces.
[0051] In this embodiment of the invention, various operations during the function call process are performed using a pre-set local large model. This local large model has been pre-trained and optimized, exhibiting high accuracy and stability. Compared to relying on external models or services for function calls, this reduces the problems of function call failures or inaccurate results caused by factors such as network latency and external service malfunctions, thereby ensuring the reliability and stability of the entire system.
[0052] It is evident that implementation Figure 1The described method for managing the local model context protocol function centrally manages the local model context protocol function through a network-attached storage device, enabling flexible and convenient operation of function registration, deactivation, and deregistration. This avoids data leakage issues associated with data migration to the cloud and reduces network latency caused by cloud migration, improving the response speed for function registration, deactivation, and deregistration. Furthermore, it leverages the local large model to achieve accurate and efficient function invocation. At the same time, the centralized management and the use of the local model enhance the overall system stability and reliability.
[0053] In an optional embodiment, when the request is for function registration, the interaction request includes at least the application ID corresponding to the application, the function name corresponding to the function to be registered, the function description, and the target parameters corresponding to the call parameter list, execution endpoint, and authentication information; and the first interface is a function registration interface or a standard API library interface. The above step 102, which executes the function registration operation corresponding to the requested item according to the function registration process, specifically includes: Perform parameter validation operations on all target parameters included in the interaction request to obtain the parameter validation results for all target parameters; When the parameter verification result indicates that the verification is successful, the target parameters and the enabled status of the function to be registered are updated in the preset MCP function registry. The first update information corresponding to the MCP function registry is determined as the function registration result for the interactive request.
[0054] In this optional embodiment, when the application has a function registration requirement, the interaction request can be generated in the following way: Launch the application to perform its initialization operations. The application calls the preset function registration interface or the pre-set standard API library interface; The application generates an interaction request corresponding to the function registration according to multiple pre-set function registration parameters, and sends the interaction request to the first interface so that the interaction request can be transmitted through the first interface; These multiple function registration parameters correspond to the target parameters mentioned above, and include the application ID, function name, function description, call parameter list, execution endpoint (Endpoint URL), authentication information, and other information corresponding to the application.
[0055] In this optional embodiment, the application ID clearly identifies the application to which the function belongs, facilitating the differentiation and management of functions from different applications; the function name and function description clearly define the specific content and purpose of the function, enabling other system components or users to accurately understand the function; the call parameter list and execution endpoint provide the key information required for function calls, ensuring that the function can be correctly triggered and executed; authentication information can be used to prevent unauthorized function registration, which helps to enhance the security of function registration.
[0056] In this optional embodiment, specifically, within an application containing multiple intelligent analysis functions, each intelligent analysis function to be registered needs to provide a detailed application ID (such as a unique identifier for the application), function name (such as "image recognition analysis"), function description (detailing the types of images the function can recognize, analysis accuracy, etc.), a list of calling parameters (such as the format and size requirements of the input image), execution endpoint (such as a specific address on the server that processes the function), and authentication information (such as an API key). With this information, the system can accurately register the function, avoiding registration failures or subsequent usage problems due to missing or inaccurate information.
[0057] In this optional embodiment, a parameter validation mechanism is set for all target parameters to ensure that the input function registration information conforms to the system's preset specifications and requirements, avoiding function registration anomalies caused by incorrect or incomplete parameters. For example, the parameter validation operation can check whether the application ID format is correct, whether the function name contains illegal characters, and whether the parameter types and ranges in the call parameter list meet the requirements.
[0058] In this optional embodiment, by returning the first update information as the function registration result, the application can promptly understand whether the function registration was successful and the function's status after registration. For example, after sending a function registration request, the application can actively or otherwise obtain the first update information of the MCP function registry to confirm whether the function to be registered has been successfully registered in the system and whether the function is in an enabled state. Through this function registration result feedback mechanism, the application can perform subsequent operations based on the registration result, such as prompting the user that the function registration was successful and starting to use the function, or prompting the user to resubmit the registration request when registration fails, thereby improving the user experience and system usability.
[0059] As can be seen, in this optional embodiment, by clearly defining the comprehensive and standardized information required for function registration, providing flexible and diverse interface options, implementing a rigorous parameter verification mechanism, and accurately recording and feeding back the function registration results, the accuracy, security, and efficiency of function registration are greatly improved, which is also beneficial to the overall system stability and user experience.
[0060] In another alternative embodiment, the method further includes: When the request is for feature registration, the first update information is sent to the preset local large model adaptation module to trigger the local large model adaptation module to obtain the updated MCP feature registry through a preset internal interface, and to configure or update the MCP feature registry to the local large model; or, The local large model adaptation module periodically polls the MCP function registry, and when it determines that there are changes in the MCP function registry, it configures or updates the MCP function registry to the local large model.
[0061] In this optional embodiment, after the function registration operation is completed, the updated information can be transmitted to the local large model adaptation module immediately, enabling the local large model to quickly obtain the latest function registration information. For example, in an intelligent customer service system, when a new function for handling specific types of customer inquiries is registered, through this real-time triggering mechanism, the local large model adaptation module can immediately obtain the detailed information of the new function, including the function name, calling parameters, execution logic, etc., and quickly configure it into the local large model. In this way, when there are subsequent related customer inquiries, the local large model can accurately identify and call the newly registered function to respond, greatly improving the system's response speed and processing efficiency, and reducing processing delays caused by information lag.
[0062] In this optional embodiment, by setting a timed polling mechanism, changes to the MCP function registry can be checked periodically at preset time intervals. For example, the MCP function registry can be polled every 10 minutes. In this way, even if no function registration operation actively triggers an update, the local large model can obtain the change information of the MCP function registry in a timely manner.
[0063] As can be seen, in this optional embodiment, efficient synchronization between the local large model and the MCP functional registry is achieved through both real-time proactive update and timed polling update. Real-time proactive update improves system real-time performance and processing efficiency, while timed polling update provides reliability and flexibility. The combination of the two enhances system stability and adaptability, ensuring that the system can accurately and promptly use the latest registered functions in different scenarios.
[0064] In another optional embodiment, when the request is to disable a function, the first interface is the function disable interface; when the request is to cancel a function, the first interface is the function cancel interface. The above step 102, which executes the function deactivation operation corresponding to the requested item according to the function deactivation process, specifically includes: The deactivation information corresponding to the currently deactivated function is determined based on the interaction request; the deactivation information includes at least the name of the first function corresponding to the currently deactivated function; Based on the deactivation information, the function status of the currently deactivated function in the preset MCP function registry is adjusted to the deactivated state; and the second update information of the MCP function registry after the change is determined as the function deactivation result for the interactive request; The specific methods for performing the function cancellation operation corresponding to the requested item according to the function cancellation process include: The cancellation information corresponding to the current cancellation function is determined based on the interaction request; the cancellation information includes at least the name of the second function corresponding to the current cancellation function. The currently deregistered function is deleted from the preset MCP function registry based on the deregistration information; and the third update information of the MCP function registry after the change is determined as the function deregistration result for the interactive request.
[0065] In this optional embodiment, by setting dedicated function deactivation and deactivation interfaces, clear entry points are provided for function deactivation and deactivation operations. Furthermore, by specifying the first function name corresponding to the currently deactivated function and the second function name corresponding to the currently deactivated function, the function that needs to be deactivated / deactivated can be accurately located, avoiding accidental operation of other functions.
[0066] In this optional embodiment, deleting the current logout function from the preset MCP function registry also clears user permission settings, call records, and other data related to the current logout function by default, avoiding potential problems caused by data residue. This improves system cleanliness and data accuracy. In this optional embodiment, please refer to Figure 8 , Figure 8 This is a schematic diagram of the interface for disabling the response function corresponding to the interactive request disclosed in an embodiment of the present invention, such as... Figure 8 As shown, this allows users to trigger a logout option for a specific function on the application's management interface, such as choosing to disable or uninstall the music app, thereby triggering an interactive request corresponding to the function's disabling or logout.
[0067] In this optional embodiment, after changing the functional status of the currently disabled function based on the deactivation information and deleting the currently deregistered function from the MCP function registry based on the deregistration information, update information for the MCP function registry can be generated in a timely manner, which facilitates understanding the response progress of the function's deactivation or deregistration.
[0068] As can be seen, in this optional embodiment, dedicated interfaces are set for function deactivation and function deregistration, and accurate operation is achieved by precisely locating the function name. Function deactivation allows for flexible adjustment of the function status to ensure system stability, while function deregistration completely removes the function to optimize system resources. Both methods provide feedback on the operation results through updated information, ensuring the accuracy and maintainability of system data and improving the accuracy of function deactivation and deregistration, as well as the timeliness of operation progress feedback.
[0069] In another alternative embodiment, the method further includes: The system retrieves the MCP function registry from the preset local large model adaptation module and determines whether there are any changes to the registry information compared to the previous MCP function registry. When the judgment result is yes, the local large model adaptation module updates the MCP function registry to the local large model. If the judgment result is negative, an unmodified information for the MCP function registry and an unmodified information for the MCP function registry are generated. The unmodified information is used to indicate that no changes to the registry information of the MCP function registry and the previous MCP function registry were detected.
[0070] In this optional embodiment, the local large model adaptation module actively pulls the MCP function registry in a timely manner according to preset rules (such as timed pulling or pulling based on specific events), ensuring that the local large model can keep up with the latest function registration information as soon as possible.
[0071] In this optional embodiment, by comparing the two versions of the function registry, it is possible to accurately identify which function information has changed, such as added functions, deleted functions, or modified function parameters. The MCP function registry is only updated to the local large model when changes to registry information are detected, avoiding unnecessary update operations. For example, in a complex industrial control system, the MCP function registry may contain a large amount of function information. If the local large model is unconditionally updated every time it is retrieved, it will not only consume a lot of system resources but may also cause system instability due to data conflicts during the update process. By accurately identifying changes and updating only when necessary, system stability and resource utilization can be improved.
[0072] As can be seen, in this optional embodiment, by actively pulling the MCP function registry through the local large model adaptation module and accurately judging information changes, timely synchronization between the local large model and registry information is achieved, avoiding invalid updates, and providing feedback on unchanged information. This is beneficial to improving the granularity of monitoring and management, enhancing the adaptability and scalability of the system, and improving the overall performance and stability of the system.
[0073] Example 2 Please see Figure 2 , Figure 2 This is a flowchart illustrating another method for managing the local model context protocol function disclosed in an embodiment of the present invention. Figure 2 The described method for managing the local model context protocol function can be applied to a network attached storage device (NAT), where the NAT communicates with an electronic device that has an application installed. The electronic device accesses the NAT through the application. This embodiment of the invention is not limited to this. Figure 2 As shown, the management method for this local model context protocol function may include the following operations: 201. When an interaction request transmitted by the application through the first interface is detected, the request item of the interaction request is determined. The request item includes function registration, function deactivation, or function cancellation.
[0074] 202. Perform the function registration operation corresponding to the requested item according to the function registration process, or perform the function deactivation operation corresponding to the requested item according to the function deactivation process, or perform the function deactivation operation corresponding to the requested item according to the function deactivation process, and obtain the item response result for the requested item.
[0075] 203. Transmit the event response result back to the first interface through the second interface, so as to return the event response result to the application through the first interface.
[0076] 204. When a function call request triggered by the client is detected, the intent recognition operation is performed on the function call request according to the preset local big model to obtain the intent recognition result for the function call request.
[0077] 205. Determine the target call function that matches the intent recognition result from the function list recorded in the local large model.
[0078] In this embodiment of the invention, the local large model can be a conventional LLM large model. Then, based on the local large model, the true intent of the user or system initiating the request can be accurately determined. For details, please refer to... Figure 7 , Figure 7 This is a schematic diagram of the interface for responding to function call requests disclosed in an embodiment of the present invention; as shown below. Figure 7As shown, a user enters a natural language command in the client (such as a web dialog box or app), such as "Play the song Ningxia". The client sends this command to the local big data model, which understands the user's intent and matches a specific target function from the currently configured function list, such as the "music play" function. Alternatively, if the user issues a function call request such as "Generate a work report for this week", the local big data model can identify that the user's intent is to generate a document with a specific time range (this week) and type (work report).
[0079] In this embodiment of the invention, through this precise intent recognition, the target function to be called can be accurately determined from the function list recorded by the local large model, avoiding the situation of calling the wrong function due to the misunderstanding of intent, and greatly improving the accuracy and efficiency of function calling.
[0080] In this embodiment of the invention, by setting a function list and matching it with the intent recognition result, the range of function selection can be quickly narrowed, thereby improving the positioning efficiency and accuracy of the target function that satisfies the function call request.
[0081] 206. Generate a call request for the target function based on the local large model, and send the call request to its corresponding application endpoint.
[0082] In this embodiment of the invention, the application endpoint acts as an intermediary in the function call, undertaking the tasks of parsing and forwarding. It can accurately interpret the information in the call request and determine the specific execution location of the target function. The call request can be an HTTP request and carries parameters related to the target function.
[0083] 207. The application endpoint parses the call request to obtain the parsing result for the call request. The parsing result includes at least the execution endpoint where the target call function is located. The call request is then forwarded to the execution endpoint to trigger the execution endpoint to call the target call function according to the call request.
[0084] 208. The application endpoint receives the function execution result of the execution endpoint in response to the call request, and returns the function execution result to the local large model; the function execution result received by the local large model is determined as the function call result of the function call request.
[0085] 209. Return the function call result to the client.
[0086] For further descriptions of steps 201-203 and 209 in this embodiment of the invention, please refer to the other specific descriptions of steps 101-103 and 105 in Embodiment 1. These descriptions will not be repeated in this embodiment of the invention.
[0087] It is evident that implementation Figure 2The described method for managing local model context protocol functions uses a large local model to identify intents and accurately locate requirements, then intelligently matches the function list, improving the accuracy of requirement parsing for function call requests and the accuracy of determining the target function to be called for each request. It also standardizes the generation and sending of call requests, which are then parsed and forwarded by the application endpoint, finally receiving and returning the complete execution results. This refined function call response process improves the accuracy and efficiency of function calls.
[0088] In an optional embodiment, the application endpoint is a client, or a function call service pre-defined by the network attached storage device; The result of the function execution is used to indicate at least whether the execution of the endpoint call to the target function was successful, or to indicate whether the execution of the endpoint call to the target function failed. The methods for returning the function call result to the client as described above specifically include: Based on the local large model, the function call result is transformed into information in the form of natural language to obtain the output information for the function call result, and the output information is displayed on the corresponding display interface on the client.
[0089] In this optional embodiment, setting the client as the application endpoint considers the directness and convenience of user interaction with the system, allowing function call requests to be initiated directly from the user's operating terminal, reducing intermediate steps and improving the response speed of function calls. Optionally, if the function call service preset by the network attached storage device (NAS) is selected as the application endpoint, the response efficiency and stability of function call requests can be improved based on the data storage and processing capabilities of the NAS device.
[0090] As can be seen, in this optional embodiment, by setting up diverse application endpoints (client or NAS device function call service), the system's response flexibility to different call requests is enhanced; and the reliability of system operation is ensured by clear function execution result indication; furthermore, the function call results can be converted into natural language and displayed on the client interface using a local large model, which improves the user's ease of viewing function call results and enhances the user experience.
[0091] Example 3 Please see Figure 3 , Figure 3 This is a schematic diagram of the structure of a local model context protocol (MMCP) function management system disclosed in an embodiment of the present invention. The MCP function management system can be applied to a network attached storage device (NETS), and the NETS communicates with an electronic device that has an application installed. The electronic device accesses the NETS through the application. This embodiment of the present invention does not impose limitations. Figure 3As shown, the management system for this local model context protocol function may include a determination module 301, an event response module 302, a transmission module 303, and a function call response module 304, wherein: The determination module 301 is used to determine the request items of the interaction request when an interaction request transmitted by the application through the first interface is detected. The request items include function registration, function deactivation or function cancellation.
[0092] The event response module 302 is used to perform the function registration operation corresponding to the requested event according to the function registration process, or to perform the function deactivation operation corresponding to the requested event according to the function deactivation process, or to perform the function deactivation operation corresponding to the requested event according to the function deactivation process, so as to obtain the event response result for the requested event.
[0093] The transmission module 303 is used to transmit the event response result back to the first interface through the second interface, so as to return the event response result to the application through the first interface; wherein, the event response result includes the function registration result for function registration, or the function deactivation result for function deactivation, or the function deregistration result for function cancellation.
[0094] The function call response module 304 is used to perform intent recognition operation, function matching operation against the preset function list, function call operation against the application endpoint, and call result receiving operation respectively on the function call request according to the preset local large model when a function call request triggered by the client is detected, so as to obtain the function call result for the function call request; wherein, the preset function list is provided to the local large model through the network attached storage device.
[0095] The transmission module 303 is also used to return the function call result to the client.
[0096] It is evident that implementation Figure 3 The described local model context protocol (MTP) function management system centrally manages the local model context protocol function through a network-attached storage device, enabling flexible and convenient operation of function registration, deactivation, and deregistration. This avoids data leakage issues associated with data migration to the cloud and reduces network latency added by cloud migration, improving the response speed for function registration, deactivation, and deregistration. Furthermore, it can achieve accurate and efficient function invocation by leveraging a large local model. At the same time, the overall system stability and reliability are enhanced through centralized management and the use of local models.
[0097] In an optional embodiment, when the request is for function registration, the interaction request includes at least the application ID corresponding to the application, the function name corresponding to the function to be registered, the function description, and the target parameters corresponding to the call parameter list, execution endpoint, and authentication information; and the first interface is a function registration interface or a standard API library interface. The specific methods by which the event response module 302 performs the function registration operation corresponding to the requested event according to the function registration process include: Perform parameter validation operations on all target parameters included in the interaction request to obtain the parameter validation results for all target parameters; When the parameter verification result indicates that the verification is successful, the target parameters and the enabled status of the function to be registered are updated in the preset MCP function registry. The first update information corresponding to the MCP function registry is determined as the function registration result for the interactive request.
[0098] As can be seen, in this optional embodiment, by clearly defining the comprehensive and standardized information required for function registration, providing flexible and diverse interface options, implementing a rigorous parameter verification mechanism, and accurately recording and feeding back the function registration results, the accuracy, security, and efficiency of function registration are greatly improved, which is also beneficial to the overall system stability and user experience.
[0099] In another alternative embodiment, please refer to Figure 4 , Figure 4 This is a schematic diagram of the structure of another local model context protocol function management system disclosed in an embodiment of the present invention. Figure 4 As shown, the system also includes a notification module 305, wherein: The notification module 305 is used to send the first update information to the preset local large model adaptation module when the requested item is function registration, so as to trigger the local large model adaptation module to obtain the updated MCP function registry through the preset internal interface, and configure or update the MCP function registry to the local large model; or, the local large model adaptation module periodically polls the MCP function registry, and when it determines that there are information changes in the MCP function registry, it configures or updates the MCP function registry to the local large model.
[0100] As can be seen, in this optional embodiment, efficient synchronization between the local large model and the MCP functional registry is achieved through both real-time proactive update and timed polling update. Real-time proactive update improves system real-time performance and processing efficiency, while timed polling update provides reliability and flexibility. The combination of the two enhances system stability and adaptability, ensuring that the system can accurately and promptly use the latest registered functions in different scenarios.
[0101] In another optional embodiment, when the request is to disable a function, the first interface is the function disable interface; when the request is to cancel a function, the first interface is the function cancel interface. The specific methods by which the event response module 302 executes the function deactivation operation corresponding to the requested event according to the function deactivation process include: The deactivation information corresponding to the currently deactivated function is determined based on the interaction request; the deactivation information includes at least the name of the first function corresponding to the currently deactivated function; Based on the deactivation information, the function status of the currently deactivated function in the preset MCP function registry is adjusted to the deactivated state; and the second update information of the MCP function registry after the change is determined as the function deactivation result for the interactive request; The specific methods by which the event response module 302 performs the function cancellation operation corresponding to the requested event according to the function cancellation process include: The cancellation information corresponding to the current cancellation function is determined based on the interaction request; the cancellation information includes at least the name of the second function corresponding to the current cancellation function. The currently deregistered function is deleted from the preset MCP function registry based on the deregistration information; and the third update information of the MCP function registry after the change is determined as the function deregistration result for the interactive request.
[0102] As can be seen, in this optional embodiment, dedicated interfaces are set for function deactivation and function deregistration, and accurate operation is achieved by precisely locating the function name. Function deactivation allows for flexible adjustment of the function status to ensure system stability, while function deregistration completely removes the function to optimize system resources. Both methods provide feedback on the operation results through updated information, ensuring the accuracy and maintainability of system data and improving the accuracy of function deactivation and deregistration, as well as the timeliness of operation progress feedback.
[0103] In another alternative embodiment, such as Figure 4 As shown, the system also includes: The update module 306 is used to pull the MCP function registry from the preset local large model adaptation module and determine whether there are any changes in the registry information of the MCP function registry compared to its corresponding previous MCP function registry. The update module 306 is also used to update the MCP function registry to the local large model when the judgment result is yes; The update module 306 is also used to generate an unmodified information for the MCP function registry and an MCP function registry when the judgment result is negative. The unmodified information is used to indicate that no changes to the registry information of the MCP function registry and the previous MCP function registry were detected.
[0104] As can be seen, in this optional embodiment, by actively pulling the MCP function registry through the local large model adaptation module and accurately judging information changes, timely synchronization between the local large model and registry information is achieved, avoiding invalid updates, and providing feedback on unchanged information. This is beneficial to improving the granularity of monitoring and management, enhancing the adaptability and scalability of the system, and improving the overall performance and stability of the system.
[0105] In another optional embodiment, the function call response module 304 performs an intent recognition operation, a function matching operation against a preset function list, a function call operation against the application endpoint, and a call result receiving operation on the function call request according to a preset local large model. The specific methods for obtaining the function call result for the function call request include: The intent recognition operation is performed on the function call request according to the preset local big model to obtain the intent recognition result for the function call request; and the target call function that matches the intent recognition result is determined from the function list recorded by the local big model. Generate a call request for the target function based on the local large model, and send the call request to its corresponding application endpoint; The application endpoint parses the call request to obtain the parsing result for the call request. The parsing result includes at least the execution endpoint where the target call function is located. The call request is then forwarded to the execution endpoint to trigger the execution endpoint to call the target call function according to the call request. The application endpoint receives the function execution result of the execution endpoint in response to the call request, and returns the function execution result as the local large model; the function execution result received by the local large model is determined as the function call result of the function call request.
[0106] As can be seen, in this optional embodiment, intent recognition and precise demand location are achieved through a local large-scale model, followed by intelligent matching of the function list. This improves the accuracy of demand parsing for function call requests and the accuracy of determining the target function to be called for each request. Furthermore, it standardizes the generation and sending of call requests, which are then parsed and forwarded by the application endpoint, ultimately receiving and returning the complete execution result. This refined function call response process improves the accuracy and efficiency of function calls.
[0107] In another alternative embodiment, the application endpoint is a client, or a function call service pre-defined by the network attached storage device; The result of the function execution is used to indicate at least whether the execution of the endpoint call to the target function was successful, or to indicate whether the execution of the endpoint call to the target function failed. The transmission module 303 returns the function call result to the client in the following ways: Based on the local large model, the function call result is transformed into information in the form of natural language to obtain the output information for the function call result, and the output information is displayed on the corresponding display interface on the client.
[0108] As can be seen, in this optional embodiment, by setting up diverse application endpoints (client or NAS device function call service), the system's response flexibility to different call requests is enhanced; and the reliability of system operation is ensured by clear function execution result indication; furthermore, the function call results can be converted into natural language and displayed on the client interface using a local large model, which improves the user's ease of viewing function call results and enhances the user experience.
[0109] Example 4 Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of a network-attached storage device disclosed in an embodiment of the present invention. Figure 5 As shown, the network attached storage device is communicatively connected to an electronic device, which has an application installed; the electronic device accesses the network attached storage device through the application. The network-attached storage device integrates a management system for the local model context protocol function as described in Embodiment 3 of this aspect, and is used to perform some or all of the steps in any of the management methods for the local model context protocol function described in Embodiment 1 or Embodiment 2 of this invention.
[0110] Example 5 This invention discloses a control device for a local model context protocol function. The device includes a network attached storage device as described in Embodiment 4 of this invention. The device performs request-response operations on interactive requests triggered by the network attached storage device according to any one of the control methods for the local model context protocol function as described in Embodiment 1 or Embodiment 2 of this invention.
[0111] The system and device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0112] Through the detailed description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, including read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-Erasable Programmable Read-Only Memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0113] Finally, it should be noted that the above embodiments are merely preferred embodiments of the present invention and are only used to illustrate the technical solutions of the present invention, not to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for managing the local model context protocol function, characterized in that, The method is applied to a network attached storage device (NET), and the NET is communicatively connected to an electronic device with an application installed. The electronic device accesses the NET through the application. The method includes: When an interaction request transmitted by the application through the first interface is detected, the request item of the interaction request is determined, and the request item includes function registration, function deactivation or function cancellation; The system performs a function registration operation corresponding to the requested item according to the function registration process, or a function deactivation operation corresponding to the requested item according to the function deactivation process, or a function deregistration operation corresponding to the requested item according to the function deregistration process, to obtain a response result for the requested item. The response result is then transmitted back to the first interface through the second interface, so that the response result can be returned to the application through the first interface. The response result includes a function registration result for the function registration, a function deactivation result for the function deactivation, or a function deregistration result for the function deregistration. When a function call request triggered by a client is detected, the system performs an intent recognition operation, a function matching operation against a preset function list, a function call operation against an application endpoint, and a call result receiving operation on the function call request according to a preset local large model, to obtain the function call result for the function call request, and returns the function call result to the client; wherein, the preset function list is provided to the local large model through the network attached storage device.
2. The method for managing the local model context protocol function according to claim 1, characterized in that, When the requested item is the function registration, the interaction request includes at least the application ID corresponding to the application, the function name corresponding to the function to be registered, the function description, and the target parameters corresponding to the call parameter list, execution endpoint, and authentication information; and the first interface is a function registration interface or a standard API library interface. The step of performing the function registration operation corresponding to the requested item according to the function registration process includes: Perform parameter validation operations on all the target parameters included in the interaction request to obtain parameter validation results for all the target parameters; When the parameter verification result indicates that the verification is successful, the target parameter and the enabled status of the function to be registered are updated in the preset MCP function registry. The first update information corresponding to the MCP function registry is determined as the function registration result for the interaction request.
3. The method for managing the local model context protocol function according to claim 2, characterized in that, The method further includes: When the requested item is the function registration, the first update information is sent to a preset local large model adaptation module to trigger the local large model adaptation module to obtain the updated MCP function registry through a preset internal interface, and to configure or update the MCP function registry to the local large model; or, The local large model adaptation module periodically polls the MCP function registry, and when it determines that there are information changes in the MCP function registry, it configures or updates the MCP function registry to the local large model.
4. The method for managing the local model context protocol function according to any one of claims 1-3, characterized in that, When the requested item is to disable the function, the first interface is the function disable interface; when the requested item is to cancel the function, the first interface is the function cancel interface. The step of performing the function deactivation operation corresponding to the requested item according to the function deactivation procedure includes: The deactivation information corresponding to the currently deactivated function is determined based on the interaction request; the deactivation information includes at least the name of the first function corresponding to the currently deactivated function; Based on the deactivation information, the function status of the currently deactivated function in the preset MCP function registry is adjusted to the deactivated state; and the second update information of the changed MCP function registry is determined as the function deactivation result for the interaction request; The step of performing the function cancellation operation corresponding to the requested item according to the function cancellation process includes: The cancellation information corresponding to the current cancellation function is determined based on the interaction request; the cancellation information includes at least the name of the second function corresponding to the current cancellation function. The currently deregistered function is deleted from the preset MCP function registry based on the deregistration information; and the third update information of the MCP function registry after the change is determined as the function deregistration result for the interaction request.
5. The method for managing the local model context protocol function according to claim 4, characterized in that, The method further includes: The preset local large model adaptation module pulls the MCP function registry and determines whether there are any changes in registry information between the MCP function registry and its corresponding previous MCP function registry. When the judgment result is yes, the local large model adaptation module updates the MCP function registry to the local large model. When the judgment result is negative, unmodified information is generated for the MCP function registry and the previous MCP function registry. The unmodified information is used to indicate that no registry information changes were detected between the MCP function registry and the previous MCP function registry.
6. The method for managing the local model context protocol function according to claim 1, 2, 3, or 5, characterized in that, The process of performing intent recognition, function matching against a preset function list, function invocation against the application endpoint, and invocation result reception on the function invocation request according to a preset local large model, to obtain the function invocation result for the function invocation request, includes: The intent recognition operation is performed on the function call request according to the preset local big model to obtain the intent recognition result for the function call request; and the target call function matching the intent recognition result is determined from the function list recorded by the local big model. Generate a call request for the target function based on the local large model, and send the call request to its corresponding application endpoint; The application endpoint parses the call request to obtain a parsing result for the call request, the parsing result including at least the execution endpoint where the target call function is located; and forwards the call request to the execution endpoint to trigger the execution endpoint to call the target call function according to the call request; The application endpoint receives the function execution result of the execution endpoint in response to the call request, and returns the function execution result to the local large model; the function execution result received by the local large model is determined as the function call result of the function call request.
7. The method for managing the local model context protocol function according to claim 6, characterized in that, The application endpoint is the client, or the function call service preset by the network attached storage device; The execution result of the function is used at least to indicate that the execution endpoint successfully called the target function, or to indicate that the execution endpoint failed to call the target function. Returning the function call result to the client includes: Based on the local large model, the function call result is converted into information in the form of natural language to obtain output information for the function call result, and the output information is displayed on the corresponding display interface of the client.
8. A management and control system for a local model context protocol function, characterized in that, The system is applied to a network attached storage device (NET), and the NET is communicatively connected to an electronic device with an application installed. The electronic device accesses the NET through the application. The system includes: The determining module is used to determine the request items of the interaction request when the application transmits an interaction request through the first interface. The request items include function registration, function deactivation, or function cancellation. The item response module is used to perform a function registration operation corresponding to the requested item according to the function registration process, or to perform a function deactivation operation corresponding to the requested item according to the function deactivation process, or to perform a function deactivation operation corresponding to the requested item according to the function deactivation process, so as to obtain an item response result for the requested item; A transmission module is used to transmit the event response result back to the first interface through the second interface, so as to return the event response result to the application through the first interface; wherein, the event response result includes a function registration result for the function registration, or a function deactivation result for the function deactivation, or a function deregistration result for the function cancellation; The function call response module is used to, when a function call request triggered by a client is detected, perform an intent recognition operation, a function matching operation against a preset function list, a function call operation against an application endpoint, and a call result receiving operation on the function call request according to a preset local large model, so as to obtain a function call result for the function call request; wherein, the preset function list is provided to the local large model through the network attached storage device; The transmission module is also used to return the function call result to the client.
9. A network-attached storage device, characterized in that, The network attached storage device is communicatively connected to an electronic device, which has an application installed thereon; the electronic device accesses the network attached storage device through the application. The network-attached storage device integrates a management system for the local model context protocol function as described in claim 8, and is used to execute the management method for the local model context protocol function as described in any one of claims 1-7.
10. A control device for a local model context protocol function, characterized in that, The apparatus includes the network attached storage device as described in claim 9; the apparatus performs request-response operations on interactive requests triggered by the network attached storage device in accordance with the management method of the local model context protocol function as described in any one of claims 1-7.