Secure computing processing method and system based on SQL optimizer

By receiving data operation requests in multi-party security calculations, generating execution plans, and adjusting optimization rules according to access control policies, it solves the problem of reduced security after the introduction of the SQL optimizer and achieves a balance between data security and performance.

CN118607007AInactive Publication Date: 2024-09-06TIANJIN ANHUA JINHE TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411081290.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2024-09-06
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

After the introduction of the SQL optimizer, the security of multi-party secure calculations is reduced, resulting in an increased risk of data leakage.

Method used

By receiving the user's data operation request, it generates a pending execution plan, obtains the user's access control policy, selects optimization rules that comply with the access control policy based on the optimization rule set, adjusts the execution plan, and ensures data operation permissions and security.

Benefits of technology

It effectively improves the data security of multi-party secure computing, prevents data leakage, and maintains query performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118607007A
    Figure CN118607007A
Patent Text Reader

Abstract

The invention discloses a secure computing processing method and system based on an SQL optimizer, and the method comprises the steps: receiving a data operation request from a user, the data operation request being used for requesting to operate data in a database; generating an undetermined execution plan corresponding to the data operation request through an SQL (Structured Query Language) preprocessor; an access control strategy corresponding to the user is obtained, and the access control strategy is used for determining the data operation authority of the user in the database; an optimization rule is selected from an optimization rule set, and an optimization strategy involved in the selected optimization rule conforms to an access control strategy corresponding to the user; and adjusting the execution plan to be determined according to the selected optimization rule. According to the method and the device, the problem that the security of multi-party security calculation is reduced after the SQL optimizer is introduced is solved, so that the security of data in the multi-party security calculation is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of secure computing, and in particular to a secure computing processing method and system based on a SQL optimizer. Background Art

[0002] Figure 1 It is a schematic diagram of multi-party secure computing based on a database according to related technologies, such as Figure 1 As shown, the data provider of xx needs to provide the sum of social security data, water, electricity, gas data and subsidy data for one year, and this sum data can be provided to the outside. The data provider imports the evaluation rules in step 1, and then applies for data from the data administrator of the xx Municipal Bureau of Data (step 2). The data application is evaluated by the credit evaluation rules, and after the data is approved (step 3), the data is encrypted and called from the database (step 4). After calculation in the trusted computing environment, the evaluation results are exported (step 5). After the above steps, the exported result is the sum of social security data A, water, electricity, gas data B and subsidy data C, and other data will not be leaked.

[0003] When the above calculation process is processed by multi-party secure computing, the processing efficiency will be reduced. To solve this problem, an optimizer can be introduced during SQL processing. The optimizer is a subsystem of the database. The purpose of the optimizer is to obtain the most efficient execution path of the target SQL in the current situation according to certain judgment principles, that is, to obtain the best execution plan for the target SQL.

[0004] After the optimizer is introduced, the optimizer will execute SQL query statements according to a certain logic, which may cause data leakage during the execution of SQL statements, thereby reducing the security of multi-party secure computing. Summary of the invention

[0005] The embodiments of the present application provide a secure computing processing method and system based on a SQL optimizer, so as to at least solve the problem of reduced security of multi-party secure computing after the introduction of a SQL optimizer.

[0006] According to one aspect of the present application, a secure computing processing method based on a SQL optimizer is provided, comprising: receiving a data operation request from a user, wherein the data operation request is used to request an operation on data in a database; generating a pending execution plan corresponding to the data operation request through a SQL preprocessor; obtaining an access control policy corresponding to the user, wherein the access control policy is used to determine the data operation authority of the user in the database; selecting an optimization rule from an optimization rule set, wherein the optimization strategy involved in the selected optimization rule complies with the access control policy corresponding to the user; and adjusting the pending execution plan according to the selected optimization rule.

[0007] Furthermore, before receiving a data operation request from a user, the following step is also included: configuring a role for the user, wherein different roles correspond to different operation permissions, and the roles include at least a super user and an ordinary user, wherein the super user has all operation permissions, and the ordinary user only has specified operation permissions.

[0008] Furthermore, the operation permissions of the user are set for different tables in the database and / or different columns of each table.

[0009] Further, an optimization rule is selected from the optimization rule set, wherein the optimization strategy involved in the selected optimization rule complies with the access control strategy corresponding to the user. The following steps are included: for each optimization rule in the optimization rule set, the optimization strategy in the optimization rule is obtained; and it is determined whether the optimization strategy involved in the optimization rule complies with the access control strategy corresponding to the user, and if so, the optimization rule is selected.

[0010] According to another aspect of the present application, a secure computing processing system based on a SQL optimizer is also provided, including: a receiving module, used to receive a data operation request from a user, wherein the data operation request is used to request an operation on data in a database; a preprocessing module, used to generate a pending execution plan corresponding to the data operation request through a SQL preprocessor; an acquisition module, used to obtain an access control policy corresponding to the user, wherein the access control policy is used to determine the user's data operation authority in the database; a selection module, used to select an optimization rule from an optimization rule set, wherein the optimization strategy involved in the selected optimization rule complies with the access control policy corresponding to the user; and an adjustment module, used to adjust the pending execution plan according to the selected optimization rule.

[0011] Furthermore, it also includes: a configuration module, which is used to configure a role for the user before receiving a data operation request from the user, wherein different roles correspond to different operation permissions, and the roles include at least super users and ordinary users, the super users have all operation permissions, and the ordinary users only have specified operation permissions.

[0012] Furthermore, the operation permissions of the user are set for different tables in the database and / or different columns of each table.

[0013] Furthermore, the selection module is used to: for each optimization rule in the optimization rule set, obtain the optimization strategy in the optimization rule; determine whether the optimization strategy involved in the optimization rule complies with the access control policy corresponding to the user, and if so, select the optimization rule.

[0014] According to another aspect of the present application, an electronic device is also provided, comprising a memory and a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the above-mentioned method steps.

[0015] According to another aspect of the present application, a readable storage medium is provided, on which computer instructions are stored, wherein the computer instructions implement the above method steps when executed by a processor.

[0016] In the embodiment of the present application, a data operation request from a user is received, wherein the data operation request is used to request an operation on data in a database; a pending execution plan corresponding to the data operation request is generated by a SQL preprocessor; an access control policy corresponding to the user is obtained, wherein the access control policy is used to determine the data operation authority of the user in the database; an optimization rule is selected from an optimization rule set, wherein the optimization strategy involved in the optimization rule is selected to comply with the access control policy corresponding to the user; and the pending execution plan is adjusted according to the selected optimization rule. The present application solves the problem of reduced security of multi-party secure computing after the introduction of the SQL optimizer, thereby providing the security of data in multi-party secure computing. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings: Figure 1 It is a schematic diagram of a database-based multi-party secure computation according to the related technology; Figure 2is a schematic diagram of the execution flow of the parser, preprocessor and optimizer according to an embodiment of the present application; Figure 3 is a flowchart of a secure computing processing method based on a SQL optimizer according to an embodiment of the present application; and, Figure 4 It is a schematic diagram of security policies and optimization rules according to an embodiment of the present application. DETAILED DESCRIPTION

[0018] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0019] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0020] SQL optimization is involved in the following text, and SQL optimization is first explained below.

[0021] SQL (Structured Query Language) is a structured query language. It only describes what kind of data the user needs, but does not tell the database how to execute it. This leaves a lot of room for optimization in SQL rewriting. The following example illustrates this, in which the average age of fifth-grade students is queried.

[0022] SELECT avg(s.age) FROM students JOIN classes c ON s.cls_id = c.id WHERE c.grade = 5 There are two ways to execute this query. The first is to execute it directly in the order written by the user. First do an INNER JOIN operation, then filter (retain only fifth-grade students), and finally perform an aggregation operation (calculate the average) on the filtered data. The second way is to rewrite the SQL appropriately before executing it, as follows: SELECT avg(s.age) FROM students JOIN ( SELECT id FROM classes WHERE grade = 5 / * Push down filter conditions* / ) c ON s.cls_id = c.id The rewritten SQL completes the filtering operation before the INNER JOIN operation. This way, the amount of data involved in the JOIN operation will be less, and the query efficiency will be faster. This rewrite is equivalent, because the result after the JOIN only retains the data of the fifth grade, and the data other than the fifth grade does not need to participate in the JOIN operation. The main job of the optimizer is to make the query execute as quickly as possible while ensuring equivalence.

[0023] The optimizer is a subsystem of the database. The purpose of the optimizer is to obtain the most efficient execution path of the target SQL in the current situation according to certain judgment principles, that is, to obtain the best execution plan for the target SQL. According to the judgment principles used when selecting the execution plan, the optimizer in the database is divided into RBO (principle-based optimizer) and CBO (cost-based optimizer, the cost of SQL is calculated based on statistical information). RBO: rule-based optimizer. RBO is an optimizer suitable for OLTP-type SQL statements. Compared with CBO, RBO has inherent defects. Once there is a problem with the execution plan of the SQL statement, it will be difficult to adjust. The biggest disadvantage of RBO is that it uses the rules of the database's built-in code as the judgment standard, but does not take into account the actual data volume and data distribution of the target table.

[0024] CBO: Cost-based optimizer. The CBO optimizer generates a set of possible execution plans based on SQL statements, estimates the cost of each execution plan, and calls the plan generator to generate an execution plan, compares the costs of the execution plans, and finally selects the execution plan with the lowest cost. The query optimizer consists of a query transformer, a cost estimator, and a plan generator.

[0025] Of course, there are optimizers based on other rules, which will not be discussed here one by one. No matter what rules the optimizer is based on, it can be applied to the solutions in the following implementation methods. From the above examples, it can be seen that in order to optimize multi-party secure computing, the SQL optimizer optimization rules are introduced, but the blind use of optimization strategies will lead to the leakage of sensitive information. For example, the predicate pushdown in traditional databases executes the filter conditions in advance, which can reduce the amount of data processed downstream, but blindly applying it to multi-party secure SQL analysis may cause certain attributes or conditions of sensitive data to be leaked to other parties. That is, the process of the optimizer executing SQL will also involve the rewriting of statements. Therefore, data may be leaked during the process of the optimizer executing SQL.

[0026] In order to solve this problem, in the following implementation, a secure computing processing solution based on a SQL optimizer is provided. In the following embodiment, the security and performance of SQL queries in secure computing scenarios are balanced. The solution achieves a balance between data security and query performance by combining the optimizer's optimization rules with fine-grained column access control strategies.

[0027] In the following implementation, the following parties are involved: Data owner-provides data resources and computing resources.

[0028] Data developers: Develop and utilize existing multi-party data resources to form new data services. Provide data service operations to third-party visitors.

[0029] Data accessor - performs statistical analysis on the data provided by the data owner and accesses the data products created by the data developer.

[0030] Figure 2 is a schematic diagram of the execution flow of the parser, preprocessor and optimizer according to an embodiment of the present application, such as Figure 2 As shown, users will have their own corresponding role information, and each role will have corresponding access control policy information. Then, the role information and the access control policy information corresponding to each role will be associated to generate an access control policy for each user. The users here can be data developers and / or visitors. These roles, role information, and access control policies can be configured by the data owner. After receiving data access requests from users, SQL will be used to execute these data access requests to generate a SQL execution plan. After the SQL optimizer (or optimizer engine) is introduced, the access control policy and optimization rules are input into the SQL optimizer. According to the access control policy, a suitable optimization rule is selected from the optimization rule set. According to the selected optimization rule, the SQL execution plan after the SQL optimizer optimizes the data access request is obtained, that is, the execution plan that meets the requirements of secure computing. The following is an explanation of the following. Figure 2 The scheme in is described step by step.

[0031] 1) The data owner defines multiple default roles, each of which has different access permissions to the data table. For example, the super-visitor has full access to the data table, while the normal-visitor can only access the data table within the minimum permissions.

[0032] 2) Based on the defined permissions, the data owner can set fine-grained column access control policies for each data table. These policies allow or prohibit different types of operations on specific columns at the data source. For example, allowing the field to perform data query operations on the data source, allowing the field to perform data equality operations on the data source, and so on.

[0033] 3) Data developers or visitors initiate SQL query requests.

[0034] 4) After receiving the execution plan of the user's SQL query, the data owner extracts the attribute information of the user-role and role-access control policy in the database and generates the access control policy for the user.

[0035] 5) The SQL query optimizer engine of the data owner will select the appropriate optimization rule based on the user's access control policy and optimization rule set, and adjust the SQL execution plan according to the selected optimization rule.

[0036] 6) Output the final safe execution plan.

[0037] From the above analysis, we can see that in the above steps, the optimization rules are determined by the access control strategy to ensure the security of the data. Therefore, this step is an important step to solve the above problem. Figure 3 is a flowchart of a secure computing processing method based on a SQL optimizer according to an embodiment of the present application, such as Figure 3 As shown below, Figure 3 The steps involved in the method are described.

[0038] Step S302: receiving a data operation request from a user, wherein the data operation request is used to request an operation to be performed on data in a database.

[0039] Step S304: Generate a pending execution plan corresponding to the data operation request through a SQL preprocessor.

[0040] Step S306: obtaining an access control policy corresponding to the user, wherein the access control policy is used to determine the data operation authority of the user in the database.

[0041] Step S308: selecting an optimization rule from the optimization rule set, wherein the optimization strategy involved in the selected optimization rule complies with the access control strategy corresponding to the user.

[0042] Step S310: adjusting the pending execution plan according to the selected optimization rule.

[0043] Through the above steps, the problem of reduced security of multi-party secure computing after the introduction of the SQL optimizer is solved, thereby improving the security of data in the multi-party secure computing.

[0044] In the above steps, before receiving a data operation request from a user, the following steps may also be included: configuring a role for the user, wherein different roles correspond to different operation permissions, and the roles include at least a super user and an ordinary user, wherein the super user has all operation permissions, and the ordinary user only has specified operation permissions.

[0045] As an optional implementation, the operation permissions of the user may also be set for different tables in the database and / or different columns of each table.

[0046] In the above step S308, the following steps may be included: For each optimization rule in the optimization rule set, obtaining an optimization strategy in the optimization rule; Determine whether the optimization strategy involved in the optimization rule complies with the access control strategy corresponding to the user, and if so, select the optimization rule.

[0047] The following is an example to illustrate this.

[0048] In the following example, you can use the security access policy to better formulate the execution plan.

[0049] SQL queries for multi-party secure computing may involve multiple data owners. They are secure access to and analysis of data from multiple data owners, not a single database.

[0050] 1) The data owner predefines the security access policy for the table The data owner defines two roles on each table, such as super-visitor, who has full security access to the data table; and normal-vistor, who can access the table only within the scope of permissions.

[0051] The data owner sets different security access policies for the roles on each data table. For example, there is a data table patdata, with columns ID and DIS. For the super-visitor role, set the security access policy of all columns to ALL, indicating that there is no restriction on access to all table fields. For the normal-visitor role, set the security access policy of the DIS column to searchonlocal, allowing query operations on the field to be performed in local plaintext (including equal, greater than, less than, fuzzy, etc.). That is, filtering operations involving the field DIS can be performed in local plaintext state. If this option is not set, filtering operations involving this field must be performed in multi-party secure computing.

[0052] The data owner grants the corresponding normal-visitor or super-visitor role to the user.

[0053] 2) User initiated access The user initiates a multi-party SQL query request to perform a joint query on multi-party data. The platform receives the SQL query request, and the SQL statement passes through the parser and preprocessor to generate an initial logical plan. The platform obtains the security access policy of the table involved in the SQL request, and the security access policy of the table corresponds to the user's role.

[0054] Input the initial logical plan and the table's security access policy (searchonlocal allows query operations on the field (including equal, greater than, less than, fuzzy, etc.) on local plain text, matchonlocal allows data equality operations on the field on local plain text, etc.), and the optimization rule set (predicate pushdown rules, aggregation pushdown rules, sort pushdown rules, etc.) into the optimizer, associate the optimization rules with the security policy, and select appropriate rules according to the requirements of the security policy. Rewrite the logical execution plan. Output the final logical execution plan and start execution.

[0055] In this example, the parser: parses the SQL statement by keywords and generates the corresponding syntax tree. The preprocessor: further checks whether the syntax tree is legal according to some syntax rules, such as checking whether the data table and data column exist, resolving names and aliases to see if they are ambiguous, and converting the syntax tree into an initial logical execution plan.

[0056] Figure 4 is a schematic diagram of the security policy and optimization rules according to the embodiment of the present application, such as Figure 4 As shown in the figure, the security policy is named: searchonlocal (local search policy), which is used to indicate how to perform the predetermined operation. Figure 4For example, this policy allows query operations (including equal, greater than, less than, and fuzzy queries, etc.) on predetermined fields on local plaintext. Another security policy is named: matchonlocal (local join policy), which allows data equality operations on predetermined fields on local plaintext. The rule optimizations are as follows: predicate pushdown rules, join pushdown rules. In the first example, the security policy (searchonlocal) configured for the column selects the predicate pushdown optimization rule according to the security policy, which triggers the optimization rule predicate pushdown, and rewrites the execution logic plan according to the optimization rule. In the second example, the security policy (searchonlocal matchonlocal) configured for the column selects the predicate pushdown optimization rule and join pushdown rule according to the security policy, which triggers the predicate pushdown rule and join pushdown rule, and rewrites the execution logic plan according to the optimization rule.

[0057] In this embodiment, an electronic device is provided, including a memory and a processor. The memory stores a computer program, and the processor is configured to run the computer program to execute the method in the above embodiment.

[0058] The above program can be run in the processor, or it can be stored in the memory (or computer-readable medium), which includes permanent and non-permanent, removable and non-removable media. Information storage can be achieved by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

[0059] These computer programs can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps of the functions specified in one or more blocks can be implemented by different modules corresponding to different steps.

[0060] Such a device or system is provided in this embodiment. The system is called a secure computing processing system based on SQL optimizer, and the system includes: a receiving module for receiving a data operation request from a user, wherein the data operation request is used to request an operation on data in a database; a preprocessing module for generating a pending execution plan corresponding to the data operation request through an SQL preprocessor; an acquisition module for acquiring an access control policy corresponding to the user, wherein the access control policy is used to determine the user's data operation authority in the database; a selection module for selecting an optimization rule from an optimization rule set, wherein the optimization strategy involved in the selected optimization rule complies with the access control policy corresponding to the user; and an adjustment module for adjusting the pending execution plan according to the selected optimization rule.

[0061] The system or device is used to implement the functions of the method in the above-mentioned embodiment. Each module in the system or device corresponds to each step in the method, which has been explained in the method and will not be repeated here.

[0062] Optionally, it also includes: a configuration module, which is used to configure a role for the user before receiving a data operation request from the user, wherein different roles correspond to different operation permissions, and the roles include at least super users and ordinary users, the super users have all operation permissions, and the ordinary users only have data browsing permissions.

[0063] Optionally, the operation permissions of the user are set for different tables in the database and / or different columns of each table.

[0064] Optionally, the selection module is used to: for each optimization rule in the optimization rule set, obtain the optimization strategy in the optimization rule; determine whether the optimization strategy involved in the optimization rule complies with the access control policy corresponding to the user, and if so, select the optimization rule.

[0065] Through the above implementation, the problem of reduced security of multi-party secure computing after the introduction of the SQL optimizer is solved, thereby improving the security of data in the multi-party secure computing.

[0066] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A secure computing processing method based on SQL optimizer, characterized in that: include: Receiving a data operation request from a user, wherein the data operation request is used to request an operation to be performed on data in a database; Generate a pending execution plan corresponding to the data operation request through a SQL preprocessor; Obtaining an access control policy corresponding to the user, wherein the access control policy is used to determine the data operation authority of the user in the database; Selecting an optimization rule from the optimization rule set, wherein the optimization strategy involved in the selected optimization rule complies with the access control strategy corresponding to the user; The pending execution plan is adjusted according to the selected optimization rule.

2. The method according to claim 1, characterized in that: Before receiving a data operation request from a user, the following steps are also included: Roles are configured for the user, wherein different roles correspond to different operation permissions, and the roles at least include super users and ordinary users. The super user has all operation permissions, and the ordinary user only has specified operation permissions.

3. The method according to claim 1 or 2, characterized in that: The operation permissions of the user are set for different tables in the database and / or different columns of each table.

4. The method according to claim 3, characterized in that Select an optimization rule from the optimization rule set: For each optimization rule in the optimization rule set, obtaining an optimization strategy in the optimization rule; Determine whether the optimization strategy involved in the optimization rule complies with the access control strategy corresponding to the user, and if so, select the optimization rule.

5. A secure computing processing system based on SQL optimizer, characterized in that: include: A receiving module, used for receiving a data operation request from a user, wherein the data operation request is used for requesting to operate the data in the database; A preprocessing module, used to generate a pending execution plan corresponding to the data operation request through a SQL preprocessor; An acquisition module, used to acquire an access control policy corresponding to the user, wherein the access control policy is used to determine the data operation authority of the user in the database; A selection module, configured to select an optimization rule from the optimization rule set, wherein the optimization strategy involved in the selected optimization rule complies with the access control strategy corresponding to the user; The adjustment module is used to adjust the pending execution plan according to the selected optimization rule.

6. The system according to claim 5, characterized in that Also includes: The configuration module is used to configure a role for the user before receiving a data operation request from the user, wherein different roles correspond to different operation permissions, and the roles include at least a super user and an ordinary user, wherein the super user has all operation permissions, and the ordinary user only has specified operation permissions.

7. The system according to claim 5 or 6, characterized in that: The operation permissions of the user are set for different tables in the database and / or different columns of each table.

8. The system according to claim 7, characterized in that The selection module is used to: For each optimization rule in the optimization rule set, obtaining an optimization strategy in the optimization rule; Determine whether the optimization strategy involved in the optimization rule complies with the access control strategy corresponding to the user, and if so, select the optimization rule.

Citation Information

Patent Citations

  • Access control method for spatial database

    CN101976249A

  • Data query method, device and equipment and storage medium

    CN113986952A

  • Data joint query method, device and equipment and computer readable storage medium

    CN114328504A

  • Optimizing fine grained access control using authorization indexes

    US20120330925A1

  • Method and apparatus for federated data query, electronic device, and computer-readable storage medium

    US20230325389A1