Data processing method and electronic device
By using asymmetric encryption algorithms and dynamic verification information in the secure hardware module, the risks of decryption and transfer of encrypted data in general computing environments are resolved, enabling secure storage and convenient access to privacy data.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- LENOVO (BEIJING) LTD
- Filing Date
- 2026-03-31
- Publication Date
- 2026-06-26
AI Technical Summary
When handling tasks involving user privacy information, existing technologies pose a risk of decryption and transfer of encrypted data in general computing environments, potentially leading to the leakage of privacy information.
An asymmetric encryption algorithm is used, and the private and public keys in the security hardware module are used to encrypt, decrypt and sign the data. The security and integrity of the data are ensured by dynamically verifying the information and hash value, and the decryption operation is restricted to the hardware level.
It effectively prevents security risks in the use of privacy data, ensures the confidentiality and integrity of data during transmission and storage, and takes into account both the convenience and security of the target model.
Smart Images

Figure CN122286801A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence technology, and in particular to a data processing method and an electronic device. Background Technology
[0002] When handling tasks involving user privacy information, artificial intelligence models need to access encrypted sensitive data. However, related technical solutions pose a risk that encrypted data may be decrypted and transferred within general computing environments during data use, potentially leading to privacy breaches. Summary of the Invention
[0003] This disclosure provides a data processing method and an electronic device.
[0004] According to one aspect of this disclosure, a data processing method is provided, comprising: in response to a target model processing a task involving first data, obtaining second data; the first data being document data containing privacy information, and the second data being obtained by encrypting the first data using a first public key; generating dynamic verification information bound to the current operation; signing the dynamic verification information using a second private key, and sending the obtained signature verification information to a secure hardware module; in response to the secure hardware module verifying the signature verification information using the second public key, decrypting the second data using the first private key in the secure hardware module to obtain the first data; wherein the first public key is paired with the first private key, and the second public key is paired with the second private key.
[0005] According to embodiments of this disclosure, the method further includes: in response to a storage instruction for the first data, encrypting the first data using a first public key to obtain the second data; calculating a first hash value for the first data and a second hash value for the second data; and storing the second data, the first hash value, and the second hash value in a target database associated with the target model.
[0006] According to embodiments of this disclosure, the method further includes: generating a storage notification instruction; signing the storage notification instruction using a third private key in a secure hardware module to obtain a signed storage notification instruction; and sending the signed storage notification instruction to a target database.
[0007] According to embodiments of this disclosure, storing the second data, the first hash value, and the second hash value in a target database associated with a target model includes: in response to the target model passing a signature storage notification instruction verified by a third public key, storing the second data, the first hash value, and the second hash value in the target database; wherein the third public key is paired with a third private key.
[0008] According to embodiments of this disclosure, storing second data, a first hash value, and a second hash value in a target database associated with a target model includes: sending the second data, the first hash value, and the second hash value to the target model; calculating a second verification hash value based on the second data in the target model; and storing the second data, the first hash value, and the second hash value in the target database in association if the second verification hash value matches the second hash value.
[0009] According to embodiments of this disclosure, the method further includes: acquiring target metadata corresponding to the first data; and storing the target metadata in association with the second data in a target database associated with the target model.
[0010] According to embodiments of this disclosure, in response to a task involving first data processed by a target model, obtaining second data includes: in response to a task involving first data processed by a target model, determining second data from a target database based on target metadata.
[0011] According to embodiments of this disclosure, obtaining second data includes: obtaining second data and a second hash value stored in a target database; calculating a second verification hash value based on the obtained second data; and confirming the integrity of the second data if the second verification hash value matches the second hash value.
[0012] According to embodiments of this disclosure, decrypting second data using a first private key in a secure hardware module to obtain first data includes: sending the second data to the secure hardware module for decryption to obtain decrypted data; calculating a first verification hash value based on the decrypted data; and confirming that the decrypted data is valid first data if the first verification hash value matches the first hash value.
[0013] Another aspect of this disclosure provides an electronic device, including: a secure hardware module and a secure agent module; wherein the secure agent module is configured to: in response to a target model processing a task involving first data, acquire second data; the first data is document data containing privacy information, and the second data is obtained by encrypting the first data using a first public key; generate dynamic verification information bound to the current operation; sign the dynamic verification information using a second private key, and send the obtained signature verification information to the secure hardware module; in response to the secure hardware module verifying the signature verification information using the second public key, decrypt the second data using the first private key in the secure hardware module to obtain the first data; wherein the first public key is paired with the first private key, and the second public key is paired with the second private key.
[0014] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0015] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0016] Figure 1 This is a flowchart of a data processing method according to an embodiment of the present disclosure;
[0017] Figure 2 This is a schematic diagram of a data processing method according to an embodiment of the present disclosure;
[0018] Figure 3 This is a schematic diagram of a data processing method according to another embodiment of the present disclosure;
[0019] Figure 4 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure; and
[0020] Figure 5 This is a schematic block diagram of an example electronic device used to implement embodiments of the present disclosure. Detailed Implementation
[0021] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0022] In the technical solutions disclosed herein, the collection, storage, use, processing, transmission, provision, disclosure, and application of data (including but not limited to user personal information) comply with the provisions of relevant laws and regulations, necessary confidentiality measures have been taken, and they do not violate public order and good morals.
[0023] Figure 1 This is a flowchart of a data processing method according to an embodiment of the present disclosure.
[0024] like Figure 1 As shown, the data processing method of this embodiment includes operations S110-S140.
[0025] In operation S110, in response to the target model processing task involving the first data, the second data is obtained; the first data is document data containing privacy information, and the second data is obtained by encrypting the first data using the first public key.
[0026] In the embodiments of this disclosure, the execution entity of the data processing method in this embodiment may be a security proxy module. The security proxy module is located between the target model and the underlying security hardware and data storage module, and acts as the central controller and coordinator of the entire security data processing flow.
[0027] In embodiments of this disclosure, the target model is an artificial intelligence model used to process tasks. The target model can be a large local model running on a user's local device (such as a personal computer), or it can be a cloud model deployed on a remote server. When performing tasks such as question answering or summarizing, the target model may need to access or call specific private data.
[0028] In the embodiments of this disclosure, the first data is document data containing privacy information. The first data refers to original document data containing privacy information that needs to be protected. For example, the first data could be a user's website login password, or it could be a text document containing sensitive content.
[0029] In the embodiments of this disclosure, the second data is obtained by encrypting the first data using a first public key. The second data refers to the data obtained by encrypting the first data, i.e., ciphertext.
[0030] In embodiments of this disclosure, the first public key and the first private key refer to a pair of cryptographic keys used together in an asymmetric encryption algorithm. The first public key is used to encrypt data, and its paired first private key is used to decrypt data. The first private key is securely stored in a secure hardware module.
[0031] In embodiments of this disclosure, second data is acquired in response to a target model processing a task involving first data. This process is triggered when the target model processes a user request that requires the first data. The security proxy module acquires the corresponding encrypted second data.
[0032] For example, a user asks the target model, "What is my password for XX website?". The target model understands that the question involves the private data "XX website password" and triggers this process. The security proxy module, based on the context of "XX website", finds and retrieves the ciphertext (secondary data) corresponding to the website password.
[0033] In operation S120, dynamic verification information bound to the current operation is generated.
[0034] In the embodiments of this disclosure, dynamic verification information refers to a unique authentication credential temporarily generated for this specific decryption operation. "Dynamic" is reflected in its value changing with each operation and being valid only once. "Bound to the current operation" means that this information is specifically used to authorize this decryption request for specific second data.
[0035] For example, dynamic verification information can be a random number or a combined string containing a timestamp and an operation sequence number.
[0036] In embodiments of this disclosure, dynamic verification information bound to the current operation is generated. The security proxy module generates a unique dynamic verification message for this decryption operation.
[0037] For example, the security proxy module generates a random number "7f3a9c1b" and concatenates it with the current timestamp "20231027103000" to form the dynamic verification information "7f3a9c1b-20231027103000".
[0038] In operation S130, the dynamic verification information is signed using the second private key, and the resulting signature verification information is sent to the security hardware module.
[0039] In the embodiments of this disclosure, the second private key and the second public key refer to another pair of cryptographic keys used in an asymmetric encryption algorithm to digitally sign and verify dynamically verified information. The second private key is used for signing, and the second public key is used for verifying the signature.
[0040] In the embodiments of this disclosure, a secure hardware module refers to a physical or firmware module that provides hardware-level security protection and is independent of the main computing environment. The secure hardware module can generate and store sensitive keys, such as a first private key, in a protected area within itself, and these private keys cannot be directly read or exported by external software. Cryptographic operations such as decryption and signature verification can be securely performed within the secure hardware module, ensuring that the operation process and intermediate results are not leaked.
[0041] For example, a security hardware module can be a Trusted Platform Module (TPM), which is a security chip that conforms to international standards.
[0042] In the embodiments of this disclosure, the dynamic verification information is signed using a second private key, and the resulting signed verification information is sent to the security hardware module. The security proxy module uses its controlled second private key to perform a digital signature operation on the dynamic verification information, obtaining signed verification information, which is then sent to the security hardware module. The purpose of the signature is to prove to the security hardware module that the decryption request originates from a legitimate requester holding the correct second private key, and that the dynamic verification information has not been tampered with during transmission.
[0043] For example, the security proxy module signs “7f3a9c1b-20231027103000” with its second private key to obtain a signature value “Sig_XYZ”, and then sends “7f3a9c1b-20231027103000” and “Sig_XYZ” together to the TPM.
[0044] In operation S140, in response to the security hardware module verifying the signature verification information through the second public key, the second data is decrypted using the first private key in the security hardware module to obtain the first data; wherein, the first public key is paired with the first private key, and the second public key is paired with the second private key.
[0045] In the embodiments of this disclosure, after receiving a request, the secure hardware module uses the corresponding second public key to verify the received signature verification information. If the verification passes, the request is confirmed to be legitimate, and the dynamic verification information is valid and generated in this instance. Only under the premise of successful verification will the secure hardware module, within its internal secure environment, use its tightly protected first private key to decrypt the received second data. The plaintext data obtained after decryption is the first data.
[0046] For example, TPM uses a pre-stored second public key to verify that the signature "Sig_XYZ" is indeed a valid signature for "7f3a9c1b-20231027103000". After successful verification, TPM uses its internally stored first private key to decrypt the second data, ultimately obtaining the first data, and returns it to the security proxy module.
[0047] Through the embodiments of this disclosure, a hardware-level security authentication and decryption mechanism based on dynamic verification information is introduced during the processing of privacy data in the target model, effectively addressing the security risks in the usage phase of privacy data. By strictly restricting decryption operations to within the secure hardware module and employing dynamic signature authentication that changes only once, replay attacks are prevented, ensuring that only legitimate requests that have undergone real-time authentication can access the core private key and decrypted data. Furthermore, this method is inclusive of the target model's deployment location (local / cloud), taking into account the target model's need for convenient access to privacy data.
[0048] Figure 2 This is a schematic diagram of a data processing method according to an embodiment of the present disclosure.
[0049] like Figure 2 As shown, Figure 2 This demonstrates the security environment and key protection mechanisms of the security agent module at the system level.
[0050] In the embodiments of this disclosure, the security proxy module is a software entity responsible for executing all core security logic such as encryption, decryption, signing, and verification. The security proxy module runs in a protected security environment created by kernel isolation technology.
[0051] In the embodiments disclosed herein, kernel isolation is an advanced security technology jointly implemented by hardware and the operating system. It creates an independent, highly privileged, and strictly isolated secure kernel or monitor beneath the main operating system kernel. This provides a protected security environment for the security agent module, completely isolated from the host operating system. Even if the host operating system is compromised by malware or has vulnerabilities, attackers find it extremely difficult to penetrate this isolation layer to spy on, tamper with, or attack the code and data of the security agent module running within it, ensuring the confidentiality and integrity of the security agent module's execution environment.
[0052] In embodiments of this disclosure, memory specifically refers to a dedicated physical memory region managed and protected by kernel isolation mechanisms. The code and data of the security agent module are loaded and stored here during runtime. Due to kernel isolation protection, the host operating system and other ordinary applications cannot directly access this memory, preventing the theft of critical information through memory.
[0053] In some embodiments of this disclosure, the method further includes: in response to a storage instruction for the first data, encrypting the first data using a first public key to obtain the second data; calculating a first hash value for the first data and a second hash value for the second data; and storing the second data, the first hash value, and the second hash value in a target database associated with the target model.
[0054] In the embodiments of this disclosure, a data storage process in the data processing method is described. The execution entity is a security proxy module, which coordinates the security hardware module and the target model to jointly complete the secure storage operation. The method in this embodiment occurs before the decryption process in the preceding embodiments. In this embodiment, the first data is encrypted to obtain the second data, and the second data is stored in the database.
[0055] In embodiments of this disclosure, a storage instruction refers to an operation command that triggers the secure saving of first data. For example, an instruction generated when a user clicks the "Save Password" button in an application, or authorizes the memorization of a piece of private text.
[0056] In the embodiments of this disclosure, the first public key is an asymmetric encryption public key paired with a first private key stored in a protected location within the security hardware module. The first public key is used to encrypt data, and data encrypted with the first public key can only be decrypted by the corresponding first private key. The first public key is generated by the security hardware module and provided to the security proxy module.
[0057] Figure 3 This is a schematic diagram of a data processing method according to another embodiment of the present disclosure.
[0058] In embodiments of this disclosure, in response to a storage instruction for the first data, the first data is encrypted using a first public key to obtain the second data. For example... Figure 3 As shown, when the security agent module receives the storage instruction, it obtains or uses the cached first public key from the security hardware module to perform encryption operations on the first data that needs to be saved. Figure 3 The "Encrypt" box represents this encryption process, whose inputs are the first data from the security agent module and the first public key from the security hardware module.
[0059] For example, a user issues a storage command, "Remember my email password 'abc123'." This storage command is forwarded to the security proxy module. The security proxy module then obtains the first public key from the security hardware module, encrypts the password "abc123", and obtains the corresponding ciphertext.
[0060] In the embodiments of this disclosure, the hash value is a fixed-length, unique digital fingerprint obtained by calculating data using a hash algorithm. A first hash value is calculated from the original first data and is used to verify the integrity of the original data. A second hash value is calculated from the encrypted second data and is used to verify the integrity of the encrypted data.
[0061] In embodiments of this disclosure, a first hash value for the first data and a second hash value for the second data are calculated. The security proxy module calculates both hash values in parallel after encryption. The first hash value is used to verify the authenticity of the original data upon future decryption, and the second hash value is used to verify the integrity of the ciphertext during data storage and subsequent retrieval.
[0062] In the embodiments of this disclosure, the target database refers to a storage system or structure logically associated with the target model and used to store the data required by it. The target database may be a knowledge base within the target model, a vector database, or an externally associated dedicated storage.
[0063] For example, the target database could be a dedicated storage area used by a large local model to store the encrypted data and documents it acquires.
[0064] In embodiments of this disclosure, the second data, the first hash value, and the second hash value are stored in a target database associated with the target model. For example... Figure 3As shown, the security proxy module sends the encrypted second data, along with its associated first and second hash values, to the target model. The target model is responsible for storing this data in its associated target database. During storage, the second data, first hash value, and second hash value are typically associated and bound together for subsequent retrieval and verification.
[0065] For example, the security proxy module packages the second data, the first hash value, and the second hash value, and sends them to the local large model. The large model associates this information with its learned context (such as "the user's email password") and stores it in the target database. The target model receives an incomprehensible ciphertext and two hash values, rather than the original password.
[0066] The embodiments of this disclosure provide a secure data storage method that uses hardware-level public keys to encrypt private data and simultaneously saves the hash values of the plaintext and ciphertext. This ensures that the private data is securely stored in ciphertext form by the target model, and that its integrity and authenticity can be rigorously verified in the future, laying a reliable foundation for subsequent secure retrieval and use.
[0067] In some embodiments of this disclosure, the method further includes: generating a storage notification instruction; signing the storage notification instruction using a third private key in a secure hardware module to obtain a signed storage notification instruction; and sending the signed storage notification instruction to a target database.
[0068] In the embodiments of this disclosure, a storage notification instruction refers to a control message generated by the security proxy module during the storage process, used to notify the target database (or its associated target model) to prepare to receive and store the second data and its associated hash value. The storage notification instruction can be a predefined string, the content of which is public, and its core function is to indicate the nature of the subsequent data.
[0069] In embodiments of this disclosure, a storage notification instruction is generated. After the security proxy module completes the encryption and hash calculation of the first data, a storage notification instruction is generated before the encrypted data is sent to the target database for storage. This step aims to establish a secure and trusted communication context for subsequent data transmission.
[0070] For example, after encrypting the user's password document, the security agent module generates an instruction string as the storage notification instruction for this operation.
[0071] In the embodiments of this disclosure, the third private key and the third public key refer to a pair of asymmetric encryption keys generated by the security hardware module, which are dedicated to digitally signing and verifying storage notification instructions. The third private key is securely stored and used by the security hardware module, while the third public key needs to be pre-distributed to the target model or target database.
[0072] In embodiments of this disclosure, a signed storage notification instruction refers to a combination of data obtained by digitally signing the storage notification instruction using a third private key. The signed storage notification instruction may include the original instruction and its digital signature.
[0073] For example, the security agent module requests the security hardware module to sign the storage notification instruction with a third private key to obtain a signature value. The storage notification instruction and the signature value together constitute the signed storage notification instruction.
[0074] In the embodiments of this disclosure, the storage notification instruction is signed using a third private key in the secure hardware module to obtain a signed storage notification instruction. The secure agent module sends the generated storage notification instruction to the secure hardware module, requesting it to digitally sign the instruction using its protected third private key. After internally completing the signing, the secure hardware module returns the result. The signing process ensures the non-repudiation and integrity of the instruction, meaning the target database can verify that the instruction indeed originates from a legitimate secure agent module with access to the secure hardware, and that the instruction has not been tampered with.
[0075] For example, the security agent module sends a storage notification instruction to the TPM. The TPM signs the instruction using a third private key stored internally, generates a signature value, and returns the combination of the instruction and the signature value (i.e., the signed storage notification instruction) to the security agent module.
[0076] In the embodiments of this disclosure, a signature storage notification instruction is sent to the target database. The security proxy module sends the received signature storage notification instruction to the target database. The steps in this embodiment are a secure handshake step before the actual transmission of encrypted data. After receiving the instruction, the target database uses its pre-owned third public key to verify the signature. If the verification is successful, it indicates that the subsequent data storage request is legitimate and trustworthy.
[0077] The embodiments of this disclosure add an instruction signing and verification step to the storage process. By digitally signing the storage notification instruction with a security hardware module, the legitimacy of the initiator of the data storage operation and the integrity of the instruction are ensured. This provides a security access check for the target database, preventing unauthorized data storage or malicious data injection, thereby improving the security and reliability of data processing.
[0078] In some embodiments of this disclosure, storing the second data, the first hash value, and the second hash value into a target database associated with the target model includes: in response to the target model verifying the signature storage notification instruction via a third public key, storing the second data, the first hash value, and the second hash value into the target database; wherein the third public key is paired with a third private key.
[0079] In the embodiments of this disclosure, the third public key refers to an asymmetric encryption public key used in conjunction with a third private key stored in a secure hardware module. Its function is to verify data signed by the third private key. The third public key needs to be securely configured to the target model beforehand.
[0080] In embodiments of this disclosure, in response to the target model verifying the signature storage notification instruction via a third public key, the second data, the first hash value, and the second hash value are stored in the target database. Verification success means that the target model uses its third public key to perform calculations and comparisons on the digital signature portion of the received signature storage notification instruction, confirming that the signature is indeed a valid signature for the corresponding instruction and that the instruction has not been tampered with during transmission.
[0081] In the embodiments of this disclosure, after receiving the signature storage notification instruction from the security proxy module, the target model does not immediately store the subsequent data, but instead initiates a verification process. It uses its pre-configured third public key to verify the instruction. Only when the verification confirms that the instruction originates legitimately (from a legitimate security proxy module capable of accessing the security hardware module) and its content is complete, does the target model write the received second data, the first hash value, and the second hash value into its associated target database. Otherwise, the storage request should be rejected.
[0082] For example, the security proxy module sends a signed storage notification instruction along with an encrypted cryptographic data packet to the target model. The target model extracts the instruction and signature and verifies its validity using a stored third-party public key. Only after successful verification does the target model consider it a legitimate storage command and securely store the ciphertext, plaintext hash, and ciphertext hash included in the data packet into the target database. If verification fails, the entire data packet is ignored or discarded.
[0083] Through the embodiments of this disclosure, a trusted storage channel is established by verifying the instruction signature of the target model before storage. This ensures that only requesters who have undergone strict authentication can write data to the model's knowledge base, effectively preventing malicious data injection or spoofing attacks and enhancing the security and trustworthiness of the storage system.
[0084] In some embodiments of this disclosure, storing the second data, the first hash value, and the second hash value in a target database associated with the target model includes: sending the second data, the first hash value, and the second hash value to the target model; calculating a second verification hash value based on the second data in the target model; and storing the second data, the first hash value, and the second hash value in the target database in association if the second verification hash value matches the second hash value.
[0085] In the embodiments of this disclosure, the second data, the first hash value, and the second hash value are sent to the target model. After completing the encryption and hash calculation, the security proxy module transmits the generated second data, the first hash value, and the second hash value as a data packet to the target model.
[0086] In the embodiments of this disclosure, the target model calculates a second verification hash value based on the second data. The second verification hash value refers to a new hash value that the target model recalculates itself based on the second data after receiving it. Upon receiving the data packet, the target model does not immediately trust that the second data within it is complete and accurate. The target model extracts the second data from the data packet and independently calculates its hash value using the same hash algorithm as the security proxy module; this newly calculated value is the second verification hash value.
[0087] In embodiments of this disclosure, if the second verification hash value matches the second hash value, the second data, the first hash value, and the second hash value are stored in the target database in association. The target model compares its self-calculated second verification hash value with the second hash value from the security proxy module in the data packet. A match between the second verification hash value and the second hash value means that the two hash values are exactly the same, thus proving that the second data did not suffer any errors or tampering during transmission from the security proxy module to the target model. Only if this verification passes does the target model consider the data complete, and then logically associate the second data, the first hash value, and the second hash value before storing them in the target database. If the verification fails, error handling (e.g., requesting a retransmission) is triggered.
[0088] For example, the local large model compares its self-calculated second verification hash value with the received second hash value. If they match, it means the ciphertext transmission was correct, and the large model stores the ciphertext, plaintext hash, and ciphertext hash together in the knowledge base. If they do not match, an error is returned to the security broker module.
[0089] By providing the target model with the ability to actively verify the integrity of the ciphertext before storage through the embodiments of this disclosure, it is ensured that the encrypted data is only remembered by the model if it is not damaged during transmission. This avoids the model storing and using incorrect or tampered encrypted data due to transmission errors or man-in-the-middle attacks, and ensures the reliability of all subsequent operations based on this data (such as retrieval and decryption).
[0090] In some embodiments of this disclosure, the method further includes: acquiring target metadata corresponding to the first data; and storing the target metadata in association with the second data in a target database associated with the target model.
[0091] In the embodiments of this disclosure, target metadata refers to information used to describe, mark, or index the attributes, characteristics, or context of the first data, and the target metadata itself is not the plaintext content of the first data.
[0092] For example, when the first piece of data is an encrypted business contract, its target metadata may include "Contractor: Company A", "Signing Date: October 2023", and "Keywords: Procurement, Confidentiality Agreement". When the first piece of data is a website password, its target metadata may include "Website Name: xxx.com", "Username: user@email.com", and "Category: Job".
[0093] In the embodiments of this disclosure, target metadata corresponding to the first data is obtained. During the storage process, the security proxy module needs to collect or generate the corresponding target metadata for the first data to be encrypted and stored. The target metadata is crucial for subsequent intelligent retrieval. The target metadata can be obtained by receiving manual user input, automatically extracting it from the original data, or generating it based on the operation context.
[0094] In the embodiments of this disclosure, the target metadata and the second data are stored in a target database associated with the target model in an associative manner. Associative storage means establishing a logical relationship between the target metadata and the second data during storage, so that the corresponding second data can be queried and located subsequently through the target metadata.
[0095] For example, in a database, the two can be associated with the same primary key ID, or in a vector database, they can be embedded in the same vector representation.
[0096] In the embodiments of this disclosure, after the security proxy module encrypts the first data to obtain the second data, it sends the second data along with its target metadata to the target database. During storage, it ensures that a searchable mapping relationship exists between the two. This allows the target model, although unable to understand the ciphertext content, to fully understand and process the target metadata in plaintext form, thereby enabling effective organization, indexing, and retrieval of encrypted data based on the metadata.
[0097] For example, the security proxy module stores the encrypted ciphertext of the website password (secondary data) along with the metadata {"website name: xxx.com", "username: user@email.com"} in the target knowledge base associated with the target model. Subsequently, when a user asks "What is the password for my xxx.com website?", the large model can quickly locate the associated encrypted password by matching the metadata "xxx.com", without attempting to understand the ciphertext itself.
[0098] Through embodiments of this disclosure, by introducing and associating stored target metadata, semantic tags and indexes that can be processed by the target model are provided for encrypted data whose content cannot be directly understood. This effectively solves the problem that encrypted data is difficult to intelligently retrieve and recommend, enabling the target model to accurately locate the required encrypted information based on the metadata context, thereby improving practicality and user experience while protecting privacy.
[0099] In some embodiments of this disclosure, in response to a task involving the target model processing the first data, obtaining the second data includes: in response to a task involving the target model processing the first data, determining the second data from a target database based on target metadata.
[0100] In embodiments of this disclosure, a task involving the first data refers to a user request or internal computation that the target model is processing, whose execution depends on or requires invoking the first data.
[0101] For example, a user asks the target model, "Summarize the project plan I encrypted last week," and this summary task is "a task involving the primary data (project plan)."
[0102] In embodiments of this disclosure, in response to a target model processing a task involving first data, second data is determined from a target database based on target metadata. When the target model's task processing logic recognizes the need for certain first data (such as a specific document or a password), it does not and cannot directly search the encrypted content. The target model utilizes contextual information implied or deducible from the task, which semantically matches the stored target metadata. Using this contextual information as query conditions, the target model retrieves matching target metadata records from its associated target database. Once a matching metadata record is found, the second data bound to that metadata can be determined based on pre-established associations.
[0103] For example, a user asks the target model, "Help me find the encrypted document about 'project budget'." The model parses the task and extracts the key query term "project budget." Then, the model searches its target database (knowledge base) for all stored target metadata. Suppose it finds a metadata record with the following structure: {"Document Name: xx Project Planning", "Keywords: Project Planning, Budget, Timeline"}, which contains "budget". Because "budget" is semantically highly relevant to the user's query "project budget", the model identifies this metadata record and, through association, locates the ciphertext (secondary data) of the encrypted document corresponding to that record.
[0104] Through the embodiments of this disclosure, by utilizing target metadata as an understandable retrieval index, the target model can accurately respond to user requests involving privacy data without touching plaintext, efficiently locate the corresponding encrypted data, and realize semantic-based intelligent retrieval of encrypted data.
[0105] In some embodiments of this disclosure, obtaining the second data includes: obtaining the second data and the second hash value stored in the target database; calculating the second verification hash value based on the obtained second data; and confirming the integrity of the second data if the second verification hash value matches the second hash value.
[0106] In embodiments of this disclosure, second data and a second hash value stored in the target database are obtained. When the security agent module needs to obtain specific second data for a target model processing task, it first retrieves and reads the second data from the target database, and simultaneously obtains the second hash value that was stored along with the data.
[0107] For example, when a user asks "What is my password for XX website?", the decryption process is triggered. Based on this request, the security proxy module finds and reads the encrypted ciphertext (second data) of the corresponding "XX website" from the target database of the target model, as well as the hash value (second hash value) that was originally stored with the ciphertext.
[0108] In embodiments of this disclosure, a second verification hash value is calculated based on the acquired second data. After obtaining the second data, the executing entity does not directly trust its integrity. Using the same hash algorithm as when storing the data, a separate hash operation is immediately performed on the newly acquired second data to calculate a new hash value, namely the second verification hash value.
[0109] In the embodiments of this disclosure, the integrity of the second data is confirmed if the second verification hash value matches the second hash value. The security agent module rigorously compares the newly calculated second verification hash value with the original second hash value obtained from the database. A match means that the two values are completely identical, thus proving that the content of the currently acquired second data has not changed since it was stored until it was read this time. Only if this verification passes does the system confirm that the second data is complete and can safely proceed to subsequent processes (such as submission to the security hardware module for decryption). If the verification fails, it indicates that the data has been corrupted or tampered with, and the process should be aborted and an error should be reported.
[0110] For example, the security agent module compares its self-calculated second verification hash value with the second hash value retrieved from the database. If they match, the encrypted password ciphertext is confirmed to be intact and can be sent to the TPM for decryption. If they differ, it indicates that the ciphertext may have been damaged on the storage medium or maliciously modified during transmission, and the system will refuse to use the data and display an error message.
[0111] The embodiments of this disclosure add a preliminary integrity verification step to the data usage chain. By recalculating and comparing the hash value immediately after obtaining the encrypted data, it ensures that the data to be decrypted and used is completely consistent with the original storage data. This effectively prevents the use of invalid or harmful data due to storage medium failure, transmission errors, or malicious tampering, thereby ensuring the security and reliability of subsequent operations.
[0112] In some embodiments of this disclosure, the second data is decrypted using a first private key in a secure hardware module to obtain the first data, including: sending the second data to the secure hardware module for decryption to obtain decrypted data; calculating a first verification hash value based on the decrypted data; and confirming that the decrypted data is valid first data if the first verification hash value matches the first hash value.
[0113] In the embodiments of this disclosure, the second data is sent to the secure hardware module for decryption to obtain decrypted data. The secure proxy module sends the second data, which has undergone integrity verification, to the secure hardware module and requests it to decrypt it using its internally protected first private key. The secure hardware module completes the decryption operation within its security boundaries and returns the decrypted data. The steps of this embodiment ensure that the private key never leaves the secure hardware module and that the decryption operation is performed in a trusted environment.
[0114] For example, the security agent module sends the acquired and verified ciphertext (second data) to the TPM (security hardware module) and requests decryption. The TPM performs decryption operations internally using its first private key to obtain the decrypted string data, which it then returns to the security agent module.
[0115] In embodiments of this disclosure, a first verification hash value is calculated based on the decrypted data. Upon receiving the decrypted data, the security proxy module does not immediately use it as valid first data. To prevent errors in the decryption process itself, or accidental modification of the returned data during transmission, its authenticity needs to be verified. The security proxy module uses the same hash algorithm as during storage to independently calculate a hash on the received decrypted data to obtain the first verification hash value.
[0116] In the embodiments of this disclosure, if the first verification hash value matches the first hash value, the decrypted data is confirmed to be valid first data. The security agent module rigorously compares the original first hash value obtained from the target database with the first verification hash value just calculated. A match means that the two hash values are exactly the same, thus proving that the data currently decrypted and returned by the security hardware module is completely consistent with the original first data that was initially encrypted and stored. After this verification is successful, the system confirms that the decrypted data is valid and securely usable first data. If the verification fails, it indicates that the decryption process has failed or the data has been tampered with, and the decryption result should be discarded and a security alarm should be triggered.
[0117] Through the embodiments of this disclosure, a final data authenticity verification is added at the end of the decryption process. By comparing the hash value of the decrypted data with the hash value of the stored original data, the correctness and integrity of the decryption result are cryptographically ensured, eliminating the risk of decryption errors or data tampering in the final return stage, thereby improving the reliability of the obtained plaintext data.
[0118] Figure 4 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure.
[0119] In this embodiment of the disclosure, the electronic device 400 includes a security hardware module 410 and a security proxy module 420; wherein, the security proxy module 420 is configured to: in response to a target model processing a task involving first data, obtain second data; the first data is document data containing privacy information, and the second data is obtained by encrypting the first data using a first public key; generate dynamic verification information bound to the current operation; sign the dynamic verification information using a second private key, and send the obtained signature verification information to the security hardware module 410; in response to the security hardware module 410 verifying the signature verification information using the second public key, decrypt the second data using the first private key in the security hardware module 410 to obtain the first data; wherein, the first public key is paired with the first private key, and the second public key is paired with the second private key.
[0120] In this embodiment of the disclosure, the target model can run on the processor of an electronic device, that is, the target model can be a large local model running on the electronic device. The target model can also be a cloud model deployed on a remote server.
[0121] In this embodiment of the disclosure, the security proxy module 420 can execute the data processing method described above.
[0122] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0123] Figure 5This is a schematic block diagram of an example electronic device used to implement embodiments of the present disclosure.
[0124] like Figure 5 As shown, an electronic device 500 according to an embodiment of this application includes a processor 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory 502 or a program loaded from a storage portion 508 into a random access memory 503. The processor 501 may include, for example, a general-purpose microprocessor, an instruction set processor and / or an associated chipset and / or a dedicated microprocessor. The processor 501 may also include onboard memory for caching purposes. The processor 501 may include a single processing unit or multiple processing units for executing different steps of the method flow according to an embodiment of this application.
[0125] Random access memory 503 stores various programs and data required for the operation of electronic device 500. Processor 501, read-only memory 502, and random access memory 503 are interconnected via bus 504. Processor 501 executes various steps of the method flow according to embodiments of this application by executing programs stored in read-only memory 502 and / or random access memory 503. It should be noted that programs may also be stored in one or more memories other than read-only memory 502 and random access memory 503. Processor 501 may also execute various steps of the method flow according to embodiments of this application by executing programs stored in one or more memories.
[0126] According to embodiments of this application, the electronic device 500 may further include an input / output interface 505, which is also connected to a bus 504. The electronic device 500 may also include one or more of the following components connected to the input / output interface 505: an input section 506 including a keyboard, mouse, etc.; an output section 507 including a cathode ray tube, liquid crystal display, etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card, such as a local area network card, modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the input / output interface 505 as needed. A removable medium 511, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 510 as needed so that computer programs read from it can be installed into the storage section 508 as needed.
[0127] Embodiments of this application also provide a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of this application.
[0128] According to embodiments of this application, the computer-readable storage medium can be a non-volatile computer-readable storage medium, such as including but not limited to: portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory, portable compact disk read-only memory, optical storage devices, magnetic storage devices, or any suitable combination thereof. In embodiments of this application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this application, the computer-readable storage medium may include the read-only memory 502 described above, and / or random access memory 503, and / or one or more memories other than read-only memory 502 and random access memory 503.
[0129] Embodiments of this application also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to cause the computer system to implement the methods provided in the embodiments of this application.
[0130] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 509, and / or installed from a removable medium 511. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0131] In embodiments of this application, the computer program can be downloaded and installed from a network via communication section 509, and / or installed from removable medium 511. When the computer program is executed by processor 501, it performs the functions defined in the system of this application embodiment. According to embodiments of this application, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0132] According to embodiments of this application, program code for executing the computer programs provided in the embodiments of this application can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0133] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0134] Those skilled in the art will understand that the features described in the various embodiments of this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, the features described in the various embodiments of this application can be combined and / or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application.
Claims
1. A data processing method, comprising: In response to the target model's task involving the first data, acquire the second data; The first data is document data containing privacy information, and the second data is obtained by encrypting the first data using a first public key; Generate dynamic verification information that is bound to the current operation; The dynamic verification information is signed using a second private key, and the resulting signed verification information is sent to the security hardware module. In response to the security hardware module verifying the signature verification information using the second public key, the second data is decrypted using the first private key in the security hardware module to obtain the first data; The first public key is paired with the first private key, and the second public key is paired with the second private key.
2. The method according to claim 1, further comprising: In response to a storage instruction for the first data, the first data is encrypted using the first public key to obtain the second data; Calculate the first hash value of the first data and the second hash value of the second data; The second data, the first hash value, and the second hash value are stored in the target database associated with the target model.
3. The method according to claim 2, further comprising: Generate storage notification instructions; The storage notification instruction is signed using the third private key in the security hardware module to obtain a signed storage notification instruction. Send the signature storage notification instruction to the target database.
4. The method according to claim 3, wherein storing the second data, the first hash value, and the second hash value in a target database associated with the target model comprises: In response to the target model verifying the signature storage notification instruction via the third public key, the second data, the first hash value, and the second hash value are stored in the target database; The third public key is paired with the third private key.
5. The method according to claim 2, wherein storing the second data, the first hash value, and the second hash value in a target database associated with the target model comprises: Send the second data, the first hash value, and the second hash value to the target model; The target model calculates a second verification hash value based on the second data; If the second verification hash value matches the second hash value, the second data, the first hash value, and the second hash value are stored together in the target database.
6. The method according to claim 1, further comprising: Obtain the target metadata corresponding to the first data; The target metadata is stored in association with the second data in a target database associated with the target model.
7. The method of claim 6, wherein obtaining the second data in response to a task involving the first data in processing the target model comprises: In response to a target model processing task involving the first data, the second data is determined from the target database based on the target metadata.
8. The method according to claim 2, wherein obtaining the second data comprises: Obtain the second data and the second hash value stored in the target database; Calculate the second verification hash value based on the acquired second data; If the second verification hash value matches the second hash value, the integrity of the second data is confirmed.
9. The method according to claim 2, wherein decrypting the second data using the first private key in the security hardware module to obtain the first data comprises: The second data is sent to the security hardware module for decryption to obtain decrypted data; Calculate the first verification hash value based on the decrypted data; If the first verification hash value matches the first hash value, the decrypted data is confirmed to be valid first data.
10. An electronic device, comprising: Security hardware module and security agent module; among which, The security proxy module is used for: In response to a task involving the target model processing the first data, second data is obtained; the first data is document data containing privacy information, and the second data is obtained by encrypting the first data using a first public key; Generate dynamic verification information that is bound to the current operation; The dynamic verification information is signed using a second private key, and the resulting signed verification information is sent to the security hardware module. In response to the security hardware module verifying the signature verification information using the second public key, the second data is decrypted using the first private key in the security hardware module to obtain the first data; The first public key is paired with the first private key, and the second public key is paired with the second private key.