Data desensitization method and device, equipment and medium
By building an associated syntax tree and pre-configured desensitization rules, the syntax diversity problem of complex SQL query statements is solved, the efficiency and security of data desensitization are improved, and data leakage is avoided.
Patent Information
- Application Number
- CN202310644206.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-01
- Publication Date
- 2024-12-03
AI Technical Summary
Existing dynamic desensitization methods are difficult to deal with complex SQL query statements, especially multi-layer complex nested queries and syntax diversity problems, resulting in inability to correctly parse and desensitize, which may lead to data leakage and execution errors.
By building an association syntax tree, recording the mapping association relationship between the original data table and the return table, determining the target sensitive data type of the return field, and desensitizing according to pre-configured desensitization rules, the syntax diversity problem and complexity are solved. The resolution difficulty of the query.
It improves the desensitization effect of SQL query statements, reduces the difficulty of syntax parsing, enhances the security of data access and query efficiency, and effectively protects sensitive information.
Smart Images

Figure CN119066693A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data security technology, and in particular to a data desensitization method, device, equipment and medium. Background Art
[0002] With the development of the digital economy, data security issues have become increasingly prominent, and data desensitization has gradually become an indispensable part of security governance. If sensitive data is not desensitized and published or shared, it is easy to cause privacy leakage of individuals or companies, resulting in irreparable losses, such as patient information in the medical field, transaction or log information of customers in the banking field.
[0003] Dynamic desensitization is a technical means for operation and maintenance, data exchange and other scenarios. It is often used to perform instant desensitization when accessing sensitive data, thereby avoiding data leakage and ensuring the security of data access. AST (Abstract Syntax Tree) can establish a mapping relationship with sensitive data in the database by constructing SQL query statements, and has become a common means of dynamic desensitization technology; however, existing dynamic desensitization methods can often only process simple query statements and simply replace sensitive data types contained in SQL; when encountering some complex query statements, such as multi-layer complex nested queries, they cannot be correctly parsed and desensitized; in addition, the problem of grammatical diversity may not be handled correctly, for example, after desensitizing distinct syntax, the number of returned records will be reduced, or after SQL desensitization rewriting, semantic changes or even execution errors will occur.
[0004] In summary, how to solve the problem of grammatical diversity in SQL query statements and improve the protection of sensitive data are issues that need to be resolved. Summary of the invention
[0005] In view of this, the purpose of the present invention is to provide a data desensitization method, device, equipment and medium, which can solve the problem of grammatical diversity in SQL query statements and improve the protection effect of sensitive data. The specific scheme is as follows:
[0006] In a first aspect, the present application discloses a data desensitization method, comprising:
[0007] Construct an associated syntax tree based on the target query statement; the associated syntax tree is used to record the mapping association relationship between the original fields in the original data table and the returned fields in the returned table;
[0008] The target sensitive data type of the return field is determined based on the associated syntax tree, and the return field is desensitized according to a pre-configured desensitization rule corresponding to the target sensitive data type to obtain a desensitization result.
[0009] Optionally, constructing an associated syntax tree based on the target query statement includes:
[0010] The original query statement is nested as a sub-query statement in a preset outer query statement to obtain a target query statement;
[0011] The target query statement is parsed to obtain a syntax tree associated with the return table and the return field.
[0012] Optionally, the data desensitization method further includes:
[0013] The sensitive data type of each original field in the original data table is pre-set, and desensitization rules corresponding to the sensitive data type are configured; the desensitization rules include masking desensitization and random value replacement.
[0014] Optionally, determining the target sensitive data type of the return field based on the associated syntax tree includes:
[0015] Acquire a mapping association relationship between the returned field and the original field in the original data table based on the association syntax tree;
[0016] The target sensitive data type of the returned field is determined based on the mapping association relationship and the sensitive data type of the original field.
[0017] Optionally, determining the target sensitive data type of the returned field based on the mapping association relationship and the sensitive data type of the original field includes:
[0018] If the returned field is only mapped to an original field in an original data table, the sensitive data type of the original field is used as the target sensitive data type of the returned field;
[0019] If the returned field mapping is associated with original fields in multiple original data tables, it is determined whether the sensitive data types of the original fields are the same, and the target sensitive data type of the returned field is determined based on the determination result.
[0020] Optionally, determining the target sensitive data type of the return field based on the judgment result includes:
[0021] If the judgment result is that the sensitive data types of the original fields are the same, the sensitive data types are used as the target sensitive data types of the returned fields;
[0022] If the judgment result is that the sensitive data types of the original fields are not the same, the target sensitive data type of the returned field is set as the default sensitive data type.
[0023] Optionally, performing desensitization processing on the returned field according to a pre-configured desensitization rule corresponding to the target sensitive data type to obtain a desensitization result includes:
[0024] Determining a pre-configured desensitization rule corresponding to the target sensitive data type;
[0025] Modifying the return field in the associated syntax tree based on the desensitization rule to obtain a modified associated syntax tree;
[0026] The desensitization result is obtained based on the modified associated syntax tree.
[0027] In a second aspect, the present application discloses a data desensitization device, comprising:
[0028] An associated syntax tree construction module is used to construct an associated syntax tree based on a target query statement; the associated syntax tree is used to record the mapping association relationship between the original fields in the original data table and the returned fields in the returned table;
[0029] The desensitization processing module is used to determine the target sensitive data type of the return field based on the associated syntax tree, and perform desensitization processing on the return field according to a pre-configured desensitization rule corresponding to the target sensitive data type to obtain a desensitization result.
[0030] In a third aspect, the present application discloses an electronic device, comprising:
[0031] Memory, used to store computer programs;
[0032] A processor is used to execute the computer program to implement the steps of the aforementioned disclosed data desensitization method.
[0033] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned disclosed data desensitization method are implemented.
[0034] It can be seen that the present application constructs an associated syntax tree based on the target query statement; the associated syntax tree is used to record the mapping association relationship between the original field in the original data table and the return field in the return table; the target sensitive data type of the return field is determined based on the associated syntax tree, and the return field is desensitized according to the pre-configured desensitization rules corresponding to the target sensitive data type to obtain the desensitization result. It can be seen that the associated syntax tree in the present application is only used to record the mapping association relationship between the original field in the original data table and the return field in the return table, so the associated syntax tree is first constructed for the target query statement, and then the target sensitive data type of the return field is determined based on the associated syntax tree, and then the return field is desensitized according to the pre-configured desensitization rules corresponding to the target sensitive data type to obtain the final desensitization result. That is, by constructing a syntax association tree for the target query statement to establish a mapping association relationship between the return field and the original field, the syntax diversity problem that cannot be avoided by the traditional abstract syntax tree can be solved, the difficulty of syntax parsing is reduced, and the efficiency of the query is improved, the leakage problem of sensitive information is effectively solved, and the security and availability of user data are improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0036] Figure 1 This is a flow chart of a data desensitization method disclosed in this application;
[0037] Figure 2 A schematic diagram of the structure of an associative syntax tree disclosed in this application;
[0038] Figure 3 A flow chart of a specific data desensitization method disclosed in this application;
[0039] Figure 4 A schematic diagram of a desensitization process based on an associated syntax tree disclosed in this application;
[0040] Figure 5 A schematic diagram of an application principle of the present application disclosed in the present application;
[0041] Figure 6 A schematic diagram of a specific associated syntax tree structure disclosed in this application;
[0042] Figure 7 This is a schematic diagram of the structure of a data desensitization device disclosed in this application;
[0043] Figure 8 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0044] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0045] Existing dynamic desensitization methods can often only process simple query statements, and may not correctly handle the problem of grammatical diversity. To this end, the embodiments of the present application disclose data desensitization methods, devices, equipment and media, which can solve the problem of grammatical diversity in SQL query statements and improve the protection effect of sensitive data.
[0046] See also Figure 1 As shown, the embodiment of the present application discloses a data desensitization method, which includes:
[0047] Step S11: construct an associated syntax tree based on the target query statement; the associated syntax tree is used to record the mapping association relationship between the original fields in the original data table and the returned fields in the returned table.
[0048] In this embodiment, an associated syntax tree is constructed for the target query statement, wherein the target query statement is a query statement in the SQL language, and the associated syntax tree only records the mapping association relationship between the original fields in the original data table and the returned fields in the returned table, and does not record the exact calculation relationship. For details, see Figure 2 As shown in Figure 2 This is a schematic diagram of the structure of an associative syntax tree disclosed in this application.
[0049] Step S12: determining the target sensitive data type of the return field based on the associated syntax tree, and performing desensitization processing on the return field according to a pre-configured desensitization rule corresponding to the target sensitive data type to obtain a desensitization result.
[0050] In this embodiment, the target sensitive data type of the return field is determined based on the associated syntax tree, and then the return field is desensitized according to the pre-configured desensitization rules corresponding to the target sensitive data type to obtain the final desensitization result. That is, by constructing a syntax association tree for the target query statement to establish a mapping association relationship between the return field and the original field, and then determining the target sensitive data type of the return field, and desensitizing the return field, it can solve the syntax diversity problem that cannot be avoided in the traditional abstract syntax tree, reduce the difficulty of syntax parsing, and at the same time improve the efficiency of the query, effectively solve the problem of sensitive information leakage, and improve the security and availability of user data.
[0051] It can be seen that the present application constructs an associated syntax tree based on the target query statement; the associated syntax tree is used to record the mapping association relationship between the original field in the original data table and the return field in the return table; the target sensitive data type of the return field is determined based on the associated syntax tree, and the return field is desensitized according to the pre-configured desensitization rules corresponding to the target sensitive data type to obtain the desensitization result. It can be seen that the associated syntax tree in the present application is only used to record the mapping association relationship between the original field in the original data table and the return field in the return table, so the associated syntax tree is first constructed for the target query statement, and then the target sensitive data type of the return field is determined based on the associated syntax tree, and then the return field is desensitized according to the pre-configured desensitization rules corresponding to the target sensitive data type to obtain the final desensitization result. That is, by constructing a syntax association tree for the target query statement to establish a mapping association relationship between the return field and the original field, and then determining the target sensitive data type of the return field, and desensitizing the return field, the syntax diversity problem that cannot be avoided by the traditional abstract syntax tree can be solved, the difficulty of syntax parsing is reduced, and the efficiency of the query is improved at the same time, the leakage problem of sensitive information is effectively solved, and the security and availability of user data are improved.
[0052] See also Figure 3 and Figure 4 As shown, the embodiment of the present application discloses a specific data desensitization method. Compared with the previous embodiment, this embodiment further explains and optimizes the technical solution. Specifically, it includes:
[0053] Step S21: pre-set the sensitive data type of each original field in the original data table, and configure desensitization rules corresponding to the sensitive data type; the desensitization rules include masking desensitization and random value replacement.
[0054] In this embodiment, the sensitive data type of each original field in the original data table is pre-set, and the desensitization rules corresponding to the sensitive data type are configured. Among them, the desensitization rules include masking desensitization and random value replacement, etc. Masking desensitization can be specifically divided into full masking, masking the beginning and the end, masking the middle, retaining the beginning and the end, retaining the middle, etc. In addition, the data type of the original field is personal information and corporate information, such as: mobile phone number, bank card number, ID card, name, etc.
[0055] Step S22: nesting the original query statement as a sub-query statement in the preset external query statement to obtain a target query statement.
[0056] In this embodiment, the application principle of the present application is as follows Figure 5 As shown, considering the problems faced in the existing AST-based SQL parsing process, the captured original query statement is used as a subquery statement and nested in the preset external query statement to obtain the target query statement. The external query statement is specifically "select*from()temp". Assuming that the SQL statement to be queried, that is, the original query statement is "select name,if(max(table1.age)>min(table2.age),round(avg(table3.score),abs(table4.score)))score from table5", and then the original query statement is wrapped with "select*from()temp", that is, the original query statement is nested in the external query statement, then the target query statement can be obtained: "select*from(select name,if(max(table1.age)>min(table2.age),round(avg(table3.score),abs(table4.score)))score from table5)temp".
[0057] Step S23: parsing the target query statement to obtain an associated syntax tree of the return table and the return field; the associated syntax tree is used to record the mapping association relationship between the original field in the original data table and the return field in the return table.
[0058] In this embodiment, the target query statement is parsed to obtain the associated syntax tree of the return table and the return field. For details, see Figure 6 It should be noted that the returned fields are the fields returned by the original query statement, that is, it is only necessary to determine whether the fields returned by the subquery statement contain sensitive fields, thus avoiding the problem of needing to accurately parse the original SQL.
[0059] Step S24: obtaining a mapping association relationship between the return field and the original field in the original data table based on the association syntax tree.
[0060] In this embodiment, the mapping relationship between the returned fields and the original fields in the original data table is obtained based on the associated syntax tree. Figure 6 As shown in the figure, the returned name field only maps the name field of table5, and the returned score field maps the age field of table1, the age field of table2, the score field of table3, and the score field of table4.
[0061] Step S25: Determine the target sensitive data type of the returned field based on the mapping association relationship and the sensitive data type of the original field, and determine a pre-configured desensitization rule corresponding to the target sensitive data type.
[0062] In this embodiment, the target sensitive data type of the returned field is determined based on the mapping association relationship and the sensitive data type of the original field, and then a pre-configured desensitization rule corresponding to the target sensitive data type is determined.
[0063] In a specific implementation, the above-mentioned determination of the target sensitive data type of the return field based on the mapping association relationship and the sensitive data type of the original field includes: if the return field is only mapped to an original field in an original data table, the sensitive data type of the original field is used as the target sensitive data type of the return field; if the return field is mapped to original fields in multiple original data tables, it is determined whether the sensitive data types of the original fields are the same, and the target sensitive data type of the return field is determined based on the judgment result. It can be understood that if the return field is only mapped to an original field in an original data table, the sensitive data type of the original field is used as the target sensitive data type of the return field, such as Figure 6 The name field returned in only maps to the name field of the associated table5, so the target sensitive data type is the sensitive data type of the original name field; in addition, if the returned field mapping is associated with the original fields in multiple original data tables, such as Figure 6The score field mapping returned in is associated with the age field of table1, the age field of table2, the score field of table3, and the score field of table4. At this time, it belongs to the disputed sensitive type. Then it is necessary to further determine whether the sensitive data types of each original field are the same, and determine the target sensitive data type of the returned field based on the judgment result. Specifically, the above-mentioned determination of the target sensitive data type of the returned field based on the judgment result includes: if the judgment result is that the sensitive data types of each original field are the same, then the sensitive data type is used as the target sensitive data type of the returned field; if the judgment result is that the sensitive data types of each original field are not the same, then the target sensitive data type of the returned field is set to the default sensitive data type. That is, if the sensitive data types of the original fields are the same, then any sensitive data type is used as the target sensitive data type of the returned field; if they are not the same, then the target sensitive data type of the returned field is set to the default sensitive data type.
[0064] Step S26: modifying the return field in the associated syntax tree based on the desensitization rule to obtain a modified associated syntax tree, and obtaining a desensitization result based on the modified associated syntax tree.
[0065] In this embodiment, the return field in the associated syntax tree is modified according to the corresponding desensitization rule to obtain a modified associated syntax tree, and then the desensitization result is obtained based on the modified associated syntax tree.
[0066] It can be seen that in this application, the original query statement is nested as a sub-query statement in the external query statement "select * from () temp" to obtain the target query statement, and then the target query statement is parsed to obtain the associated syntax tree of the return table and the return field. In addition, the return field is the field returned by the original query statement, that is, it is only necessary to determine whether the field returned by the sub-query statement contains sensitive fields, avoiding the problem of accurately parsing the original SQL. Through the above scheme, the data desensitization method in this application can meet the needs of statistical query or multi-table association desensitization, can convert queries into a unified method, improve efficiency, solve the problem of failure of complex SQL dynamic desensitization, ensure legality and semantics, and provide a flexible desensitization method to achieve better data protection effects.
[0067] See also Figure 7 As shown, the embodiment of the present application discloses a data desensitization device, which includes:
[0068] An associated syntax tree construction module 11 is used to construct an associated syntax tree based on a target query statement; the associated syntax tree is used to record a mapping association relationship between original fields in an original data table and returned fields in a returned table;
[0069] The desensitization processing module 12 is used to determine the target sensitive data type of the return field based on the associated syntax tree, and perform desensitization processing on the return field according to the pre-configured desensitization rule corresponding to the target sensitive data type to obtain a desensitization result.
[0070] It can be seen that the present application constructs an associated syntax tree based on the target query statement; the associated syntax tree is used to record the mapping association relationship between the original field in the original data table and the return field in the return table; the target sensitive data type of the return field is determined based on the associated syntax tree, and the return field is desensitized according to the pre-configured desensitization rules corresponding to the target sensitive data type to obtain the desensitization result. It can be seen that the associated syntax tree in the present application is only used to record the mapping association relationship between the original field in the original data table and the return field in the return table, so the associated syntax tree is first constructed for the target query statement, and then the target sensitive data type of the return field is determined based on the associated syntax tree, and then the return field is desensitized according to the pre-configured desensitization rules corresponding to the target sensitive data type to obtain the final desensitization result. That is, by constructing a syntax association tree for the target query statement to establish a mapping association relationship between the return field and the original field, the syntax diversity problem that cannot be avoided by the traditional abstract syntax tree can be solved, the difficulty of syntax parsing is reduced, and the efficiency of the query is improved, the leakage problem of sensitive information is effectively solved, and the security and availability of user data are improved.
[0071] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Specifically, it may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the data desensitization method performed by the electronic device disclosed in any of the aforementioned embodiments.
[0072] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0073] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0074] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system 221, a computer program 222 and data 223, etc. The storage method can be temporary storage or permanent storage.
[0075] Among them, the operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, so as to realize the operation and processing of the massive data 223 in the memory 22 by the processor 21, which can be Windows, Unix, Linux, etc. In addition to including a computer program that can be used to complete the data desensitization method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks. In addition to data received by the electronic device and transmitted from an external device, the data 223 can also include data collected by its own input and output interface 25, etc.
[0076] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium, in which a computer program is stored. When the computer program is loaded and executed by a processor, the method steps performed in the data desensitization process disclosed in any of the aforementioned embodiments are implemented.
[0077] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0078] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0079] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0080] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0081] The above is a detailed introduction to a data desensitization method, device, equipment and storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A data desensitization method, characterized in that: include: Build an associated syntax tree based on the target query statement; The associated syntax tree is used to record the mapping association relationship between the original fields in the original data table and the returned fields in the returned table; The target sensitive data type of the return field is determined based on the associated syntax tree, and the return field is desensitized according to a pre-configured desensitization rule corresponding to the target sensitive data type to obtain a desensitization result.
2. The data desensitization method according to claim 1, characterized in that: The step of constructing an associated syntax tree based on the target query statement includes: The original query statement is nested as a sub-query statement in a preset outer query statement to obtain a target query statement; The target query statement is parsed to obtain a syntax tree associated with the return table and the return field.
3. The data desensitization method according to claim 1, characterized in that: Also includes: Pre-setting the sensitive data type of each original field in the original data table, and configuring desensitization rules corresponding to the sensitive data type; The desensitization rules include masking desensitization and random value replacement.
4. The data desensitization method according to claim 3, characterized in that: The determining the target sensitive data type of the return field based on the associated syntax tree includes: Acquire a mapping association relationship between the returned field and the original field in the original data table based on the association syntax tree; The target sensitive data type of the returned field is determined based on the mapping association relationship and the sensitive data type of the original field.
5. The data desensitization method according to claim 4, characterized in that: The determining the target sensitive data type of the returned field based on the mapping association relationship and the sensitive data type of the original field includes: If the returned field is only mapped to an original field in an original data table, the sensitive data type of the original field is used as the target sensitive data type of the returned field; If the returned field mapping is associated with original fields in multiple original data tables, it is determined whether the sensitive data types of the original fields are the same, and the target sensitive data type of the returned field is determined based on the determination result.
6. The data desensitization method according to claim 5, characterized in that: The determining, based on the judgment result, the target sensitive data type of the returned field includes: If the judgment result is that the sensitive data types of the original fields are the same, the sensitive data types are used as the target sensitive data types of the returned fields; If the judgment result is that the sensitive data types of the original fields are not the same, the target sensitive data type of the returned field is set as the default sensitive data type.
7. The data desensitization method according to any one of claims 1 to 6, characterized in that: The desensitizing the returned field according to a pre-configured desensitization rule corresponding to the target sensitive data type to obtain a desensitization result includes: Determining a pre-configured desensitization rule corresponding to the target sensitive data type; Modifying the return field in the associated syntax tree based on the desensitization rule to obtain a modified associated syntax tree; The desensitization result is obtained based on the modified associated syntax tree.
8. A data desensitization device, characterized in that: include: An associated syntax tree building module is used to build an associated syntax tree based on a target query statement; The associated syntax tree is used to record the mapping association relationship between the original fields in the original data table and the returned fields in the returned table; The desensitization processing module is used to determine the target sensitive data type of the return field based on the associated syntax tree, and perform desensitization processing on the return field according to a pre-configured desensitization rule corresponding to the target sensitive data type to obtain a desensitization result.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the data desensitization method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein, when the computer program is executed by a processor, the steps of the data desensitization method as described in any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Data desensitization method and device, equipment and storage medium
CN119760777A
A data desensitization method, device, equipment and storage medium
CN119760777B
Feature-retaining data desensitization and modeling method
CN120408721A
