Sensitive data management method and device, storage medium and electronic device

By encapsulating sensitive data into target mapping objects and storing them in an isolated area, and combining this with the processing of non-sensitive data using a large model, the problem of sensitive data leakage during large model calls is solved, achieving both security isolation and performance improvement.

CN121808803APending Publication Date: 2026-04-07QINGDAO HAIER TECH +2
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-04
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

In existing technologies, sensitive data cannot be effectively isolated when large models make MCP calls, which leads to the risk of sensitive data leakage.

Method used

Sensitive data in the target request is encapsulated into a target mapping object and stored in the sensitive data storage area of ​​the client instance, preventing the large model from reading it; when the target tool needs to be called, the first call parameter is determined according to the mapping object, and the non-sensitive data is processed by the large model to generate the second call parameter, thus achieving physical and logical isolation between sensitive data and the large model.

Benefits of technology

Effectively isolate sensitive data to prevent leakage, improve model generation speed, and maintain development efficiency and cost advantages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121808803A_ABST
    Figure CN121808803A_ABST
Patent Text Reader

Abstract

The invention discloses a sensitive data management method and device, a storage medium and an electronic device, and relates to the technical field of smart home, and the method comprises the steps: packaging target sensitive data in a target request into a target mapping object, and storing the target mapping object to a target sensitive data storage area in a client instance, data stored in the sensitive data storage area is forbidden to be read by the large model; under the condition that it is determined that the target tool needs to be called, determining a first calling parameter needed for calling the target tool according to a target mapping object obtained from the sensitive data storage area, and converting the non-sensitive data into a second calling parameter needed for calling the target tool through a large model; and calling the target tool according to the first calling parameter and the second calling parameter. By means of the method and device, the problem that in the related technology, when MCP calling is conducted on a large model, sensitive data cannot be effectively isolated, and consequently the sensitive data has the leakage risk can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of smart home technology, and more specifically, to a sensitive data management method and apparatus, storage medium and electronic device. Background Technology

[0002] Current Artificial Intelligence (AI) agent systems generally employ large models as the core processing unit, interacting with external services through a unified Model Call Protocol (MCP). MCP, through standardized interface specifications, has significantly improved development efficiency and reduced costs, supporting independent development, testing, and deployment of modules such as data processing and model inference. However, in these technologies, MCP parameters are directly generated from the large model, and these parameters contain sensitive information (e.g., user information, device identifiers, tokens). Entrusting this sensitive information to public network models would lead to serious information leakage; even using a self-deployed model results in a significant decrease in generation speed due to the large parameter volume (token inflation), leading to technical problems such as interaction delays and degraded user experience. Current technical solutions lack the ability to securely isolate sensitive information outside the model generation chain, ensuring controlled transmission only when calling external services, thus balancing system security and performance.

[0003] Therefore, in related technologies, when large models make MCP calls, there is a problem that sensitive data cannot be effectively isolated, leading to the risk of sensitive data leakage.

[0004] There is no effective solution yet to address the issue that sensitive data may be leaked when MCP is called on large models in related technologies due to the inability to effectively isolate sensitive data. Summary of the Invention

[0005] This application provides a sensitive data management method and apparatus, storage medium and electronic device to at least solve the problem in related technologies where sensitive data cannot be effectively isolated when making MCP calls in large models, leading to the risk of sensitive data leakage.

[0006] According to one embodiment of this application, a sensitive data management method is provided, comprising: encapsulating target sensitive data in a target request into a target mapping object, and storing the target mapping object in a sensitive data storage area in a client instance, wherein the target request includes: the target sensitive data and non-sensitive data, and the data stored in the sensitive data storage area is prohibited from being read by a large model; when it is determined through the target request that a target tool needs to be invoked, determining a first invocation parameter required to invoke the target tool based on the target mapping object obtained from the sensitive data storage area, and converting the non-sensitive data into a second invocation parameter required to invoke the target tool through a large model; and invoking the target tool according to the first invocation parameter and the second invocation parameter.

[0007] In one exemplary embodiment, encapsulating target sensitive data in a target request into a target mapping object includes: determining whether encryption of the target sensitive data is permitted; if encryption of the target sensitive data is permitted, determining a target encryption algorithm corresponding to the target sensitive data and generating a key corresponding to the target encryption algorithm, wherein the target encryption algorithm includes at least one of the following: a symmetric encryption algorithm and an asymmetric encryption algorithm; encrypting the target sensitive data based on the target encryption algorithm and the key, and encapsulating the encrypted target sensitive data into the target mapping object; if encryption of the target sensitive data is not permitted, encapsulating the target sensitive data into the target mapping object.

[0008] In an exemplary embodiment, when it is determined through the target request that a target tool needs to be invoked, determining the first invocation parameter required to invoke the target tool based on the target mapping object obtained from the sensitive data storage area includes: reading the target mapping object in the sensitive data storage area and creating a sensitive parameter container; determining the data type corresponding to each data position contained in the sensitive parameter container; determining the association relationship between each data position in the sensitive parameter container and each sensitive data corresponding to the target mapping object based on the data type, wherein the target sensitive data includes: multiple types of sensitive data; each type of sensitive data includes one or more sensitive data; and concatenating each sensitive parameter into the sensitive parameter container based on the association relationship to generate the first invocation parameter.

[0009] In one exemplary embodiment, converting the non-sensitive data into a second invocation parameter required to invoke the target tool via a large model includes: sending the non-sensitive data to the large model so that the large model parses the non-sensitive data to determine the request intent corresponding to the target request; instructing the large model to generate a third invocation parameter based on the parsed non-sensitive data; instructing the large model to convert the parameter format corresponding to the third invocation parameter into a parameter format supported by the target tool, and determining the format-converted third invocation parameter as the second invocation parameter.

[0010] In one exemplary embodiment, invoking the target tool according to the first invocation parameter and the second invocation parameter includes: creating a target parameter container and adding the first invocation parameter and the second invocation parameter to the target parameter container respectively to generate target parameters in the target parameter container; and sending the target parameters to the server corresponding to the target tool through an encryption protocol to invoke the target tool.

[0011] In one exemplary embodiment, encapsulating target sensitive data in a target request into a target mapping object includes: determining the field name corresponding to the target sensitive data as a key and determining the field value corresponding to the target sensitive data as a value; and encapsulating the key and the value in the form of a key-value pair into the target mapping object.

[0012] In an exemplary embodiment, after invoking the target tool according to the first invocation parameter and the second invocation parameter, the method further includes: determining the request type corresponding to the target request; if the request type is determined to be a query request, instructing the large model to obtain the query result corresponding to the query request based on the target tool; if the request type is determined to be a control request, instructing the large model to determine a control signal according to the control request, and sending the control signal to the target device corresponding to the control request based on the target tool.

[0013] According to another embodiment of the present application, a sensitive data management device is also provided, comprising: an encapsulation module, configured to encapsulate target sensitive data in a target request into a target mapping object, and store the target mapping object in a sensitive data storage area in a client instance, wherein the target request includes: the target sensitive data and non-sensitive data, and the data stored in the sensitive data storage area is prohibited from being read by a large model; a determination module, configured to, when it is determined that a target tool needs to be called, determine a first calling parameter required to call the target tool based on the target mapping object obtained from the sensitive data storage area, and convert the non-sensitive data into a second calling parameter required to call the target tool through a large model; and a calling module, configured to call the target tool according to the first calling parameter and the second calling parameter.

[0014] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, and the computer program is configured to execute the above-described sensitive data management method at runtime.

[0015] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above-described sensitive data management method through the computer program.

[0016] According to another aspect of the embodiments of this application, a computer program product is also provided, including a computer program, wherein the computer program is executed by a processor using the above-described sensitive data management method.

[0017] In this embodiment, the target sensitive data in the target request is encapsulated into a target mapping object, and the target mapping object is stored in the sensitive data storage area of ​​the client instance. Data stored in the sensitive data storage area is prohibited from being read by the large model. When it is determined that a target tool needs to be invoked, the first invocation parameter required to invoke the target tool is determined based on the target mapping object obtained from the sensitive data storage area. Furthermore, the non-sensitive data is converted into a second invocation parameter required to invoke the target tool through the large model. The target tool is then invoked based on the first and second invocation parameters. In other words, this application encapsulates the target sensitive data into a target mapping object and stores it in a structured manner in the sensitive data storage area. When a target tool needs to be invoked, the first invocation parameter is determined based on the target invocation object in the sensitive data storage area. Consequently, the large model processing chain only processes non-sensitive data, converting it into the second invocation parameter, while prohibiting the large model from processing sensitive data, thus physically and logically isolating the large model processing chain from the sensitive data. This application solves the problem in related technologies where sensitive data cannot be effectively isolated during MCP invocation in the large model, leading to the risk of sensitive data leakage. Therefore, it effectively isolates sensitive data to prevent leakage. Attached Figure Description

[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a schematic diagram of the hardware environment for a sensitive data management method according to an embodiment of this application;

[0021] Figure 2 This is a flowchart of a sensitive data management method according to an embodiment of this application;

[0022] Figure 3 This is a structural block diagram of a sensitive data management device according to an embodiment of this application. Detailed Implementation

[0023] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0024] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0025] According to one aspect of the embodiments of this application, a sensitive data management method is provided. This sensitive data management method is widely used in whole-house intelligent digital control application scenarios such as smart homes, smart home device ecosystems, and intelligence house ecosystems. Optionally, Figure 1 This is a schematic diagram of the hardware environment for a sensitive data management method according to an embodiment of this application. In this embodiment, the above-mentioned sensitive data management method can be applied to a computer device, and the computer device can be applied to, for example... Figure 1 The hardware environment shown consists of home appliance 102 and server 104. Figure 1 As shown, server 104 is connected to home appliance 102 via a network and can be used to provide services (such as application services) to nodes or clients installed on nodes. A database can be set up on the server or independently to provide data storage services for server 104. Cloud computing and / or edge computing services can be configured on the server or independently to provide data processing services for server 104.

[0026] The aforementioned networks may include, but are not limited to, at least one of the following: wired network, wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network (WAN), metropolitan area network (MAN), local area network (LAN). The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity), Bluetooth. Home appliances 102 may not be limited to smart air conditioners, smart range hoods, smart refrigerators, smart ovens, smart stoves, smart washing machines, smart water heaters, smart washing equipment, smart dishwashers, smart projectors, smart TVs, smart clothes racks, smart curtains, smart audio-visual equipment, smart sockets, smart speakers, smart speakers, smart fresh air systems, smart kitchen and bathroom equipment, smart bathroom fixtures, smart robot vacuum cleaners, smart window cleaning robots, smart mopping robots, smart air purifiers, smart steam ovens, smart microwave ovens, smart water heaters, smart air purifiers, smart water dispensers, smart door locks, etc.

[0027] This embodiment provides a sensitive data management method, applied to the aforementioned computer device. Figure 2 This is a flowchart of a sensitive data management method according to an embodiment of this application, which includes the following steps:

[0028] Step S202: Encapsulate the target sensitive data in the target request into a target mapping object, and store the target mapping object in the sensitive data storage area of ​​the client instance. The target request includes the target sensitive data and non-sensitive data. The data stored in the sensitive data storage area is prohibited from being read by the large model.

[0029] The target sensitive data includes at least one of the following: the target object's identity information, device information, and access token.

[0030] The non-sensitive data refers to business instructions, business data, and business parameters used in the business processing of the target request. The non-sensitive parameters include at least one of the following: business instructions, non-privacy data of the target object, and public data. The public data includes at least one of the following: weather data and news data.

[0031] The sensitive data storage area is a storage area set up within the system for sensitive information (such as user identity, device identifier, access token, etc.), and it can be located in the defaultToolContext (default tool call context).

[0032] Step S204: If it is determined that the target tool needs to be invoked, the first invocation parameter required to invoke the target tool is determined based on the target mapping object obtained from the sensitive data storage area, and the non-sensitive data is converted into the second invocation parameter required to invoke the target tool through the large model;

[0033] Step S206: Invoke the target tool according to the first invocation parameter and the second invocation parameter.

[0034] Through the above steps, the target sensitive data in the target request is encapsulated into a target mapping object, and the target mapping object is stored in the sensitive data storage area of ​​the client instance. Data stored in the sensitive data storage area is prohibited from being read by the large model. When it is determined that a target tool needs to be called, the first call parameter required to call the target tool is determined based on the target mapping object obtained from the sensitive data storage area. Furthermore, the non-sensitive data is converted into a second call parameter required to call the target tool through the large model. The target tool is then called based on the first and second call parameters. In other words, this application encapsulates the target sensitive data into a target mapping object and stores it in a structured manner in the sensitive data storage area. When a target tool needs to be called, the first call parameter is determined based on the target call object in the sensitive data storage area. Therefore, the large model processing chain only processes non-sensitive data, converting it into the second call parameter, while prohibiting the large model from processing sensitive data, thus physically and logically isolating the large model processing chain from the sensitive data. This application solves the problem in related technologies where sensitive data cannot be effectively isolated during MCP calls in the large model, leading to the risk of sensitive data leakage. It effectively isolates sensitive data to prevent leakage.

[0035] Optionally, step S202 above, which encapsulates the target sensitive data in the target request into a target mapping object, includes: determining whether encryption of the target sensitive data is allowed; if encryption of the target sensitive data is allowed, determining the target encryption algorithm corresponding to the target sensitive data and generating a key corresponding to the target encryption algorithm, wherein the target encryption algorithm includes at least one of the following: a symmetric encryption algorithm and an asymmetric encryption algorithm; encrypting the target sensitive data based on the target encryption algorithm and the key, and encapsulating the encrypted target sensitive data into the target mapping object; if encryption of the target sensitive data is not allowed, encapsulating the target sensitive data into the target mapping object.

[0036] Understandably, it's possible to dynamically assess whether sensitive target data needs encryption, select an appropriate encryption algorithm based on the assessment results, and ultimately securely encapsulate and transmit the sensitive target data. Specifically:

[0037] Assess the necessity of encrypting sensitive target data in the current environment. For example, if an agent is calling an external API on the public internet to obtain weather information and needs to transmit the user's location data, encryption should be enabled in this scenario because the location is sensitive and may be exposed to an untrusted network environment. Once the decision is made to encrypt sensitive target data, a suitable encryption algorithm needs to be selected. Encryption algorithms can be symmetric encryption (such as Advanced Encryption Standard (AES), used in scenarios where both parties share a key) or asymmetric encryption (such as public-key encryption algorithms (Rivest-Shamir-Adleman, or RSA), suitable for situations where a shared key is not required). For example, for device control commands, considering the frequency and real-time nature of the commands, the high-performance AES algorithm, suitable for large amounts of data, can be selected, and a key can be automatically generated for encryption and decryption.

[0038] After encryption, the sensitive target data is converted into ciphertext and further encapsulated in a UserContextMap object (i.e., the target mapping object). For example, a user's access token, originally in plaintext, is encrypted using the AES algorithm and then stored in the UserContextMap along with other non-sensitive data, waiting to be passed through when an external service makes a call.

[0039] If the evaluation results show that encryption is not required, sensitive data (such as device type or software version, which are relatively less sensitive information) can be directly encapsulated into UserContextMap, omitting the encryption process, simplifying the data processing flow, and improving system efficiency.

[0040] Optionally, step S202 above, which encapsulates the target sensitive data in the target request into a target mapping object, further includes: determining the field name corresponding to the target sensitive data as a key and determining the field value corresponding to the target sensitive data as a value; and encapsulating the key and the value in the form of a key-value pair into the target mapping object.

[0041] Understandably, when processing sensitive target data, it's necessary to encapsulate it into a target mapping object (such as UserContextMap). Specifically, upon receiving a user request, the system automatically identifies which data fields are sensitive. For example, from the user request, "user_id", "device_token", and "access_token" can be identified as sensitive field names. These field names will serve as keys in the mapping object. The system then retrieves the actual values ​​corresponding to these field names. For instance, the value of "user_id" might be "123456", the value of "device_token" might be "0x1A2B3C4D5E", and the value of "access_token" might be a long string, such as "eyJhbGciOiJIUzI1NiIsInR5cCI6…". These specific values ​​will serve as values ​​in the mapping object; thus, the aforementioned key-value pairs are encapsulated into the target mapping object.

[0042] Optionally, step S204 above, when it is determined through the target request that a target tool needs to be invoked, determines the first invocation parameter required to invoke the target tool based on the target mapping object obtained from the sensitive data storage area, including: reading the target mapping object in the sensitive data storage area and creating a sensitive parameter container; determining the data type corresponding to each data position contained in the sensitive parameter container; determining the association relationship between each data position in the sensitive parameter container and each sensitive data corresponding to the target mapping object based on the data type, wherein the target sensitive data includes: multiple types of sensitive data; each type of sensitive data includes one or more sensitive data; and concatenating each sensitive parameter into the sensitive parameter container based on the association relationship to generate the first invocation parameter.

[0043] Understandably, it is necessary to ensure that the target mapping object corresponding to the target sensitive data is safely and correctly converted into the first call parameter. Specifically:

[0044] When the intelligent agent system needs to invoke a target tool, it reads the target mapping object from the sensitive data storage area. The target mapping object can be a UserContextMap. Subsequently, a sensitive parameter container is created based on the target mapping object. The sensitive parameter container can be a Map structure used to carry sensitive data when invoking the target tool.

[0045] Identify the data type corresponding to each data location in the UserContextMap (for example, user_id might be a string, device_token is also a string, and access_token follows the same rule). Then, establish the association between each data location in the sensitive parameter container and the sensitive data in the UserContextMap.

[0046] For example, if the target tool needs to receive user_id and access_token in JSON format, but not device_token, then create a sensitive parameter container that only contains the first two items and ensure that the data types match.

[0047] Based on the association relationships, relevant sensitive data from the UserContextMap is concatenated into a sensitive parameter container to form the first set of call parameters. This parameter set contains all the sensitive information required for the target tool to be invoked.

[0048] Optionally, step S204 above, which converts the non-sensitive data into a second invocation parameter required to invoke the target tool through a large model, includes: sending the non-sensitive data to the large model so that the large model parses the non-sensitive data to determine the request intent corresponding to the target request; instructing the large model to generate a third invocation parameter based on the parsed non-sensitive data; instructing the large model to convert the parameter format corresponding to the third invocation parameter into a parameter format supported by the target tool, and determining the format-converted third invocation parameter as the second invocation parameter.

[0049] Understandably, the large model does not directly access sensitive data, but only receives non-sensitive data, processes it, and generates the second calling parameter. Specifically:

[0050] Upon receiving the target request, the non-sensitive data in the request is sent to the large model for parsing. Non-sensitive data may include the user's natural language input, business instructions, or publicly available query parameters, such as instructions like "check the weather in Beijing" or "open a music player."

[0051] Taking a weather query as an example, non-sensitive data might be: "What will the weather be like in Beijing tomorrow?" After receiving this non-sensitive data, the big model analyzes the intent, namely "query the weather", and extracts key parameters, such as the city name (Beijing) and the query time (tomorrow).

[0052] After parsing the non-sensitive data, the large model generates a third invocation parameter based on the intent of the non-sensitive data. The third invocation parameter is generated by the large model based on the business logic and requirements it understands based on the target request, and is used to invoke the target tool (e.g., weather query application programming interface (API), music player control interface, etc.).

[0053] For example, the third call parameter might be a Map containing a structure like {"command": "GET_WEATHER", "location": "Beijing", "date": "2023-04-02"}, where GET_WEATHER is the business instruction, and location and date are the specific query parameters.

[0054] The generated third invocation parameter may not match the parameter format of the target tool (i.e., the MCP service). For example, a large model may generate parameters in JSON format, while the MCP service requires XML format. Therefore, the large model needs to be instructed to convert the third invocation parameter to a format supported by the MCP service; the converted third invocation parameter becomes the second invocation parameter.

[0055] Optionally, step S206 above, which calls the target tool according to the first call parameter and the second call parameter, includes: creating a target parameter container and adding the first call parameter and the second call parameter to the target parameter container respectively to generate target parameters in the target parameter container; and sending the target parameters to the server corresponding to the target tool through an encryption protocol to call the target tool.

[0056] Understandably, the collective steps of invoking the target tool based on the first and second invocation parameters can include: creating a target parameter container, which can be a structured data type, such as a Map, to integrate all parameters required to call the external service (i.e., the target tool), including the first invocation parameters corresponding to sensitive data and the second invocation parameters corresponding to non-sensitive data. Taking a weather query service as an example, suppose the first invocation parameters to be transmitted include user_id and access_token, while the second invocation parameters include the city's latitude and longitude and the query time. The first and second invocation parameters are then added to the target parameter container respectively. The target parameter container ensures that all invocation parameters are packaged in a uniform format and structure.

[0057] Before invoking the target tool, the data in the target parameter container is sent to the server corresponding to the target tool using an encryption protocol (such as Hypertext Transfer Protocol Secure (HTTPS) or Transport Layer Security (TLS)) in order to invoke the target tool.

[0058] Optionally, after sending the target parameters to the large model in step S206 above, so that the large model calls the target tool based on the target parameters according to the first call parameters and the second call parameters, the method further includes: determining the request type corresponding to the target request; if the request type is determined to be a query request, instructing the large model to obtain the query result corresponding to the query request based on the target tool; if the request type is determined to be a control request, instructing the large model to determine a control signal according to the control request, and sending the control signal to the target device corresponding to the control request based on the target tool.

[0059] Understandably, after invoking the target tool, it is necessary to process the target request sent by the target object based on the target tool. Specifically:

[0060] When a target request is received, its nature should be analyzed to determine whether it is a query request or a control request. For example, a request might be to query the weather forecast (query type) or to control the smart lights in the home (control type).

[0061] For query-type requests, such as weather forecasts, the large model is instructed to call the appropriate tools (such as weather query APIs) to obtain the required query results. During this process, the large model does not directly generate or manipulate sensitive data; instead, it indirectly obtains non-sensitive query results, such as meteorological information like temperature and humidity, through tool calls, ensuring the security of user privacy.

[0062] For control requests, such as turning a smart light on or off, the large model is guided to determine the control signal based on the request content. For example, if the request is "turn on the living room light," the large model will understand the instruction intent and generate the corresponding control signal (such as "ON"). Next, using the target tool (such as a smart home control API), the control signal is sent to the target device (the smart light in the living room) to complete the actual control operation of the device.

[0063] To better understand the process of the above sensitive data management method, the implementation flow of the above sensitive data management method will be described below in conjunction with optional embodiments, but this is not intended to limit the technical solution of the embodiments of this application.

[0064] The technical solutions in the related technologies have the following problems: 1) Sensitive information is directly exposed in the model generation chain, which is prone to information leakage (especially when calling public network models); 2) When generating model parameters, sensitive information needs to be reassembled, which leads to an expansion of the number of tokens, a decrease in generation speed, and an impact on the interactive experience; 3) It is impossible to decouple sensitive information from non-sensitive data without changing the model processing logic.

[0065] This application's optional embodiments relate to a secure processing and transparent transmission mechanism for sensitive information in intelligent agent systems, applicable to MCP protocol tool calls in large model-driven AI inference pipeline scenarios. In intelligent agent systems, when a large model triggers an MCP call, how can sensitive information (including user identity, device information, access tokens, etc.) be effectively isolated to prevent information leakage risks, while avoiding token bloat, reduced generation speed, and degraded user experience caused by large parameters generated by the model? Specifically:

[0066] (1) Sensitive data encapsulation layer:

[0067] When the proxy service interface receives a user request, the system automatically encapsulates sensitive data such as user identity, device information, and access tokens (i.e., target sensitive data) into a structured Map object (e.g., UserContextMap, i.e., the target mapping object). This Map object only contains predefined sensitive fields (such as user_id, device_token, and access_token) to ensure data minimization.

[0068] (2) Context storage layer:

[0069] The encapsulated UserContextMap object is stored in the defaultToolContext (a tool invocation context, i.e., a sensitive data storage area) of the ChatClient instance (i.e., the client instance). This context serves as a dedicated storage area for sensitive information, isolated from the model processing chain, to prevent sensitive information from being directly exposed during the model generation process.

[0070] (3) Tool call processing layer:

[0071] When a tool call is triggered (i.e., the `call` method of `ToolCallback`), the system extracts a `UserContextMap` object from `defaultToolContext` and assembles the sensitive information within it into the parameters required for the MCP service call (i.e., the first call parameters). This ensures that the large model only processes non-sensitive parameters (such as business instructions and non-sensitive data), and sensitive information does not participate in the model generation chain.

[0072] (4) Server-side pass-through layer:

[0073] When implementing utility methods annotated with @Tool on the MCP server side, an input parameter object (e.g., UserContext) with the same name as UserContextMap is defined. When the MCP service is invoked, this input parameter object receives the assembled sensitive information, achieving secure pass-through.

[0074] For example: / / MCP server example (Java); @Tool(name="weather", description="Query city weather forecast"); public String deviceControl(@ToolParam(description="province") String province, @ToolParam(description="city") String city, JSONObject userContext){; / / Use only sensitive information (such as device_token) in userContext to call external device API; String token=userContext.getString("token");}.

[0075] By following the steps above, it can be ensured that the MCP service does not directly access the original sensitive data, but only receives transparent information through structured objects, thus eliminating the risk of information leakage.

[0076] (5) Effectiveness guarantee mechanism:

[0077] Security isolation: The model generation chain only processes non-sensitive data, and sensitive information is always processed in the defaultToolContext to avoid direct exposure; Performance optimization: Because sensitive information is pre-encapsulated, the model generation speed is improved; Cost control: Maintain the original development efficiency and cost advantages of MCP.

[0078] In summary, the optional embodiments of this application achieve physical isolation between sensitive information and model processing through a three-layer decoupling mechanism of "encapsulation-storage-transmission". In scenarios such as device control, this solution reduces the risk of information leakage and improves model generation speed. This mechanism is suitable for high-security scenarios of AI intelligent agent systems driven by large models.

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

[0080] Figure 3 This is a structural block diagram of a sensitive data management device according to an embodiment of this application; as shown below. Figure 3 As shown, it includes:

[0081] The encapsulation module 32 is used to encapsulate the target sensitive data in the target request into a target mapping object, and store the target mapping object in the sensitive data storage area in the client instance. The target request includes the target sensitive data and non-sensitive data, and the data stored in the sensitive data storage area is prohibited from being read by the large model.

[0082] The determination module 34 is used to determine, when it is determined that a target tool needs to be called, a first calling parameter required to call the target tool based on the target mapping object obtained from the sensitive data storage area, and to convert the non-sensitive data into a second calling parameter required to call the target tool through a large model;

[0083] The module 36 is used to invoke the target tool according to the first invocation parameter and the second invocation parameter.

[0084] The aforementioned apparatus encapsulates the target sensitive data in the target request into a target mapping object, and stores the target mapping object in a sensitive data storage area within the client instance. Data stored in this sensitive data storage area is prohibited from being read by the large model. When it is determined that a target tool needs to be invoked, the first invocation parameter required to invoke the target tool is determined based on the target mapping object obtained from the sensitive data storage area. Furthermore, the large model converts non-sensitive data into a second invocation parameter required to invoke the target tool. The target tool is then invoked based on the first and second invocation parameters. In other words, this application encapsulates the target sensitive data into a target mapping object and stores it in a structured manner in the sensitive data storage area. When a target tool needs to be invoked, the first invocation parameter is determined based on the target invocation object in the sensitive data storage area. Consequently, the large model processing chain only processes non-sensitive data, converting it into the second invocation parameter, while prohibiting the large model from processing sensitive data, thus physically and logically isolating the large model processing chain from the sensitive data. This application solves the problem in related technologies where sensitive data cannot be effectively isolated during MCP invocation in the large model, leading to the risk of sensitive data leakage. Therefore, it effectively isolates sensitive data to prevent leakage.

[0085] In one exemplary embodiment, the encapsulation module 32 is further configured to determine whether encryption of the target sensitive data is permitted; if encryption of the target sensitive data is permitted, determine the target encryption algorithm corresponding to the target sensitive data and generate a key corresponding to the target encryption algorithm, wherein the target encryption algorithm includes at least one of the following: a symmetric encryption algorithm and an asymmetric encryption algorithm; encrypt the target sensitive data based on the target encryption algorithm and the key, and encapsulate the encrypted target sensitive data into the target mapping object; if encryption of the target sensitive data is not permitted, encapsulate the target sensitive data into the target mapping object.

[0086] In an exemplary embodiment, the determining module 34 is further configured to read the target mapping object in the sensitive data storage area and create a sensitive parameter container; determine the data type corresponding to each data position contained in the sensitive parameter container; determine the association relationship between each data position in the sensitive parameter container and each sensitive data corresponding to the target mapping object according to the data type, wherein the target sensitive data includes: multiple types of sensitive data; each type of sensitive data includes one or more sensitive data; and concatenate each sensitive parameter into the sensitive parameter container based on the association relationship to generate the first calling parameter.

[0087] In an exemplary embodiment, the determining module 34 is further configured to send the non-sensitive data to the large model, so that the large model parses the non-sensitive data to determine the request intent corresponding to the target request; instruct the large model to generate a third calling parameter based on the parsed non-sensitive data; instruct the large model to convert the parameter format corresponding to the third calling parameter into the parameter format supported by the target tool, and determine the format-converted third calling parameter as the second calling parameter.

[0088] In an exemplary embodiment, the calling module 36 is further configured to create a target parameter container, and add the first calling parameter and the second calling parameter to the target parameter container respectively to generate target parameters in the target parameter container; and send the target parameters to the server corresponding to the target tool through an encryption protocol to call the target tool.

[0089] In an exemplary embodiment, the encapsulation module 32 is further configured to determine the field name corresponding to the target sensitive data as a key and the field value corresponding to the target sensitive data as a value; and encapsulate the key and the value in the form of a key-value pair into the target mapping object.

[0090] In an exemplary embodiment, the calling module 36 is further configured to determine the request type corresponding to the target request; if the request type is determined to be a query request, instruct the large model to obtain the query result corresponding to the query request based on the target tool; if the request type is determined to be a control request, instruct the large model to determine a control signal according to the control request, and send the control signal to the target device corresponding to the control request based on the target tool.

[0091] Embodiments of this application also provide a storage medium including a stored program, wherein the program executes any of the methods described above when it is run.

[0092] Optionally, in this embodiment, the storage medium may be configured to store program code for performing the following steps:

[0093] S1, encapsulate the target sensitive data in the target request into a target mapping object, and store the target mapping object in the sensitive data storage area of ​​the client instance, wherein the target request includes: the target sensitive data and non-sensitive data, and the data stored in the sensitive data storage area is prohibited from being read by the large model;

[0094] S2, if it is determined that the target tool needs to be invoked, the first invocation parameter required to invoke the target tool is determined based on the target mapping object obtained from the sensitive data storage area, and the non-sensitive data is converted into the second invocation parameter required to invoke the target tool through the large model;

[0095] S3, invoke the target tool according to the first invocation parameter and the second invocation parameter.

[0096] Embodiments of this application also provide an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.

[0097] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0098] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:

[0099] S1, encapsulate the target sensitive data in the target request into a target mapping object, and store the target mapping object in the sensitive data storage area of ​​the client instance, wherein the target request includes: the target sensitive data and non-sensitive data, and the data stored in the sensitive data storage area is prohibited from being read by the large model;

[0100] S2, if it is determined that the target tool needs to be invoked, the first invocation parameter required to invoke the target tool is determined based on the target mapping object obtained from the sensitive data storage area, and the non-sensitive data is converted into the second invocation parameter required to invoke the target tool through the large model;

[0101] S3, invoke the target tool according to the first invocation parameter and the second invocation parameter.

[0102] Embodiments of this application also provide a computer program product, including a computer program that is executed by a processor through the steps of any of the above method embodiments.

[0103] Optionally, in this embodiment, the above-mentioned computer program product can be executed by a processor using the following steps:

[0104] S1, encapsulate the target sensitive data in the target request into a target mapping object, and store the target mapping object in the sensitive data storage area of ​​the client instance, wherein the target request includes: the target sensitive data and non-sensitive data, and the data stored in the sensitive data storage area is prohibited from being read by the large model;

[0105] S2, if it is determined that the target tool needs to be invoked, the first invocation parameter required to invoke the target tool is determined based on the target mapping object obtained from the sensitive data storage area, and the non-sensitive data is converted into the second invocation parameter required to invoke the target tool through the large model;

[0106] S3, invoke the target tool according to the first invocation parameter and the second invocation parameter.

[0107] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0108] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.

[0109] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.

[0110] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method for managing sensitive data, characterized in that, include: The target sensitive data in the target request is encapsulated into a target mapping object, and the target mapping object is stored in the sensitive data storage area in the client instance. The target request includes: the target sensitive data and non-sensitive data. The data stored in the sensitive data storage area is prohibited from being read by the large model. If it is determined that a target tool needs to be invoked, the first invocation parameter required to invoke the target tool is determined based on the target mapping object obtained from the sensitive data storage area, and the non-sensitive data is converted into a second invocation parameter required to invoke the target tool through a large model; The target tool is invoked based on the first invocation parameter and the second invocation parameter.

2. The sensitive data management method according to claim 1, characterized in that, Encapsulate the target-sensitive data in the target request into a target mapping object, including: Determine whether encryption of the target sensitive data is permitted; If encryption of the target sensitive data is permitted, a target encryption algorithm corresponding to the target sensitive data is determined, and a key corresponding to the target encryption algorithm is generated. The target encryption algorithm includes at least one of the following: a symmetric encryption algorithm and an asymmetric encryption algorithm. The target sensitive data is encrypted based on the target encryption algorithm and the key, and the encrypted target sensitive data is encapsulated into the target mapping object; When encryption of the target sensitive data is not permitted, the target sensitive data is encapsulated into the target mapping object.

3. The sensitive data management method according to claim 1, characterized in that, If it is determined through the target request that a target tool needs to be invoked, the first invocation parameters required to invoke the target tool are determined based on the target mapping object obtained from the sensitive data storage area, including: The target mapping object is read from the sensitive data storage area, and a sensitive parameter container is created; Determine the data type corresponding to each data location contained in the sensitive parameter container; The association between each data location in the sensitive parameter container and each sensitive data corresponding to the target mapping object is determined according to the data type, wherein the target sensitive data includes: multiple types of sensitive data; each type of sensitive data includes one or more sensitive data. Based on the aforementioned association, each sensitive parameter is concatenated into the sensitive parameter container to generate the first calling parameter.

4. The sensitive data management method according to claim 1, characterized in that, The non-sensitive data is transformed into a second invocation parameter required to invoke the target tool through a large model, including: The non-sensitive data is sent to the large model so that the large model can parse the non-sensitive data to determine the request intent corresponding to the target request; The large model is instructed to generate a third calling parameter based on the parsed non-sensitive data; The large model is instructed to convert the parameter format corresponding to the third call parameter into the parameter format supported by the target tool, and the converted third call parameter is determined as the second call parameter.

5. The sensitive data management method according to claim 1, characterized in that, Invoking the target tool according to the first invocation parameter and the second invocation parameter includes: Create a target parameter container, and add the first call parameter and the second call parameter to the target parameter container respectively, so as to generate target parameters in the target parameter container; The target parameters are sent to the server corresponding to the target tool via an encryption protocol to invoke the target tool.

6. The sensitive data management method according to claim 1, characterized in that, Encapsulate the target-sensitive data in the target request into a target mapping object, including: The field name corresponding to the target sensitive data is determined as the key, and the field value corresponding to the target sensitive data is determined as the value; The key and the value are encapsulated as key-value pairs into the target mapping object.

7. The sensitive data management method according to claim 1, characterized in that, After invoking the target tool according to the first invocation parameter and the second invocation parameter, the method further includes: Determine the request type corresponding to the target request; If the request type is determined to be a query request, the large model is instructed to obtain the query results corresponding to the query request based on the target tool; If the request type is determined to be a control request, the large model is instructed to determine a control signal based on the control request and send the control signal to the target device corresponding to the control request based on the target tool.

8. A sensitive data management device, characterized in that, include: An encapsulation module is used to encapsulate the target sensitive data in the target request into a target mapping object, and store the target mapping object in the sensitive data storage area in the client instance. The target request includes the target sensitive data and non-sensitive data, and the data stored in the sensitive data storage area is prohibited from being read by the large model. The determination module is used to determine, when it is determined that a target tool needs to be called, a first call parameter required to call the target tool based on the target mapping object obtained from the sensitive data storage area, and to convert the non-sensitive data into a second call parameter required to call the target tool through a large model; The calling module is used to call the target tool according to the first calling parameter and the second calling parameter.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method described in any one of claims 1 to 7.

10. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 7 through the computer program.