Data desensitization method and device
By performing reversible transformation and noise processing on user data in social networks, combined with Gaussian normalization and frequency encoding conversion rules, usable and private synthetic data is generated, which solves the problem of difficult to balance data privacy and usability in the existing technology. problem, achieving efficient desensitization of data.
Patent Information
- Application Number
- CN202410848238.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-10-01
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the process of desensitizing user data in social networks, the existing technology has difficulty in improving privacy while maintaining data availability, and cannot effectively resist re-identification attacks.
By obtaining the data type of the original data, calling the corresponding reversible conversion rules to perform reversible conversion, and performing noise processing on the converted data, input it into the data synthesis model to generate synthetic data, determine its availability, and replace the original data if available. Combining Gaussian normalization and frequency encoding transformation rules maintains data diversity and privacy.
It improves the privacy and availability of data, enhances the value of data in data sharing and analysis, and effectively resists re-identification attacks.
Smart Images

Figure CN118734359A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data privacy processing, and in particular to a data desensitization method and device. Background Art
[0002] With the popularization of the Internet and mobile devices, personal privacy protection has become increasingly important. For example, in social networks, user data sets contain a large amount of personal information of users, such as name, age, gender, geographic location, interests and hobbies, etc. If this information is used improperly, it may pose a serious threat to the privacy of users.
[0003] In order to overcome the problem of privacy leakage of user sensitive data in social networks, the existing technology mainly replaces or blurs the privacy attributes of sensitive data in user data sets. The problems with this method are: the definition and positioning of privacy attributes are difficult, and it cannot resist re-identification attacks; and the usability of the data after desensitization is greatly lost.
[0004] Therefore, in the process of data sharing and data analysis, how to improve personal privacy while effectively utilizing the value of data and improving availability is a major challenge currently faced. Summary of the invention
[0005] In view of this, an object of the present invention is to provide a data desensitization method and device to improve data privacy and usability.
[0006] In a first aspect, a data desensitization method is provided, comprising:
[0007] Obtain the original data to be desensitized and the data type of the original data;
[0008] Call the corresponding reversible conversion rule according to the data type of the original data;
[0009] Perform reversible transformation on the original data according to the reversible transformation rules;
[0010] Performing noise processing on the reversibly transformed data to obtain noise-added data;
[0011] Input the noise-added data into the trained data synthesis model to obtain synthetic data;
[0012] Perform inverse transformation on the synthetic data to obtain data similar to the original data;
[0013] Determine whether similar data is available;
[0014] If available, similar data will be substituted for the original data.
[0015] Optionally, the data type includes a numeric type and a categorical type, and the corresponding reversible conversion rule is called according to the data type of the original data, including:
[0016] When it is detected that the data type of the original data is a numerical type, it is determined whether the original data is time series data;
[0017] If it is time series data, the optimized timestamp conversion rule is called;
[0018] If it is non-time series data, the Gaussian normalization conversion rule is called;
[0019] When it is detected that the data type of the original data is classified, determining whether the original data is selected sensitive data;
[0020] If sensitive data is selected, the anonymous substitution transformation rule is called;
[0021] If it is non-selected sensitive data, the frequency encoding conversion rule is called.
[0022] Optionally, the Gaussian normalization transformation rule is:
[0023] Convert the different distributions of the original data into uniform distributions;
[0024] Calculate the CDF value of each data in the uniform distribution;
[0025] Converts a uniform distribution to a standard normal distribution based on the CDF value.
[0026] Optionally, the frequency encoding conversion rule is:
[0027] Get the classification category of the original data;
[0028] Sort the classification categories of the original data in alphabetical order;
[0029] Calculate the frequency of each classification category in the total classification category;
[0030] The cumulative frequency of each classification category was calculated based on the frequency of each classification category;
[0031] Calculate the category interval for each classification category based on the cumulative frequency;
[0032] Convert categorical raw data into numerical data based on category intervals.
[0033] Optionally, performing noise processing on the reversibly converted data to obtain the noise-added data includes:
[0034] Obtaining query sensitivity of the reversibly converted data based on a preset data sensitivity calculation formula;
[0035] Calculate the dynamic privacy budget of the reversibly transformed data based on the query sensitivity and the basic privacy budget;
[0036] Calculate the noise scale based on the dynamic privacy budget;
[0037] Calculate noise distribution based on noise scale;
[0038] Noise is added to the reversibly transformed data based on the noise distribution to obtain noisy data.
[0039] Optionally, the synthetic data is inversely transformed to obtain similar data of the original data including:
[0040] Calculate the similarity between the synthetic data and the unnoised reversibly transformed data;
[0041] comparing the similarity with a preset similarity threshold;
[0042] If it is greater than the similarity threshold, an inverse transformation is performed according to a rule opposite to the reversible transformation rule to obtain data similar to the original data.
[0043] Optionally, determining whether similar data is available includes:
[0044] Calculate the attribute correlation between similar data and original data;
[0045] comparing the attribute correlation with a preset correlation;
[0046] If it is greater than the preset correlation, the similar data and the original data are input into the classification model to obtain the accuracy, precision and recall indicators;
[0047] Compare the three indicators with the corresponding preset indicator thresholds respectively;
[0048] If all three indicators are greater than or equal to their corresponding preset indicator thresholds, then availability is achieved;
[0049] If any of the indicators is lower than the corresponding preset indicator threshold, the system is not available.
[0050] Optionally, if similar data is not available, the method further comprises:
[0051] Adjust the basic privacy budget and re-perform data noise addition, synthesis and inverse conversion operations.
[0052] Optionally, before replacing the similar data with the original data, the method further comprises:
[0053] Determine whether the frequency errors of the same value or the same category in the original data after the inverse transformation are within the preset error range;
[0054] If it is within the preset error range, similar data will be replaced with the original data;
[0055] If it exceeds the preset error range, the basic privacy budget will be adjusted and the data noise addition, synthesis and inverse conversion operations will be performed again.
[0056] In a second aspect, a data desensitization device is provided, the device comprising:
[0057] An acquisition unit, used to acquire the original data to be desensitized and the data type of the original data;
[0058] A calling unit, used for calling a corresponding reversible conversion rule according to the data type of the original data;
[0059] A reversible conversion unit, used for reversibly converting the original data according to a reversible conversion rule;
[0060] A noise adding unit, used for performing noise adding processing on the data after the reversible conversion to obtain noise added data;
[0061] A synthesis unit, used for inputting the noise-added data into the trained data synthesis model to obtain synthetic data;
[0062] An inverse conversion unit, used for inversely converting the synthesized data to obtain data similar to the original data;
[0063] A judging unit, used to judge whether similar data is available;
[0064] A replacement unit is used to replace the original data with similar data if available.
[0065] A data desensitization method and device provided by an embodiment of the present invention obtains the original data to be desensitized and the data type of the original data; calls the corresponding reversible conversion rule according to the data type of the original data; reversibly converts the original data according to the reversible conversion rule; performs noise processing on the reversibly converted data to obtain noisy data; inputs the noisy data into a trained data synthesis model to obtain synthetic data; performs inverse conversion on the synthetic data to obtain similar data of the original data; determines whether the similar data is available; if available, replaces the original data with the similar data to achieve the purpose of desensitization, and replaces the original data set to perform related behaviors in social networks. The present application maintains the diversity of the original data through reversible conversion and inverse conversion, increases the availability of the data, and synthesizes synthetic data that is similar in structure and distribution through a data synthesis model, thereby improving the privacy of the data.
[0066] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0068] Figure 1 A flow chart of a data desensitization method provided by an embodiment of the present invention is shown;
[0069] Figure 2 A structural schematic diagram of a data desensitization device provided in an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0070] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present invention.
[0071] The present invention provides a data desensitization method, such as Figure 1 As shown, the following steps are included:
[0072] Step S101: Obtain the original data to be desensitized and the data type of the original data.
[0073] In an embodiment of the present application, the original data to be desensitized may be a user attribute data set in a social network. The user attribute data set includes a lot of sensitive data, and therefore data desensitization is required.
[0074] In one example, a python function can be used to obtain the data type of the original data. The data types mainly include numerical data, such as specific age data, 10 years old, 20 years old, 30 years old, etc. are numerical data, and categorical data, such as age, gender, occupation, etc. are categorical data. Numerical data is further divided into time series data and non-time series data, such as time is time series data and age is non-time series data. Categorical data is further divided into selected sensitive data and non-selected sensitive data.
[0075] In another embodiment, since the original data set often contains irrelevant data, it is necessary to preprocess the original data set to delete irrelevant data or propose target data to be studied, save the target data in a table, and then divide the data in the original data set.
[0076] Step S102: calling the corresponding reversible conversion rule according to the data type of the original data.
[0077] In an embodiment of the present application, calling the corresponding reversible conversion rule according to the data type of the original data includes the following steps:
[0078] Step S1021: When it is detected that the data type of the original data is a numerical type, determine whether the original data is time series data.
[0079] Step S1022: If it is time series data, call the optimized timestamp conversion rule.
[0080] In an embodiment of the present application, the time series data can be converted into formatted data through the Unix timestamp conversion tool. For example, the date is converted into a readable formatted date format. The data converted by optimizing the timestamp conversion rules is still numerical data.
[0081] Step S1023: If it is non-time series data, the Gaussian normalization conversion rule is called.
[0082] Gaussian normalization is used to convert non-time series data, which is generally numerical data, into a form with standard normal distribution characteristics, which helps to add noise and synthesis.
[0083] Step S1024: When it is detected that the data type of the original data is classified, determine whether the original data is selected sensitive data.
[0084] Selected sensitive data refers to certain specially designated categories of sensitive data, for example, ID card number is designated as selected sensitive data and name is designated as non-selected sensitive data.
[0085] Step S1025: If sensitive data is selected, the anonymous replacement conversion rule is called.
[0086] Select sensitive data such as regional categorized data, and use anonymous substitution to process the original data. The converted data usually remains categorized and needs to be further converted into numerical data, which helps to improve the quality of subsequent synthetic data. When performing the reverse conversion, directly replace the original data with false data.
[0087] Among them, it should be noted that the anonymous substitution algorithm is similar to the anonymization algorithm, but the anonymous substitution algorithm has lower complexity.
[0088] Step S1026: If it is non-selected sensitive data, the frequency coding conversion rule is called.
[0089] In this step, the categorical data is converted into continuous values through frequency encoding. The value of each category conforms to the uniform distribution in the interval [0,1]. Converting the categorical data into a continuous numerical representation helps to add noise and improve the similarity of subsequent data synthesis. At the same time, it also retains the frequency of each category in the data set, making the subsequent desensitized data usable.
[0090] Step S103: reversibly transform the original data according to the reversible transformation rule.
[0091] In the embodiment of the present application, reversible conversion means that after reversible conversion, the data can be restored to the original data through inverse conversion.
[0092] In one embodiment, Gaussian normalization transformation rule is used to perform reversible transformation on non-time series data:
[0093] The first step is to transform the different distributions of the original data into a uniform distribution.
[0094] In an embodiment of the present application, since there are many distribution types of the original data, such as skewed distribution, different distributions are not conducive to subsequent normal transformation processing. Therefore, data with different distributions are mapped to the same distribution and standardized to perform data preprocessing for subsequent normal transformation, which facilitates subsequent conversion operations.
[0095] Step 2: Calculate the CDF (Cumulative Distribution Function) value of each data in the uniform distribution u.
[0096] Get the general numerical data column in the original data, and calculate the CDF value of each data according to the statistical characteristics of each column of data in the original data, that is, u; for example, for each data x i , whose CDF value is u i =F(x i ) Formula 1; where F is the CDF of the univariate distribution. Since CDF is a probability value, u will be between 0 and 1.
[0097] Step 3: Convert the uniform distribution to a standard normal distribution based on the CDF value.
[0098] In order to achieve data normalization and improve the performance and effect of subsequent data synthesis, the cumulative distribution function of the standard normal distribution is applied to convert the uniform distribution u into the standard normal distribution z: Formula 2.
[0099] In another embodiment, the non-selected sensitive data is reversibly transformed using a frequency encoding transformation rule:
[0100] Step 1: Get the classification categories of the original data.
[0101] For example, if the original data includes police, doctors, nurses, and teachers, then all categories need to be obtained for subsequent sorting.
[0102] Step 2: Sort the classification categories of the original data in alphabetical order.
[0103] For example, in the first step, the first letter of the Chinese word for police is J, the first letter of the Chinese word for doctor is Y, the first letter of the Chinese word for nurse is H, and the first letter of the Chinese word for teacher is L. The order is sorted from front to back, and the result is nurse, teacher, police, and doctor. In other embodiments, the order can also be sorted according to the first letter of the English word, which is not limited here.
[0104] Step 3: Calculate the frequency of each classification category in the total classification category.
[0105] In this step, the frequency formula for calculating each classification category is as follows:
[0106]
[0107] Among them, f i is the frequency of the ith classification category, n is the frequency of the ith classification category, and N is the total frequency of the total categories.
[0108] In an example, for example, in a set of categorical data, there are 2 policemen, 3 nurses, 4 doctors, and 1 teacher. The total frequency of the total category is 10, the frequency of the teacher is 1, and the frequency of the teacher is 1 / 10.
[0109] Step 4: Calculate the cumulative frequency of each classification category based on the frequency of each classification category.
[0110] In this step, the cumulative frequencies are calculated:
[0111]
[0112] Among them, s i is the cumulative frequency of the first i categories.
[0113] Step 5: Calculate the category interval for each classification category based on the cumulative frequency.
[0114] In this step, the interval calculation formula is:
[0115] I(c i )=[s i-1 ,si ] Formula 5;
[0116] Among them, I(c i ) is the interval of the i-th classification category, s i-1 is the cumulative frequency of the i-1th classification category, s i The cumulative frequency of the ith classification category.
[0117] Based on the above example, for example, the classified data is nurse 1, nurse 2, nurse 3, teacher, policeman 1, policeman 2, doctor 1, doctor 2, doctor 3, doctor 4.
[0118] For example, to calculate the interval of the police, we first calculate the cumulative frequency of the teacher as 4 / 10 and the cumulative frequency of the police as 6 / 10, then the interval of the police is [4 / 10,6 / 10].
[0119] Step 6: Convert the categorized raw data into numerical data based on the category interval.
[0120] In the embodiment of the present application, for each classification category, a random value is extracted from its corresponding uniform distribution, and each category is mapped to a continuous value, that is, converted into numerical data. For example, for a given category c, in the process of mapping it to a continuous value x, its corresponding uniform distribution can be expressed as:
[0121] x~U(a,b) Formula 6;
[0122] That is, x obeys the uniform distribution on the interval I(c), and its value range is [a,b], where a and b are the starting point and end point of the interval I(c) respectively.
[0123] Step S104: performing noise processing on the reversibly converted data to obtain noisy data.
[0124] In this step, differential privacy of the data is achieved by adding noise. Differential privacy is a technology that protects personal privacy in data analysis.
[0125] Based on the above embodiment, performing noise processing on the reversibly converted data to obtain the noise-added data includes:
[0126] Step S1041: Obtain the query sensitivity of the reversibly converted data based on a preset data sensitivity calculation formula.
[0127] In this step, if you want to add noise, you need to determine the sensitivity of the data. Since the data after reversible conversion is unique, analyze the degree of correlation between the attributes corresponding to the numerical data and personal privacy, that is, use global sensitivity to determine the sensitivity of sensitive data. The sensitivity formula is as follows:
[0128]
[0129] Among them, d(x, x′) represents the distance between two data sets x and x′, and f(x) and f(x′) are deterministic query functions.
[0130] Step S1042: Calculate the dynamic privacy budget of the reversibly converted data based on the query sensitivity and the basic privacy budget.
[0131] In this step, a dynamic allocation method is used to calculate the dynamic privacy budget ε′ of each reversibly transformed data. This method comprehensively considers the basic sensitivity and query sensitivity of the data to output a suitable ε′ value. The dynamic privacy budget is calculated using the following formula:
[0132]
[0133] Among them, ε is the basic privacy budget, the basic privacy budget range is [0, 2], and S(f) is the query sensitivity.
[0134] The dynamic privacy budget can be adjusted by dynamically adjusting the range of the basic privacy budget.
[0135] Step S1043: Calculate the noise scale based on the dynamic privacy budget.
[0136] In one example, the noise metric can be calculated as follows:
[0137]
[0138] Here, λ is the scale of the noise, which can be set according to the dynamic privacy budget ∈′.
[0139] Step S1044: Calculate the noise distribution based on the noise scale.
[0140] In one example, for Laplace noise, the probability density function of the noise X is:
[0141]
[0142] Where f(x|λ) is the noise distribution and λ is the scale of the noise.
[0143] Step S1045: adding noise to the reversibly converted data based on the noise distribution to obtain noisy data.
[0144] In this step, taking categorized data as an example, the noise adding strategy can be adjusted by combining the corresponding interval of each category data during data conversion, and the corresponding noise can be added to the converted data. The data after adding noise through this strategy not only maintains the diversity of the original data, but also improves the privacy of the data. In addition, since the data is reversible, as long as the added noise is within the interval, the converted data can be restored to the original data type, thereby ensuring the availability of the data.
[0145] Step S105: input the noisy data into the trained data synthesis model to obtain synthesized data.
[0146] In the embodiment of the present application, the data synthesis model can adopt the GCS (Gaussian Copula Synthesizer) model. The GCS model is an advanced synthetic data generation model that combines the principle of the generative adversarial network GAN and the characteristics of the Gaussian Copula model to generate synthetic data with specific conditions. Each user in the social network user data set has multiple attributes. In order to maintain the correlation between attributes and users, the GCS model can simulate the correlation between variables. The GCS model can ensure the privacy of the data. At the same time, the generated data has a high similarity with the original data, which is suitable for scenarios such as data privacy protection and data enhancement.
[0147] Among them, the training process of the GCS data synthesis model is as follows:
[0148] The first step is to build a generator. The generator is the core part of the GCS model and is usually composed of a deep neural network. It can receive a conditional vector as input and output new data similar to the original data. During the training process, the goal of the generator is to generate synthetic data that can simulate the distribution of real data.
[0149] The second step is to build a discriminator. The discriminator is also part of a deep neural network, and its function is to determine whether the input data comes from the generator or the original dataset. The goal of the discriminator during training is to accurately distinguish between synthetic data and real data.
[0150] The third step is to train the model. The training of the GCS model is an iterative process involving alternating training of the generator and the discriminator. In each iteration, the generator generates new data based on the conditional vector, and the discriminator judges the authenticity of this data. Based on the feedback from the discriminator, the model parameters will be updated accordingly to improve the quality of the generated data. The model is trained by passing the noisy reversible transformation data into the model. This process will continue until the generator can generate synthetic data that is realistic enough and similar to the distribution of the incoming data.
[0151] The trained GCS model can be used to synthesize new data. By passing in the noisy reversible transformation data for synthesis, synthetic data similar to it in structure and distribution can be generated, increasing the uncertainty of the noisy data. The data synthesis method further improves the privacy of the data.
[0152] Step S106: Perform inverse transformation on the synthesized data to obtain data similar to the original data.
[0153] Based on the above embodiment, the synthetic data is inversely converted to obtain similar data of the original data, including:
[0154] Step S1061: Calculate the similarity between the synthesized data and the reversibly transformed data without noise;
[0155] In one example, the similarity can be calculated by comparing the standard deviation, variance, and other features of the synthesized data with the non-noised reversibly transformed data.
[0156] Step S1062: comparing the similarity with a preset similarity threshold;
[0157] If it is greater than the similarity threshold, an inverse transformation is performed according to a rule opposite to the reversible transformation rule to obtain data similar to the original data.
[0158] In one example, for numerical data, Gaussian normalization rule is used for data conversion, and the inverse conversion is used;
[0159] For example, for categorized data, the frequency coding conversion rule is used for data conversion. Then the inverse conversion algorithm can use the standard normal distribution inverse CDF transformation to restore the data converted to the standard normal distribution to its original distribution type, thereby maintaining the availability of the data.
[0160] First, the synthetic data is restricted to the interval [0,1], and then the synthesis is mapped back to the corresponding category according to the calculated interval; in the inverse transformation, the process of reversing the continuous value x back to the category value c can be expressed as mapping x back to the corresponding interval [a,b], and then determining the final category value c according to the interval it is in. That is:
[0161]
[0162] Among them, c i is the classification category of the i-th data; Nan is a null value.
[0163] The embodiment of the present application compares the similarity between the synthetic data and the data after reversible conversion without noise, firstly screens out some non-conforming synthetic data, reduces the amount of erroneous data in the reversible conversion and reduces the conversion error, thereby improving the success rate of the reversal conversion.
[0164] Step S107: Determine whether similar data is available.
[0165] Based on the above embodiment, determining whether similar data is available includes:
[0166] Step S1071: Calculate the attribute association between the similar data and the original data.
[0167] In this step, for example, the Pearson correlation coefficient statistical method can be used to quantify the correlation between attributes and visualize the correlation.
[0168] Step S1072: Compare the attribute correlation with the preset correlation.
[0169] Step S1073: If the correlation is greater than the preset correlation, the similar data and the original data are input into the classification model to obtain the accuracy, precision and recall indicators.
[0170] In this step, the classification model may be a DecisionTreeClassifier, a RandomForest, or other classification model.
[0171] The usability of the back-transformed data and the original data was evaluated by the classification model.
[0172] Step S1074: Compare the three indicators with the corresponding preset indicator thresholds respectively; if the three indicators are all greater than or equal to their respective corresponding preset indicator thresholds, then they are available; if any of the indicators is less than its corresponding preset indicator threshold, then they are not available.
[0173] In this step, only if all three indicators are met, it means that it is available.
[0174] Step S108: If available, the original data is replaced by similar data to complete data desensitization. The similar data can replace the original data set to perform related behaviors in the social network.
[0175] Based on the above embodiment, if similar data is not available, the method further includes:
[0176] Adjust the basic privacy budget and re-perform data noise addition, synthesis and inverse conversion operations.
[0177] Based on the above embodiment, before replacing the similar data with the original data, the method further includes:
[0178] Determine whether the frequency errors of the same value or the same category in the original data after the inverse conversion are within the preset error range.
[0179] In an embodiment of the present application, for example, for numerical data, four age data of 10, 20, 30, and 40 are shared. Then, the frequency of each age data in the similar data and the original data in the total data is determined. If the frequency error is small and within the preset error range, it can be directly replaced with the original data. If the error is large and exceeds the preset error range, it means that the similarity between the similar data and the original data is small, and the data needs to be re-synthesized and inversely converted, so as to select the best inversely converted data, ensure that the inversely converted data can achieve the purpose of desensitization, and can replace the original data set for related behaviors in social networks.
[0180] If it is within the preset error range, the similar data will be replaced with the original data.
[0181] If it exceeds the preset error range, the basic privacy budget will be adjusted and the data noise addition, synthesis and inverse conversion operations will be performed again.
[0182] Based on the same inventive concept, the present application embodiment provides a data desensitization device, such as Figure 2 As shown, the device comprises:
[0183] An acquisition unit 201 is used to acquire the original data to be desensitized and the data type of the original data;
[0184] A calling unit 202, used for calling a corresponding reversible conversion rule according to the data type of the original data;
[0185] A reversible conversion unit 203, used to perform reversible conversion on the original data according to the reversible conversion rule;
[0186] A noise adding unit 204, used for performing noise adding processing on the reversibly converted data to obtain noise added data;
[0187] A synthesis unit 205, used for inputting the noise-added data into the trained data synthesis model to obtain synthesized data;
[0188] An inverse conversion unit 206, configured to perform inverse conversion on the synthesized data to obtain data similar to the original data;
[0189] A judging unit 207, used to judge whether similar data is available;
[0190] The replacing unit 208 is configured to replace the original data with similar data if available.
[0191] Optionally, the data type includes a numeric type and a categorical type, and the calling unit is specifically used to determine whether the original data is time series data when it is detected that the data type of the original data is a numeric type; if it is time series data, call the optimized timestamp conversion rule; if it is non-time series data, call the Gaussian normalization conversion rule; when it is detected that the data type of the original data is a categorical type, determine whether the original data is selected sensitive data; if it is selected sensitive data, call the anonymous substitution conversion rule; if it is non-selected sensitive data, call the frequency coding conversion rule.
[0192] Among them, the Gaussian normalization transformation rule is:
[0193] Convert the different distributions of the original data into uniform distributions;
[0194] Calculate the CDF value of each data in the uniform distribution;
[0195] Converts a uniform distribution to a standard normal distribution based on the CDF value.
[0196] Among them, the frequency coding conversion rule is:
[0197] Get the classification category of the original data;
[0198] Sort the classification categories of the original data in alphabetical order;
[0199] Calculate the frequency of each classification category in the total classification category;
[0200] The cumulative frequency of each classification category was calculated based on the frequency of each classification category;
[0201] Calculate the category interval for each classification category based on the cumulative frequency;
[0202] Convert categorical raw data into numerical data based on category intervals.
[0203] In an embodiment of the present application, the noise adding unit is specifically used to obtain the query sensitivity of the reversibly converted data based on a preset data sensitivity calculation formula; calculate the dynamic privacy budget of the reversibly converted data based on the query sensitivity and the basic privacy budget; calculate the noise scale based on the dynamic privacy budget; calculate the noise distribution based on the noise scale; and add noise to the reversibly converted data based on the noise distribution to obtain noisy data.
[0204] In the embodiment of the present application, the inverse conversion unit is specifically used for:
[0205] Calculate the similarity between the synthetic data and the unnoised reversibly transformed data;
[0206] comparing the similarity with a preset similarity threshold;
[0207] If it is greater than the similarity threshold, an inverse transformation is performed according to a rule opposite to the reversible transformation rule to obtain data similar to the original data.
[0208] In the embodiment of the present application, the judgment unit is specifically used for:
[0209] Calculate the attribute correlation between similar data and original data;
[0210] comparing the attribute correlation with a preset correlation;
[0211] If it is greater than the preset correlation, the similar data and the original data are input into the classification model to obtain the accuracy, precision and recall indicators;
[0212] Compare the three indicators with the corresponding preset indicator thresholds respectively;
[0213] If all three indicators are greater than or equal to their corresponding preset indicator thresholds, then availability is achieved;
[0214] If any of the indicators is lower than the corresponding preset indicator threshold, the system is not available.
[0215] Optionally, if similar data is not available, the device further comprises:
[0216] The adjustment unit is used to adjust the basic privacy budget and re-perform data noise addition, synthesis and inverse conversion operations.
[0217] Optionally, before replacing the similar data with the original data, the apparatus further comprises:
[0218] The error judgment unit is used to judge whether the frequency error of the same value or the same category between the similar data after inverse conversion and the original data meets the preset error range; if it is within the preset error range, the similar data is replaced with the original data; if it exceeds the preset error range, the basic privacy budget is adjusted, and the data noise addition, synthesis and inverse conversion processing operations are performed again.
[0219] The computer program product for data desensitization provided in the embodiment of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the method in the previous method embodiment. The specific implementation can be found in the method embodiment, which will not be repeated here.
[0220] The data desensitization device provided in the embodiment of the present invention can be specific hardware on the device or software or firmware installed on the device. The implementation principle and technical effects of the device provided in the embodiment of the present invention are the same as those of the aforementioned method embodiment. For the sake of brief description, for the parts not mentioned in the device embodiment, reference can be made to the corresponding contents in the aforementioned method embodiment. Technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can all refer to the corresponding processes in the aforementioned method embodiment, and will not be repeated here.
[0221] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0222] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0223] In addition, each functional unit in the embodiment provided by the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0224] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0225] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.
[0226] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can still modify the technical solutions described in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or perform equivalent replacements on some of the technical features thereof; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. They should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A data desensitization method, It is characterized in that include: Obtaining the original data to be desensitized and the data type of the original data; Calling a corresponding reversible conversion rule according to the data type of the original data; Performing a reversible conversion on the original data according to the reversible conversion rule; Performing noise processing on the reversibly transformed data to obtain noise-added data; Inputting the noise-added data into the trained data synthesis model to obtain synthetic data; Performing inverse transformation on the synthesized data to obtain data similar to the original data; Determining whether the similar data is available; If available, the original data is replaced by the similar data.
2. The method according to claim 1, It is characterized in that The data type includes a numerical type and a categorical type, and the calling of the corresponding reversible conversion rule according to the data type of the original data includes: When it is detected that the data type of the original data is a numerical type, determining whether the original data is time series data; If it is time series data, the optimized timestamp conversion rule is called; If it is non-time series data, the Gaussian normalization conversion rule is called; When it is detected that the data type of the original data is classified, determining whether the original data is selected sensitive data; If sensitive data is selected, the anonymous substitution transformation rule is called; If it is non-selected sensitive data, the frequency encoding conversion rule is called.
3. The method according to claim 2, It is characterized in that The Gaussian normalization conversion rule is: Convert the different distributions of the original data into uniform distributions; Calculate the CDF value of each data in the uniform distribution; The uniform distribution is converted into a standard normal distribution based on the CDF value.
4. The method according to claim 2, It is characterized in that The frequency coding conversion rule is: Obtaining the classification category of the original data; Sorting the classification categories of the original data in alphabetical order; Calculate the frequency of each of the classification categories in the total classification category; calculating a cumulative frequency for each classification category based on the frequency of each of said classification categories; calculating a category interval for each classification category based on the cumulative frequency; The classified raw data is converted into numerical data based on the category interval.
5. The method according to claim 1, It is characterized in that The performing noise processing on the reversibly converted data to obtain the noise-added data comprises: Obtaining query sensitivity of the reversibly converted data based on a preset data sensitivity calculation formula; Calculate a dynamic privacy budget for the reversibly transformed data based on the query sensitivity and the basic privacy budget; Calculating a noise scale based on the dynamic privacy budget; calculating a noise distribution based on the noise scale; Noise is added to the reversibly transformed data based on the noise distribution to obtain noisy data.
6. The method according to claim 1, It is characterized in that The inverse conversion of the synthesized data to obtain similar data of the original data comprises: Calculating the similarity between the synthesized data and the reversibly transformed data without noise; comparing the similarity with a preset similarity threshold; If it is greater than the similarity threshold, an inverse conversion is performed according to a rule opposite to the reversible conversion rule to obtain data similar to the original data.
7. The method according to claim 1 or 6, It is characterized in that The determining whether the similar data is available includes: Calculating the attribute correlation between the similar data and the original data; Comparing the attribute correlation with a preset correlation; If it is greater than the preset correlation, the similar data and the original data are input into the classification model to obtain the accuracy, precision and recall indicators; Compare the three indicators with the corresponding preset indicator thresholds respectively; If all three indicators are greater than or equal to their corresponding preset indicator thresholds, then availability is achieved; If any of the indicators is lower than the corresponding preset indicator threshold, the system is not available.
8. The method according to claim 5, It is characterized in that If the similar data is not available, the method further includes: The basic privacy budget is adjusted, and the data noise addition, synthesis and inverse conversion processing operations are re-performed.
9. The method according to claim 5, It is characterized in that Before replacing the similar data with the original data, the method further includes: Determine whether the frequency errors of the same value or the same category in the inversely converted similar data and the original data meet the preset error range; If it is within the preset error range, the similar data is replaced with the original data; If it exceeds the preset error range, the basic privacy budget is adjusted and the data noise addition, synthesis and inverse conversion processing operations are performed again.
10. A data desensitization device, It is characterized in that The device comprises: An acquisition unit, used to acquire the original data to be desensitized and the data type of the original data; A calling unit, used for calling a corresponding reversible conversion rule according to the data type of the original data; A reversible conversion unit, used for performing reversible conversion on the original data according to the reversible conversion rule; A noise adding unit, used for performing noise adding processing on the data after the reversible conversion to obtain noise added data; A synthesis unit, used for inputting the noise-added data into a trained data synthesis model to obtain synthesized data; An inverse conversion unit, used for performing inverse conversion on the synthesized data to obtain data similar to the original data; A judging unit, used for judging whether the similar data is available; A replacement unit is used for replacing the original data with the similar data if available.
Citation Information
Cited By
Dynamic desensitization processing method and processing device for biological medicine numerical variable data
CN120257341A
