Database masking method and apparatus

By determining the number of associated entities and thresholds for cells in the database, the problem of poor data availability in the result table in existing technologies is solved, achieving the effect of improving data availability while ensuring privacy and security.

CN116340308BActive Publication Date: 2026-04-14BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING WODONG TIANJUN INFORMATION TECH CO LTD
Filing Date
2021-12-22
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing technologies cannot determine whether masking is needed for each cell in the database result table, resulting in poor data usability in the result table.

Method used

By determining whether masking is needed at the cell level, and based on the number of associated entities and an entity number threshold, an output table is generated to improve data availability.

Benefits of technology

It improves the usability of the result table data while preventing the exposure of sensitive data, and implements privacy control at the cell level.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116340308B_ABST
    Figure CN116340308B_ABST
Patent Text Reader

Abstract

The application discloses a database mask processing method and device, and relates to the technical field of computers. A specific implementation of the method comprises the following steps: performing operation on an original table in a database according to an operation statement input by a current user and directed to the original table, and obtaining a result table composed of original data; for any cell in the result table: acquiring a source row and a source column of the cell in the original table, determining the number of associated entities of the cell in an entity field from the source row, and determining an entity number threshold of the cell in the entity field from the source column; when the number of associated entities of the cell and the entity number threshold meet a mask condition, performing mask processing on original data of the cell to form output data of the cell, and outputting the output data to the current user in the form of an output table. The implementation can improve the usability of result table data while preventing sensitive data from being exposed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a database masking method and apparatus. Background Technology

[0002] Dynamic masking strategies in databases aim to restrict the public access to sensitive data while preventing unauthorized users from viewing it. In practice, the implementation of dynamic masking strategies can be mainly divided into permission settings and masking policy settings. Permission settings refer to the division of user access rights, dividing users into those who can view the original data and those who can only view the masked data. Masking policy settings refer to setting the masking rules used for sensitive columns in the data table. For example, in credit card schemes, only the last four digits of a specified field are publicly displayed. The effect is that only authorized users can view the original data, while unauthorized users can only view the masked data.

[0003] In the process of realizing this invention, the inventors discovered that the prior art has at least the following problems: after the original table of the database is processed to generate the result table, the result table data related to the sensitive data in the original table is masked, resulting in poor usability of the result table data; in addition, the result table is generally masked on a column-by-column basis, and it is impossible to determine whether masking is needed for each cell, resulting in coarse granularity. Summary of the Invention

[0004] In view of this, embodiments of the present invention provide a database masking method and apparatus that can determine whether masking is required at the cell level, thereby improving the usability of result table data while preventing the exposure of sensitive data.

[0005] To achieve the above objectives, according to one aspect of the present invention, a database masking method is provided.

[0006] The database masking processing method of this invention includes: performing operations on the original table in the database according to the operation statement input by the current user, to obtain a result table composed of the original data; wherein the current user does not have permission to view the original data, and the original table has at least one entity field that is predetermined and related to the masking processing; for any cell in the result table: obtaining the source row and source column of the cell in the original table, determining the number of associated entities of the cell in the entity field from the source row, and determining the threshold of the number of entities of the cell in the entity field from the source column; when the number of associated entities of the cell and the corresponding threshold of the number of entities meet the preset masking conditions, masking the original data of the cell to form the output data of the cell, and outputting the output data into an output table to the current user.

[0007] Optionally, determining the number of associated entities of the cell in the entity field from the source row includes: counting the number of non-duplicate entities in any entity field of the source row, and determining the number as the number of associated entities of the cell in the entity field.

[0008] Optionally, determining the entity quantity threshold of the cell in the entity field from the source column includes: pre-configuring an entity quantity threshold corresponding to each entity field for each column of the original table; obtaining the maximum value of the entity quantity threshold of the source column in any entity field, and determining the maximum value as the entity quantity threshold of the cell in that entity field.

[0009] Optionally, when the number of associated entities in the cell and the corresponding entity number threshold meet the preset masking conditions, the original data of the cell is masked to form the output data of the cell, including: removing the number of associated entities in the cell that is zero; for any of the removed associated entity numbers: when the number of associated entities is less than the entity number threshold of the cell in the same entity field, the original data of the cell is masked according to the masking strategy preset for the column where the cell is located.

[0010] Optionally, the method further includes: before outputting the output data to the current user in an output table: for each number of associated entities after removal: when the number of associated entities is greater than or equal to the threshold of the number of entities in the same entity field of the cell, the original data of the cell is determined as the output data of the cell.

[0011] To achieve the above objectives, according to another aspect of the present invention, a database mask processing apparatus is provided.

[0012] The database masking processing apparatus of this invention may include: a calculation unit, configured to: perform calculations on the original table in the database according to the calculation statement input by the current user, to obtain a result table composed of the original data; wherein the current user does not have permission to view the original data, and the original table has at least one predetermined entity field related to masking processing; a data preparation unit, configured to: for any cell in the result table, obtain the source row and source column of the cell in the original table, determine the number of associated entities of the cell in the entity field from the source row, and determine the entity number threshold of the cell in the entity field from the source column; and a masking unit, configured to: when the number of associated entities of the cell and the corresponding entity number threshold meet the preset masking conditions, perform masking processing on the original data of the cell to form the output data of the cell, and output the output data to the current user in an output table.

[0013] Optionally, the data preparation unit may be further configured to: count the number of non-duplicate entities in any entity field of the source row, and determine the number as the number of associated entities of the cell in that entity field; pre-configure an entity number threshold corresponding to each entity field for each column of the original table; obtain the maximum value of the entity number threshold of the source column in any entity field, and determine the maximum value as the entity number threshold of the cell in that entity field.

[0014] Optionally, the masking unit can be further used to: remove the number of associated entities whose value is zero in the cell; for any number of associated entities after removal: when the number of associated entities is less than the threshold for the number of entities in the same entity field of the cell, mask the original data of the cell according to the masking strategy set in advance for the column where the cell is located; before the output data is compiled into an output table and output to the current user: for each number of associated entities after removal: when the number of associated entities is greater than or equal to the threshold for the number of entities in the same entity field of the cell, determine the original data of the cell as the output data of the cell.

[0015] To achieve the above objectives, according to another aspect of the present invention, an electronic device is provided.

[0016] An electronic device according to the present invention includes: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the database masking method provided by the present invention.

[0017] To achieve the above objectives, according to another aspect of the present invention, a computer-readable storage medium is provided.

[0018] The present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the database masking method provided by the present invention.

[0019] According to the technical solution of the present invention, the embodiments described above have the following advantages or beneficial effects:

[0020] After receiving the operation statement on the original table in the database from the current user (who does not have permission to view the original data), the system performs the operation on the original table to form a result table composed of the original data. Next, it examines each cell in the result table, first obtaining the source row and source column of the cell in the original table, determining the number of associated entities of the cell in the preset entity field from the source row, and determining the threshold for the number of entities in the entity field of the cell from the source column. Then, it checks whether the number of associated entities and the corresponding threshold of the cell meet the preset masking conditions: if they do, the original data of the cell is masked according to the preset masking strategy; otherwise, the original data of the cell is preserved. Finally, the above data is compiled into an output table and output to the current user. Through the above steps, cell-level masking and discrimination are achieved. When the cell data involves a large number of entities (e.g., greater than or equal to the threshold), users cannot extract sensitive data of a single entity, so the original data can be output. When the cell data involves a small number of entities (e.g., less than the threshold), there is a possibility of exposing sensitive data. In this case, masking processing needs to be performed before output. This can improve data availability while preventing sensitive data from being exposed to unauthorized users, and achieve privacy control at the cell level.

[0021] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description

[0022] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:

[0023] Figure 1 This is a schematic diagram of the main steps of the database masking method in an embodiment of the present invention;

[0024] Figure 2 This is a schematic diagram illustrating the specific execution steps of the database masking processing method in this embodiment of the invention;

[0025] Figure 3 This is a schematic diagram of the components of the database masking processing device in an embodiment of the present invention;

[0026] Figure 4 This is an exemplary system architecture diagram that can be applied thereto according to embodiments of the present invention;

[0027] Figure 5 This is a schematic diagram of the electronic device structure used to implement the database masking processing method in the embodiments of the present invention. Detailed Implementation

[0028] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0029] It should be noted that, unless otherwise specified, the embodiments of the present invention and the technical features thereof can be combined with each other.

[0030] Figure 1 This is a schematic diagram illustrating the main steps of the database masking method according to an embodiment of the present invention.

[0031] like Figure 1 As shown, the database masking method of this invention can be executed according to the following steps:

[0032] Step S101: The database server performs operations on the original table based on the operation statement input by the current user targeting the original table in the database, and obtains a result table composed of the original data.

[0033] In this embodiment of the invention, the database can be a relational database that supports row and column-based data tables. The masking process, or Dynamic Data Masking (DDM), prevents sensitive data from being exposed to unauthorized users. DDM operates on the fields of the data table, hiding sensitive data in the query results. Enabling DDM does not modify the data in the table; it simply masks the query results for unauthorized users, ensuring that the results they see are masked. For example, a masking strategy can be set to mask a phone number field by displaying only the first three and last four digits, with the middle four digits masked by "*".

[0034] In practical applications, the original data viewing permission "unmask" can be preset. Users with this permission can view the original data of sensitive data, and the masking strategy is ineffective for these users. Conversely, users without this permission can only view the original data of sensitive data after masking and non-sensitive data.

[0035] In this step, the operation statements are used to perform operations on the original table in the database (which can be any table in the database) to generate a result table. These operations can be any type of operation on the tables in the database, including various aggregation operations, grouping operations, table copying, and any combination thereof. It can be understood that the result table consists of the operation results generated by executing the operation statements on the original table. It should be noted that the current user in this step does not have the aforementioned permission to view the original data; therefore, some masking processing needs to be performed on the result table to prevent them from accessing sensitive data (if the current user has permission to view the original data, the original data in the result table is directly output to them without masking processing). In one example, the original table is shown in Table 1:

[0036] Table 1 (Order Table)

[0037] Row identification User Brand Price Time Quantity 0 001 A 10 18:18 2 1 002 A 20 18:19 3 2 003 B 30 18:20 1 3 004 B 50 18:21 1 4 005 C 100 18:22 2

[0038] In practical applications, at least one entity field can be pre-specified in the original table according to current business needs. This entity field is related to the masking processing to be performed subsequently. For example, if the current business focuses on protecting sensitive data related to users and brands, the user field and brand field can be specified as entity fields. Then, the user field in Table 1 includes five user entities: 001, 002, 003, 004, and 005, and the brand field includes three brand entities: A, B, and C. Furthermore, a threshold for the number of entities corresponding to each entity field can be preset for each column (i.e., each field) of the original table, thus forming the threshold table shown in Table 2.

[0039] Table 2

[0040] Column User threshold Brand threshold User 2 1 Brand 2 1 Price 2 2 Time 0 0 Quantity 5 2

[0041] The user threshold in Table 2 corresponds to the entity count threshold for the "User" field, and the brand threshold corresponds to the entity count threshold for the "Brand" field. Table 2 means that if each column in the result table is associated with entities in both the "User" and "Brand" fields, then:

[0042] The conditions for displaying the "User" column in plaintext (i.e., directly displaying the original data without masking) are: the number of associated entities in the "User" field is greater than or equal to 2, and the number of associated entities in the "Brand" field is greater than or equal to 1. In other words, the masking condition for the "User" column is: the number of associated entities in the "User" field is less than 2, or the number of associated entities in the "Brand" field is less than 1. It can be understood that when the number of associated entities, including both "User" and "Brand" entities, is large, the current user cannot extract sensitive data from a single entity in the result table data; in this case, plaintext display is acceptable. Conversely, when the number of associated entities is small, plaintext display poses a risk of data leakage, and masking should be performed. Therefore, masking can be controlled by setting the above entity number thresholds and the corresponding plaintext display and masking conditions. It should be noted that the above plaintext display and masking conditions can be flexibly set according to actual needs, and this invention does not limit this. For example, the conditions for displaying the "User" column in plaintext could also be: the number of associated entities in the "User" field is greater than 2, and the number of associated entities in the "Brand" field is greater than 1.

[0043] The explicit conditions for the "Brand" column are: the number of associated entities in the User field is greater than or equal to 2, and the number of associated entities in the Brand field is greater than or equal to 1. In other words, the masked conditions for the "Brand" column are: the number of associated entities in the User field is less than 2, or the number of associated entities in the Brand field is less than 1.

[0044] The explicit condition for the "Price" column is: the number of associated entities in the "User" field is greater than or equal to 2, and the number of associated entities in the "Brand" field is greater than or equal to 2. In other words, the masked condition for the "Price" column is: the number of associated entities in the "User" field is less than 2, or the number of associated entities in the "Brand" field is less than 2.

[0045] The "Time" column is displayed in plain text only if the number of associated entities in the "User" field is greater than or equal to zero, and the number of associated entities in the "Brand" field is greater than or equal to zero. In other words, the "Time" column can generally be displayed in plain text.

[0046] The explicit condition for the "Quantity" column is: the number of associated entities in the User field is greater than or equal to 5, and the number of associated entities in the Brand field is greater than or equal to 2. In other words, the masked condition for the "Quantity" column is: the number of associated entities in the User field is less than 5, or the number of associated entities in the Brand field is less than 2.

[0047] After executing the statement "select sum(price*quantity) from order group by brand" on the original table (this statement performs aggregation and grouping operations), the result table shown in Table 3 can be generated:

[0048] Table 3

[0049] Row identification Brand sum(Price*Quantity) [0,1] A 80 [2,3] B 80 [4] C 200

[0050] As can be seen, the above result tables contain raw data without any masking processing. In existing technologies, the row identifier field is not output to the user, and the data in the brand field and the sum(price*quantity) field are generally related to sensitive data in the original table. Therefore, these are all masked data, resulting in most of the data in the result tables being invisible to users without permission to view the original data, thus leading to low data usability. To address these shortcomings, this invention improves data usability while protecting sensitive data through the following steps.

[0051] Step S102: For any cell in the result table: The database server obtains the source row and source column of the cell in the original table, determines the number of associated entities of the cell in the entity field from the source row, and determines the threshold of the number of entities of the cell in the entity field from the source column.

[0052] In this step, it can be determined whether masking processing needs to be performed on each cell in the result table. As a preferred approach, for any cell, first, obtain at least one source row and at least one source column of that cell in the original table. Then, count the number of non-duplicate entities in any entity field of the aforementioned source row, and determine this number as the number of associated entities of that cell in that entity field. Next, calculate the maximum value of the entity count threshold for the aforementioned source column in any entity field, and determine this maximum value as the entity count threshold for that cell in that entity field. It can be understood that if only one source column exists, then the entity count threshold for that source column in any entity field is the above maximum value.

[0053] Taking the cell with the value "80" in the third row and third column of Table 3 as an example, the row identifiers of the source rows of this cell are 2 and 3, and the source columns are the "Price" column and the "Quantity" column. Then, the number of associated entities in the "User" field of this cell is the cumulative number of non-duplicate users in the two source rows, which is 2; the number of associated entities in the "Brand" field of this cell is the cumulative number of non-duplicate brands in the two source rows, which is 1; the threshold for the number of entities in the "User" field of this cell is the maximum value of the threshold for the number of entities in the "User" field of the two source columns, which is 5; the threshold for the number of entities in the "Brand" field of this cell is the maximum value of the threshold for the number of entities in the "Brand" field of the two source columns, which is 2.

[0054] Step S103: When the number of associated entities and the corresponding entity number threshold of the cell meet the preset masking conditions, the database server performs masking processing on the original data of the cell to form the output data of the cell, and outputs the output data into an output table to the current user.

[0055] After obtaining the number of associated entities and the threshold number of entities for each entity field in any cell, it can be determined whether the number of associated entities and the corresponding threshold number meet the preset masking conditions. If they do, the original data of the cell is masked to form the output data for that cell; otherwise, the original data of the cell is used directly as the output data. Finally, the output data is compiled into an output table and output to the current user, thereby achieving privacy control at the cell level and improving the data availability of the result table while ensuring the security of sensitive data.

[0056] Preferably, in this embodiment of the invention, the discrimination step based on the above masking conditions is as follows: First, for any cell, the number of associated entities with a value of zero in that cell is removed. In specific applications, if the number of associated entities in a certain entity field of the cell is zero, it means that the cell is unrelated to that entity field, and the number of associated entities can be ignored. For any number of associated entities after removal, if the number of associated entities is less than the threshold for the number of entities in the same entity field of the cell (i.e., the number of associated entities being compared and the threshold for the number of entities should correspond to the same entity field), it means that the cell has a risk of exposing sensitive data, and the original data of the cell can be masked according to the masking strategy set in advance for the column where the cell is located, thereby forming the output data of the cell; for each number of associated entities after removal, if each number of associated entities is greater than or equal to the threshold for the number of entities in the same entity field of the cell, it means that the cell will not expose sensitive data, and the original data of the cell is directly determined as the output data of the cell. For example, the masking strategy above could be a default strategy (using ***** as the mask), an Email strategy (applies to string types, where the first character, @, and .com are not masked, and other characters are replaced with XXXX), or a random strategy (applies to numeric types, using a random value to replace the original number as the mask). It can be understood that the above judgment is an example of masking condition implementation; in actual applications, specific masking conditions can be set according to business requirements.

[0057] Taking the masking strategy as the default strategy as an example, after the above processing, Table 3 becomes the output table shown in Table 4:

[0058] Table 4

[0059] Brand sum(Price*Quantity) A ** B ** * **

[0060] As can be seen, the output table contains some cell data that meets the conditions for plaintext display, thereby improving data usability while protecting sensitive data.

[0061] Figure 2 This is a schematic diagram illustrating the specific execution steps of the database masking processing method in an embodiment of the present invention, as shown below. Figure 2As shown, the database masking processing method of this embodiment of the invention can perform the following steps: Step S201, the database server receives the calculation statement input by the current user. The calculation statement is for the original table in the database, and the current user does not have permission to view the original data. Step S202, the database server executes the calculation statement and generates a result table for plaintext display based on the original table. Step S203, the database server obtains the source row and source column of each cell in the result table. Step S204, the database server calculates the number of associated entities of the cell based on the source row and calculates the entity number threshold of the cell based on the source column. Step S205, the database server determines whether the number of associated entities and the entity number threshold corresponding to the same entity field of the cell meet the masking conditions: if yes, proceed to step S206 and mask the original data of the cell according to the masking strategy of the column; otherwise, retain the original data. Step S207, the database server generates an output table for the current user.

[0062] The following describes a specific embodiment of the present invention, following the example above and Tables 1, 2, and 3.

[0063] After the database server executes the operation statement "select sum(price*quantity) from order group by brand" on the original table shown in Table 1, it generates the result table shown in Table 3. In Table 3, the database server can use arrays to store row identifiers (i.e., identifiers of the source rows) and column identifiers (i.e., identifiers of the source columns). Furthermore, the "row identifier" field and each entity field in the original table can be extracted beforehand to form an entity table, making it easier to calculate the number of associated entities in a cell later. In the entity table, if there is a clear correspondence between the entity fields, the data from the original table is directly entered; if there is no clear correspondence between the entity fields, null values ​​can be entered; if the correspondence between the entity fields is not important, wildcards can be entered.

[0064] For each cell in the results table, retrieve the source row and source column of that cell from the "Row Identifier" field. Then, in the entity table, perform a deduplication count of entities based on the source row (during the counting process, each wildcard can be considered a different entity) to obtain the number of associated entities. Finally, calculate the maximum value of the entity count threshold for each source column in the same entity field to obtain the entity count threshold for each cell.

[0065] Finally, for each non-zero number of associated entities, it is determined whether the number is greater than or equal to the corresponding entity number threshold. If so, the original data is output; otherwise, the original data is masked according to the preset masking strategy and then output, thereby realizing data masking control at the cell level.

[0066] According to the technical solution of this embodiment of the invention, after receiving the operation statement input by the current user for the original table in the database, the original table is operated on to form a result table composed of the original data; then, each cell in the result table is judged, that is, the source row and source column of the cell in the original table are obtained first, and the number of associated entities of the cell in the preset entity field is determined from the source row, and the threshold of the number of entities in the entity field of the cell is determined from the source column; thereafter, it is judged whether the number of associated entities of the cell and the corresponding threshold of the number of entities meet the preset masking conditions: if they meet, the original data of the cell is masked according to the preset masking strategy; otherwise, the original data of the cell is retained; finally, the above data is combined into an output table and output to the current user. Through the above steps, cell-level masking and discrimination are achieved. When cell data involves a large number of entities, users cannot extract sensitive data of a single entity, so the original data can be output. When cell data involves a small number of entities, there is a possibility of exposing sensitive data. In this case, masking processing needs to be performed before output. This can improve data availability while preventing sensitive data from being exposed to unauthorized users, and achieve privacy control at the cell level.

[0067] It should be noted that, for the sake of ease of description, the foregoing method embodiments are described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, and some steps may actually be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential for implementing the present invention.

[0068] To facilitate better implementation of the above-described solutions of the embodiments of the present invention, related apparatus for implementing the above-described solutions is also provided below.

[0069] Please see Figure 3 As shown, the database masking processing device 300 provided in this embodiment of the invention may include: a calculation unit 301, a data preparation unit 302, and a masking unit 303.

[0070] The calculation unit 301 can be used to: perform calculations on the original table in the database according to the calculation statement input by the current user, to obtain a result table composed of the original data; wherein the current user does not have permission to view the original data, and the original table has at least one entity field that is predetermined and related to the masking process; the data preparation unit 302 can be used to: for any cell in the result table, obtain the source row and source column of the cell in the original table, determine the number of associated entities of the cell in the entity field from the source row, and determine the threshold of the number of entities of the cell in the entity field from the source column; the masking unit 303 can be used to: when the number of associated entities of the cell and the corresponding threshold of the number of entities meet the preset masking conditions, perform masking processing on the original data of the cell to form the output data of the cell, and output the output data to the current user in an output table.

[0071] In this embodiment of the invention, the data preparation unit 302 may be further used to: count the number of non-duplicate entities in any entity field of the source row, and determine the number as the number of associated entities of the cell in the entity field; pre-configure an entity number threshold corresponding to each entity field for each column of the original table; obtain the maximum value of the entity number threshold of the source column in any entity field, and determine the maximum value as the entity number threshold of the cell in the entity field.

[0072] As a preferred embodiment, the masking unit 303 can be further used to: remove the number of associated entities whose value is zero in the cell; for any number of associated entities after removal: when the number of associated entities is less than the threshold for the number of entities in the same entity field of the cell, mask the original data of the cell according to the masking strategy set in advance for the column where the cell is located; before the output data is compiled into an output table and output to the current user: for each number of associated entities after removal: when the number of associated entities is greater than or equal to the threshold for the number of entities in the same entity field of the cell, determine the original data of the cell as the output data of the cell.

[0073] According to the technical solution of this embodiment of the invention, after receiving the operation statement input by the current user for the original table in the database, the original table is operated on to form a result table composed of the original data; then, each cell in the result table is judged, that is, the source row and source column of the cell in the original table are obtained first, and the number of associated entities of the cell in the preset entity field is determined from the source row, and the threshold of the number of entities in the entity field of the cell is determined from the source column; thereafter, it is judged whether the number of associated entities of the cell and the corresponding threshold of the number of entities meet the preset masking conditions: if they meet, the original data of the cell is masked according to the preset masking strategy; otherwise, the original data of the cell is retained; finally, the above data is combined into an output table and output to the current user. Through the above steps, cell-level masking and discrimination are achieved. When cell data involves a large number of entities, users cannot extract sensitive data of a single entity, so the original data can be output. When cell data involves a small number of entities, there is a possibility of exposing sensitive data. In this case, masking processing needs to be performed before output. This can improve data availability while preventing sensitive data from being exposed to unauthorized users, and achieve privacy control at the cell level.

[0074] Figure 4 An exemplary system architecture 400 is shown where the database masking method or database masking apparatus of embodiments of the present invention can be applied.

[0075] like Figure 4 As shown, system architecture 400 may include terminal devices 401, 402, and 403, network 404, and server 405 (this architecture is merely an example; the components included in a specific architecture may be adjusted according to the specific application). Network 404 serves as the medium for providing a communication link between terminal devices 401, 402, and 403 and server 405. Network 404 may include various connection types, such as wired or wireless communication links or fiber optic cables.

[0076] Users can use terminal devices 401, 402, and 403 to interact with server 405 via network 404 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 401, 402, and 403, such as database masking applications (for example only).

[0077] Terminal devices 401, 402, and 403 can be various electronic devices with displays that support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0078] Server 405 can be a server that provides various services, such as a backend server that supports database masking applications operated by users using terminal devices 401, 402, and 403 (for example only). The backend server can process received masking requests and feed back the processing results (such as an output table formed after masking—for example only) to terminal devices 401, 402, and 403.

[0079] It should be noted that the database masking method provided in this embodiment of the invention is generally executed by server 405, and correspondingly, the database masking device is generally located in server 405.

[0080] It should be understood that Figure 4 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0081] The present invention also provides an electronic device. The electronic device according to an embodiment of the present invention includes: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the database masking method provided by the present invention.

[0082] The following is for reference. Figure 5 It shows a schematic diagram of the structure of a computer system 500 suitable for implementing an electronic device according to embodiments of the present invention. Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.

[0083] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 502 or programs loaded from storage section 508 into random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the computer system 500. The CPU 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0084] The following components are connected to I / O interface 505: an input section 506 including a keyboard, mouse, etc.; an output section 507 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to I / O interface 505 as needed. A removable medium 511, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 510 as needed so that computer programs read from it can be installed into storage section 508 as needed.

[0085] In particular, according to the embodiments disclosed in this invention, the processes described in the above main step diagrams can be implemented as computer software programs. For example, embodiments of this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the main step diagrams. In the above embodiments, the computer program can be downloaded and installed from a network via communication section 509, and / or installed from removable medium 511. When the computer program is executed by central processing unit 501, it performs the functions defined in the system of this invention.

[0086] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0087] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0088] The units described in the embodiments of the present invention can be implemented in software or hardware. The described units can also be located in a processor; for example, a processor can be described as including a processing unit, a data preparation unit, and a masking unit. The names of these units do not necessarily limit the specific unit; for example, a processing unit can also be described as "a unit that provides a result table to the data preparation unit."

[0089] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs, and when the device executes the one or more programs, the steps performed by the device include: performing operations on the original table according to an operation statement input by the current user targeting the original table in the database, to obtain a result table composed of the original data; wherein the current user does not have permission to view the original data, and the original table has at least one predetermined entity field related to masking processing; for any cell in the result table: obtaining the source row and source column of the cell in the original table, determining the number of associated entities of the cell in the entity field from the source row, and determining the entity number threshold of the cell in the entity field from the source column; when the number of associated entities and the corresponding entity number threshold of the cell meet the preset masking conditions, masking processing is performed on the original data of the cell to form the output data of the cell, and the output data is compiled into an output table and output to the current user.

[0090] According to the technical solution of this embodiment of the invention, after receiving the operation statement input by the current user for the original table in the database, the original table is operated on to form a result table composed of the original data; then, each cell in the result table is judged, that is, the source row and source column of the cell in the original table are obtained first, and the number of associated entities of the cell in the preset entity field is determined from the source row, and the threshold of the number of entities in the entity field of the cell is determined from the source column; thereafter, it is judged whether the number of associated entities of the cell and the corresponding threshold of the number of entities meet the preset masking conditions: if they meet, the original data of the cell is masked according to the preset masking strategy; otherwise, the original data of the cell is retained; finally, the above data is combined into an output table and output to the current user. Through the above steps, cell-level masking and discrimination are achieved. When cell data involves a large number of entities, users cannot extract sensitive data of a single entity, so the original data can be output. When cell data involves a small number of entities, there is a possibility of exposing sensitive data. In this case, masking processing needs to be performed before output. This can improve data availability while preventing sensitive data from being exposed to unauthorized users, and achieve privacy control at the cell level.

[0091] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A database masking method, characterized in that, include: The original table is processed according to the operation statement input by the current user, which is directed to the original table in the database, to obtain a result table composed of the original data; wherein, the current user does not have permission to view the original data, and the original table has at least one entity field that is predetermined and related to masking processing; For any cell in the result table: obtain the source row and source column of the cell in the original table, determine the number of associated entities of the cell in the entity field from the source row, and determine the threshold of the number of entities of the cell in the entity field from the source column; When the number of associated entities and the corresponding entity number threshold of a cell meet the preset masking conditions, the original data of the cell is masked to form the output data of the cell, and the output data is compiled into an output table and output to the current user. The step of determining the number of associated entities of the cell in the entity field from the source row includes: counting the number of non-duplicate entities in any entity field of the source row, and determining the number as the number of associated entities of the cell in the entity field; Determining the entity quantity threshold of the cell in the entity field from the source column includes: pre-configuring an entity quantity threshold corresponding to each entity field for each column of the original table; obtaining the maximum value of the entity quantity threshold of the source column in any entity field, and determining the maximum value as the entity quantity threshold of the cell in that entity field.

2. The method according to claim 1, characterized in that, When the number of associated entities and the corresponding entity number threshold of a cell meet a preset masking condition, the original data of the cell is masked to form the output data of the cell, including: Remove the number of associated entities whose cell value is zero; For any number of associated entities after removal: when the number of associated entities is less than the threshold for the number of entities in the same entity field of the cell, the original data of the cell is masked according to the masking strategy set in advance for the column where the cell is located.

3. The method according to claim 2, characterized in that, The method further includes: before assembling the output data into an output table and outputting it to the current user: For each associated entity count after removal: when the number of associated entities is greater than or equal to the threshold for the number of entities in the same entity field of the cell, the original data of the cell is determined as the output data of the cell.

4. A database masking processing device, characterized in that, include: The calculation unit is used to: perform calculations on the original table in the database based on the calculation statement input by the current user, to obtain a result table composed of the original data; wherein the current user does not have permission to view the original data, and the original table has at least one predetermined entity field related to masking processing; The data preparation unit is configured to: for any cell in the result table, obtain the source row and source column of the cell in the original table, determine the number of associated entities of the cell in the entity field from the source row, and determine the threshold of the number of entities of the cell in the entity field from the source column; The masking unit is used to: when the number of associated entities and the corresponding entity number threshold of the cell meet the preset masking conditions, mask the original data of the cell to form the output data of the cell, and output the output data to the current user by forming an output table; The data preparation unit is further configured to: count the number of non-duplicate entities in any entity field of the source row, and determine the number as the number of associated entities of the cell in that entity field; pre-configure an entity number threshold corresponding to each entity field for each column of the original table; obtain the maximum value of the entity number threshold of the source column in any entity field, and determine the maximum value as the entity number threshold of the cell in that entity field.

5. The apparatus according to claim 4, characterized in that, The shielding unit is further used for: Remove the number of associated entities whose value is zero in the cell; for any number of associated entities after removal: if the number of associated entities is less than the threshold for the number of entities in the same entity field of the cell, mask the original data of the cell according to the masking strategy set in advance for the column where the cell is located; Before the output data is compiled into an output table and output to the current user: for each number of associated entities after removal: when the number of associated entities is greater than or equal to the threshold of the number of entities in the same entity field of the cell, the original data of the cell is determined as the output data of the cell.

6. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-3.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-3.

Citation Information

Patent Citations

  • A method and system for dynamically masking database information

    CN109101566A

  • Configurable annotations for privacy-sensitive user content

    CN110506271A