Data desensitization method, device and equipment for distributed database

By indicating the desensitization information in the query statement in the distributed database, the computing node performs desensitization processing, solving the problem of high coupling between data desensitization rules and business codes, and achieving flexible desensitization rules and higher data security.

CN119128995BActive Publication Date: 2025-03-07SUZHOU JIBEISI DATA TECHNOLOGY CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411641415.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-03-07
Estimated Expiration
2044-11-18

AI Technical Summary

Technical Problem

In the prior art, data desensitization rules have high coupling with business code, making it difficult to modify and expand the desensitization rules, reducing the flexibility of the desensitization rules.

Method used

In a distributed database, before sending the query statement to the calculation node, the coordination point writes annotated desensitization information in the query statement, and the calculation node performs desensitization processing based on the desensitization information, without setting desensitization rules in the business code.

Benefits of technology

It realizes the desensitization process during the query process, decouples the desensitization rules and business code, improves the flexibility of the desensitization rules, and improves the security of data through complete desensitization rules.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119128995B_ABST
    Figure CN119128995B_ABST
Patent Text Reader

Abstract

The present invention provides a data desensitization method, device and equipment for a distributed database, which can be applied to the field of distributed database technology. The method includes: in response to receiving an initial query statement, determining a target field to be queried, wherein the target field includes a target function and a target data column; in the case where the target data column is determined to be a sensitive data column, determining a target desensitization rule for the target field according to a first desensitization rule corresponding to the target data column and a second desensitization rule corresponding to the target function; generating target desensitization configuration information corresponding to the target field according to the target desensitization rule; writing the target desensitization information into the initial query statement in the form of an annotation to obtain a target query statement; and sending the target query statement to a computing node so that the computing node executes the target query statement to obtain a target query result, wherein the target query result is obtained by desensitizing according to the target desensitization information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of distributed databases, and more specifically to a data desensitization method, device and equipment for a distributed database. Background Art

[0002] With the rapid development of big data technology, data security issues have received widespread attention. As an important means of maintaining data security, data desensitization protects sensitive data by deforming it.

[0003] When masking sensitive data, data is usually obtained from the database first, and then the data is transformed according to the masking rules in the business code. However, setting masking rules in the business code will lead to a high degree of coupling between the masking rules and the business code, making it difficult to modify and expand the masking rules. Summary of the invention

[0004] In view of the above problems, the present invention provides a data desensitization method, device and equipment for a distributed database.

[0005] According to a first aspect of the present invention, there is provided a data desensitization method for a distributed database, which is applied to a coordination node and includes: determining a target field to be queried according to an initial query statement, wherein the target field includes a target function and a target data column; in the case where the target data column is determined to be a sensitive data column, determining a target desensitization rule for the target field according to a first desensitization rule corresponding to the target data column and a second desensitization rule corresponding to the target function; generating target desensitization information corresponding to the target field according to the target desensitization rule; writing the target desensitization information into the initial query statement in the form of an annotation to obtain a target query statement; and sending the target query statement to a computing node so that the computing node executes the target query statement to obtain a target query result, wherein the target query result is obtained by desensitizing according to the target desensitization information.

[0006] According to a second aspect of the present invention, a data desensitization method for a distributed database is provided, which is applied to a computing node and includes: in response to receiving a target query statement sent by a coordination node, obtaining target desensitization information from the target query statement and creating an execution plan for the target query statement, wherein the target query statement is obtained by performing the following operations using the coordination node: determining a target field to be queried according to an initial query statement, wherein the target field includes a target function and a target data column; when determining that the target data column is a sensitive data column, determining a target desensitization rule for the target field according to a first desensitization rule corresponding to the target data column and a second desensitization rule corresponding to the target function; generating target desensitization information corresponding to the target field according to the target desensitization rule; writing the target desensitization information into the initial query statement in the form of an annotation to obtain the target query statement; executing the execution plan to obtain an initial query result; performing desensitization processing on the initial query result according to the target desensitization configuration information to obtain a target query result; and returning the target query result to the coordination node so that the coordination node returns the target query result to the client.

[0007] The third aspect of the present invention provides a data desensitization device for a distributed database, which is applied to a coordination node and includes: a field determination module, which is used to determine the target field to be queried in response to receiving an initial query statement, wherein the target field includes a target function and a target data column; a rule determination module, which is used to determine the target desensitization rule for the target field according to a first desensitization rule corresponding to the target data column and a second desensitization rule corresponding to the target function when the target data column is determined to be a sensitive data column; an information generation module, which is used to generate target desensitization information corresponding to the target field according to the target desensitization rule; an information writing module, which is used to write the target desensitization information into the initial query statement in the form of a comment to obtain a target query statement; and a statement sending module, which is used to send the target query statement to a computing node, so that the computing node executes the target query statement to obtain a target query result, wherein the target query result is obtained by desensitizing according to the target desensitization information.

[0008] The fourth aspect of the present invention provides a data desensitization device for a distributed database, which is applied to a computing node and includes: a plan generation module, which is used to obtain target desensitization information from the target query statement in response to receiving a target query statement sent by a coordination node, and create an execution plan for the target query statement, wherein the target query statement is obtained by using the coordination node to perform the following operations: according to the initial query statement, determine the target field to be queried, wherein the target field includes a target function and a target data column; when it is determined that the target data column is a sensitive data column, according to the first desensitization rule corresponding to the target data column and the target function corresponding to the target function; A corresponding second desensitization rule determines the target desensitization rule for the target field; according to the target desensitization rule, target desensitization information corresponding to the target field is generated; the target desensitization information is written into the initial query statement in the form of an annotation to obtain a target query statement; a plan execution module is used to execute the above execution plan to obtain an initial query result; a desensitization processing module is used to perform desensitization processing on the above initial query result according to the above target desensitization configuration information to obtain a target query result; and a result return module is used to return the above target query result to the above coordination node, so that the above coordination node returns the above target query result to the client.

[0009] A fifth aspect of the present invention provides an electronic device, comprising: one or more processors; a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above method.

[0010] According to an embodiment of the present invention, before sending the initial query statement to the computing node, the coordination node writes the target desensitization information in the initial query statement in the form of a comment to generate a target query statement. The computing node can desensitize the initial query result according to the target desensitization information in the target query statement, and return the desensitized target query result, thereby completing the desensitization process in the query process without configuring the desensitization rules in the business code, realizing the decoupling of the desensitization rules from the business code, and improving the flexibility of the desensitization rules. In addition, by considering the setting of the desensitization rules for the target field, the desensitization rules are more complete, and the security of the data is further improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The above contents and other objects, features and advantages of the present invention will become more apparent through the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:

[0012] Figure 1 An application scenario diagram of a distributed database data desensitization method, apparatus, and device according to an embodiment of the present invention is shown.

[0013] Figure 2A flow chart of a data desensitization method for a distributed database according to an embodiment of the present invention is shown.

[0014] Figure 3 A flowchart of determining target desensitization rules according to a specific embodiment of the present invention is shown.

[0015] Figure 4 A flow chart of a data desensitization method for a distributed database according to another embodiment of the present invention is shown.

[0016] Figure 5 A flow chart of a data desensitization method according to a specific embodiment of the present invention is shown.

[0017] Figure 6 A structural block diagram of a data desensitization device for a distributed database applied to a coordination node according to an embodiment of the present invention is shown.

[0018] Figure 7 A structural block diagram of a data desensitization device for a distributed database applied to a computing node according to an embodiment of the present invention is shown.

[0019] Figure 8 A block diagram of an electronic device suitable for implementing a data desensitization method for a distributed database according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0020] Below, embodiments of the present invention will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present invention. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of embodiments of the present invention. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of concepts of the present invention.

[0021] The terms used herein are only for describing specific embodiments and are not intended to limit the present invention. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0022] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0023] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0024] In the technical solution of the present invention, the user information (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0025] In the scenario of using personal information for automated decision-making, the methods, devices, and systems provided by the embodiments of the present invention provide users with corresponding operation portals for users to choose to agree or reject the automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered. The expression "automated decision-making" here refers to the activity of automatically analyzing and evaluating an individual's behavioral habits, interests and hobbies, or economic, health, credit status, etc. through computer programs, and making decisions. The expression "expert decision-making" here refers to the activity of making decisions by people who specialize in a certain field, have specialized experience, knowledge and skills, and have reached a certain level of professionalism.

[0026] When masking sensitive data, there are usually two masking methods, static masking and dynamic masking. Static masking is to transform the data before storing it in the database, so the data actually stored in the database is not the original data, which has a great impact on the accuracy of the data stored in the database. Dynamic masking usually uses the masking rules in the business code to transform sensitive data, but due to the high coupling between the masking rules and the business code, it is difficult to modify and expand the masking rules, so there is a problem of poor flexibility of the masking rules.

[0027] In the embodiment of the present invention, in a distributed database, before the coordination node sends the query statement to the computing node, the desensitization information in the form of comments is written into the query statement, and the computing node performs desensitization according to the desensitization information, without setting the desensitization rule method in the business code. In addition, the embodiment of the present invention also considers the setting of desensitization rules for the target field to improve the desensitization rules.

[0028] An embodiment of the present invention provides a data desensitization method for a distributed database, which is applied to a coordination node, including: in response to receiving an initial query statement, determining a target field to be queried, wherein the target field includes a target function and a target data column; when determining that the target data column is a sensitive data column, determining a target desensitization rule for the target field according to a first desensitization rule corresponding to the target data column and a second desensitization rule corresponding to the target function; generating target desensitization configuration information corresponding to the target field according to the target desensitization rule; writing the target desensitization information into the initial query statement in the form of a comment to obtain a target query statement; and sending the target query statement to a computing node so that the computing node executes the target query statement to obtain a target query result, wherein the target query result is obtained by desensitizing according to the target desensitization information.

[0029] Figure 1 An application scenario diagram of a data desensitization method for a distributed database according to an embodiment of the present invention is shown.

[0030] like Figure 1 As shown, the application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 110, and a distributed database 120. The distributed database 120 includes a coordination node 121, a first computing node 122, a second computing node 123, and a third computing node 124. The network 110 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the distributed database 120. The network 110 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.

[0031] The user can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the distributed database 120 through the network 110 to perform operations such as adding data, deleting data, modifying data, and querying data on the distributed database 120. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).

[0032] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0033] The distributed database 120 can be a database that provides data storage and computing services. It can perform data processing on received user requests and other data, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the first terminal device 101, the second terminal device 102, and the third terminal device 103.

[0034] The coordination node 121 can be used to respond to requests sent by the first terminal device 101, the second terminal device 102, and the third terminal device 103, and forward the requests to the first computing node 122, the second computing node 123, and the third computing node 124 to balance the load of the first computing node 122, the second computing node 123, and the third computing node 124.

[0035] The first computing node 122 , the second computing node 123 and the third computing node 124 are basic storage units and computing units of the distributed database 120 , and can be used to respond to requests sent by the coordination node 121 , perform operations on stored data, and return operation results to the coordination node 121 .

[0036] It should be noted that the data desensitization method for a distributed database provided in an embodiment of the present invention can generally be executed by a distributed database 120. Accordingly, the data desensitization device for a distributed database provided in an embodiment of the present invention can generally be arranged in a distributed database 120. The data desensitization method for a distributed database provided in an embodiment of the present invention can also be executed by a server or server cluster that is different from the distributed database 120 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the distributed database 120. Accordingly, the data desensitization device for a distributed database provided in an embodiment of the present invention can also be arranged in a server or server cluster that is different from the distributed database 120 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the distributed database 120.

[0037] It should be understood that Figure 1 The number of terminal devices, networks, coordination nodes, and computing nodes in the embodiment is only for illustration purposes. Any number of terminal devices, networks, coordination nodes, and computing nodes may be provided as required.

[0038] The following will be based on Figure 1 The scene described by Figure 2~Figure 5 The data desensitization method of the distributed database of the embodiment of the invention is described in detail.

[0039] Figure 2 A flow chart of a data desensitization method for a distributed database according to an embodiment of the present invention is shown.

[0040] like Figure 2 As shown, the data desensitization of the distributed database of this embodiment includes operations S210 to S250, and the data desensitization method of the distributed database can be executed by a coordination node.

[0041] In operation S210, a target field to be queried is determined according to an initial query statement.

[0042] According to an embodiment of the present invention, the initial query statement may be a query statement received by the coordination node. Specifically, in response to receiving the initial query statement, the coordination node may parse the initial query statement and determine the target field to be queried.

[0043] According to an embodiment of the present invention, the initial query statement may also be a query statement to be sent to a computing node. Specifically, the coordination node may parse the original query statement in response to receiving the original query statement, create a query plan for the original query statement, and determine that the query statement to be sent to the computing node in the last step of the query plan is the initial query statement.

[0044] According to an embodiment of the present invention, the target field includes a target function and a target data column. Specifically, the target field is used to query the target data column to obtain the target data, and to calculate the target data according to the target function, that is, the input parameter of the target function is the target data, and the output parameter is the field value of the target field. For example, the target function can perform operations such as logical judgment on the target data, and can also calculate multiple target data queried according to multiple target data columns.

[0045] In operation S220, when it is determined that the target data column is a sensitive data column, a target desensitization rule for the target field is determined according to a first desensitization rule corresponding to the target data column and a second desensitization rule corresponding to the target function.

[0046] According to an embodiment of the present invention, determining whether a target data column is a sensitive data column includes: determining a target data table corresponding to the target data column, obtaining desensitizing configuration information of the target data table from a table structure file of the target data table, and determining whether the target data column is a sensitive data column based on the desensitizing configuration information.

[0047] According to an embodiment of the present invention, the first desensitization rule may be a desensitization rule corresponding to the target data column, and the second desensitization rule may be a desensitization rule corresponding to the target function. Since there may be a conflict between the first desensitization rule and the second desensitization rule, and when the target field is for multiple target data columns, there may also be a conflict between the first desensitization rules of the multiple target data columns, it is necessary to determine the desensitization rule for the target field based on the first desensitization rule and the second desensitization rule.

[0048] According to an embodiment of the present invention, the first desensitization rule and the second desensitization rule can be set according to needs, and can specifically include hash desensitization, replacement desensitization, mask desensitization, encryption desensitization, etc., without any limitation.

[0049] According to an embodiment of the present invention, the first desensitization rule and the second desensitization rule may also be related to user permissions, and the first desensitization rule and the second desensitization rule may be different for users with different permissions. Specifically, a user identifier may be configured in the initial query statement, and the permissions corresponding to the user may be determined based on the user identifier.

[0050] In operation S230, target desensitization information corresponding to the target field is generated according to the target desensitization rule.

[0051] According to an embodiment of the present invention, the target desensitization information corresponding to the target field is generated according to the target desensitization rule. Specifically, the target desensitization information may include the target desensitization rule and may also include the association relationship between the target desensitization rule and the calculated desensitization field.

[0052] According to an embodiment of the present invention, by configuring the association relationship between the desensitization rule and the target field in the target desensitization information, the target field targeted by the desensitization rule can be made clear.

[0053] In operation S240, the target desensitized information is written into the initial query statement in the form of a comment to obtain a target query statement.

[0054] According to an embodiment of the present invention, when the target desensitization information is written into the initial query statement in the form of a comment, the target desensitization information can be used as a hint to reduce the impact on the query statement. For example, the target query statement can be select / * +mask[1,'sha']* / c1,c2 from t, where / * +mask[1,'sha']* / is the target desensitization configuration information, which is used to indicate that the desensitization rule corresponding to the first target field is a hash algorithm (sha), c1 is the first target field, c2 is the second target field, and t is the target data table.

[0055] In operation S250 , the target query statement is sent to the computing node, so that the computing node executes the target query statement to obtain the target query result.

[0056] According to an embodiment of the present invention, the target query result is obtained by performing desensitization processing on the target desensitized information.

[0057] According to an embodiment of the present invention, in response to receiving a target query statement, the computing node can obtain a target query result after executing the target query statement, and return the target query result to the coordination node. Specifically, the computing node can first query the database according to the target query statement to obtain an initial query result, and then desensitize the initial query result according to the target desensitization configuration information to obtain the target query result.

[0058] According to an embodiment of the present invention, in response to receiving the target query result, the coordination node returns the target query result to the client.

[0059] According to an embodiment of the present invention, before sending the initial query statement to the computing node, the coordination node writes the target desensitization information in the initial query statement in the form of a comment to generate a target query statement. The computing node can desensitize the initial query result according to the target desensitization information in the target query statement, and return the desensitized target query result, thereby completing the desensitization process in the query process without configuring the desensitization rules in the business code, realizing the decoupling of the desensitization rules from the business code, and improving the flexibility of the desensitization rules. In addition, by considering the setting of the desensitization rules for the target field, the desensitization rules are more complete, and the security of the data is further improved.

[0060] According to an embodiment of the present invention, before determining the target desensitization rule for the target field, it also includes: determining the target data table corresponding to the target data column according to the initial query statement; determining the target desensitization configuration information corresponding to the target data table according to the target data table; obtaining the first desensitization rule corresponding to the target data column according to the target desensitization configuration information and the target data column; and determining the second desensitization rule corresponding to the target function according to the return value data type of the target function using the default desensitization configuration information.

[0061] According to an embodiment of the present invention, the initial query statement may include a table identifier of a target data table, and the target data table may be determined according to the table identifier.

[0062] According to an embodiment of the present invention, the target desensitization configuration information includes desensitization rules corresponding to data columns in the target data table. The target desensitization configuration information of the target data table can be stored in the table structure file (frm) of the target data table. Therefore, when the target desensitization configuration information needs to be modified, only the table structure file needs to be modified, which is highly flexible and avoids affecting the original data stored in the database.

[0063] According to an embodiment of the present invention, the target desensitization configuration information of the target data table can be set when creating the target data table, or can be set for an existing target data table. Specifically, the sensitive data columns in the target data table and the desensitization rules corresponding to the sensitive data columns can be specified through structured query statements (SQL). For example, altertable t alter a masked with(function='sha') is used to indicate that the a column in the t table is set as a sensitive data column, and the desensitization rule is hash desensitization (sha), where t is the target data table and a is the data column in the target data table.

[0064] According to an embodiment of the present invention, the first desensitization rule may be determined from the target desensitization configuration information through the column identifier of the target data column.

[0065] According to an embodiment of the present invention, the default desensitization configuration information includes desensitization rules corresponding to data types. Specifically, for data of date and time data types, the desensitization is replaced with a preset date and time such as "1900-01-01 00:00:00", for integer, floating point and exact data types, the desensitization is replaced with a preset value such as "0", for string types, the desensitization is replaced with a preset string such as "XXXX", and no desensitization is performed on null values ​​(NULL).

[0066] According to an embodiment of the present invention, since the target function is generated according to the actual query requirements, it is impossible to set a fixed desensitization rule for the target function. However, since the target function only returns the return value to the user as the query result, it is only necessary to desensitize the return value. And since the data type is relatively fixed, desensitization for the target function can be achieved by setting the default desensitization configuration information according to the data type.

[0067] According to an embodiment of the present invention, the return value data type of the target function can be obtained from the target function.

[0068] According to an embodiment of the present invention, the default desensitizing configuration information can also be used to desensitize the data table. Specifically, when only the sensitive data column in the data table is specified, but the desensitization rules corresponding to the sensitive data column are not specified, desensitization is performed according to the data type of the sensitive data stored in the sensitive data column according to the default desensitizing configuration information.

[0069] According to an embodiment of the present invention, since the target desensitization configuration information and the default desensitization configuration information are pre-stored in a database, the first desensitization rule and the second desensitization rule can be obtained from the target desensitization configuration information and the default desensitization configuration information when determining the first desensitization rule. When the desensitization rule needs to be modified, the desensitization rule can also be modified by modifying the target desensitization configuration information and the default desensitization configuration information, thereby improving the flexibility of determining and modifying the desensitization rules.

[0070] According to an embodiment of the present invention, a target desensitization rule for a target field is determined according to a first desensitization rule corresponding to a target data column and a second desensitization rule corresponding to a target function, including: determining a function type of the target function; when the function type is a control flow function, determining the target desensitization rule according to the first desensitization rule and the second desensitization rule; and when the function type is a non-control flow function, determining the target desensitization rule according to the second desensitization rule.

[0071] According to an embodiment of the present invention, function types may include control flow functions and non-control flow functions.

[0072] According to an embodiment of the present invention, a control flow function may be a function that executes a corresponding process according to a condition that is met, so generally, the control flow function does not calculate the target data, but directly returns the target data when the condition is met. Specifically, the control flow function may include a conditional judgment function, such as a case when function, an if function, an ifnull function, an nvl function, and a coalesce function.

[0073] According to an embodiment of the present invention, a non-control flow function may be a function for comparing or calculating target data, so the non-control flow function does not directly return the target data, but returns the calculation result generated by calculating the target data. Specifically, the non-control flow function may include string functions, comparison functions, numerical functions, time and date functions, data analysis functions (OLAP), and aggregation functions, etc.

[0074] According to an embodiment of the present invention, since the non-control flow function will calculate the target data, the data type of the calculation result may be different from the data type of the target data. The calculation result cannot be desensitized by the first desensitization rule. Therefore, the calculation result can be directly desensitized by the second desensitization rule, that is, the second desensitization rule is determined as the target desensitization rule.

[0075] For example, the initial query statement is select concat(mask_col, $123) from t, where mask_col is a sensitive data column, the concat function is used to connect the sensitive target data in mask_col and the string "123", and the return value data type of the concat function is a string type, so the second desensitization rule is the default desensitization rule for the string type.

[0076] According to an embodiment of the present invention, target desensitization rules are determined by taking different function types into consideration, so that the desensitization rules are more perfect and data security is guaranteed.

[0077] According to an embodiment of the present invention, when the function type is a control flow function, a target desensitization rule is determined according to a first desensitization rule and a second desensitization rule, including: when it is determined that the return value of the target function is related to a target data column, the first desensitization rule is determined to be the target desensitization rule; and when it is determined that the return value of the target function is related to multiple target data columns, the second desensitization rule is determined to be the target desensitization rule.

[0078] According to an embodiment of the present invention, the control flow function directly returns the target data, so when the target field return value is one, it can be determined that the first desensitization rule corresponding to the target data column is the target desensitization rule.

[0079] For example, the initial query statement is select case col when 1 then '123' when 2 then '456' when 3 then mask_col else '789' from t, where the case when function is a control flow function, col and mask_col are target data columns, mask_col is a sensitive data column, t is a target data table, and the return value can be one of the sensitive target data in mask_col, the string "123", the string "456", and the string "789", that is, the return value is related to mask_col, so it can be determined that the first desensitization rule corresponding to mask_col is the target desensitization rule.

[0080] According to an embodiment of the present invention, when the return value is related to multiple target data columns, there is a conflict between the desensitization rules of the multiple target data columns, and desensitization cannot be performed directly through the first desensitization rule. Therefore, the second desensitization rule can be determined as the target desensitization rule.

[0081] According to an embodiment of the present invention, when the return value is related to multiple desensitized data columns, the second desensitization rule is determined to be the target desensitization rule.

[0082] For example, the initial query statement is select nvl(mask_col1,mask_col2) from t, where mask_col1 and mask_col2 are target data columns and both are sensitive data columns, t is the target data table, and the return value can be the sensitive target data in mask_col1 or the sensitive target data in mask_col2, that is, the return value is related to multiple target data columns, so it can be determined that the second desensitization rule corresponding to the nvl function is the target desensitization rule.

[0083] According to an embodiment of the present invention, when the return value is related to multiple target data columns, and the multiple target data columns include non-sensitive data columns, the second desensitization rule is still determined to be the target desensitization rule.

[0084] For example, the initial query statement is select coalesce(col, mask_col) from t, where col and mask_col are target data columns, and only mask_col is a sensitive data column, t is the target data table, and the return value can be the target data in col or the sensitive target data in mask_col, that is, the return value is related to multiple target data columns, and the multiple target data columns include non-sensitive data columns, and the second desensitization rule corresponding to the coalesce function is determined to be the target desensitization rule.

[0085] According to an embodiment of the present invention, the target desensitization rule is determined by considering the return value of the control flow function, so that the desensitization rule is more perfect and data security is guaranteed.

[0086] According to an embodiment of the present invention, the method for determining a target desensitization rule further includes: determining a target desensitization rule for a target field according to a first desensitization rule corresponding to a target data column and a second desensitization rule corresponding to a target function.

[0087] According to an embodiment of the present invention, when a target sub-function is nested inside a target function, and both the target function and the target sub-function are control flow functions, a target desensitization rule is determined according to a first desensitization rule and a second desensitization rule.

[0088] According to an embodiment of the present invention, when it is determined that the return value of the target function is related to a target data column, and the return value of the target sub-function is related to a target data column, the first desensitization rule is determined to be the target desensitization rule.

[0089] For example, the initial query statement is select case col when 1 then nvl(mask_col, '123')when 2 then '456' else '789' from t, where the case when function is the target function, and the target sub-function nvl function is nested inside it. col and mask_col are target data columns, mask_col is a sensitive data column, and the return value of the nvl function can be the sensitive target data in mask_col or the string "123", that is, the return value of the target sub-function is related to a target data column, and the return value of the case when function can be one of the sensitive target data in mask_col, the string "123", the string "456", and the string "789", that is, the return value of the target function is also related to a target data column, and the second desensitization rule corresponding to mask_col is determined to be the target desensitization rule.

[0090] According to an embodiment of the present invention, when it is determined that the return value of the target function is related to multiple target data columns, or the return value of the target sub-function is related to multiple target data columns, the second desensitization rule is determined to be the target desensitization rule.

[0091] According to an embodiment of the present invention, when the target function or the target sub-function is a non-control flow function, the second desensitization rule is determined to be the target desensitization rule.

[0092] According to an embodiment of the present invention, nested functions are considered to determine target desensitization rules, so that the desensitization rules are more perfect and data security is guaranteed.

[0093] According to an embodiment of the present invention, a sub-query statement may be nested inside the target field, the sub-query statement includes a sub-target field, the sub-target field is used to query according to the sub-target data column to obtain sub-target data, and calculate the target data according to the sub-target function.

[0094] According to an embodiment of the present invention, when a subquery statement is nested inside a target field and a target function is included in the target field, a method for determining a target desensitization rule includes: determining the target desensitization rule according to a third desensitization rule corresponding to a sub-target data column and a second desensitization rule corresponding to the target function. Specifically, when both the target function and the sub-target function are control flow functions, and it is determined that the return value of the target function is related to a sub-target data column, and the return value of the sub-target function is also related to a sub-target data column, the third desensitization rule is determined to be the target desensitization rule; when both the target function and the sub-target function are control flow functions, and it is determined that the return value of the target function is related to multiple sub-target data columns, or the return value of the sub-target function is related to multiple sub-target data columns, the second desensitization rule is determined to be the target desensitization rule; when the target function or the sub-target function is a non-control flow function, the second desensitization rule is determined to be the target desensitization rule.

[0095] According to an embodiment of the present invention, when a subquery statement is nested inside a target field and the target field does not include a target function, a method for determining a target desensitization rule includes: determining the target desensitization rule according to a third desensitization rule corresponding to a sub-target data column and a fourth desensitization rule corresponding to a sub-target function. Specifically, when the sub-target function is a control flow function and the return value of the sub-target function is determined to be related to a sub-target data column, the third desensitization rule is determined to be the target desensitization rule; when the sub-target function is a control flow function and the return value of the sub-target function is determined to be related to multiple sub-target data columns, the fourth desensitization rule is determined to be the target desensitization rule; when the sub-target function is a non-control flow function, the fourth desensitization rule is determined to be the target desensitization rule.

[0096] For example, the initial query statement is select col from (select reverse(mask_col) as colfrom t) as tmp, where select ... from ... as tmp is the target function, select reverse(mask_col) as col from t is a subquery statement, the target field does not include the target function, reverse is the sub-target function, and the reverse function is a non-control flow function. The fourth desensitization rule corresponding to the reverse function is determined as the target desensitization rule.

[0097] Figure 3 A flowchart of determining target desensitization rules according to a specific embodiment of the present invention is shown.

[0098] like Figure 3 As shown, determining the target desensitization rules includes operations S310 to S350.

[0099] In operation S310, the function type of the target function is determined. If the function type is determined to be a control flow function, operation S320 is performed, otherwise operation S330 is performed.

[0100] In operation S320, it is determined how many target data columns are related to the return value of the target function. If it is determined that the return value is only related to one target data column, operation S340 is performed, otherwise operation S350 is performed.

[0101] In operation S330, the second desensitization rule is determined as a target desensitization rule.

[0102] In operation S340 , the first desensitization rule is determined as a target desensitization rule.

[0103] In operation S350, the second desensitization rule is determined as a target desensitization rule.

[0104] Figure 4 A flow chart of a data desensitization method for a distributed database according to another embodiment of the present invention is shown.

[0105] like Figure 4 As shown, the data desensitization of the distributed database of this embodiment includes operations S410 to S440, and the data desensitization method of the distributed database can be executed by a computing node.

[0106] In operation S410, in response to receiving a target query statement sent by a coordination node, target desensitization information is obtained from the target query statement, and an execution plan is created for the target query statement.

[0107] According to an embodiment of the present invention, after generating a target query statement, the coordination node sends the target query statement to a computing node, wherein the target query statement includes target desensitization information in the form of annotations.

[0108] According to an embodiment of the present invention, a target query statement is obtained by using a coordination node to perform the following operations: according to an initial query statement, determining a target field to be queried, wherein the target field includes a target function and a target data column; when determining that the target data column is a sensitive data column, determining a target desensitization rule for the target field according to a first desensitization rule corresponding to the target data column and a second desensitization rule corresponding to the target function; generating target desensitization information corresponding to the target field according to the target desensitization rule; and writing the target desensitization information into the initial query statement in the form of a comment to obtain a target query statement.

[0109] According to an embodiment of the present invention, in response to receiving the target query statement, the computing node parses the target query statement and creates an execution plan. Specifically, the execution plan may be created by an optimizer in the computing node.

[0110] It should be noted that since the target masking information is in the form of comments, when the optimizer creates an execution plan for the target query statement, it will not create a corresponding execution plan for the masking task, but only for the query task.

[0111] In operation S420, the execution plan is executed to obtain an initial query result.

[0112] According to an embodiment of the present invention, the computing node can execute the query task according to the execution plan, query the database, and obtain the initial query result. Specifically, the execution plan may include the target data table and the target field to be queried, and the computing node queries the target data table according to the target field.

[0113] In operation S430, the initial query result is desensitized according to the target desensitization configuration information to obtain the target query result.

[0114] According to an embodiment of the present invention, since the target desensitization configuration information includes desensitization rules for the initial query results, the initial query results can be desensitized according to the target desensitization configuration information to obtain a processed target query result.

[0115] In operation S440 , the target query result is returned to the coordination node, so that the coordination node returns the target query result to the client.

[0116] According to an embodiment of the present invention, after obtaining the target query result, the computing node returns the query result to the coordination node. In response to receiving the target query result, the coordination node returns the target query result to the client.

[0117] According to an embodiment of the present invention, since the target query statement includes target desensitizing information in the form of comments, the computing node first obtains the initial query result according to the execution plan, and then desensitizes the initial query result according to the target desensitizing configuration information, thereby realizing the decoupling of the query task and the desensitizing task.

[0118] According to an embodiment of the present invention, the initial query result is desensitized according to the target desensitization configuration information, and the target query result is obtained, including: determining the target field corresponding to the initial query result; determining the target desensitization rule corresponding to the target field according to the target desensitization configuration information; and desensitizing the initial query result according to the target desensitization rule to obtain the target query result.

[0119] According to an embodiment of the present invention, the target desensitization configuration information may include a target desensitization rule corresponding to the target field. When desensitizing the initial query result, the target desensitization rule corresponding to the target field can be determined from the target desensitization configuration information based on the target field corresponding to the initial query result.

[0120] According to an embodiment of the present invention, the initial query field is desensitized using a target desensitization rule to obtain a desensitized target query result to complete the query task.

[0121] According to an embodiment of the present invention, the computing node performs desensitization processing on the initial query result according to the target desensitization information, and while completing the desensitization task, it also achieves decoupling of the desensitization task from the query task.

[0122] Figure 5 A flow chart of a data desensitization method according to a specific embodiment of the present invention is shown.

[0123] like Figure 5 As shown, the data desensitization method includes operations S501 to S508.

[0124] In operation S501, the client sends an initial query statement to the coordination node.

[0125] In operation S502, the coordination node generates target desensitization information according to the initial query statement. Specifically, the coordination node can determine multiple target fields to be queried according to the initial query statement; generate target desensitization rules for each target field; and generate target desensitization configuration information according to the target desensitization rules of each of the multiple target fields.

[0126] In operation S503, the coordination node writes the target desensitized information into the initial query statement in the form of comments to generate a target query statement.

[0127] In operation S504 , the coordination node sends the target query statement to the computing node.

[0128] In operation S505 , in response to receiving the target query statement, the computing node creates and executes an execution plan for the target query statement to obtain an initial query result.

[0129] In operation S506, the computing node desensitizes the initial query result according to the target desensitization information to obtain the target query result.

[0130] In operation S507 , the computing node sends the target query result to the coordination node.

[0131] In operation S508 , in response to receiving the target query result, the coordination node sends the target query result to the client.

[0132] Figure 6 A structural block diagram of a data desensitization device for a distributed database applied to a coordination node according to an embodiment of the present invention is shown.

[0133] like Figure 6As shown, the data desensitization device 600 of the distributed database applied to the coordination node of this embodiment includes a field determination module 610, a rule determination module 620, an information generation module 630, an information writing module 640 and a statement sending module 650.

[0134] The field determination module 610 is used to determine the target field to be queried according to the initial query statement, wherein the target field includes a target field, and the target field is used to query according to the target data column to obtain the target data, and calculate the target data according to the target function. In one embodiment, the field determination module 610 can be used to perform the operation S210 described above, which will not be repeated here.

[0135] The rule determination module 620 is used to determine the target desensitization rule for the target field according to the first desensitization rule corresponding to the target data column and the second desensitization rule corresponding to the target function when the target data column is determined to be a sensitive data column. In one embodiment, the rule determination module 620 can be used to perform the operation S220 described above, which will not be repeated here.

[0136] The information generation module 630 is used to generate target desensitization information corresponding to the target field according to the target desensitization rule. In one embodiment, the information generation module 630 can be used to perform the operation S230 described above, which will not be repeated here.

[0137] The information writing module 640 is used to write the target desensitized information into the initial query statement in the form of an annotation to obtain the target query statement. In one embodiment, the information writing module 640 can be used to perform the operation S240 described above, which will not be repeated here.

[0138] The statement sending module 650 is used to send the target query statement to the computing node so that the computing node executes the target query statement to obtain the target query result, wherein the target query result is obtained by performing desensitization processing based on the target desensitization information. In one embodiment, the statement sending module 650 can be used to perform the operation S650 described above, which will not be repeated here.

[0139] According to an embodiment of the present invention, the rule determination module 620 includes a type determination submodule, a first determination submodule and a second determination submodule.

[0140] The type determination submodule is used to determine the function type of the target function.

[0141] The first determination submodule is used to determine a target desensitization rule according to a first desensitization rule and a second desensitization rule when the function type is a control flow function.

[0142] The second determination submodule is used to determine the target desensitization rule according to the second desensitization rule when the function type is a non-control flow function.

[0143] According to an embodiment of the present invention, the first determining submodule includes a first determining unit and a second determining unit.

[0144] The first determination unit is used to determine the first desensitization rule as the target desensitization rule when it is determined that the return value of the target function is related to a target data column.

[0145] The second determining unit is used to determine the second desensitization rule as the target desensitization rule when it is determined that the return value of the target function is related to multiple target data columns.

[0146] According to an embodiment of the present invention, a target sub-function is nested inside the target function, and both the target function and the target sub-function are control flow functions. The data desensitization device 600 of the distributed database applied to the coordination node also includes a nested rule determination module.

[0147] The nested rule determination module is used to determine a target desensitization rule for a target field according to a first desensitization rule corresponding to a target data column and a second desensitization rule corresponding to a target function.

[0148] According to an embodiment of the present invention, a data desensitization device 600 for a distributed database applied to a coordination node further includes a table determination module, a configuration determination module, a first determination module and a second determination module.

[0149] The table determination module is used to determine the target data table corresponding to the target data column according to the initial query statement.

[0150] The configuration determination module is used to determine the target desensitization configuration information corresponding to the target data table according to the target data table, wherein the target desensitization configuration information includes desensitization rules corresponding to the data columns in the target data table.

[0151] The first determination module is used to obtain a first desensitization rule corresponding to the target data column according to the target desensitization configuration information and the target data column.

[0152] The second determination module is used to determine a second desensitization rule corresponding to the target function according to the return value data type of the target function by using the default desensitization configuration information, wherein the default desensitization configuration information includes a desensitization rule corresponding to the data type.

[0153] According to an embodiment of the present invention, any multiple modules among the field determination module 610, the rule determination module 620, the information generation module 630, the information writing module 640 and the statement sending module 650 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present invention, at least one of the field determination module 610, the rule determination module 620, the information generation module 630, the information writing module 640 and the statement sending module 650 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in a suitable combination of any of them. Alternatively, at least one of the field determination module 610, the rule determination module 620, the information generation module 630, the information writing module 640 and the statement sending module 650 can be at least partially implemented as a computer program module, which can perform corresponding functions when executed.

[0154] Figure 7 A structural block diagram of a data desensitization device for a distributed database applied to a computing node according to an embodiment of the present invention is shown.

[0155] like Figure 7 As shown, the data desensitization device 700 of the distributed database applied to the computing node of this embodiment includes a plan generation module 710, a plan execution module 720, a desensitization processing module 730 and a result return module 740.

[0156] The plan generation module 710 is used to obtain target desensitization information from the target query statement in response to receiving the target query statement sent by the coordination node, and create an execution plan for the target query statement, wherein the target query statement is obtained by using the coordination node to perform the following operations: according to the initial query statement, determine the target field to be queried, wherein the target field includes a target function and a target data column; when it is determined that the target data column is a sensitive data column, determine the target desensitization rule for the target field according to the first desensitization rule corresponding to the target data column and the second desensitization rule corresponding to the target function; according to the target desensitization rule, generate target desensitization information corresponding to the target field; write the target desensitization information into the initial query statement in the form of an annotation to obtain the target query statement. In one embodiment, the plan generation module 710 can be used to perform the operation S310 described above, which will not be repeated here.

[0157] The plan execution module 720 is used to execute the execution plan to obtain the initial query result. In one embodiment, the plan execution module 720 can be used to execute the operation S320 described above, which will not be described in detail here.

[0158] The desensitization processing module 730 is used to perform desensitization processing on the initial query result according to the target desensitization configuration information to obtain the target query result. In one embodiment, the desensitization processing module 730 can be used to perform the operation S330 described above, which will not be repeated here.

[0159] The result returning module 740 is used to return the target query result to the coordination node, so that the coordination node returns the target query result to the client. In one embodiment, the result returning module 740 can be used to perform the operation S340 described above, which will not be described in detail here.

[0160] According to an embodiment of the present invention, the desensitization processing module 730 includes a field determination submodule, a desensitization determination module and a desensitization processing module.

[0161] The field determination module is used to determine the target field corresponding to the initial query result.

[0162] The desensitization processing module is used to determine the target desensitization rules corresponding to the target field according to the target desensitization configuration information.

[0163] The desensitization processing module is used to perform desensitization processing on the initial query results according to the target desensitization rules to obtain the target query results.

[0164] According to an embodiment of the present invention, any multiple modules of the plan generation module 710, the plan execution module 720, the desensitization processing module 730 and the result return module 740 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present invention, at least one of the plan generation module 710, the plan execution module 720, the desensitization processing module 730 and the result return module 740 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in an appropriate combination of any of them. Alternatively, at least one of the plan generation module 710, the plan execution module 720, the desensitization processing module 730 and the result return module 740 can be at least partially implemented as a computer program module, and when the computer program module is executed, the corresponding function can be executed.

[0165] Figure 8 A block diagram of an electronic device suitable for implementing a data desensitization method for a distributed database according to an embodiment of the present invention is shown.

[0166] like Figure 8 As shown, the electronic device 800 according to an embodiment of the present invention includes a processor 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 to a random access memory (RAM) 803. The processor 801 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 801 may also include an onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present invention.

[0167] In RAM 803, various programs and data required for the operation of electronic device 800 are stored. Processor 801, ROM 802 and RAM 803 are connected to each other via bus 804. Processor 801 performs various operations of the method flow according to the embodiment of the present invention by executing the programs in ROM 802 and / or RAM 803. It should be noted that the program can also be stored in one or more memories other than ROM 802 and RAM 803. Processor 801 can also perform various operations of the method flow according to the embodiment of the present invention by executing the programs stored in the one or more memories.

[0168] According to an embodiment of the present invention, the electronic device 800 may further include an input / output (I / O) interface 805, which is also connected to the bus 804. The electronic device 800 may further include one or more of the following components connected to the input / output (I / O) interface 805: an input portion 806 including a keyboard, a mouse, etc.; an output portion 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 808 including a hard disk, etc.; and a communication portion 890 including a network interface card such as a LAN card, a modem, etc. The communication portion 890 performs communication processing via a network such as the Internet. The drive 810 is also connected to the input / output (I / O) interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that the computer program read therefrom is installed into the storage portion 808 as needed.

[0169] The present invention also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiment; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present invention is implemented.

[0170] According to an embodiment of the present invention, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present invention, the computer-readable storage medium may include the ROM 802 and / or RAM 803 described above and / or one or more memories other than ROM 802 and RAM 803.

[0171] The embodiment of the present invention also includes a computer program product, which includes a computer program, and the computer program includes a program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the data desensitization method of the distributed database provided by the embodiment of the present invention.

[0172] The computer program executes the above functions defined in the system / device of the embodiment of the present invention when the processor 801 executes the computer program. According to the embodiment of the present invention, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0173] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 890, and / or installed from the removable medium 811. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0174] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 890, and / or installed from the removable medium 811. When the computer program is executed by the processor 801, the above functions defined in the system of the embodiment of the present invention are performed. According to the embodiment of the present invention, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.

[0175] According to an embodiment of the present invention, the program code for executing the computer program provided by the embodiment of the present invention can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).

[0176] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0177] It will be appreciated by those skilled in the art that the features described in the various embodiments of the present invention may be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in the present invention. In particular, without departing from the spirit and teachings of the present invention, the features described in the various embodiments of the present invention may be combined and / or combined in various ways. All of these combinations and / or combinations fall within the scope of the present invention.

[0178] The embodiments of the present invention are described above. However, these embodiments are only for the purpose of illustration, and are not intended to limit the scope of the present invention. Although each embodiment is described above, it does not mean that the measures in each embodiment cannot be used in combination advantageously. Without departing from the scope of the present invention, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present invention.

Claims

1. A data desensitization method for a distributed database, applied to a coordination node, characterized in that: The method comprises: According to the initial query statement, determine the target field to be queried, wherein the target field includes a target function and a target data column; In the case where it is determined that the target data column is a sensitive data column, determining a target desensitization rule for the target field according to a first desensitization rule corresponding to the target data column and a second desensitization rule corresponding to the target function; According to the target desensitization rule, generating target desensitization information corresponding to the target field; Writing the target desensitized information into the initial query statement in the form of a comment to obtain a target query statement; and Sending the target query statement to a computing node so that the computing node executes the target query statement to obtain a target query result, wherein the target query result is obtained by performing a desensitization process based on the target desensitization information; The determining, according to the first desensitization rule corresponding to the target data column and the second desensitization rule corresponding to the target function, a target desensitization rule for the target field includes: Determining a function type of the objective function; In the case where the function type is a control flow function, determining the target desensitization rule according to the first desensitization rule and the second desensitization rule, wherein the control flow function is used to directly return the target data obtained by querying the target data column when a condition is met; and In the case where the function type is a non-control flow function, the target desensitization rule is determined according to the second desensitization rule, wherein the non-control flow function is used to calculate the target data obtained by querying the target data column to obtain a calculation result, and return the calculation result.

2. The method according to claim 1, characterized in that When the function type is a control flow function, determining the target desensitization rule according to the first desensitization rule and the second desensitization rule includes: In the case where it is determined that the return value of the target function is related to one of the target data columns, determining the first desensitization rule as a target desensitization rule; and When it is determined that the return value of the target function is related to the plurality of target data columns, the second desensitization rule is determined to be the target desensitization rule.

3. The method according to claim 1, characterized in that The target function has a target sub-function nested inside it, and both the target function and the target sub-function are control flow functions. The method further includes: According to a first desensitization rule corresponding to the target data column and a second desensitization rule corresponding to the target function, a target desensitization rule for the target field is determined.

4. The method according to claim 1, characterized in that The method further comprises: Determine, according to the initial query statement, a target data table corresponding to the target data column; According to the target data table, determining target desensitization configuration information corresponding to the target data table, wherein the target desensitization configuration information includes desensitization rules corresponding to data columns in the target data table; According to the target desensitization configuration information and the target data column, obtaining a first desensitization rule corresponding to the target data column; and Using the default desensitization configuration information, a second desensitization rule corresponding to the target function is determined according to the return value data type of the target function, wherein the default desensitization configuration information includes a desensitization rule corresponding to the data type.

5. A data desensitization method for a distributed database, applied to a computing node, characterized in that: The method comprises: In response to receiving a target query statement sent by the coordination node, obtaining target desensitization information from the target query statement, and creating an execution plan for the target query statement, wherein the target query statement is obtained by using the coordination node to perform the following operations: According to the initial query statement, determine the target field to be queried, wherein the target field includes a target function and a target data column; In the case where it is determined that the target data column is a sensitive data column, determining a target desensitization rule for the target field according to a first desensitization rule corresponding to the target data column and a second desensitization rule corresponding to the target function; According to the target desensitization rule, generating target desensitization information corresponding to the target field; Writing the target desensitized information into the initial query statement in the form of comments to obtain a target query statement; The determining, according to the first desensitization rule corresponding to the target data column and the second desensitization rule corresponding to the target function, a target desensitization rule for the target field includes: Determining a function type of the objective function; In the case where the function type is a control flow function, determining the target desensitization rule according to the first desensitization rule and the second desensitization rule, wherein the control flow function is used to directly return the target data obtained by querying the target data column when a condition is met; and In the case where the function type is a non-control flow function, the target desensitization rule is determined according to the second desensitization rule, wherein the non-control flow function is used to calculate the target data obtained by querying the target data column to obtain a calculation result, and return the calculation result; Execute the execution plan to obtain an initial query result; Desensitizing the initial query result according to the target desensitization configuration information to obtain the target query result; and The target query result is returned to the coordination node, so that the coordination node returns the target query result to the client.

6. The method according to claim 5, characterized in that The desensitizing process is performed on the initial query result according to the target desensitizing configuration information to obtain the target query result, including: Determining a target field corresponding to the initial query result; Determining a target desensitization rule corresponding to the target field according to the target desensitization configuration information; and According to the target desensitization rule, the initial query result is desensitized to obtain the target query result.

7. A data desensitization device for a distributed database, applied to a coordination node, characterized in that: The device comprises: A field determination module, used to determine a target field to be queried according to an initial query statement, wherein the target field includes a target function and a target data column; A rule determination module, configured to determine, when determining that the target data column is a sensitive data column, a target desensitization rule for the target field according to a first desensitization rule corresponding to the target data column and a second desensitization rule corresponding to the target function; An information generation module, used to generate target desensitization information corresponding to the target field according to the target desensitization rule; An information writing module, used for writing the target desensitized information into the initial query statement in the form of an annotation to obtain a target query statement; and A statement sending module, used for sending the target query statement to a computing node, so that the computing node executes the target query statement to obtain a target query result, wherein the target query result is obtained by performing a desensitization process based on the target desensitization information; Wherein, the rule determination module includes: A type determination submodule, used to determine the function type of the target function; a first determination submodule, configured to determine the target desensitization rule according to the first desensitization rule and the second desensitization rule when the function type is a control flow function, wherein the control flow function is configured to directly return target data obtained by querying the target data column when a condition is met; and The second determination submodule is used to determine the target desensitization rule according to the second desensitization rule when the function type is a non-control flow function, wherein the non-control flow function is used to calculate the target data obtained by querying the target data column to obtain a calculation result, and return the calculation result.

8. A data desensitization device for a distributed database, applied to a computing node, characterized in that: The device comprises: A plan generation module is used for, in response to receiving a target query statement sent by a coordination node, obtaining target desensitization information from the target query statement and creating an execution plan for the target query statement, wherein the target query statement is obtained by using the coordination node to perform the following operations: According to the initial query statement, determine the target field to be queried, wherein the target field includes a target function and a target data column; In the case where it is determined that the target data column is a sensitive data column, determining a target desensitization rule for the target field according to a first desensitization rule corresponding to the target data column and a second desensitization rule corresponding to the target function; According to the target desensitization rule, generating target desensitization information corresponding to the target field; Writing the target desensitized information into the initial query statement in the form of comments to obtain a target query statement; The determining, according to the first desensitization rule corresponding to the target data column and the second desensitization rule corresponding to the target function, a target desensitization rule for the target field includes: Determining a function type of the objective function; In the case where the function type is a control flow function, determining the target desensitization rule according to the first desensitization rule and the second desensitization rule, wherein the control flow function is used to directly return the target data obtained by querying the target data column when a condition is met; and In the case where the function type is a non-control flow function, the target desensitization rule is determined according to the second desensitization rule, wherein the non-control flow function is used to calculate the target data obtained by querying the target data column to obtain a calculation result, and return the calculation result; A plan execution module, used to execute the execution plan and obtain an initial query result; a desensitization processing module, configured to perform desensitization processing on the initial query result according to the target desensitization configuration information to obtain a target query result; and The result returning module is used to return the target query result to the coordination node, so that the coordination node returns the target query result to the client.

9. An electronic device, comprising: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Data access control permission conversion method and device and computer equipment

    CN118013549A

  • Data desensitization method and device, storage medium and electronic equipment

    CN118606999A