Method and device for identifying private data in a database

By identifying the relationship between fields in the database, the amount of calculation is reduced, the efficiency of massive data identification is improved, the problem of low performance in the existing technology is solved, and the private data in the database is quickly identified.

CN113672653BActive Publication Date: 2024-10-29HANGZHOU ANT KUAI TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110909377.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-09
Publication Date
2024-10-29
Estimated Expiration
2041-08-09

AI Technical Summary

Technical Problem

The existing technology has low performance when identifying private data in massive databases and cannot scan all data tables within the specified time, resulting in poor customer experience.

Method used

By forming a queue of fields in the database and processing them in order, each field is identified when there is no identification result label. If it belongs to private data, the second field with a preset relationship is found and the second field is identified using this relationship. fields to reduce the amount of calculations.

Benefits of technology

It improves the efficiency of identifying private data in the database, reduces the amount of calculation, and can process massive data within an acceptable time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113672653B_ABST
    Figure CN113672653B_ABST
Patent Text Reader

Abstract

The embodiments of this specification provide a method and device for identifying private data in a database, the method comprising: forming a queue of each field in each data table included in the database; performing processing operations on the current first field in sequence according to the order of each field in the queue, the processing operations comprising: identifying whether the first field belongs to private data when the first field does not have an identification result label, obtaining a first identification result, and using the first identification result as the identification result label of the first field; if the first identification result indicates that the first field belongs to private data, searching for a second field having a preset relationship with the first field; using a method corresponding to the preset relationship, identifying whether the second field belongs to private data, obtaining a second identification result, and using the second identification result as the identification result label of the second field. The efficiency of identifying private data in a database can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of the present specification relate to the computer field, and more particularly, to a method and apparatus for identifying private data in a database. Background Art

[0002] Private data is secret data, which refers to information that one does not want to be known by others or irrelevant persons. From the perspective of the owner of the privacy, private data can be divided into personal privacy data and common privacy data. Personal privacy data includes information that can be used to locate or identify individuals (such as phone numbers, addresses, credit card numbers, etc.) and sensitive information (such as personal health conditions, financial information, important company documents, etc.). Common privacy data mainly focuses on family privacy, such as family annual income. The leakage and abuse of private data can easily lead to various personal and public safety issues. In order to protect private data, it is necessary to identify the fields belonging to private data from the database. Usually, the database includes a large number of data tables, and each data table has dozens of fields on average.

[0003] In the prior art, when identifying private data in a database, it is basically necessary to identify whether each field in each data table is private data one by one. In the case of small data volumes, performance issues are not obvious, but when used for massive data (for example, hundreds of millions of tables, billions of fields), there will be obvious performance issues, which are mainly manifested in incomplete scanning of the tables within the specified time, resulting in poor customer experience.

[0004] Therefore, it is hoped that there will be an improved solution that can improve the efficiency of identifying private data in the database. Summary of the invention

[0005] One or more embodiments of the present specification describe a method and apparatus for identifying private data in a database, which can improve the efficiency of identifying private data in a database.

[0006] In a first aspect, a method for identifying private data in a database is provided, wherein the database includes a plurality of data tables, each data table includes a plurality of fields, and the method includes:

[0007] Form a queue with each field in each data table included in the database;

[0008] According to the order of the fields in the queue, processing operations are performed on the current first field in sequence, and the processing operations include:

[0009] In the case where the first field does not have an identification result label, identifying whether the first field belongs to private data, obtaining a first identification result, and using the first identification result as an identification result label of the first field;

[0010] If the first recognition result indicates that the first field belongs to private data, searching for a second field having a preset relationship with the first field;

[0011] In a manner corresponding to the preset relationship, it is identified whether the second field belongs to private data, a second identification result is obtained, and the second identification result is used as an identification result label of the second field.

[0012] In a possible implementation manner, forming a queue with each field in each data table included in the database includes:

[0013] The field names of the various fields are parsed from the metadata table in the database, and the field names are sorted to form the queue.

[0014] Further, the identifying whether the first field belongs to private data includes:

[0015] Acquire sample data corresponding to the field name of the first field from the database;

[0016] The sample data is input into a privacy data recognition model to obtain the first recognition result.

[0017] Furthermore, the privacy data identification model includes at least one of the following identification logics:

[0018] Regular expressions, language models, validation rules, and multi-classification models.

[0019] In a possible implementation manner, searching for a second field having a preset relationship with the first field includes:

[0020] A second field having a preset relationship with the first field is searched from a pre-established data relationship graph; the data relationship graph includes nodes corresponding to the fields, and the connecting edges between the nodes correspond to the relationship between the fields.

[0021] Furthermore, the data relationship graph also includes nodes corresponding to data tables, and the connecting edges between the nodes also correspond to the relationship between the data table and the field, and the relationship between the data tables.

[0022] Furthermore, the data relationship graph is obtained by parsing a structured query language (SQL) statement corresponding to the database.

[0023] Furthermore, searching a pre-established data relationship graph for a second field having a preset relationship with the first field includes:

[0024] Starting from the node corresponding to the first field, search for nodes whose connection edges correspond to the preset relationship, until the connection edges are no longer the preset relationship, and use the field corresponding to the found node as the second field.

[0025] In a possible implementation manner, the preset relationship is replication;

[0026] The identifying whether the second field belongs to private data by using a method corresponding to the preset relationship includes:

[0027] The second recognition result is directly determined as the second field belonging to private data.

[0028] In a possible implementation manner, the preset relationship is truncation;

[0029] The identifying whether the first field belongs to private data includes:

[0030] Using each recognition model in the first recognition model set, respectively identify whether the first field belongs to private data, obtain each first recognition sub-result, and comprehensively determine the first recognition result according to each first recognition sub-result;

[0031] The identifying whether the second field belongs to private data by using a method corresponding to the preset relationship includes:

[0032] At least one recognition model in a second recognition model set is used to identify whether the second field belongs to privacy data, thereby obtaining the second recognition result; the second recognition model set is a subset of the first recognition model set.

[0033] In a possible implementation manner, the first recognition result and / or the second recognition result includes:

[0034] Whether the field is private data, and if so, the type of private data.

[0035] In a second aspect, a device for identifying private data in a database is provided, wherein the database includes a plurality of data tables, each data table includes a plurality of fields, and the device includes:

[0036] A queue forming unit, used for forming a queue from each field in each data table included in the database;

[0037] The first identification unit is configured to perform processing operations on the current first field in sequence according to the order of the fields in the queue obtained by the queue forming unit, wherein the processing operations include:

[0038] In the case where the first field does not have an identification result label, identifying whether the first field belongs to private data, obtaining a first identification result, and using the first identification result as an identification result label of the first field;

[0039] a searching unit, configured to search for a second field having a preset relationship with the first field if the first recognition result obtained by the first recognition unit indicates that the first field belongs to private data;

[0040] The second identification unit is used to identify whether the second field found by the search unit belongs to privacy data in a manner corresponding to the preset relationship, obtain a second identification result, and use the second identification result as an identification result label of the second field.

[0041] According to a third aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the method of the first aspect.

[0042] According to a fourth aspect, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method of the first aspect is implemented.

[0043] Through the method and device provided by the embodiments of this specification, first, each field in each data table included in the database is formed into a queue; then, according to the order of each field in the queue, processing operations are performed on the current first field in turn, and the processing operations include: when the first field does not have an identification result label, identifying whether the first field belongs to privacy data, obtaining a first identification result, and using the first identification result as the identification result label of the first field; then if the first identification result indicates that the first field belongs to privacy data, searching for a second field that has a preset relationship with the first field; finally, using a method corresponding to the preset relationship, identifying whether the second field belongs to privacy data, obtaining a second identification result, and using the second identification result as the identification result label of the second field. As can be seen from the above, the embodiments of the present specification utilize the relationship between fields. In the process of sequentially identifying whether each field belongs to privacy data, once a first field that belongs to privacy data is encountered, a second field that has a preset relationship with the first field is immediately queried, and a method corresponding to the preset relationship is used to identify whether the second field belongs to privacy data. Since the relationship between the second field and the first field that has been identified as privacy data is taken into account when identifying whether the second field belongs to privacy data, the amount of calculation can be effectively reduced, thereby greatly improving the efficiency of identifying privacy data in the database. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0045] Figure 1 A schematic diagram of an implementation scenario of an embodiment disclosed in this specification;

[0046] Figure 2 A flow chart showing a method for identifying private data in a database according to one embodiment;

[0047] Figure 3 A system structure diagram showing the identification of private data in a database according to one embodiment;

[0048] Figure 4 A schematic diagram of a fast privacy data scanning method based on blood relationship according to an embodiment is shown;

[0049] Figure 5 A schematic block diagram shows an apparatus for identifying private data in a database according to one embodiment. DETAILED DESCRIPTION

[0050] The solution provided in this specification is described below in conjunction with the accompanying drawings.

[0051] Figure 1 This is a schematic diagram of an implementation scenario of an embodiment disclosed in this specification. The implementation scenario involves identifying private data in a database, where the database includes multiple data tables, each data table includes multiple fields, and the fields correspond to columns. Figure 1 The database includes n data tables, which are recorded as Table 1, Table 2, ..., Table n, respectively, where Table 1 includes i columns, Table 2 includes j columns, ..., Table n includes k columns. The database also includes a metadata table, which records the information of each data table, for example, the field name and storage location corresponding to each column in the data table.

[0052] Usually, when identifying private data in a database, the metadata table is read first to obtain information about each data table. Then, based on the information about each data table and the underlying database interface, data from one table is retrieved at a time, and private data is identified for each column of data in the table to determine whether the column is private data. Since there are usually dozens of types of private data corresponding to private data, some private data identification may be based on deep learning models, which are computationally complex. When the amount of data in a database is very large, it is difficult to identify the entire database within an acceptable time frame.

[0053] The embodiments of this specification utilize the relationship between fields to identify private data, thereby effectively reducing the amount of calculation, thereby greatly improving the efficiency of identifying private data in the database.

[0054] The relationship between the above fields may be a blood relationship between the fields. The blood relationship is used to characterize the upstream and downstream relationship between data, usually including copying, truncation, splicing, conversion, etc., which reflects that the data of one field is obtained through certain processing to obtain the data of another field.

[0055] Figure 2 A flowchart of a method for identifying privacy data in a database according to an embodiment is shown. The database includes multiple data tables, each of which includes multiple fields. This embodiment can be based on Figure 1 The implementation scenario shown in Figure 1 is as follows. Figure 2 As shown, the method for identifying privacy data in a database in this embodiment includes the following steps: Step 21, forming a queue for each field in each data table included in the database; Step 22, performing processing operations on the current first field in sequence according to the order of each field in the queue, the processing operations including: in the case where the first field does not have an identification result label, identifying whether the first field belongs to privacy data, obtaining a first identification result, and using the first identification result as the identification result label of the first field; Step 23, if the first identification result indicates that the first field belongs to privacy data, searching for a second field having a preset relationship with the first field; Step 24, using a method corresponding to the preset relationship, identifying whether the second field belongs to privacy data, obtaining a second identification result, and using the second identification result as the identification result label of the second field. The specific execution method of each of the above steps is described below.

[0056] First, in step 21, each field in each data table included in the database is queued. It can be understood that each field in the queue has a certain order, and each field in each data table can be sorted randomly, or each field in the same data table can be sorted in adjacent positions.

[0057] In one example, forming a queue with each field in each data table included in the database includes:

[0058] The field names of the various fields are parsed from the metadata table in the database, and the field names are sorted to form the queue.

[0059] It is understandable that the above field name can uniquely identify a field. For example, a globally unique identifier (GUID) is used as the above field name, and its specific form is project_name.table_name.column_name, where project_name represents the database, table_name represents the data table, and column_name represents the field.

[0060] Then, in step 22, according to the order of the fields in the queue, the processing operation is performed on the current first field in turn, and the processing operation includes: if the first field does not have an identification result label, identifying whether the first field belongs to private data, obtaining a first identification result, and using the first identification result as the identification result label of the first field. It can be understood that each field only needs to be identified once, and fields with identification result labels do not need to be identified again.

[0061] In one example, the identifying whether the first field belongs to private data includes:

[0062] Acquire sample data corresponding to the field name of the first field from the database;

[0063] The sample data is input into a privacy data recognition model to obtain the first recognition result.

[0064] It can be understood that the sample data is a column of data corresponding to the field name of the first field, or part of the data in a column of data. Table 1 shows the columns of a data table.

[0065] Table 1: Data table

[0066] Column 1 Column 2 Column 3 Row 1 Little Red female 15 years old Row 2 Xiao Ming male 16 years old Row 3 Xiao Gang male 17 years old Row 4 Xiaolan female 14 years old

[0067] Refer to Table 1, which is a data table with 4 rows and 3 columns. If the field name of the first field corresponds to column 1, all the data in column 1 can be used as sample data, and the sample data includes Xiaohong, Xiaoming, Xiaogang, and Xiaolan; or, part of the data in column 1 can be used as sample data, for example, the sample data only includes Xiaohong.

[0068] Furthermore, the privacy data identification model includes at least one of the following identification logics:

[0069] Regular expressions, language models, validation rules, and multi-classification models.

[0070] It is understandable that a regular expression is also called a regular expression, regular notation, regular expression, and conventional notation. It constructs a single string based on agreed grammatical rules to describe and match a series of strings that conform to a certain syntactic rule.

[0071] A language model is a mathematical model that uses probability distribution to describe the probability of a word string or character string.

[0072] There may be multiple verification rules, for example, identifying privacy data by determining whether the sample data is all numbers and whether the number of numbers is a predetermined number of digits.

[0073] Multi-classification models can be obtained through machine learning and can also be called neural network models or deep learning models.

[0074] Then, in step 23, if the first recognition result indicates that the first field belongs to private data, a second field having a preset relationship with the first field is searched. It can be understood that if the first field belongs to private data, the second field having a preset relationship with the first field must belong to private data, or has a high probability of belonging to private data.

[0075] In one example, searching for a second field having a preset relationship with the first field includes:

[0076] A second field having a preset relationship with the first field is searched from a pre-established data relationship graph; the data relationship graph includes nodes corresponding to the fields, and the connecting edges between the nodes correspond to the relationship between the fields.

[0077] In the embodiments of this specification, the data relationship graph may exist in the form of a graph database. Graph database: also known as a graph database, is a non-relational database that uses graph theory to store relationship information between entities. Compared with relational databases, graph databases can be easily and quickly queried, as well as various calculations and reasoning.

[0078] Furthermore, the data relationship graph also includes nodes corresponding to data tables, and the connecting edges between the nodes also correspond to the relationship between the data table and the field, and the relationship between the data tables.

[0079] Furthermore, the data relationship graph is obtained by parsing a structured query language (SQL) statement corresponding to the database.

[0080] The above-mentioned parsed SQL statements can be called SQL parsing. SQL parsing is the cornerstone for building data lineage relationships. It mainly parses the inheritance relationship between fields and tables, fields and fields, and tables described in SQL. Usually, the relationship between fields can include copy, truncation, concatenation, etc.; the relationship between tables is dependency; the relationship between fields and tables is belong. The parsed lineage relationship can be represented by a triple (source_node, target_node, relation). Among them, source_node is the identifier of the source node; target_node is the identifier of the target node; relation is the relationship between nodes. For example, the following SQL:

[0081] Create Table1 as

[0082] Select identify_no,mobile_no

[0083] From Table2;

[0084] The blood relationships that can be obtained through SQL parsing are:

[0085] (Table2.identify_no,Table1.identify_no,copy), which means that the identity field in Table 1 is a copy of the identity field in Table 2;

[0086] (Table2.mobile_no,Table1.mobile_no,copy), which means the phone number field in Table 1 is a copy of the phone number field in Table 2;

[0087] (Table2, Table1, depend), which means that Table 1 and Table 2 are dependent on each other;

[0088] (Table1.identify_no,Table1,belong), which means the identity field in Table1 belongs to Table1;

[0089] (Table1.mobile_no,Table1,belong), which means the phone number field in Table1 belongs to Table1;

[0090] (Table2.mobile_no,Table2,belong), which means the phone number field in Table2 belongs to Table2;

[0091] (Table2.identify_no,Table2,belong), which means that the identity field in Table2 belongs to Table2.

[0092] Currently, there are mature third-party libraries available for SQL parsing, and the principles will not be described here.

[0093] Furthermore, searching a pre-established data relationship graph for a second field having a preset relationship with the first field includes:

[0094] Starting from the node corresponding to the first field, search for nodes whose connection edges correspond to the preset relationship, until the connection edges are no longer the preset relationship, and use the field corresponding to the found node as the second field.

[0095] In the embodiment of this specification, the second field can be found by using a depth-first search method. The depth-first search method is to start from a vertex v in the graph and visit the vertex v; start from the unvisited adjacent points of the vertex v in turn and perform a depth-first traversal of the graph; until all vertices in the graph that have paths connected to the vertex v are visited; if there are still vertices in the graph that have not been visited, start from an unvisited vertex and re-perform a depth-first traversal until all vertices in the graph have been visited. It can be understood that the vertex v corresponds to the first field.

[0096] Finally, in step 24, a method corresponding to the preset relationship is used to identify whether the second field belongs to private data, obtain a second identification result, and use the second identification result as the identification result label of the second field. It can be understood that the identification of whether the second field belongs to private data is different from the identification of whether the first field belongs to private data. When identifying whether the second field belongs to private data, the preset relationship is taken into account, so the amount of calculation can be effectively reduced, and the efficiency of private data identification can be greatly improved.

[0097] In one example, the preset relationship is replication;

[0098] The identifying whether the second field belongs to private data by using a method corresponding to the preset relationship includes:

[0099] The second recognition result is directly determined as the second field belonging to private data.

[0100] It is understandable that if the first field and the second field are in a duplicate relationship, and under the premise that the first field has been identified as privacy data, the second field must be privacy data, and there is no need to identify the privacy data of the second field, thereby improving identification efficiency.

[0101] In one example, the preset relationship is truncation;

[0102] The identifying whether the first field belongs to private data includes:

[0103] Using each recognition model in the first recognition model set, respectively identify whether the first field belongs to private data, obtain each first recognition sub-result, and comprehensively determine the first recognition result according to each first recognition sub-result;

[0104] The identifying whether the second field belongs to private data by using a method corresponding to the preset relationship includes:

[0105] At least one recognition model in a second recognition model set is used to identify whether the second field belongs to privacy data, thereby obtaining the second recognition result; the second recognition model set is a subset of the first recognition model set.

[0106] It can be understood that if the first field and the second field are in a truncated relationship, that is, the second field is a substring of the first field, and under the premise that the first field has been identified as privacy data, the second field has a greater probability of belonging to privacy data, which can narrow the scope of privacy data identification for the second field, reduce the amount of calculation compared to identifying the first field, and thus improve recognition efficiency.

[0107] In one example, the first recognition result and / or the second recognition result includes:

[0108] Whether the field is private data, and if so, the type of private data.

[0109] In the embodiments of this specification, there are many types of privacy data, which is also a reason for the low efficiency in the conventional privacy data identification. The common types of privacy data are shown in Table 2.

[0110] Table 2: Common types of privacy data

[0111]

[0112]

[0113] See Table 2. Due to the diversity of privacy data types, identification is more complicated and usually requires a lot of calculations. In the embodiments of this specification, the relationship between fields is introduced to assist in privacy data identification, thereby effectively reducing the amount of calculations.

[0114] According to the method provided in the embodiment of the present specification, each field in each data table included in the database is first formed into a queue; then, according to the order of each field in the queue, the current first field is processed in sequence, and the processing operation includes: in the case where the first field does not have an identification result label, identifying whether the first field belongs to privacy data, obtaining a first identification result, and using the first identification result as the identification result label of the first field; then, if the first identification result indicates that the first field belongs to privacy data, searching for a second field having a preset relationship with the first field; finally, using a method corresponding to the preset relationship, identifying whether the second field belongs to privacy data, obtaining a second identification result, and using the second identification result as the identification result label of the second field. As can be seen from the above, the embodiment of the present specification utilizes the relationship between the fields. In the process of sequentially identifying whether each field belongs to privacy data, once a first field belonging to privacy data is encountered, the second field having a preset relationship with the first field will be immediately queried, and the second field will be identified as privacy data using a method corresponding to the preset relationship. Since the relationship between the second field and the first field that has been identified as privacy data is considered when identifying whether the second field belongs to privacy data, the amount of calculation can be effectively reduced, thereby greatly improving the efficiency of identifying privacy data in the database.

[0115] Figure 3 A system structure diagram of identifying privacy data in a database according to one embodiment is shown. Figure 3 First, the metadata parsing module 31 reads and parses the relevant data from the metadata table in the database, and puts the parsing results into the column queue. Here, the scanner 32 assumes that one thread is used for processing, and reads one element from the column queue each time. Based on this, the corresponding sample data is retrieved from the database, and then the built-in privacy data identification module is used to identify the data. If the identification result is not sensitive data, the next element is read from the column queue for consumption; if the identification result is sensitive data, the depth-first search algorithm is used to view the upstream and downstream elements with a replication relationship from the data lineage map, and then the relevant elements are marked with sensitive data labels in the database.

[0116] Among them, the database decoupling unit: the customer data is stored in different types of databases, which can be MYSQL, ORACLE, etc. Here, a unified interface is used to shield the problems caused by different databases.

[0117] Built-in privacy data identification module: stores various logics for identifying sensitive data types, including regular expressions, language models, verification rules, multi-classification models, etc.

[0118] Scanning logic unit: used to execute scanning logic, adopting a hybrid solution of linear scanning and tree scanning, based on sequential scanning. When sensitive data is identified, it switches to tree scanning.

[0119] Data sampling logic unit: used to sample data from the database according to metadata, providing a data basis for subsequent scanner recognition.

[0120] It is understandable that the above-mentioned sensitive data is privacy data.

[0121] Figure 4 A schematic diagram of a fast privacy data scanning method based on blood relationship according to an embodiment is shown. Figure 4 The embodiment of this specification uses sequential scanning as the cold start entry. First, each column of each table is scanned from top to bottom in sequence according to the metadata table. Once a sensitive data type is scanned, it is immediately scanned in the data lineage map in a depth-first search manner. Two conditions must be met during the search: if the edge dependency is a copy relationship, continue to search downward until the edge dependency is not a copy relationship, otherwise backtrack upward; the searched node needs to be connected to the original node, otherwise the search is stopped.

[0122] like Figure 4 As shown, when column i of Table 1 is found to be sensitive data in the sequential scan, a depth-first search is immediately performed in the data lineage map. At this time, it is found that column 1 of Table 2 and Table n is duplicated with column i of Table 1. Then, the corresponding column 1 of Table 2 and Table n is directly set to the same sensitive data type as column 1 of Table 1, thereby reducing the computational complexity of the built-in privacy data recognition module of the scanner and improving recognition efficiency.

[0123] It should be noted that when querying the data lineage graph, the same effect can be achieved by using a breadth-optimal search algorithm to traverse the connected graph. In addition, the data lineage relationship can be stored in a common relational database instead of a graph database.

[0124] According to another aspect of the embodiment, there is also provided a device for identifying privacy data in a database, wherein the database includes a plurality of data tables, each data table includes a plurality of fields, and the device is used to execute the method provided in the embodiment of this specification. Figure 5 FIG. 1 is a schematic block diagram of an apparatus for identifying private data in a database according to an embodiment. Figure 5 As shown, the device 500 includes:

[0125] A queue forming unit 51 is used to form a queue for each field in each data table included in the database;

[0126] The first identification unit 52 is used to perform processing operations on the current first field in sequence according to the order of each field in the queue obtained by the queue forming unit 51, and the processing operations include:

[0127] In the case where the first field does not have an identification result label, identifying whether the first field belongs to private data, obtaining a first identification result, and using the first identification result as an identification result label of the first field;

[0128] a searching unit 53, configured to search for a second field having a preset relationship with the first field if the first recognition result obtained by the first recognition unit 52 indicates that the first field belongs to private data;

[0129] The second identification unit 54 is used to identify whether the second field found by the search unit 53 belongs to privacy data in a manner corresponding to the preset relationship, obtain a second identification result, and use the second identification result as an identification result label of the second field.

[0130] Optionally, as an embodiment, the queue forming unit 51 is specifically configured to parse the field names of various fields from the metadata table in the database, and sort the field names to form the queue.

[0131] Furthermore, the first identification unit 52 includes:

[0132] An acquisition subunit, used for acquiring sample data corresponding to the field name of the first field from the database;

[0133] The identification subunit is used to input the sample data obtained by the obtaining subunit into the privacy data identification model to obtain the first identification result.

[0134] Furthermore, the privacy data identification model includes at least one of the following identification logics:

[0135] Regular expressions, language models, validation rules, and multi-classification models.

[0136] Optionally, as an embodiment, the search unit 53 is specifically used to search for a second field having a preset relationship with the first field from a pre-established data relationship graph; the data relationship graph includes nodes corresponding to the fields, and the connecting edges between the nodes correspond to the relationship between the fields.

[0137] Furthermore, the data relationship graph also includes nodes corresponding to data tables, and the connecting edges between the nodes also correspond to the relationship between the data table and the field, and the relationship between the data tables.

[0138] Furthermore, the data relationship graph is obtained by parsing a structured query language SQL statement corresponding to the database.

[0139] Furthermore, the search unit 53 is specifically used to start from the node corresponding to the first field, search for the node whose connection edge corresponds to the preset relationship, until the connection edge relationship is not the preset relationship, and use the field corresponding to the found node as the second field.

[0140] Optionally, as an embodiment, the preset relationship is copy;

[0141] The second identification unit 54 is specifically configured to directly determine that the second identification result is that the second field belongs to private data.

[0142] Optionally, as an embodiment, the preset relationship is truncation;

[0143] The first recognition unit 52 is specifically configured to use each recognition model in the first recognition model set to respectively recognize whether the first field belongs to private data, obtain each first recognition sub-result, and comprehensively determine the first recognition result based on each first recognition sub-result;

[0144] The second recognition unit 54 is specifically configured to use at least one recognition model in a second recognition model set to recognize whether the second field belongs to privacy data, and obtain the second recognition result; the second recognition model set is a subset of the first recognition model set.

[0145] Optionally, as an embodiment, the first recognition result and / or the second recognition result includes:

[0146] Whether the field is private data, and if so, the type of private data.

[0147] Through the device provided by the embodiment of this specification, first, the queue forming unit 51 forms a queue for each field in each data table included in the database; then the first identification unit 52 performs processing operations on the current first field in sequence according to the order of each field in the queue, and the processing operations include: when the first field does not have an identification result label, identifying whether the first field belongs to privacy data, obtaining a first identification result, and using the first identification result as the identification result label of the first field; then the search unit 53 searches for a second field having a preset relationship with the first field when the first identification result indicates that the first field belongs to privacy data; finally, the second identification unit 54 uses a method corresponding to the preset relationship to identify whether the second field belongs to privacy data, obtains a second identification result, and uses the second identification result as the identification result label of the second field. As can be seen from the above, the embodiments of the present specification utilize the relationship between fields. In the process of sequentially identifying whether each field belongs to privacy data, once a first field that belongs to privacy data is encountered, a second field that has a preset relationship with the first field is immediately queried, and a method corresponding to the preset relationship is used to identify whether the second field belongs to privacy data. Since the relationship between the second field and the first field that has been identified as privacy data is taken into account when identifying whether the second field belongs to privacy data, the amount of calculation can be effectively reduced, thereby greatly improving the efficiency of identifying privacy data in the database.

[0148] According to another embodiment, there is also provided a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute a combination of Figure 2 The method described.

[0149] According to another embodiment of the present invention, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the Figure 2 The method described.

[0150] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the present invention can be implemented by hardware, software, firmware or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.

[0151] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for identifying private data in a database, wherein the database includes a plurality of data tables, each of which includes a plurality of fields, the method comprising: Form a queue with each field in each data table included in the database; According to the order of the fields in the queue, processing operations are performed on the current first field in sequence, and the processing operations include: In the case where the first field does not have an identification result label, identifying whether the first field belongs to private data, obtaining a first identification result, and using the first identification result as an identification result label of the first field; If the first recognition result indicates that the first field belongs to private data, searching for a second field having a preset relationship with the first field; Using a method corresponding to the preset relationship, identifying whether the second field belongs to private data, obtaining a second identification result, and using the second identification result as an identification result label of the second field; The step of identifying whether the first field belongs to private data includes: Using each recognition model in the first recognition model set, respectively identify whether the first field belongs to private data, obtain each first recognition sub-result, and comprehensively determine the first recognition result according to each first recognition sub-result; The identifying whether the second field belongs to private data by using a method corresponding to the preset relationship includes: When the preset relationship is truncation, at least one recognition model in the second recognition model set is used to identify whether the second field belongs to privacy data to obtain the second recognition result; the second recognition model set is a subset of the first recognition model set.

2. The method of claim 1, wherein: The forming of a queue of each field in each data table included in the database includes: The field names of the various fields are parsed from the metadata table in the database, and the field names are sorted to form the queue.

3. The method of claim 2, wherein: The using each recognition model in the first recognition model set to respectively identify whether the first field belongs to private data includes: Acquire sample data corresponding to the field name of the first field from the database; The sample data is input into each recognition model to obtain each first recognition sub-result.

4. The method of claim 3, wherein: The recognition model includes at least one of the following recognition logics: Regular expressions, language models, validation rules, and multi-classification models.

5. The method of claim 1, wherein: The searching for a second field having a preset relationship with the first field includes: A second field having a preset relationship with the first field is searched from a pre-established data relationship graph; the data relationship graph includes nodes corresponding to the fields, and the connecting edges between the nodes correspond to the relationship between the fields.

6. The method of claim 5, wherein: The data relationship graph also includes nodes corresponding to data tables, and the connecting edges between the nodes also correspond to the relationship between the data table and the field, and the relationship between the data tables.

7. The method according to claim 5 or 6, wherein: The data relationship graph is obtained by parsing the structured query language SQL statement corresponding to the database.

8. The method of claim 5, wherein: The step of searching a pre-established data relationship graph for a second field having a preset relationship with the first field includes: Starting from the node corresponding to the first field, search for nodes whose connection edges correspond to the preset relationship, until the connection edges are no longer the preset relationship, and use the field corresponding to the found node as the second field.

9. The method of claim 1, wherein: The identifying whether the second field belongs to private data by using a method corresponding to the preset relationship includes: When the preset relationship is copy, the second identification result is directly determined as the second field belonging to private data.

10. The method of claim 1, wherein: The first recognition result and / or the second recognition result include: Whether the field is private data, and if so, the type of private data.

11. A device for identifying private data in a database, wherein the database includes a plurality of data tables, each data table includes a plurality of fields, and the device comprises: A queue forming unit, used for forming a queue from each field in each data table included in the database; The first identification unit is configured to perform processing operations on the current first field in sequence according to the order of the fields in the queue obtained by the queue forming unit, wherein the processing operations include: In the case where the first field does not have an identification result label, identifying whether the first field belongs to private data, obtaining a first identification result, and using the first identification result as an identification result label of the first field; a searching unit, configured to search for a second field having a preset relationship with the first field if the first recognition result obtained by the first recognition unit indicates that the first field belongs to private data; A second identification unit is used to identify whether the second field found by the search unit belongs to private data in a manner corresponding to the preset relationship, obtain a second identification result, and use the second identification result as an identification result label of the second field; The first identification unit is specifically used to use each identification model in the first identification model set to respectively identify whether the first field belongs to private data, obtain each first identification sub-result, and comprehensively determine the first identification result according to each first identification sub-result; The second identification unit is specifically used to, when the preset relationship is truncation, use at least one identification model in the second identification model set to identify whether the second field belongs to privacy data, and obtain the second identification result; the second identification model set is a subset of the first identification model set.

12. The device of claim 11, wherein: The queue forming unit is specifically used to parse the field names of various fields from the metadata table in the database, and form the queue after sorting the field names.

13. The device of claim 12, wherein: The first identification unit comprises: An acquisition subunit, used for acquiring sample data corresponding to the field name of the first field from the database; The identification subunit is used to input the sample data acquired by the acquisition subunit into each recognition model to obtain each first recognition subresult.

14. The device of claim 13, wherein: The recognition model includes at least one of the following recognition logics: Regular expressions, language models, validation rules, and multi-classification models.

15. The device of claim 11, wherein: The search unit is specifically used to search for a second field having a preset relationship with the first field from a pre-established data relationship graph; the data relationship graph includes nodes corresponding to the fields, and the connecting edges between the nodes correspond to the relationship between the fields.

16. The device of claim 15, wherein: The data relationship graph also includes nodes corresponding to data tables, and the connecting edges between the nodes also correspond to the relationship between the data table and the field, and the relationship between the data tables.

17. The device according to claim 15 or 16, wherein: The data relationship graph is obtained by parsing the structured query language SQL statement corresponding to the database.

18. The device of claim 15, wherein: The search unit is specifically used to start from the node corresponding to the first field, search for the node whose connection edge corresponds to the preset relationship, until the connection edge relationship is not the preset relationship, and use the field corresponding to the found node as the second field.

19. The device of claim 11, wherein: The second identification unit is specifically configured to directly determine, when the preset relationship is copy, that the second identification result is that the second field belongs to private data.

20. The device of claim 11, wherein: The first recognition result and / or the second recognition result include: Whether the field is private data, and if so, the type of private data.

21. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 10.

22. A computing device comprising a memory and a processor, wherein the memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 10 is implemented.

Citation Information

Patent Citations

  • Sensitive table group discovery method and system

    CN110781520A