Method and device for safely generating sample data from sensitive data, equipment and medium

By extracting and classifying data based on the association table query and identification rules when generating sensitive data samples, and performing fine-grained desensitization processing, the problems of insufficient sample representativeness, missing target data and inconsistent data quality are solved, and high-quality sample data generation and data security guarantee are achieved.

CN119807739APending Publication Date: 2025-04-11ZHONGDIAN DATA IND CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411831542.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

When generating sample data of sensitive data, the sample is insufficiently representative, the target data is missing, the data quality is inconsistent, and the desensitization is incomplete.

Method used

By conducting continuous table queries based on multiple correlation tables, sample data is extracted and the sensitive data identification rules are determined whether the data is the target data or noise data, and stored in the extracted database and noise database respectively. Then, the target data and noise data are desensitized based on the pre-configured desensitization rules to build a sample library.

Benefits of technology

It improves the quality of sample data and the quality consistency of real data, ensures the robustness of the model and the effectiveness of modeling work, enhances the modeling efficiency and system stability of data processing personnel, and ensures data security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119807739A_ABST
    Figure CN119807739A_ABST
Patent Text Reader

Abstract

A method, apparatus and device for safely generating sample data from sensitive data, and a medium, the method comprising: performing table connection query based on a plurality of association tables, extracting sample data, and determining whether the sample data is target data according to a sensitive data identification rule; if yes, storing in a data extraction library; if not, storing the noise data into a noise library; for all the tables, traversing all fields recorded in each table, extracting sample data and judging whether the extracted data accords with a sensitive data identification rule or not, and if yes, discarding the extracted data; if not, storing the data as noise data into a noise library; acquiring data of a plurality of tables except the data extraction library and the noise library, storing the data into a temporary noise library, and extracting target data from the data extraction library and excluding the target data; extracting noise data from the residual data and supplementing the noise data into a noise library; carrying out desensitization processing on the target data and the noise data based on a desensitization rule; and finally, constructing a sample library. The method has high authenticity while safely generating sample data, and fully reflects data characteristics.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of data processing technology, and in particular relates to a method, device, equipment and medium for securely generating sample data from sensitive data. Background Art

[0002] With the advent of the big data era, data has become an indispensable and important resource in corporate decision-making, product development and scientific research.

[0003] When processing extremely important or extremely sensitive data (such as nuclear high-base data), in order to protect the confidentiality and integrity of the data, the original data will not be provided directly to the data processing personnel, and the data processing personnel need to model based on the sample library. The sample data used is usually randomly sampled based on production data, and then the sample data is simulated and desensitized to generate a sample data set.

[0004] Although this method can meet the basic requirement of "data available but not visible" to a certain extent, it has one or more limitations such as insufficient sample representativeness, missing target data, inconsistent data quality, or incomplete desensitization. Summary of the invention

[0005] The purpose of the present invention is to provide a method, device, equipment and medium for securely generating sample data from sensitive data, so as to solve the technical problems of insufficient sample representativeness, missing target data and inconsistent data quality when generating sample data from sensitive data.

[0006] In order to solve the above technical problems, the specific technical solutions of the present invention are as follows:

[0007] In a first aspect, a method for securely generating sample data from sensitive data is provided, comprising:

[0008] Perform a table query based on multiple related tables, extract sample data and determine whether the extracted data is target data according to sensitive data identification rules; if so, store the target data in the extraction database; if not, store it in the noise database as noise data;

[0009] For all tables, traverse all fields of each table record, extract sample data and determine whether the extracted data meets the sensitive data identification rules. If yes, discard the extracted data; if no, treat the extracted data as noise data and add it to the noise library;

[0010] Acquire data from multiple tables other than the sampling library and the noise library, extract sample data and store them in a temporary noise library, extract target data based on the temporary noise library and exclude them; extract noise data from the remaining data and add them to the noise library;

[0011] Desensitizing the target data and the noise data based on pre-configured desensitization rules; if a certain target data cannot be successfully desensitized according to the established rules, desensitizing the data using the desensitization rules corresponding to the noise data;

[0012] A sample library is constructed based on the desensitized target data and noise data.

[0013] In a first possible implementation manner of the first aspect, performing a linked table query based on multiple associated tables, extracting sample data, and judging whether the extracted data is target data according to sensitive data identification rules; if so, storing the target data in a sampling database; if not, storing the target data in a noise database as noise data, specifically includes:

[0014] Define the associated table and connect the associated tables through the JOIN operation;

[0015] Execute SQL query based on the defined association table relationship to obtain JOIN association data;

[0016] Traverse the JOIN-related data one by one, and traverse all sensitive fields of each data according to the sensitive data identification rules. If the matching result is yes, mark it as target data; if the matching result is no, mark it as noise data;

[0017] Determine whether the target data has reached the preset upper limit of the number of samplings, if yes, store it in the sampling database; if no, discard it;

[0018] The noise data is classified according to its length, and different types of noise data are screened and stored in the noise library.

[0019] Based on the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, before the noise data is stored in the noise library, the following steps are performed:

[0020] Determine whether the number of types of the noise data stored in the noise library exceeds a preset upper limit of types. If so, end the process. If not, further determine whether the number of each type of noise data exceeds a preset upper limit of number. If so, end the process. If not, store the data in the noise library.

[0021] In a third possible implementation manner of the first aspect, the desensitization rule is: use the identification rule to match each sensitive field of each table, and if a match can be found, use the corresponding desensitization rule to perform desensitization.

[0022] In a second aspect, a device for securely generating sample data from sensitive data is provided, comprising:

[0023] The data extraction module is used to perform a joint table query based on multiple related tables, extract sample data and determine whether the extracted data is target data according to the sensitive data identification rules; if so, store the target data in the extraction database; if not, store it in the noise database as noise data;

[0024] For all tables, traverse all fields of each table record, extract sample data and determine whether the extracted data meets the sensitive data identification rules. If yes, discard the extracted data; if no, treat the extracted data as noise data and add it to the noise library;

[0025] Acquire data from multiple tables other than the sampling library and the noise library, extract sample data and store them in a temporary noise library, extract target data based on the temporary noise library and exclude them; extract noise data from the remaining data and add them to the noise library;

[0026] A data desensitization module, used to perform desensitization processing on both the target data and the noise data based on pre-configured desensitization rules; if a certain target data cannot be successfully desensitized according to the established rules, the desensitization rules corresponding to the noise data are used to perform desensitization processing;

[0027] The sample library construction module is used to construct a sample library based on the desensitized target data and noise data.

[0028] In a first possible implementation manner of the second aspect, the data extraction module is specifically configured to:

[0029] Define the associated table and connect the associated tables through the JOIN operation;

[0030] Execute SQL query based on the defined association table relationship to obtain JOIN association data;

[0031] Traverse the JOIN-related data one by one, and traverse all sensitive fields of each data according to the sensitive data identification rules. If the matching result is yes, mark it as target data; if the matching result is no, mark it as noise data;

[0032] Determine whether the target data has reached the preset upper limit of the number of samplings, if yes, store it in the sampling database; if no, discard it;

[0033] The noise data is classified according to its length, and different types of noise data are screened and stored in the noise library.

[0034] Based on the first possible implementation manner of the second aspect, in a second possible implementation manner of the second aspect, the data extraction module is further specifically used to:

[0035] Before the noise data is stored in the noise library, the following steps are performed:

[0036] Determine whether the number of types of the noise data stored in the noise library exceeds a preset upper limit of types. If so, end the process. If not, further determine whether the number of each type of noise data exceeds a preset upper limit of number. If so, end the process. If not, store the data in the noise library.

[0037] In a third possible implementation manner of the second aspect, the desensitization rule is: each sensitive field of each table is matched using an identification rule, and if a match can be found, the corresponding desensitization rule is used for desensitization.

[0038] According to a third aspect, an electronic device is provided, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the method for securely generating sample data from sensitive data as described in the first aspect are implemented.

[0039] In a fourth aspect, a readable storage medium is provided, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method for securely generating sample data from sensitive data as described in the first aspect are implemented.

[0040] The present invention has the following advantages:

[0041] This application divides the generation process of the sample library in the production data into two steps: data extraction and data desensitization. During the data extraction process, various types of noise data are also extracted and added to the sample library, so that the data quality of the sample data is equivalent to that of the real data, ensuring the robustness of the model and the effectiveness of the modeling work, and greatly improving the modeling efficiency and system stability of data processing personnel. Data security is guaranteed by desensitizing the target data and noise data at a more fine-grained level. While sensitive data safely generates sample data, it has a high degree of authenticity and can fully reflect the characteristics of the data. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 A schematic flow chart of a method for securely generating sample data from sensitive data of the present invention;

[0043] Figure 2 A schematic flow chart of another method for securely generating sample data for sensitive data of the present invention;

[0044] Figure 3 A schematic flow chart of noise extraction based on associated data according to the present invention;

[0045] Figure 4 A schematic flow chart of noise extraction based on sensitive fields according to the present invention;

[0046] Figure 5A schematic flow chart of noise extraction based on a tag field according to the present invention;

[0047] Figure 6 A schematic diagram of the structure of a device for securely generating sample data from sensitive data of the present invention;

[0048] Figure 7 The figure is a schematic diagram of the structure of an electronic device of the present invention. DETAILED DESCRIPTION

[0049] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined purpose, the technical solutions in the embodiments of the present application are clearly described. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field belong to the scope of protection of the present application.

[0050] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0051] The description of the method flow in the specification of the present application and the steps of the flowchart in the drawings of the present specification do not have to be strictly executed according to the step numbers, and the method steps can be executed in a different order. Moreover, some steps can be omitted, multiple steps can be combined into one step, and / or one step can be decomposed into multiple steps.

[0052] The following is a detailed description of the method, device, equipment and medium for securely generating sample data from sensitive data provided in the embodiments of the present application in combination with the accompanying drawings and preferred embodiments.

[0053] First, the application scenario of the method for securely generating sample data from sensitive data in an embodiment of the present application is described in detail.

[0054] In the related technologies, when debugging data products in the traditional data factorization market, random sampling is performed based on actual data in the production environment, and a sample data set is formed for developers to use after a certain degree of desensitization. Although this method can meet the basic requirement of "data is available but not visible" to a certain extent, it has the following major problems:

[0055] Insufficient sample representativeness: Due to the limitations of random sampling, the generated sample data often cannot fully and accurately reflect the characteristics of the original data set, especially for those data points with specific patterns or rare features.

[0056] Missing target data: In many cases, especially when it comes to classification or regression tasks, sufficient labeled data is required to train an effective prediction model. However, the sample data set after random sampling and desensitization often lacks sufficient quantity and good quality labeled information (the size of the sample library is limited). Insufficient target data will affect the training effect and accuracy of the model.

[0057] Inconsistent data quality: The data in the sample library has been additionally processed or screened, and the production data may change during the generation process. Inconsistency between sample quality and production data quality can cause deviations or anomalies when the model runs in a production environment.

[0058] Incomplete desensitization: Simple desensitization methods are difficult to completely eliminate the risk of information leakage, and some real data will be leaked in the form of noise data.

[0059] Therefore, in general, the quality of the sample library directly affects the model quality and modeling efficiency, which in turn affects the product production process.

[0060] To solve the above technical problems, the present application provides a method for securely generating sample data from sensitive data, extracting various types of noise data from production data and adding them to a sample library, so that the data quality of the sample data is equivalent to that of the real data, and ensuring data security by desensitizing the target data and noise data in a more fine-grained manner.

[0061] See also Figure 1-2 , the embodiment of the present application provides a method for securely generating sample data from sensitive data, such as Figure 1-2 As shown, the method comprises the following steps:

[0062] Step S1, perform a linked table query based on multiple related tables, extract sample data and determine whether the extracted data is target data according to sensitive data identification rules; if so, store the target data in the extraction database; if not, store it in the noise database as noise data.

[0063] This step uses the association table structure defined in the database to find data that meets the sensitive data rules, marks the filtered data as target data, and stores it in a separately established sampling library for subsequent use; for data that does not meet the sensitive data rules, it is marked as noise data and stored in a separately established noise library.

[0064] See also Figure 3In the specific implementation process, step S1 specifically includes the following steps:

[0065] Step S101, define the associated tables, and connect the associated tables through JOIN operation, that is, clearly identify the database tables from which the target data needs to be extracted, and determine the relationship between these tables.

[0066] Step S102: execute SQL query based on the defined association table relationship to obtain JOIN association data.

[0067] Step S103, traverse the JOIN associated data one by one, traverse all sensitive fields of each data according to the sensitive data identification rule, if the matching result is yes, mark it as target data; if the matching result is no, mark it as noise data.

[0068] Step S104, determining whether the target data has reached the preset upper limit of the number of samplings, if so, storing it in the sampling library; if not, discarding it.

[0069] Step S105 , classify the noise data according to their length, and select as many different types of noise data as possible to store in the noise library.

[0070] In some possible implementations, step S1 further includes the following steps:

[0071] Step S106, before the noise data is stored in the noise library, it is determined whether the number of types of noise data stored in the noise library exceeds the preset upper limit of types. If so, the process ends. If not, it is further determined whether the number of noise data of each type exceeds the preset upper limit of number. If so, the process ends. If not, the noise data is stored in the noise library. For example, there are a maximum of 50 noise categories, and a maximum of 100 noise data of each category are taken; this number can be configured according to the actual sample limit.

[0072] In some possible implementations, the above query process allows the user to manually adjust the SQL statement according to actual business needs to ensure that the required target data can be accurately obtained.

[0073] See also Figure 4 , Step S2, for all tables, traverse all fields of each table record, extract sample data and determine whether the extracted data meets the identification rules of sensitive data. If it meets the rules, it will be discarded; if it does not meet the rules, it will be used as noise data and added to the noise library.

[0074] See also Figure 5 , step S3, obtaining data from multiple tables other than the sampling library and the noise library, extracting sample data and storing them in a temporary noise library, extracting target data based on the temporary noise library and excluding them; extracting noise data from the remaining data and adding them to the noise library.

[0075] The data in multiple tables may be related. In production data, there may be cases where the same fields cannot find corresponding records in different tables. This part of data is also a kind of noise for modeling. For example, see Figure 5 , specifically including the following steps:

[0076] Step S301, obtain 20,000 pieces of data other than the sampling database and the noise database from [Table A], [Table B], and [Table C] respectively.

[0077] When this step is implemented, use not exists to obtain data in [Table A], [Table B], and [Table C] that do not exist in the sampling database and the noise database.

[0078] Step S302, the data obtained from [Table A] is stored in the temporary noise library [Table AA], the data obtained from [Table B] is stored in the temporary noise library [Table BB], and the data obtained from [Table C] is stored in the temporary noise library [Table CC].

[0079] Step S303: Based on the temporary noise library [AA table], [BB table], and [CC table], SQL is extracted to obtain target data. This step of obtaining target data is similar to step S102-step S103.

[0080] Step S304: exclude the acquired target data, and extract noise data from the remaining records after excluding the target data.

[0081] Step S305, store the extracted noise data into the noise library, and ensure that the noise data in each table reaches 10,000. That is, complete 10,000 noise data and store them in table A, table B, and table C of the noise library respectively.

[0082] Step S4, desensitizing the target data and the noise data based on the pre-configured desensitization rules; if a certain target data cannot be successfully desensitized according to the established rules, the desensitization rules corresponding to the noise data are used for desensitization.

[0083] The desensitization rule is: use the identification rule to match each sensitive field of each table, and if it matches, use the corresponding desensitization rule to perform desensitization. It should be noted that the fields related to the associated tags also need to implement associated desensitization.

[0084] In this step, since both the target data and the noise data may contain sensitive data, all the extracted data needs to be desensitized for data security. Although the noise data may leak the real data, it is generally only necessary to perform simple desensitization on the noise data. Therefore, for the target data that cannot be successfully desensitized according to the established rules, if the recognition rules do not match, the noise desensitization rules are used for desensitization.

[0085] During the specific implementation, the characters before and after desensitization need to be kept of equal length, and the same data must be the same after desensitization, and different data must remain different after desensitization.

[0086] Step S5, constructing a sample library based on the desensitized target data and noise data.

[0087] Based on the above technical solution, this application divides the generation process of the sample library in the production data into two steps: data extraction and data desensitization. During the data extraction process, various types of noise data are also extracted and added to the sample library, so that the data quality of the sample data is equivalent to that of the real data, ensuring the robustness of the model and the effectiveness of the modeling work, and greatly improving the modeling efficiency and system stability of data processing personnel. Data security is guaranteed by desensitizing the target data and noise data in a more fine-grained manner. While sensitive data safely generates sample data, it has a high degree of authenticity and can fully reflect the characteristics of the data.

[0088] See also Figure 6 Corresponding to the above-mentioned method embodiment for securely generating sample data from sensitive data, an embodiment of the present application provides a device for securely generating sample data from sensitive data, the device comprising:

[0089] A device for securely generating sample data from sensitive data, characterized by comprising:

[0090] The data extraction module 1001 is used to perform a joint table query based on multiple association tables, extract sample data and determine whether the extracted data is target data according to sensitive data identification rules; if so, store the target data in a sampling database; if not, store the target data in a noise database as noise data;

[0091] For all tables, traverse all fields of each table record, extract sample data and determine whether the extracted data meets the identification rules of sensitive data. If so, discard the data; if not, treat it as noise data and add it to the noise library;

[0092] Acquire data from multiple tables other than the sampling library and the noise library, extract sample data and store them in a temporary noise library, extract target data based on the temporary noise library and exclude them; extract noise data from the remaining data and add them to the noise library;

[0093] The data desensitization module 1003 is used to perform desensitization processing on both the target data and the noise data based on pre-configured desensitization rules; if a certain target data cannot be successfully desensitized according to the established rules, the desensitization rules corresponding to the noise data are used to perform desensitization processing;

[0094] The sample library construction module 1003 is used to construct a sample library based on the desensitized target data and noise data.

[0095] Furthermore, the data extraction module is specifically used for:

[0096] Define the associated table and connect the associated tables through the JOIN operation;

[0097] Execute SQL query based on the defined association table relationship to obtain JOIN association data;

[0098] Traverse the JOIN-related data one by one, and traverse all sensitive fields of each data according to the sensitive data identification rules. If the matching result is yes, mark it as target data; if the matching result is no, mark it as noise data;

[0099] Determine whether the target data has reached the preset upper limit of the number of samplings, if yes, store it in the sampling database; if no, discard it;

[0100] The noise data is classified according to its length, and different types of noise data are screened and stored in the noise library.

[0101] Furthermore, the data extraction module is further used to:

[0102] Before the noise data is stored in the noise library, the following steps are performed:

[0103] Determine whether the number of types of the noise data stored in the noise library exceeds a preset upper limit of types. If so, end the process. If not, further determine whether the number of each type of noise data exceeds a preset upper limit of number. If so, end the process. If not, store the data in the noise library.

[0104] Furthermore, the desensitization rule is: use the identification rule to match each sensitive field of each table, and if a match can be found, use the corresponding desensitization rule to perform desensitization.

[0105] The above-mentioned method device for securely generating sample data from sensitive data implements the steps and various processes of the above-mentioned method embodiment for securely generating sample data from sensitive data, and can achieve the same technical effect. To avoid repetition, they are not described here.

[0106] See also Figure 7 Corresponding to the above-mentioned method embodiment for securely generating sample data from sensitive data, an embodiment of the present application provides an electronic device, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor. When the computer program is executed by the processor, the steps and various processes of the above-mentioned method embodiment for securely generating sample data from sensitive data are implemented, and the same technical effect can be achieved. To avoid repetition, they will not be described here.

[0107] The memory 1009 can be used to store software programs and various data. The memory 1009 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 1009 may include a volatile memory or a non-volatile memory, or the memory 1009 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 1009 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0108] The processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 1010.

[0109] Corresponding to the above-mentioned method embodiment for securely generating sample data from sensitive data, the embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps and various processes of the above-mentioned method embodiment for securely generating sample data from sensitive data are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0110] The processor is the processor in the electronic device described in the above embodiment of the present application. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0111] It should be noted that, in this article, the terms "comprise", "include" 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, an element defined by the sentence "comprises one..." does not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be noted that the scope of the method and device in the embodiment of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0112] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0113] It can be understood that the embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific embodiments, which are merely illustrative and not restrictive, and those skilled in the art are aware that various changes or equivalent replacements can be made to these features and embodiments without departing from the spirit and scope of the present invention. In addition, those of ordinary skill in the art can modify these features and embodiments to adapt to specific circumstances and materials without departing from the spirit and scope of the present invention under the inspiration or teaching of the present application. Therefore, the present invention is not limited by the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of the present application belong to the scope protected by the present invention.

Claims

1. A method for securely generating sample data from sensitive data, characterized in that: include: Perform table join query based on multiple related tables, extract sample data and determine whether the extracted data is target data based on sensitive data identification rules; If yes, the target data is stored in the sampling database; if no, it is stored in the noise database as noise data; For all tables, traverse all fields of each table record, extract sample data and determine whether the extracted data meets the sensitive data identification rules. If yes, discard the extracted data; if no, treat the extracted data as noise data and add it to the noise library; Acquire data of multiple tables other than the sampling database and the noise database, extract sample data and store them in a temporary noise database, extract target data based on the temporary noise database and exclude them; Extracting noise data from the remaining data and adding the noise data to the noise library; Performing desensitization processing on both the target data and the noise data based on a pre-configured desensitization rule; If a certain target data cannot be successfully desensitized according to the established rules, the desensitization rules corresponding to the noise data are used for desensitization processing; A sample library is constructed based on the desensitized target data and noise data.

2. The method for securely generating sample data from sensitive data according to claim 1, characterized in that: The method of performing a linked table query based on multiple associated tables, extracting sample data and judging whether the extracted data is target data according to sensitive data identification rules; if so, storing the target data in a sampling database; if not, storing the target data in a noise database as noise data, specifically includes: Define the associated table and connect the associated tables through the JOIN operation; Execute SQL query based on the defined association table relationship to obtain JOIN association data; Traverse the JOIN-related data one by one, and traverse all sensitive fields of each data according to the sensitive data identification rules. If the matching result is yes, mark it as target data; if the matching result is no, mark it as noise data; Determine whether the target data has reached the preset upper limit of the number of samplings, if yes, store it in the sampling database; if no, discard it; The noise data is classified according to its length, and different types of noise data are screened and stored in the noise library.

3. The method for securely generating sample data from sensitive data according to claim 2, characterized in that: Before the noise data is stored in the noise library, the following steps are performed: Determine whether the number of types of the noise data stored in the noise library exceeds a preset upper limit of types. If so, end the process. If not, further determine whether the number of each type of noise data exceeds a preset upper limit of number. If so, end the process. If not, store the data in the noise library.

4. The method for securely generating sample data from sensitive data according to claim 1, characterized in that: The desensitization rule is: use the identification rule to match each sensitive field of each table, and if it can be matched, use the corresponding desensitization rule to perform desensitization.

5. A device for securely generating sample data from sensitive data, characterized in that: include: The data extraction module is used to perform table query based on multiple related tables, extract sample data and determine whether the extracted data is target data according to sensitive data identification rules; If yes, the target data is stored in the sampling database; if no, it is stored in the noise database as noise data; For all tables, traverse all fields of each table record, extract sample data and determine whether the extracted data meets the sensitive data identification rules. If yes, discard the extracted data; if no, treat the extracted data as noise data and add it to the noise library; Acquire data of multiple tables other than the sampling database and the noise database, extract sample data and store them in a temporary noise database, extract target data based on the temporary noise database and exclude them; Extracting noise data from the remaining data and adding the noise data to the noise library; A data desensitization module, used for desensitizing the target data and the noise data based on pre-configured desensitization rules; If a certain target data cannot be successfully desensitized according to the established rules, the desensitization rules corresponding to the noise data are used for desensitization processing; The sample library construction module is used to construct a sample library based on the desensitized target data and noise data.

6. The device for securely generating sample data from sensitive data according to claim 5, characterized in that: The data extraction module is specifically used for: Define the associated table and connect the associated tables through the JOIN operation; Execute SQL query based on the defined association table relationship to obtain JOIN association data; Traverse the JOIN-related data one by one, traverse all sensitive fields of each data according to the sensitive data identification rule, and if the matching result is yes, mark it as the target data; If the matching result is no, it is marked as noise data; Determine whether the target data has reached the preset upper limit of the number of samplings, if yes, store it in the sampling database; if no, discard it; The noise data is classified according to its length, and different types of noise data are screened and stored in the noise library.

7. The device for securely generating sample data from sensitive data according to claim 6, characterized in that: The data extraction module is further specifically used for: Before the noise data is stored in the noise library, the following steps are performed: Determine whether the number of types of the noise data stored in the noise library exceeds a preset upper limit of types. If so, end the process. If not, further determine whether the number of each type of noise data exceeds a preset upper limit of number. If so, end the process. If not, store the data in the noise library.

8. The device for securely generating sample data from sensitive data according to claim 5, characterized in that: The desensitization rule is: use the identification rule to match each sensitive field of each table, and if it can be matched, use the corresponding desensitization rule to perform desensitization.

9. An electronic device, characterized in that: The electronic device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the method for securely generating sample data from sensitive data as claimed in any one of claims 1 to 4.

10. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the method for securely generating sample data from sensitive data as described in any one of claims 1 to 4 are implemented.