Query statement processing method, electronic device, and computer-readable storage medium

By auditing query statements in a trusted container and sending remote verification materials, the risk of data leakage during query execution in privacy computing platforms is mitigated, achieving secure execution of query statements and data protection.

CN114791922BActive Publication Date: 2026-04-14ALIBABA CLOUD COMPUTING CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ALIBABA CLOUD COMPUTING CO LTD
Filing Date
2022-03-24
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

In privacy-preserving computing platforms, the execution of query statements poses a risk of data leakage, and existing technologies are insufficient to effectively prevent such leakage.

Method used

The query statement is reviewed based on preset rules in the trusted container. The query statement and its remote supporting documents are sent to the privacy computing platform to ensure that the query statement meets the preset conditions before execution.

Benefits of technology

It improves the security of query statements, avoids data leakage, and ensures the credibility and execution security of query statements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114791922B_ABST
    Figure CN114791922B_ABST
Patent Text Reader

Abstract

The application provides a query statement processing method, an electronic device and a computer readable storage medium. The method comprises the following steps: auditing a received query statement based on a preset rule in a trusted container to obtain auditing information of the query statement; and in response to the auditing information meeting a preset condition, sending query related data to a privacy computing platform, wherein the query related data comprises the query statement and remote proof material of the trusted container. By using the embodiment of the application, the security of executing the query statement can be improved, and data leakage can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of cloud computing, and in particular to the field of cloud platform security. Background Technology

[0002] Privacy-preserving computation platforms enable multiple parties to perform data fusion computation without disclosing their individual data. This is achieved by caching multi-party data within the platform's Trusted Execution Environment (TEE) and executing queries such as SQL (Structured Query Language) within the TEE's database engine. However, since these queries are typically written by the data requesting party to meet their application requirements, there is a risk that the execution of these queries could leak the original data of the participating parties. Summary of the Invention

[0003] This application provides a method for processing query statements, an electronic device, and a computer-readable storage medium to avoid the risk of data leakage caused by executing query statements.

[0004] One aspect of this application provides a method for processing query statements, including:

[0005] The received query statements are reviewed in a trusted container based on preset rules to obtain the review information of the query statements;

[0006] In response to the audit information meeting preset conditions, relevant query data is sent to the privacy computing platform; the relevant query data includes the query statement and remote proof materials of the trusted container.

[0007] Another aspect of this application provides a method for processing query statements, including:

[0008] Receive query-related data; the query-related data includes the query statement;

[0009] The response to the query data also includes remote verification materials of the trusted container, confirming that the query statement has been reviewed in the trusted container and that the query statement meets the preset conditions.

[0010] Another aspect of this application provides a query statement processing apparatus, comprising:

[0011] The auditing module is used to audit received query statements in a trusted container based on preset rules and obtain audit information for the query statements.

[0012] The first communication module is used to send query-related data to the privacy computing platform in response to the audit information meeting preset conditions; wherein, the query-related data includes query statements and remote proof materials of trusted containers.

[0013] Another aspect of this application provides a query statement processing apparatus, comprising:

[0014] The second communication module is used to receive query-related data, which includes query statements.

[0015] The trust determination module is used to determine, in response to queries that include remote verification materials of the trusted container, whether the query statement has been reviewed in the trusted container and whether the query statement meets preset conditions.

[0016] In another aspect, this application provides an electronic device including a memory, a processor, and a computer program stored in the memory, wherein the processor implements the method provided in any embodiment of this application when executing the computer program.

[0017] In another aspect, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method provided in any embodiment of this application.

[0018] Another aspect of this application provides a computer program product, including a computer program that, when executed by a processor, implements the method provided in any embodiment of this application.

[0019] Compared with the prior art, this application has the following advantages:

[0020] According to the technical solution of this application, query statements are reviewed within a trusted container based on preset rules. Only after confirming that the query statement meets the preset conditions is the query statement and the remote verification materials of the trusted container sent to the privacy computing platform. The privacy computing platform can determine that the query statement has been reviewed in the trusted container and meets the preset conditions based on the remote verification materials of the trusted container. Based on this, the privacy computing platform can identify whether a query statement is trustworthy, improving the security of executing query statements and preventing data leakage. Attached Figure Description

[0021] Figure 1 This is a schematic diagram of an application scenario for implementing the method of the embodiments of this application.

[0022] Figure 2 This is a schematic flowchart illustrating a query statement processing method provided in an embodiment of this application.

[0023] Figure 3 A schematic flowchart illustrating a query statement processing method provided in another embodiment of this application.

[0024] Figure 4 This is an overall architecture diagram of the query processing system of the privacy computing platform in Application Example 1.

[0025] Figure 5 This is a sequence diagram illustrating the processing method of the query statement in Application Example 2.

[0026] Figure 6 This is a structural block diagram of a query statement processing apparatus provided in an embodiment of this application.

[0027] Figure 7 This is a structural block diagram of a query statement processing apparatus provided in another embodiment of this application.

[0028] Figure 8 This is a structural block diagram of a query statement processing apparatus provided in another embodiment of this application.

[0029] Figure 9 This is a structural block diagram of an electronic device according to an embodiment of this application. Detailed Implementation

[0030] Many specific details are set forth in the following description to provide a full understanding of this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this application; therefore, this application is not limited to the specific embodiments disclosed below.

[0031] To more clearly demonstrate the query statement processing method provided in the embodiments of this application, we first introduce the application scenarios that can be used to implement this method.

[0032] For example, the query processing method provided in this application embodiment can be implemented in relevant scenarios of privacy computing platforms. A privacy computing platform, also known as a multi-party privacy computing platform, is a system for joint computation by multiple participants. Each participant collaborates to perform joint analysis and joint machine learning on their data without disclosing their own data. For example, they can jointly model different types or user feature data provided by various participants to improve the effectiveness of artificial intelligence models. A privacy computing platform is, for example, a DataTrust platform.

[0033] Figure 1This is a schematic diagram illustrating an application scenario for implementing the method of this application embodiment. The server 20 of the privacy computing platform can interact with the client 10 of the privacy computing platform and also with the database engine 30 of the privacy computing platform. Exemplarily, the aforementioned privacy computing platform provides a trusted data analysis function. This function, based on TEE technology, encrypts and transmits multi-party data and caches it within the platform's TEE, and executes query statements within the aforementioned database engine 30 within the TEE, thereby achieving the usability but invisibility of multi-party data.

[0034] Query statements can be programming language information used to access, query, update, or manage data, such as SQL statements. In this embodiment, the query statement can be an SQL statement used for federated data analysis. Generally, query statements are written by the data requester to fulfill their application requirements; however, this approach carries the risk of leaking the original data of the participating parties through the execution of SQL statements.

[0035] To solve the above-mentioned technical problems, exemplarily, such as Figure 1 As shown, in some application scenarios, a query analysis service 40 is provided to review query statements, allowing only those that conform to specific rules to be sent to the database engine 30 for execution. This query analysis service 40 can operate independently of the privacy computing platform's server 20 and interact with it, or it can be deployed within the privacy computing platform's server 20 and operate independently of other services on that server. Figure 1 The following is an example illustrating how the query analysis service 40 operates independently of the privacy computing platform's server 20 while interacting with the server 20.

[0036] For example, in the query processing flow, the platform client 10, managed by the data requester, can generate a query and send it to the platform server 20. The server 20 then sends the query to the query analysis service 40. After processing the query, the query analysis service 40 can send the relevant information to the database engine 30 via the server 20, so that the query can be executed in the database engine 30.

[0037] Figure 2 A schematic flowchart illustrating a query statement processing method according to an embodiment of this application is shown. This method can optionally be executed by the aforementioned query statement analysis service, but is not limited thereto. Figure 2 As shown, the method includes:

[0038] S210. In a trusted container, the received query statement is reviewed based on preset rules to obtain the review information of the query statement;

[0039] S220. In response to the audit information meeting the preset conditions, send relevant query data to the privacy computing platform; wherein, the relevant query data includes the query statement and remote proof materials of the trusted container.

[0040] In this embodiment, the trusted container may include a content container based on a Trusted Execution Environment (TEE). For example, the trusted execution environment in this embodiment may be SGX (Software Guard Extensions), the CPU Trusted Execution Environment (SEV) provided by an AMD processor, or the CPU Trusted Execution Environment (TrustZone) provided by an Advanced RISC Machine (ARM) processor. Taking SGX as an example, the trusted container may include an SGX-based protected content container Encalve.

[0041] For example, preset rules may include pre-configured logical rules, statement structures, etc., that are allowed to run in the database engine. Optionally, preset rules may be determined by the data provider of the privacy computing platform, or determined through negotiation between the data provider and the data requester. In practical applications, preset rules can be used as relevant configuration parameters for trusted containers, and trusted containers can be compiled based on these configuration parameters. In other words, trusted containers are configured or compiled based on preset rules. Thus, trusted containers configured based on preset rules confirmed by multiple parties have their trustworthiness confirmed by all parties, and because trusted containers are implemented using TEE technology, the preset rules can be guaranteed not to be tampered with.

[0042] In practical applications, queries can originate from the client of the privacy computing platform. Furthermore, the query can be triggered by components on the client, such as an SDK (Software Development Kit), to obtain the relevant data required by the client. For example, the client can send the query to the platform's server, which then forwards it to a query analysis service for review.

[0043] Optionally, the query statement can be reviewed by matching / comparing the query statement with preset rules to obtain review information. It can be understood that the review information in this embodiment is the review result, which is the information output upon completion of the review and can be used to characterize whether the review has passed or whether the query statement is credible and executable. For example, the review information can be 1 bit of information. By comparing the logical rules of the query statement with preset rules, the consistency between the two is reviewed. If they are consistent, the review information "1" is output to indicate that the query statement is credible; if they are inconsistent, the review information "0" is output to indicate that the query statement is unreliable.

[0044] For example, the preset conditions may include: the review information is preset information used to characterize whether the review is passed or whether the query statement is credible and executable. That is, if the review is passed, the query-related data can be sent to the privacy computing platform so that the privacy computing platform can execute the query statement.

[0045] In this embodiment, the data queried includes not only the query statement but also remote verification materials of the trusted container. It is understood that the query statement and the remote verification materials have a corresponding relationship. Thus, upon receiving a query statement, the privacy computing platform can determine that the query statement has been verified by the trusted container based on the corresponding remote verification materials. In other words, the verification result of the query statement can be recognized by the privacy computing platform as a credible verification result.

[0046] As explained above, the auditing operation is implemented within a trusted container based on TEE technology. Thus, query auditing is performed using a trusted TEE that cannot be tampered with by any party (including the privacy computing platform). Furthermore, by sending the query and remote verification materials for the trusted container, the audit result can be recognized as a trusted audit result by the platform's database engine. This ensures that the privacy computing platform only executes trusted queries that conform to specific rules, and data providers can also protect their original data from leakage by formulating specific rules, thereby improving the security of query execution and mitigating the risk of data leakage.

[0047] Furthermore, using the above method, there is no need to change the backbone system of the TEE database engine that executes queries in the privacy computing platform. In other words, the database engine remains unchanged by the configured preset rules; for example, there is no need to modify / recompile the database engine's source code or alter its original metrics. This facilitates user trust and also makes customization and maintenance easier. On the other hand, the query analysis service executing the above method remotely receives query statements input from clients, analyzing them within a data isolation environment, which prevents risks from spreading to the area where the user's original data resides.

[0048] In some optional embodiments, querying related data further includes verification information for verifying the query statement, and the remote supporting materials include a first portion of information obtained based on the verification information. That is, before receiving the query statement, the above method may further include: obtaining a first portion of information of the remote supporting materials based on the verification information.

[0049] The first part of the information can be understood as at least some (i.e., some or all) of the information in the remote verification materials. Optionally, the first part of the information can be the verification information itself or information calculated based on the verification information using a preset algorithm.

[0050] For example, the first part of the information can be obtained based on the summary information of the verification information. That is, before receiving the query statement, the above method may further include: processing the verification information based on a first digest algorithm to obtain the summary information of the verification information; and obtaining the first part of the remote proof material based on the summary information of the verification information. According to this example, the data length of the first part of the information can be compressed so that the first part of the information can be carried using a custom field of limited length in the remote proof material.

[0051] The above embodiments can establish a correspondence between query statements and remote supporting documents. Accordingly, the receiving end of the query-related data can parse the verification information or its related information from the first part of the information in the remote supporting documents. The receiving end compares the parsed verification information or its related information with the received verification information to determine whether the received verification information is trustworthy. If the verification information is trustworthy, the received query statement is verified based on the verification information. If the verification passes, it indicates that the received query statement corresponds to the remote supporting documents of the trust container and is a trustworthy query statement. Therefore, this application also provides a comprehensive method for determining the trustworthiness of a query statement, further improving the security of executing query statements.

[0052] In practical applications, this verification information can be implemented in various forms.

[0053] One exemplary approach is that the verification information can be a summary of the query statement, such as a summary obtained based on a second digest algorithm and the query statement.

[0054] Accordingly, the receiving end receives the query statement, its summary information, and remote supporting documents. It parses the first part of the remote supporting documents and compares the parsed information with the received summary information to determine the credibility of the summary information. If credible, it then verifies the credibility of the query statement based on the summary information. For example, it calculates the summary information of the query statement and compares it with the received summary information. If they match, the query statement is considered credible.

[0055] Another exemplary approach is that the verification information includes a public key, and the corresponding private key is used to obtain the digital signature of the query statement. Simultaneously, the query-related data includes the public key and the digital signature of the query statement. Specifically, each time a query statement is received, it can be processed in a trusted container based on the private key and a preset signature algorithm (e.g., processing the query statement using a second digest algorithm to obtain digest information, and then encrypting the digest information based on the private key) to obtain the digital signature of the query statement. When sending a query statement, the digital signature, public key, and remote proof materials are sent. Optionally, the public and private keys can be pre-generated. Based on this, the remote proof materials can also be obtained in advance based on the public key.

[0056] Accordingly, the receiving end receives the query statement, digital signature, public key, and remote proof material. It parses the remote proof material and, based on the parsed information and the public key, determines whether the public key is trustworthy. If the public key is trustworthy, it then verifies the trustworthiness of the query statement based on the public key, digital signature, and query statement. For example, it compares the signature information obtained based on the public key and query statement with the received signature information; if they match, the query statement is verified. In this way, the remote proof material does not need to be bound to the query statement itself; that is, it is not necessary to obtain remote proof material again for each received query statement. Multiple-use remote proof materials can be obtained based on pre-configured information, and only need to be regenerated when the key changes.

[0057] For example, the aforementioned public and private keys, i.e., the pre-configured asymmetric key pairs, can be RSA (Ron Rivest-Adi Shamir-Leonard Adleman encryption algorithm proposed by Ronald Rivest, Adi Shamir, and Leonard Adleman), DSA (Digital Signature Algorithm) key pairs, or ECC (Elliptic curve cryptography) key pairs, etc.

[0058] Optionally, the above method further includes: generating the aforementioned public key and private key during the initialization process of the trusted container, and obtaining the first part of the remote proof material based on the public key. That is, the public key, private key, and remote proof material can all be obtained during the TEE initialization process.

[0059] In some optional embodiments, the remote proof material includes a second portion of information obtained based on a metric value of the trusted container. That is, before receiving the query statement, the method may further include obtaining a second portion of information about the remote proof material based on a metric value of the trusted container. The metric value is data calculated based on the code of the trusted container and can be used to identify the trusted container.

[0060] The second part of the information can be understood as at least some (i.e., some or all) of the information in the remote proof material. Optionally, this second part of the information can be the metric value of a trusted container such as an Enclave itself, or information calculated based on the metric value using a preset algorithm.

[0061] According to the above embodiments, the second part of the information can characterize that the remote proof material corresponds to the trusted container. Thus, the receiving end can identify whether the container corresponding to the remote proof material is a trusted container based on the second part of the information. For example, when receiving the remote proof material, a metric value is obtained based on the second part of the information, and then compared with the trusted container metric value held or stored by the platform. If the two are consistent, it is determined that the remote proof material in the queried data is the remote proof material of a trusted container, that is, it is determined that the queried data includes the remote proof material of a trusted container.

[0062] Optionally, the second part of the information can also be obtained based on other identification information. For example, the second part of the remote proof material can be obtained based on at least one of the following: CPU physical version information, software version information, trusted container runtime environment information, and trusted container metric value.

[0063] As can be seen in some specific examples provided in the embodiments of this application, trusted proofs at the trusted container level and / or query statement level can be provided by transmitting remote proof materials, thereby enabling the privacy computing platform to ensure the security of executed query statements.

[0064] In some embodiments of this application, security can also be improved by compiling a trusted container. For example, before receiving a query statement, the method further includes: jointly compiling preset rules and source code used for auditing to obtain a trusted container.

[0065] For example, preset rules can be compiled together with the source code of the query analysis service that performs the auditing, in the form of a configuration parameter file, into a TEE-based container (such as SGX Enclave). This results in a trusted container and its metrics that are confirmed by multiple participants. Any tampering with the preset rules or the auditing procedure will cause changes to the metrics of the trusted container, thus preventing the receiver from verifying the query-related data. This further enhances the security of executing query statements.

[0066] In some exemplary application scenarios, step S220 above, which involves sending query-related data to the privacy computing platform, includes:

[0067] Send query-related data to the server of the privacy computing platform; wherein, the query-related data is used to trigger the server to send query statements and remote verification materials to the database engine of the privacy computing platform, and the remote verification materials are used by the database engine to determine that the query statements have been reviewed in the trusted container and that the query statements meet the preset conditions.

[0068] In other words, the privacy computing platform's server forwards the relevant query data. The database engine only receives data from this server, avoiding security risks associated with increased communication links and simplifying maintenance.

[0069] Corresponding to the methods provided in the above embodiments, this application also provides a method for processing query statements. This method can optionally be executed by the database engine of a privacy computing platform, but is not limited thereto. For example... Figure 3 As shown, the method includes:

[0070] S310, Receive query-related data; the query-related data includes the query statement;

[0071] S320, In response to the query related data also including remote verification materials of the trusted container, determine that the query statement has been reviewed in the trusted container and that the query statement meets the preset conditions.

[0072] For example, the database engine can receive query-related data, including the query statement. If the query-related data also includes remote verification materials of the trusted container, the database engine can determine, directly or through further verification, that the query statement has been audited in the trusted container and meets preset conditions.

[0073] Optionally, the above method further includes:

[0074] If the query statement has been audited in a trusted container and meets the preset conditions, then execute the query statement.

[0075] In other words, if a query statement is confirmed to have been audited by a trusted container and meets preset conditions, then the query statement can be executed. Since the credibility of a query statement can be verified remotely using supporting documentation, the security of executing the query statement can be improved, preventing the leakage of private data.

[0076] Optionally, querying relevant data also includes verification information; in step S320 above, in response to the querying relevant data also including remote verification materials of the trusted container, it is determined that the query statement has been reviewed in the trusted container and that the query statement meets preset conditions, including:

[0077] In response to the query of relevant data, remote proof materials of the trusted container are also included, and the verification information is verified based on the first part of the information in the remote proof materials;

[0078] If the verification information passes the verification, the query statement is then verified based on the verification information.

[0079] If the query statement passes verification, it is determined that the query statement has been audited in a trusted container and meets the preset conditions.

[0080] For example, the sending end can obtain the first part of the information based on the verification information of the query statement. The receiving end can obtain the verification information of the query statement or its related information (such as summary information) by parsing the first part of the information. The receiving end can then verify whether the verification information in the query-related data is credible by comparing the information obtained from parsing the first part of the information with the verification information in the query-related data.

[0081] Specifically, verifying the verification information based on the first part of the information in the remote verification material may include: obtaining the original information based on the first part of the information in the remote verification material; and determining that the verification information passes verification if there is a first preset relationship between the original information and the verification information.

[0082] As an example, the first presupposed relationship could be: the original information matches the verification information. For instance, if the information obtained by parsing the first part of the information matches the verification information in the query related data, then the verification information in the query related data passes the verification.

[0083] As another example, the first presupposed relationship could be: the original information is a summary of the verification information. For instance, if the information obtained by parsing the first part of the information matches the summary of the verification information in the query related data, then the verification information in the query related data passes the verification.

[0084] After the verification information passes the verification, various methods can be used to verify the query statement.

[0085] In one exemplary implementation, verifying a query statement based on verification information may include: determining that the query statement passes verification if there is a third preset relationship between the verification information in the query-related data and the query statement.

[0086] The third pre-defined relationship is, for example, that the verification information in the query-related data is the summary information of the query statement. For instance, the verification information in the query-related data is compared with the summary information obtained based on the second summary algorithm and the query statement. If the two match, the query statement passes the verification.

[0087] In other words, if the sending end determines that the query statement meets the conditions, it can send the summary information of the query statement as verification information along with the query statement. Then, the receiving end can verify the query statement based on the verification information after verifying the query statement, thereby improving the security of executing the query statement.

[0088] In another exemplary implementation, the verification information includes a public key, and the query-related data also includes a digital signature of the query statement. Accordingly, verifying the query statement based on the verification information may include: obtaining decrypted information based on the public key and the digital signature; and determining that the query statement passes verification if a first preset relationship exists between the decrypted information and the query statement.

[0089] The first preset relationship is, for example, that the decrypted information is a digest of the query statement. For instance, if the sending end determines that the query statement meets preset conditions, it can encrypt the digest of the query statement using its private key to obtain a digital signature, and then send the public key, digital signature, and query statement together. If the receiving end determines that the public key has been verified based on the first part of the remote proof material, it can obtain the decrypted information based on the public key and digital signature, and then compare the decrypted information with the digest of the query statement. If they match, the query statement is deemed to have passed verification.

[0090] It should be noted that, in the embodiments of this application, various digest algorithms, such as the first digest algorithm and the second digest algorithm, can also be called hash algorithms, hashing algorithms, etc., and can be implemented using MD5 (Message Digest Algorithm 5), SHA (Secure Hash Algorithm), MAC (Message Authentication Code), etc. Optionally, the first digest algorithm and the second digest algorithm can be the same digest algorithm or different digest algorithms.

[0091] Optionally, the above method may further include the step of determining that the queried data includes remote verification materials of a trusted container. Specifically, the above method further includes:

[0092] In response to queries for relevant data, including remote verification materials, the measure value of the container corresponding to the remote verification materials is obtained based on the second part of the information in the remote verification materials.

[0093] If the metric value of the container corresponding to the remote proof material is a preset metric value, the relevant data to be queried will include the remote proof material of the trusted container.

[0094] For example, the sending end can obtain the second part of the remote proof material information based on the metric value of the trusted container. If the query statement meets the preset conditions, the sending end sends the remote proof material containing the second part of the information along with the query statement. The receiving end can parse the second part of the information to obtain a metric value and compare it with the preset metric value (i.e., the trusted container metric value held by the receiving end). If the two are consistent, it is determined that the received remote proof material is the remote proof material of the trusted container, that is, the query related data includes the remote proof material of the trusted container.

[0095] As can be seen, corresponding to the foregoing embodiments, the receiving end for querying relevant data can perform verification at the query statement level and / or trusted container level based on remote proof materials, thereby improving the security of executing query statements and mitigating the risk of data leakage. Therefore, the specific technical details of the above verification process can also be implemented with reference to the corresponding content in the foregoing embodiments, and will not be elaborated here.

[0096] To more clearly present the technical concept of this application, several specific application examples are provided below. For clarity, the privacy computing platform in the following application examples is the DataTrust platform. The specific implementation of the TEE is SGX. It can be understood that the method of this application embodiment can also be applied to other TEE implementations, such as AMD SEV, ARM's TrustZone, etc.

[0097] Application Example 1

[0098] Figure 4 This is the overall architecture diagram of the query processing system of the privacy computing platform in this application example. Figure 4 The DataTrust SDK is a component of the DataTrust client for the privacy computing platform. It is responsible for sending user-defined SQL statements to the DataTrust server exchange, which then forwards the SQL statements to be audited to the query analysis service. In this application example, this service can be referred to as TSP (Trusted SQL Parser).

[0099] After the TSP completes its audit, it digitally signs the SQL statement and returns the relevant query data (SQL statement, digital signature, TSP's verification public key, and TEE remote proof materials) to the DataTrust server exchange. The exchange then sends the TSP's verification public key, TEE remote proof materials, and the audited SQL statement and its digital signature to DataTrust's trusted database engine TDS (Tabular Data Stream). TDS can only execute the SQL statement after verifying the TSP's verification public key and the digital signature of the SQL statement through the TEE remote proof materials.

[0100] Application Example 2

[0101] Figure 5 This is a sequence diagram illustrating the processing method for query statements in this application example. For example... Figure 5 As shown, this method is based on the interaction between the DataTust platform and the query statement analysis service (specifically, the SQL statement analysis service).

[0102] Among them, the SQL statement analysis service (i.e., TSP) performs service initialization (such as... Figure 5 Following process P1), the responsible party will verify and audit the security of the SQL statements, such as... Figure 5 The process is shown in P2.

[0103] The DataTust platform consists of a server and a database engine. The server is responsible for transmitting data related to SQL statements, such as... Figure 5 The process is shown on page 3. The database engine is responsible for validating and executing SQL statements, including... Figure 5 The process is shown on page 4.

[0104] In process P1, the SQL Statement Analysis Service (TSP) starts, initializes the TEE security environment, and generates a signing key within the TEE, which is an RSA key pair. The SQL Statement Analysis Service also generates a Remote Attestation Quote for the signature verification public key within the TEE, and then completes service initialization.

[0105] In process P2, the TSP receives the SQL statement and verifies its security. Specifically, the TSP analyzes the SQL statement within the TEE and matches it against preset security rules (also known as SQL rules). If a match is found, the SQL statement is signed within the TEE using an RSA signing key.

[0106] In process P3, the DataTust platform prepares to execute the SQL statement by first sending the SQL statement to the TSP, and then waiting for the TSP to return the signed SQL statement, its signature, the RSA verification public key, and the RA Quote of the RSA verification public key.

[0107] In process P4, the DataTust platform first verifies the RSA signature public key using the RSA Quote to determine whether to trust the RSA signature public key. After trusting the RSA signature public key, it verifies the SQL statement signature to determine whether to trust the security of the SQL statement. After trusting the security of the SQL statement, it executes the signed SQL statement.

[0108] The following technical details are involved in each of the above processes:

[0109] 1. Methods for formulating SQL rules

[0110] a) The data provider and the data requester can jointly negotiate and formulate the SQL rules that are allowed to run based on the original data protection requirements and analysis requirements. These rules are then compiled together with the TSP source code in the form of a configuration parameter file to form a TSP SGXEnclave, resulting in an SGX Enclave metric value that is confirmed by all parties.

[0111] b) The signing key of the TSP Enclave is held by the DataTrust platform, but this does not change the SGX Enclave metric. Therefore, the trustworthiness of the SQL rules integrated by TSP is not affected by the signing key.

[0112] 2. How the SQL Abstract Syntax Tree Parser Runs in a Trusted Environment

[0113] a) The SQL Abstract Syntax Tree Analyzer (SQLAbstract Syntax Tree Analyzer) is used to audit the execution of SQL statements. The SQLAbstract Syntax Tree Analyzer's operation process cannot be tampered with, therefore it must run entirely within the TEE Enclave, including both code and data.

[0114] b) In this application example, the open-source project Druid can be ported to SGX Enclave, thereby achieving the security goal of a).

[0115] c) In addition to the Druid SQL parser, other parsers can also be ported to run in the SGX Enclave.

[0116] 3. TSP automatically reviews user SQL statements based on pre-defined SQL matching rules.

[0117] a) TSP can be automatically audited.

[0118] b) TSP can automatically issue operating licenses.

[0119] 4. TSP Signature Public Key Trust Proof Method

[0120] a) The RSA asymmetric key generated by TSP in SGX Enclave is used as the signature key.

[0121] b) The RSA signing key exists only in and is used within the SGX Enclave. This can be verified to users through the open-source code of the TSP Enclave, as the Enclave metric value generated by the specific code is fixed.

[0122] c) The SHA256 hash algorithm can be used in the TSP Enclave to calculate the digest of the RSA public key and use this digest to generate the SGX Quote. This establishes an inseparable link between the digest of the RSA public key and the remote proof material (Quote) of the TSP Enclave. By proving the Quote, it can be proven that the corresponding RSA public key was generated and protected in the TSP Enclave.

[0123] 5. SQL statement execution license issuance method

[0124] a) Proof of the SQL statement's approval is achieved through RSA digital signature.

[0125] b) The RSA digital signature key is the key described in 4.a).

[0126] 6. Methods for establishing trust between the TEE database engine and TSP

[0127] a) The TEE database engine verifies the trustworthiness of the TSP Enclave RSA public key by verifying the TSP Enclave remote proof materials.

[0128] b) If the TSP Enclave RSA public key is trusted, the corresponding TSP digital signature is also trusted.

[0129] c) The TEE database engine does not need to record the rule maker's public key certificate or other qualifications; trust only needs to be established on the remote proof trust system between TEE Enclaves.

[0130] Based on this application example, the following technical effects can be achieved:

[0131] 1. Users can determine the trustworthiness of the SQL analysis auditing engine by submitting remote verification materials.

[0132] 2. Data providers protect their raw data from leakage by defining SQL matching rules;

[0133] 3. Only SQL statements that have been reviewed and signed by this service can be executed by the TEE database engine;

[0134] 4. The backbone system of the TEE database engine does not change due to SQL rules, which facilitates customization and maintenance;

[0135] 5. Analyze user-inputted SQL statements in a data isolation environment to prevent risks from spreading to the area where the user's original data is located.

[0136] Corresponding to the application scenarios and methods provided in the embodiments of this application, the embodiments of this application also provide a query statement processing apparatus 600. (See reference...) Figure 6 The device 600 may include:

[0137] The audit module 610 is used to audit the received query statements in the trusted container based on preset rules and obtain the audit information of the query statements.

[0138] The first communication module 620 is used to send query-related data to the privacy computing platform in response to the audit information meeting preset conditions; wherein, the query-related data includes query statements and remote proof materials of trusted containers.

[0139] For example, querying related data also includes verification information for verifying the query statement; remote verification materials include a first part of information obtained based on the verification information.

[0140] For example, the first part of the information in the remote verification material is obtained based on the summary information of the verification information.

[0141] For example, the verification information includes a public key, and the query related data also includes a digital signature of the query statement, which is obtained based on the private key corresponding to the public key.

[0142] For example, such as Figure 7 As shown, the device 600 also includes:

[0143] The initialization module 630 is used to generate a public key and a private key during the initialization process of the trusted container, and to obtain the first part of the remote proof material information based on the public key.

[0144] For example, remote proof material includes a second portion of information obtained based on the metrics of the trusted container.

[0145] For example, such as Figure 7 As shown, the device 600 also includes:

[0146] Compilation module 640 is used to compile preset rules and source code used for auditing to obtain a trusted container.

[0147] For example, the first communication module 620 is specifically used for:

[0148] Send query-related data to the server of the privacy computing platform; the query-related data is used to trigger the server to send query statements and remote verification materials to the database engine of the privacy computing platform. The remote verification materials are used by the database engine to determine that the query statements have been reviewed in the trusted container and that the query statements meet the preset conditions.

[0149] This application embodiment also provides another query statement processing device 800, see reference. Figure 8 The device 800 may include:

[0150] The second communication module 810 is used to receive query-related data; the query-related data includes query statements.

[0151] The trust determination module 820 is used to determine, in response to queries that include remote verification materials of a trusted container, that the query statement has been reviewed in the trusted container and that the query statement meets preset conditions.

[0152] Optionally, the relevant data to be queried includes verification information; the trust determination module 820 may include:

[0153] The first verification unit is used to verify the verification information based on the first part of the information in the remote verification material in response to a query for relevant data, which also includes remote proof materials of a trusted container.

[0154] The second verification unit is used to verify the query statement based on the verification information if the verification information passes the verification.

[0155] The verification and confirmation unit is used to determine that the query statement has been reviewed in the trusted container and meets the preset conditions if the query statement passes the verification.

[0156] Optionally, the first verification unit is specifically used for:

[0157] Based on the first part of the information in the remote verification materials, the original information is obtained;

[0158] If a first pre-defined relationship exists between the original information and the verification information, the summary information is determined to pass verification.

[0159] Optionally, the verification information includes the public key, and the query related data also includes the digital signature of the query statement; the second verification unit is specifically used for:

[0160] The decrypted information is obtained based on the public key and digital signature;

[0161] If a second pre-defined relationship exists between the decrypted information and the query statement, the query statement is deemed to have passed verification.

[0162] Optionally, the device 800 also includes a container verification module for:

[0163] In response to queries for relevant data, including remote verification materials, the measure value of the container corresponding to the remote verification materials is obtained based on the second part of the information in the remote verification materials.

[0164] If the metric value of the container corresponding to the remote proof material is a preset metric value, the relevant data to be queried will include the remote proof material of the trusted container.

[0165] Optionally, the device further includes:

[0166] The statement execution module is used to execute query statements if the query statements have been audited in a trusted container and meet preset conditions.

[0167] The apparatus provided in this application embodiment can be used to implement the method provided in this application embodiment, and has corresponding beneficial effects.

[0168] This application also provides an electronic device. Figure 9 A structural block diagram of an electronic device according to an embodiment of this application is shown. This electronic device may be a query analysis service device or a database engine device.

[0169] like Figure 9 As shown, the electronic device includes a memory 910 and a processor 920. The memory 910 stores a computer program that can run on the processor 920. When the processor 920 executes the computer program, it implements the query statement processing method in any embodiment of this application. The number of memories 910 and processors 920 can be one or more.

[0170] like Figure 9 As shown, the electronic device also includes:

[0171] The communication interface 930 is used to communicate with external devices and exchange and transmit data.

[0172] If the memory 910, processor 920, and communication interface 930 are implemented independently, they can be interconnected via a bus to communicate with each other. This bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 9 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0173] Optionally, in a specific implementation, if the memory 910, processor 920, and communication interface 930 are integrated on a single chip, then the memory 910, processor 920, and communication interface 930 can communicate with each other through an internal interface.

[0174] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the methods provided in any embodiment of this application.

[0175] This application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the methods provided in any embodiment of this application.

[0176] This application also provides a chip, which includes a processor for calling and executing instructions stored in a memory, causing a communication device on which the chip is installed to perform the method provided in this application.

[0177] This application also provides a chip, including: an input interface, an output interface, a processor, and a memory. The input interface, output interface, processor, and memory are connected through an internal connection path. The processor is used to execute code in the memory. When the code is executed, the processor is used to execute the method provided in the application embodiment.

[0178] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. General-purpose processors can be microprocessors or any conventional processor. It is worth noting that the processor can be a processor supporting Advanced Reduced Instruction Set Machines (ARM) architecture.

[0179] Further, optionally, the aforementioned memory may include read-only memory and random access memory, and may also include non-volatile random access memory. The memory may be volatile or non-volatile, or may include both. Non-volatile memory may include read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which serves as an external cache. Many forms of RAM are available by way of example, but not limitation. Examples include static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), sync link dynamic random access memory (SLDRAM), and direct memory bus RAM (DR RAM).

[0180] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another.

[0181] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of those different embodiments or examples.

[0182] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "a plurality of" means two or more, unless otherwise explicitly specified.

[0183] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process. Furthermore, the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functionality involved.

[0184] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus or device (such as a computer-based system, a processor-included system or other system that can fetch and execute instructions from, an instruction execution system, apparatus or device).

[0185] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. All or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware, the program being stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiments.

[0186] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. This storage medium can be a read-only memory, a disk, or an optical disk, etc.

[0187] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various variations or substitutions within the technical scope disclosed in this application, and these should all be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for processing query statements, comprising: The received query statement is reviewed in a trusted container based on preset rules to obtain the review information of the query statement; In response to the audit information meeting preset conditions, query-related data is sent to the privacy computing platform; wherein, the query-related data includes the query statement and the remote proof materials of the trusted container; The query-related data further includes verification information for verifying the query statement; the remote verification material includes a first part of information obtained based on the verification information, the first part of information being used by the receiving end of the query-related data to verify whether the query statement is a trustworthy query statement; verifying whether the query statement is a trustworthy query statement includes: verifying the verification information based on the first part of information; if the verification information passes verification, verifying the query statement based on the verification information; if the query statement passes verification, determining that the query statement is a trustworthy query statement; The remote proof material includes a second part of information obtained based on the metric value of the trusted container. The second part of information is used by the receiving end to identify whether the container corresponding to the remote proof material is a trusted container.

2. The method according to claim 1, wherein, The verification information includes a public key, and the query-related data also includes a digital signature of the query statement, which is obtained based on the private key corresponding to the public key.

3. The method according to any one of claims 1-2, wherein, The method further includes: The preset rules and the source code used to implement the audit are compiled together to obtain the trusted container.

4. A method for processing query statements, comprising: Receive and query relevant data; The query-related data includes the query statement; In response to the query-related data also including remote verification materials of a trusted container, it is determined that the query statement has been reviewed in the trusted container and that the query statement meets preset conditions; The query-related data includes verification information; The response to the query-related data also includes remote verification materials of a trusted container, confirming that the query statement has been reviewed in the trusted container and that the query statement meets preset conditions, including: In response to the query-related data also including remote proof materials of a trusted container, the verification information is verified based on the first part of the information in the remote proof materials; If the verification information passes verification, the query statement is verified based on the verification information; If the query statement passes verification, it is determined that the query statement has been reviewed in the trusted container and that the query statement meets preset conditions; The method further includes: In response to the query related data including remote proof materials, a metric value for the container corresponding to the remote proof materials is obtained based on the second part of the information in the remote proof materials; If the metric value of the container corresponding to the remote proof material is a preset metric value, it is determined that the query related data includes the remote proof material of the trusted container.

5. A query statement processing apparatus, comprising: The auditing module is used to audit the received query statements in a trusted container based on preset rules, and obtain the audit information of the query statements. The first communication module is used to send query-related data to the privacy computing platform in response to the audit information meeting preset conditions; wherein, the query-related data includes the query statement and the remote proof materials of the trusted container; The query-related data further includes verification information for verifying the query statement; the remote verification material includes a first part of information obtained based on the verification information, the first part of information being used by the receiving end of the query-related data to verify whether the query statement is a trustworthy query statement; verifying whether the query statement is a trustworthy query statement includes: verifying the verification information based on the first part of information; if the verification information passes verification, verifying the query statement based on the verification information; if the query statement passes verification, determining that the query statement is a trustworthy query statement; The remote proof material includes a second part of information obtained based on the metric value of the trusted container. The second part of information is used by the receiving end to identify whether the container corresponding to the remote proof material is a trusted container.

6. A query statement processing apparatus, comprising: The second communication module is used to receive query-related data; The query-related data includes the query statement; A trust determination module is used to determine, in response to the query-related data including remote verification materials of a trusted container, that the query statement has been reviewed in the trusted container and that the query statement meets preset conditions. The query-related data includes verification information; The response to the query-related data also includes remote verification materials of a trusted container, confirming that the query statement has been reviewed in the trusted container and that the query statement meets preset conditions, including: In response to the query-related data also including remote proof materials of a trusted container, the verification information is verified based on the first part of the information in the remote proof materials; If the verification information passes verification, the query statement is verified based on the verification information; If the query statement passes verification, it is determined that the query statement has been reviewed in the trusted container and that the query statement meets preset conditions; In response to the query related data including remote proof materials, a metric value for the container corresponding to the remote proof materials is obtained based on the second part of the information in the remote proof materials; If the metric value of the container corresponding to the remote proof material is a preset metric value, it is determined that the query related data includes the remote proof material of the trusted container.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory, wherein the processor, when executing the computer program, implements the method of any one of claims 1-4.

8. A computer-readable storage medium storing a computer program that, when executed by a processor, implements the method of any one of claims 1-4.

Citation Information

Patent Citations

  • Database operation request verifying method and device, server and storage medium

    CN108763887A

  • Dynamic credibility judgment method for executing clauses of select statements based on database

    CN112613302A

  • Data query method and device, electronic device and storage medium

    CN113704211A