Method and apparatus for training privacy information classification model, identifying privacy information

By using self-supervised learning, the encoder is pre-trained with unlabeled samples and the model is adjusted with a small number of labeled samples. This solves the problem of identifying private data in databases in big data scenarios and achieves efficient identification of private data in databases.

CN114398681BActive Publication Date: 2026-06-09ALIPAY (HANGZHOU) INFORMATION TECH CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
Filing Date
2022-01-20
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

In big data scenarios, existing technologies struggle to effectively identify private data in databases, especially when there are only a few labeled samples, where traditional supervised learning methods are ineffective.

Method used

By employing a self-supervised learning approach, a pre-trained encoder and classifier are used, along with a large number of unlabeled samples and a small number of target privacy category labeled samples, to adjust the encoder and classifier, forming a trained classification model that can identify privacy data in the database.

Benefits of technology

With a small number of labeled samples, it effectively identifies private data in the database, improves the training effect and recognition efficiency of the model, and reduces the demand for labeled data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114398681B_ABST
    Figure CN114398681B_ABST
Patent Text Reader

Abstract

The embodiment of the specification provides a method and device for training a privacy information classification model and identifying privacy information. The method for training the privacy information classification model comprises the following steps: obtaining a pre-trained encoder, wherein the encoder is trained based on a no-label sample in a database and a preset training target, and the preset training target comprises making the representation similarity of data in the same field in the no-label sample greater than the representation similarity of data between different fields; obtaining a training sample set with a target privacy category label; inputting the training sample set into the encoder and a connected classifier, adjusting the encoder and the classifier according to the prediction output of the classifier, and obtaining a trained classification model. The privacy data in the database can be effectively identified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to one or more embodiments in the field of computers, and more particularly to methods and apparatus for training privacy information classification models and identifying privacy information. Background Technology

[0002] Personal information refers to various information recorded electronically or otherwise that can identify a specific natural person or reflect the activities of a specific natural person, either alone or in combination with other information.

[0003] Personal sensitive information, also known as privacy information or private data, refers to personal information that, if leaked, illegally provided, or misused, may endanger personal safety and property, and is highly likely to cause damage to personal reputation, mental and physical health, or discriminatory treatment.

[0004] With the development of information technology and the widespread use of mobile smart devices, people are constantly generating data. Large companies and institutions collect and accumulate massive amounts of user data, much of which is considered private data. Before implementing privacy protection measures, it's crucial to identify which data is private, or in other words, to determine the corresponding category of private information. Identifying which fields of data are private within the vast amounts of user data stored in databases has become a challenging problem. Summary of the Invention

[0005] This specification describes one or more embodiments of a method and apparatus for training a privacy information classification model and identifying privacy information, which can effectively identify privacy data in a database.

[0006] Firstly, a method for training a privacy information classification model is provided, the method including:

[0007] Obtain a pre-trained encoder, which is trained based on unlabeled samples in the database and a preset training objective. The preset training objective includes making the representation similarity of data within the same field in the unlabeled samples greater than the representation similarity of data between different fields.

[0008] Obtain a set of training samples labeled with the target privacy category;

[0009] The training sample set is input into the encoder and the classifier connected thereafter. Based on the prediction output of the classifier, the encoder and the classifier are adjusted to obtain the trained classification model.

[0010] In one possible implementation, the encoder is pre-trained through the following steps:

[0011] Obtain some raw data from the first field of the database as the first set of derived samples;

[0012] Obtain several original data from the second field of the database as a second set of derived samples;

[0013] Each original data from the first group of derived samples and the second group of derived samples is input into the encoder, and the encoder outputs the representation vector corresponding to each original data.

[0014] Based on each representation vector, the similarity between each original data point is determined;

[0015] The encoder parameters are adjusted in the direction of reducing the total coding loss; wherein, the higher the similarity between two original data belonging to the same group of derived samples, the lower the similarity between two original data belonging to different groups of derived samples, the smaller the total coding loss.

[0016] Furthermore, the step of obtaining several raw data points from the first field of the database as the first set of derived samples includes:

[0017] From the original data of the first field of the database, a number of original data are obtained by random sampling as the first group of derived samples;

[0018] The step of obtaining several raw data from the second field of the database as a second set of derived samples includes:

[0019] From the original data of the second field of the database, a number of original data are obtained by random sampling as a second group of derived samples.

[0020] In one possible implementation, the training sample set includes positive and negative samples of the target privacy category, and the classification model is used to identify whether an input sample belongs to the privacy data of the target privacy category.

[0021] In one possible implementation, obtaining the training sample set with the target privacy category label includes:

[0022] Obtain positive samples of the target privacy information category specified by the user;

[0023] Based on the positive samples, corresponding negative samples are generated using data augmentation techniques.

[0024] Furthermore, the step of generating corresponding negative samples based on the positive samples using data augmentation includes:

[0025] Replace at least one character from the plurality of characters included in the positive sample with other characters to obtain the corresponding negative sample; or,

[0026] The order of the characters in the positive sample is changed to obtain the corresponding negative sample; or,

[0027] The corresponding negative sample is obtained by back-translating the first translation of the positive sample.

[0028] Secondly, a method for identifying privacy information is provided, the method including:

[0029] Obtain the classification model trained according to the method in the first aspect;

[0030] From the original data of each target field in the target database, obtain several original data points as input samples;

[0031] The classification model is used to obtain the identification results of whether each input sample belongs to the target privacy category of privacy data;

[0032] When the proportion of identification results belonging to the target privacy category exceeds a preset threshold, it is determined that the target field of the target database contains privacy data of the target privacy information category.

[0033] In one possible implementation, obtaining several original data points from the original data of each target field in the target database as input samples includes:

[0034] From the original data of each target field in the target database, a number of original data are obtained by random sampling and used as input samples.

[0035] Thirdly, an apparatus for training a privacy information classification model is provided, the apparatus comprising:

[0036] The first acquisition unit is used to acquire a pre-trained encoder, which is trained based on unlabeled samples in the database and a preset training objective. The preset training objective includes making the representation similarity of data within the same field in the unlabeled samples greater than the representation similarity of data between different fields.

[0037] The second acquisition unit is used to acquire a set of training samples with target privacy category labels;

[0038] The training unit is used to input the training sample set obtained by the second acquisition unit into the encoder and the classifier connected thereafter obtained by the first acquisition unit, and adjust the encoder and the classifier according to the prediction output of the classifier to obtain the trained classification model.

[0039] Fourthly, a device for identifying privacy information is provided, the device comprising:

[0040] The first acquisition unit is used to acquire the classification model trained according to the device of the third aspect;

[0041] The second acquisition unit is used to acquire several original data from the original data of each target field in the target database as input samples.

[0042] The identification unit is used to obtain the identification result of whether each input sample obtained by the second acquisition unit belongs to the target privacy category of privacy data through the classification model obtained by the first acquisition unit;

[0043] The determining unit is used to determine that the target field of the target database contains privacy data of the target privacy information category when the proportion of the identification results belonging to the target privacy category in the identification results obtained by the identification unit exceeds a preset threshold.

[0044] Fifthly, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method of the first or second aspect.

[0045] In a sixth aspect, a computing device is provided, including a memory and a processor, wherein executable code is stored in the memory, and when the processor executes the executable code, it implements the method of the first aspect or the second aspect.

[0046] The method and apparatus for training a privacy information classification model provided in the embodiments of this specification first obtain a pre-trained encoder, which is trained based on unlabeled samples in a database and a preset training objective. The preset training objective includes ensuring that the representational similarity of data within the same field in the unlabeled samples is greater than the representational similarity of data between different fields. Then, a set of training samples with target privacy category labels is obtained. Finally, the set of training samples is input into the encoder and a classifier connected thereafter. Based on the prediction output of the classifier, the encoder and the classifier are adjusted to obtain the trained classification model. As can be seen from the above, the embodiments of this specification employ a self-supervised learning approach, utilizing a large number of unlabeled samples to obtain a pre-trained encoder, significantly reducing the need for subsequent labeled data. Based on this pre-trained encoder and a small set of training samples with target privacy category labels, a trained classification model is obtained. Even with only a small number of labeled privacy information samples, the classification model can still achieve good training results, thereby effectively identifying privacy data in the database.

[0047] The method and apparatus for identifying privacy information provided in the embodiments of this specification first obtain a classification model trained according to the method of the first aspect; then, several original data are obtained from the original data of each target field in the target database as input samples; next, the classification model is used to obtain the identification result of whether each input sample belongs to the target privacy category of privacy data; finally, when the proportion of identification results belonging to the target privacy category in each identification result exceeds a preset threshold, it is determined that the target field of the target database contains privacy data of the target privacy information category. As can be seen from the above, the embodiments of this specification, by utilizing a trained classification model, identifying several original data of the target field in the target database, and statistically analyzing the identification results, enable rapid determination of whether a certain field in a table in the database belongs to a specified privacy information category in massive data scenarios, thereby effectively identifying privacy data in the database. Attached Figure Description

[0048] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0049] Figure 1 This is a schematic diagram illustrating an implementation scenario of one embodiment disclosed in this specification;

[0050] Figure 2 A flowchart illustrating a method for training a privacy information classification model according to one embodiment is shown.

[0051] Figure 3 A schematic diagram illustrating the pre-training process of an encoder according to one embodiment is shown;

[0052] Figure 4 A schematic diagram illustrating the training process of a classification model according to one embodiment is shown.

[0053] Figure 5 A schematic diagram of the structure of an encoder according to one embodiment is shown;

[0054] Figure 6 A schematic diagram of two-stage training of an encoder according to one embodiment is shown;

[0055] Figure 7 A flowchart illustrating a method for identifying privacy information according to one embodiment is shown;

[0056] Figure 8 A schematic diagram illustrating the testing process of a classification model according to one embodiment is shown;

[0057] Figure 9A schematic block diagram of an apparatus for training a privacy information classification model according to one embodiment is shown;

[0058] Figure 10 A schematic block diagram of an apparatus for identifying privacy information according to one embodiment is shown. Detailed Implementation

[0059] The solution provided in this specification will now be described with reference to the accompanying drawings.

[0060] Figure 1 This is a schematic diagram illustrating an implementation scenario of one embodiment disclosed in this specification. This implementation scenario involves identifying privacy information, particularly identifying privacy information categories in various fields of data within a database. The database includes multiple data tables, each containing multiple fields, where each field corresponds to a column. (Refer to...) Figure 1 The database contains n data tables, denoted as table1, table2, ..., tablen, where table1 contains i columns, table2 contains j columns, ..., tablen contains k columns.

[0061] Typically, when identifying privacy information in a database, privacy information is identified for each column of data in the table separately to determine whether the data in that column belongs to privacy data or to which category of privacy information it belongs. Since there are usually dozens of privacy information categories corresponding to privacy data, and some privacy information identification may be based on deep learning models requiring a large number of labeled training samples, in big data scenarios, privacy data is only a small part of the database, with most data being non-private data. It is difficult to obtain a large number of evenly distributed labeled training samples, and using the usual supervised learning training methods will result in poor model training performance, causing the model to be unable to effectively identify privacy data in the database.

[0062] The embodiments in this specification improve upon the conventional supervised learning training method by introducing a self-supervised learning training method. Even with only a small number of labeled privacy information samples, the classification model can still achieve good training results, thereby effectively identifying privacy data in the database.

[0063] Supervised learning is a method of machine learning that refers to the process of adjusting the parameters of a classification model using a set of samples of known classes to achieve the required performance. It is also known as supervised training or teacher-led learning.

[0064] Unsupervised learning is a method of machine learning that refers to automatically classifying or grouping input data without providing pre-labeled training examples. It is also known as unsupervised training or unteacher-free learning.

[0065] Self-supervised learning, employing a self-supervised approach, can be viewed as a special form of unsupervised learning with a supervised form, where supervision is induced by the self-supervised task rather than pre-existing prior knowledge. Compared to completely unsupervised settings, self-supervised learning uses information from the dataset itself to construct pseudo-labels.

[0066] Figure 2 This diagram illustrates a method flowchart for training a privacy information classification model according to one embodiment, which can be based on... Figure 1 The implementation scenario is shown. For example... Figure 2 As shown, the method for training a privacy information classification model in this embodiment includes the following steps: Step 21, obtaining a pre-trained encoder, which is trained based on unlabeled samples in a database and a preset training objective. The preset training objective includes ensuring that the representational similarity of data within the same field in the unlabeled samples is greater than the representational similarity of data between different fields; Step 22, obtaining a training sample set with target privacy category labels; Step 23, inputting the training sample set into the encoder and the classifier connected thereafter, and adjusting the encoder and the classifier according to the prediction output of the classifier to obtain the trained classification model. The specific execution method of each of the above steps is described below.

[0067] First, in step 21, a pre-trained encoder is obtained. This encoder is trained based on unlabeled samples from the database and a preset training objective. The preset training objective aims to ensure that the representational similarity of data within the same field in the unlabeled samples is greater than the representational similarity of data between different fields. It is understood that the pre-training described above belongs to self-supervised learning. The unlabeled samples can be the original data of a certain field in the database, which does not have a corresponding privacy category label. The preset training objective is a self-supervised task.

[0068] In the embodiments of this specification, the character structure of each field of data in the database is not limited. It can be a string composed of numbers and / or letters, such as an ID card number, or a text string, such as an individual's shipping address.

[0069] In one example, the encoder is pre-trained through the following steps:

[0070] Obtain some raw data from the first field of the database as the first set of derived samples;

[0071] Obtain several original data from the second field of the database as a second set of derived samples;

[0072] Each original data from the first group of derived samples and the second group of derived samples is input into the encoder, and the encoder outputs the representation vector corresponding to each original data.

[0073] Based on each representation vector, the similarity between each original data point is determined;

[0074] The encoder parameters are adjusted in the direction of reducing the total coding loss; wherein, the higher the similarity between two original data belonging to the same group of derived samples, the lower the similarity between two original data belonging to different groups of derived samples, the smaller the total coding loss.

[0075] Furthermore, the step of obtaining several raw data points from the first field of the database as the first set of derived samples includes:

[0076] From the original data of the first field of the database, a number of original data are obtained by random sampling as the first group of derived samples;

[0077] The step of obtaining several raw data from the second field of the database as a second set of derived samples includes:

[0078] From the original data of the second field of the database, a number of original data are obtained by random sampling as a second group of derived samples.

[0079] Figure 3 A schematic diagram illustrating the pre-training process of an encoder according to one embodiment is shown. (Refer to...) Figure 3Since data columns in a database naturally store data of the same type, sampling directly within the same data column yields several original data points belonging to the same group of derived samples. For example, samples 1 and 2 both originate from data column 1, thus belonging to one group of derived samples; samples 3 and 4 both originate from data column 2, thus belonging to another group of derived samples. Each sample, after passing through an encoder, generates a corresponding initial representation vector. This initial representation vector is a high-dimensional vector; for example, the initial representation vector for sample 1 is h1, for sample 2 it is h2, for sample 3 it is h3, and for sample 4 it is h4. The output layer then transforms these initial representation vectors to obtain transformed representation vectors for each sample; for example, the transformed representation vector for sample 1 is z1, for sample 2 it is z2, for sample 3 it is z3, and for sample 4 it is z4. From these transformed representation vectors, the similarity between any two samples can be calculated, leading to the calculation of the encoding loss between any two samples, and finally, the total encoding loss for the entire sample set. By sampling from the same data column to obtain various sets of derived samples, the encoder can grasp some key features of privacy data. For example, for a column of ID card numbers, the key feature is its fixed 18-digit length, including the first 6 digits as the address code, the middle 8 digits as the birth date code, and the last digit as the check digit. This method of directly extracting raw data as samples does not destroy these key features, which is beneficial for the model to characterize this type of privacy information and improves the model's performance.

[0080] In the embodiments of this specification, the similarity between any two samples can be calculated using the following formula:

[0081] S i,j =z i T z j / (|z i ||z j |);

[0082] Among them, z i and z j S represents the transformation representation vectors of sample i and sample j, respectively. i,j This represents the vector similarity between sample i and sample j, with the superscript T indicating the transpose operation, and |·| representing the L2 norm of the vector.

[0083] The encoding loss for any two samples can be calculated using the following formula:

[0084]

[0085] Where i and j represent any two samples, and τ is an adjustable parameter that controls the loss range within [-1, 1]; [k≠i] `k` is the sign function, meaning the function value is 1 when `k` is not equal to `i`, and 0 otherwise; `exp` represents the exponential function; `N` is the number of derived sample groups. Taking a group of derived samples containing 2 samples as an example, `2N` is the total number of samples. During training, the parameters in the model are continuously adjusted to reduce the encoding loss. A smaller encoding loss means higher similarity between two samples in the same group and lower similarity between two samples in different groups.

[0086] The total encoding loss for the entire sample set can be calculated using the following formula:

[0087]

[0088] It is understandable that the formulas for the aforementioned encoding loss and total encoding loss all assume that each group of derived samples includes two samples. However, in actual applications, this is not the case. Each group of derived samples can include more samples, and the number of derived samples in each group can be the same or different. The formulas can be slightly modified to suit the actual situation.

[0089] The encoder obtained through the above pre-training process can make the vectors of samples of the same class closer in the feature space and the vectors of samples of different classes farther apart in the feature space when encoding samples.

[0090] Then, in step 22, a set of training samples with target privacy category labels is obtained. It is understood that these target privacy category labels indicate whether a sample belongs to the target privacy category.

[0091] The common privacy categories of privacy data are shown in Table 1.

[0092] Table 1: Common Privacy Categories

[0093]

[0094]

[0095] As shown in Table 1, privacy categories are diverse. The target privacy category label can be marked as a relatively broad privacy category, such as personal identification information, or it can be marked as a more specific privacy category, such as ID card.

[0096] In one example, the training sample set includes positive and negative samples of the target privacy category, and the classification model is used to identify whether an input sample belongs to the privacy data of the target privacy category.

[0097] In one example, obtaining the training sample set with the target privacy category label includes:

[0098] Obtain positive samples of the target privacy information category specified by the user;

[0099] Based on the positive samples, corresponding negative samples are generated using data augmentation techniques.

[0100] Furthermore, the step of generating corresponding negative samples based on the positive samples using data augmentation includes:

[0101] Replace at least one character from the plurality of characters included in the positive sample with other characters to obtain the corresponding negative sample; or,

[0102] The order of the characters in the positive sample is changed to obtain the corresponding negative sample; or,

[0103] The corresponding negative sample is obtained by back-translating the first translation of the positive sample.

[0104] Finally, in step 23, the training sample set is input into the encoder and the classifier connected to it. Based on the prediction output of the classifier, the encoder and the classifier are adjusted to obtain the trained classification model. It is understood that the classification model includes an encoder and a classifier. In this step, when training the classification model, the encoder parameters are not randomly initialized, but rather use parameters obtained through pre-training.

[0105] Figure 4 This diagram illustrates the training process of a classification model according to one embodiment. (Refer to...) Figure 4 The classification model consists of a pre-trained encoder and a classifier. The classifier can be understood as the output layer of the classification model. This output layer is different from the output layer used when the encoder is pre-trained. The encoder parameters are fine-tuned using user-specified positive samples and corresponding negative samples generated through data augmentation, while the classifier parameters are directly trained using the aforementioned positive and negative samples.

[0106] Figure 5 A schematic diagram of an encoder according to one embodiment is shown. (Refer to...) Figure 5 A typical encoder consists of an encoding layer and hidden layers. The input is a string of characters, which can be letters, numbers, or other symbols. The output is a high-dimensional vector feature corresponding to the input, i.e., the initial representation vector mentioned earlier. During the pre-training phase, this high-dimensional vector feature is passed through the output layer to calculate the total encoding loss; during the fine-tuning phase, this high-dimensional vector feature is passed through a classifier to calculate the prediction loss for sample classification. The hidden layer can, but is not limited to, structures such as Transformer.

[0107] Figure 6 A schematic diagram of two-stage training of an encoder according to one embodiment is shown. (Refer to...) Figure 6 The encoder undergoes two stages: pre-training and fine-tuning, resulting in a trained classification model. Data is typically stored in a database, with common databases including ODPS, MaxCompute, MySQL, and Oracle. If the data volume is particularly large, sampling can be performed, usually random sampling. First, a large number of unlabeled samples are extracted from the database. A self-supervised task is constructed through contrastive learning, training a pre-trained encoder. Then, a small number of privacy-related samples are specified by the user, and the pre-trained encoder is fine-tuned to obtain a classification model for that privacy-related information, used to automatically identify privacy-related information in the database. For example, after obtaining the pre-trained encoder, the user specifies a small number of phone number samples as positive samples. Negative samples are then generated using random methods. These positive and negative samples are used to adjust the parameters in the pre-trained encoder, resulting in a phone number classification model that can be used to automatically identify phone number information in the database. It should be noted that the pre-trained encoder can be reused repeatedly after being saved. With fine-tuning of relevant positive and negative samples, it can generate classification models for various types of privacy information. For example, by using a small amount of positive sample data of type A and the generated negative sample data of type A, the encoder can be fine-tuned to obtain classification model A, which is used to identify type A privacy information; by using a small amount of positive sample data of type B and the generated negative sample data of type B, the encoder can be fine-tuned to obtain classification model B, which is used to identify type B privacy information.

[0108] Contrastive learning is a typical form of discriminative self-supervised learning. Its guiding principle is to automatically construct similar and dissimilar instances, aiming to learn a representation learning model that ensures similar instances are close together in the projection space, while dissimilar instances are far apart. It's understandable that two samples from the same group are considered similar examples, while two samples from different groups are considered dissimilar examples.

[0109] The method provided in this specification first obtains a pre-trained encoder, which is trained based on unlabeled samples in a database and a preset training objective. The preset training objective includes ensuring that the representational similarity of data within the same field in the unlabeled samples is greater than the representational similarity of data between different fields. Then, a training sample set with target privacy category labels is obtained. Finally, the training sample set is input into the encoder and a subsequently connected classifier. Based on the classifier's prediction output, the encoder and the classifier are adjusted to obtain a trained classification model. As can be seen, this specification embodiment uses self-supervised learning to obtain a pre-trained encoder using a large number of unlabeled samples, significantly reducing the need for subsequent labeled data. Based on this pre-trained encoder and a small set of training samples with target privacy category labels, a trained classification model is obtained. Even with only a small number of labeled privacy information samples, the classification model can still achieve good training results, thus effectively identifying privacy data in the database.

[0110] Figure 7 This diagram illustrates a method flowchart for identifying privacy information according to one embodiment, which can be based on... Figure 1 The implementation scenario is shown. For example... Figure 7 As shown, the method for identifying privacy information in this embodiment includes the following steps: Step 71, obtaining information based on... Figure 2 The method trains a classification model; step 72, obtains several original data from the original data of the target field in the target database as input samples; step 73, obtains the identification result of whether each input sample belongs to the target privacy category of privacy data through the classification model; step 74, when the proportion of identification results belonging to the target privacy category in each identification result exceeds a preset threshold, it is determined that the target field of the target database contains privacy data of the target privacy information category. The specific execution method of each of the above steps is described below.

[0111] First, in step 71, obtain according to... Figure 2 The classification model is trained using this method. Understandably, this model can identify whether an input sample belongs to the target privacy category of privacy data. If data stored in a database is used as input samples, it can effectively identify privacy data within the database.

[0112] Then, in step 72, several original data points are obtained from the original data of each target field in the target database as input samples. It is understandable that, typically, the database stores a large amount of data, so it is not necessary to identify each original data point in the target field individually; instead, only a portion of the original data needs to be identified.

[0113] In one example, obtaining several original data points from the original data of each target field in the target database as input samples includes:

[0114] From the original data of each target field in the target database, a number of original data are obtained by random sampling and used as input samples.

[0115] Next, in step 73, the classification model is used to obtain the identification result of whether each input sample belongs to the target privacy category of privacy data. It is understood that the identification results of input samples belonging to the same field may not be consistent. It is possible that some input samples are identified as privacy data belonging to the target privacy category, while others are identified as privacy data not belonging to the target privacy category.

[0116] Finally, in step 74, when the proportion of identification results belonging to the target privacy category exceeds a preset threshold, it is determined that the target field in the target database contains privacy data of the target privacy information category. It is understandable that data in the same field typically belongs to the same type; therefore, the privacy data identification results of the target field in the target database can be obtained through statistical analysis of the identification results of several datasets.

[0117] Figure 8 A schematic diagram illustrating the testing process of a classification model according to one embodiment is shown. (Refer to...) Figure 8 This classification model consists of an encoder and a classifier, trained through two phases: pre-training and fine-tuning. Using this trained model, data columns in a database can be sampled and detected to automatically identify whether private data belonging to the target privacy category exists. For example, K data entries are sampled from a column in the database, resulting in sample 1, sample 2, ..., sample K. These samples are then input into the classification model, yielding the detection results for the K samples, which are sequentially named Result 1, Result 2, ..., Result K. The proportion of each detection result classified as belonging to the target privacy category is determined, and a threshold is used to obtain the detection result for the data column. In other words, if the proportion exceeds a preset threshold, the corresponding data column contains private data of the target privacy category; if the proportion does not exceed the preset threshold, the corresponding data column does not contain private data of the target privacy category. The preset threshold can be set by the user. For example, if the target privacy category is ID card numbers and the preset threshold is 50%, then if more than 50% of the data entries in the sample are classified as ID card numbers, this column is considered to contain private information containing ID card numbers.

[0118] The method provided in the embodiments of this specification first obtains according to... Figure 2The method trains a classification model; then, it obtains several original data points from the target field of the target database as input samples; next, it uses the classification model to obtain the identification result of whether each input sample belongs to the target privacy category; finally, when the proportion of identification results belonging to the target privacy category in each identification result exceeds a preset threshold, it is determined that the target field of the target database contains privacy data of the target privacy information category. As can be seen from the above, this embodiment of the specification utilizes a trained classification model to identify several original data points of the target field in the target database, and performs statistical analysis on the identification results. This enables the rapid determination of whether a field in a table in a database belongs to a specified privacy information category in massive data scenarios, thereby effectively identifying privacy data in the database.

[0119] According to another embodiment, an apparatus for training a privacy information classification model is also provided, the apparatus being used to perform the method for training a privacy information classification model provided in the embodiments of this specification. Figure 9 A schematic block diagram of an apparatus for training a privacy information classification model according to one embodiment is shown. Figure 9 As shown, the device 900 includes:

[0120] The first acquisition unit 91 is used to acquire a pre-trained encoder, which is trained based on unlabeled samples in the database and a preset training objective. The preset training objective includes making the representation similarity of data within the same field in the unlabeled samples greater than the representation similarity of data between different fields.

[0121] The second acquisition unit 92 is used to acquire a set of training samples with target privacy category labels;

[0122] The training unit 93 is used to input the training sample set acquired by the second acquisition unit 92 into the encoder and the classifier connected thereafter acquired by the first acquisition unit 91, and adjust the encoder and the classifier according to the prediction output of the classifier to obtain the trained classification model.

[0123] Optionally, as an embodiment, the first acquisition unit 91 is specifically used to acquire the encoder obtained by the pre-training unit through pre-training;

[0124] The pre-training unit includes:

[0125] The first acquisition subunit is used to acquire several raw data from the first field of the database as the first set of derived samples;

[0126] The second acquisition subunit is used to acquire several original data from the second field of the database as a second set of derived samples;

[0127] The encoding subunit is used to input the original data from the first set of derived samples obtained by the first acquisition subunit and the second set of derived samples obtained by the second acquisition subunit into the encoder, and output the representation vector corresponding to each original data through the encoder.

[0128] A sub-unit is defined to determine the similarity between the original data based on the representation vectors obtained from the encoding sub-unit.

[0129] A pre-training subunit is used to adjust the parameters of the encoder in the direction of reducing the total encoding loss; wherein, the higher the similarity between two original data belonging to the same group of derived samples, the lower the similarity between two original data belonging to different groups of derived samples, the smaller the total encoding loss.

[0130] Furthermore, the first acquisition subunit is specifically used to acquire several original data from each original data of the first field of the database as a first group of derived samples by random sampling.

[0131] The second acquisition subunit is specifically used to acquire a number of original data from each original data of the second field of the database as a second set of derived samples by random sampling.

[0132] Optionally, as an embodiment, the training sample set includes positive and negative samples of the target privacy category, and the classification model is used to identify whether the input sample belongs to the privacy data of the target privacy category.

[0133] Optionally, as an embodiment, the second acquisition unit 92 includes:

[0134] The acquisition sub-unit is used to acquire positive samples of the target privacy information category specified by the user;

[0135] A generation subunit is used to generate corresponding negative samples based on the positive samples obtained by the acquisition subunit using data augmentation.

[0136] Furthermore, the generating subunit is specifically used to replace at least one character among the multiple characters included in the positive sample with other characters to obtain the corresponding negative sample; or, to change the order of the multiple characters included in the positive sample to obtain the corresponding negative sample; or, to obtain the corresponding negative sample by back-translating the first translation corresponding to the positive sample.

[0137] The apparatus provided in this embodiment first acquires a pre-trained encoder based on unlabeled samples in a database and a preset training objective. The preset training objective includes ensuring that the representational similarity of data within the same field in the unlabeled samples is greater than the representational similarity of data between different fields. Then, a second acquisition unit 92 acquires a set of training samples with target privacy category labels. Finally, a training unit 93 inputs the training sample set into the encoder and a subsequently connected classifier, adjusting the encoder and classifier based on the classifier's prediction output to obtain a trained classification model. As can be seen, this embodiment employs self-supervised learning, utilizing a large number of unlabeled samples to obtain a pre-trained encoder, significantly reducing the need for subsequent labeled data. Based on this pre-trained encoder and a small set of training samples with target privacy category labels, a trained classification model is obtained. Even with only a small number of labeled privacy information samples, the classification model can still achieve excellent training results, thus effectively identifying privacy data in the database.

[0138] According to another embodiment, an apparatus for identifying privacy information is also provided, which is used to perform the method for identifying privacy information provided in the embodiments of this specification. Figure 10 A schematic block diagram of an apparatus for identifying privacy information according to one embodiment is shown. Figure 10 As shown, the device 1000 includes:

[0139] The first acquisition unit 1001 is used to acquire data based on... Figure 9 The classification model trained by the device;

[0140] The second acquisition unit 1002 is used to acquire several original data from the original data of each target field in the target database as input samples.

[0141] The identification unit 1003 is used to obtain the identification result of whether each input sample obtained by the second acquisition unit 1002 belongs to the target privacy category of privacy data through the classification model obtained by the first acquisition unit 1001;

[0142] The determining unit 1004 is used to determine that the target field of the target database contains privacy data of the target privacy information category when the proportion of the identification results belonging to the target privacy category in the identification results obtained by the identification unit 1003 exceeds a preset threshold.

[0143] Optionally, as an embodiment, the second acquisition unit 1002 is specifically used to acquire several original data from each original data of the target field in the target database using a random sampling method as input samples.

[0144] Using the apparatus provided in the embodiments of this specification, the first acquisition unit 1001 first acquires data based on... Figure 9 The device trains a classification model; then, the second acquisition unit 1002 acquires several raw data from the raw data of the target field in the target database as input samples; next, the identification unit 1003 uses the classification model to obtain the identification result of whether each input sample belongs to the target privacy category of privacy data; finally, the determination unit 1004 determines that the target field of the target database contains privacy data of the target privacy information category when the proportion of identification results belonging to the target privacy category in each identification result exceeds a preset threshold. As can be seen from the above, the embodiments of this specification utilize a trained classification model to identify several raw data of the target field in the target database and perform statistical analysis on the identification results, so that in the case of massive data, it is possible to quickly determine whether a certain field of a table in the database belongs to the specified privacy information category, thereby effectively identifying privacy data in the database.

[0145] According to another embodiment, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed in a computer, causes the computer to perform a combination Figure 2 or Figure 7 The method described.

[0146] According to another embodiment, a computing device is also provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements a combination... Figure 2 or Figure 7 The method described.

[0147] Those skilled in the art will recognize that, in one or more of the examples above, the functions described in this invention can be implemented using hardware, software, firmware, or any combination thereof. When implemented in software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium.

[0148] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for training a privacy information classification model, the method comprising: Obtain a pre-trained encoder, which is trained based on unlabeled samples in the database and a preset training objective. The preset training objective includes making the representation similarity of data within the same field in the unlabeled samples greater than the representation similarity of data between different fields. Obtain a set of training samples labeled with the target privacy category; The training sample set is input into the encoder and the classifier connected thereafter. Based on the prediction output of the classifier, the encoder and the classifier are adjusted to obtain the trained classification model. The encoder is obtained through the following pre-training steps: Obtain some raw data from the first field of the database as the first set of derived samples; Obtain several original data from the second field of the database as a second set of derived samples; Each original data from the first group of derived samples and the second group of derived samples is input into the encoder, and the encoder outputs the representation vector corresponding to each original data. Based on each representation vector, the similarity between each original data point is determined; The encoder parameters are adjusted in the direction of reducing the total coding loss; wherein, the higher the similarity between two original data belonging to the same group of derived samples, the lower the similarity between two original data belonging to different groups of derived samples, the smaller the total coding loss.

2. The method as described in claim 1, wherein, The step of obtaining several raw data points from the first field of the database as the first set of derived samples includes: From the original data of the first field of the database, a number of original data are obtained by random sampling as the first group of derived samples; The step of obtaining several raw data from the second field of the database as a second set of derived samples includes: From the original data of the second field of the database, a number of original data are obtained by random sampling as a second group of derived samples.

3. The method as described in claim 1, wherein, The training sample set includes positive and negative samples of the target privacy category, and the classification model is used to identify whether the input sample belongs to the privacy data of the target privacy category.

4. The method of claim 1, wherein, The process of obtaining a training sample set with target privacy category labels includes: Obtain positive samples of the target privacy information category specified by the user; Based on the positive samples, corresponding negative samples are generated using data augmentation techniques.

5. The method of claim 4, wherein, The step of generating corresponding negative samples based on the positive samples using data augmentation includes: Replace at least one character from the plurality of characters included in the positive sample with other characters to obtain the corresponding negative sample; or, The order of the characters in the positive sample is changed to obtain the corresponding negative sample; or, The corresponding negative sample is obtained by back-translating the first translation of the positive sample.

6. A method for identifying privacy information, the method comprising: Obtain the classification model trained according to the method of claim 1; From the original data of each target field in the target database, obtain several original data points as input samples; The classification model is used to obtain the identification results of whether each input sample belongs to the target privacy category of privacy data; When the proportion of identification results belonging to the target privacy category exceeds a preset threshold, it is determined that the target field of the target database contains privacy data of the target privacy information category.

7. The method of claim 6, wherein, The step of obtaining several original data points from the original data of each target field in the target database as input samples includes: From the original data of each target field in the target database, a number of original data are obtained by random sampling and used as input samples.

8. An apparatus for training a privacy information classification model, the apparatus comprising: The first acquisition unit is used to acquire a pre-trained encoder, which is trained based on unlabeled samples in the database and a preset training objective. The preset training objective includes making the representation similarity of data within the same field in the unlabeled samples greater than the representation similarity of data between different fields. The second acquisition unit is used to acquire a set of training samples with target privacy category labels; The training unit is used to input the training sample set obtained by the second acquisition unit into the encoder and the classifier connected thereafter obtained by the first acquisition unit, and adjust the encoder and the classifier according to the prediction output of the classifier to obtain the trained classification model. Specifically, the first acquisition unit is used to acquire the encoder obtained by the pre-training unit through pre-training. The pre-training unit includes: The first acquisition subunit is used to acquire several raw data from the first field of the database as the first set of derived samples; The second acquisition subunit is used to acquire several raw data from the second field of the database as a second set of derived samples; The encoding subunit is used to input the original data from the first set of derived samples obtained by the first acquisition subunit and the second set of derived samples obtained by the second acquisition subunit into the encoder, and output the representation vector corresponding to each original data through the encoder. A sub-unit is defined to determine the similarity between the original data based on the representation vectors obtained from the encoding sub-unit. A pre-training subunit is used to adjust the parameters of the encoder in the direction of reducing the total encoding loss; wherein, the higher the similarity between two original data belonging to the same group of derived samples, the lower the similarity between two original data belonging to different groups of derived samples, the smaller the total encoding loss.

9. The apparatus of claim 8, wherein, The first acquisition subunit is specifically used to acquire several original data from each original data of the first field of the database as a first group of derived samples by random sampling. The second acquisition subunit is specifically used to acquire a number of original data from each original data of the second field of the database as a second set of derived samples by random sampling.

10. The apparatus of claim 8, wherein, The training sample set includes positive and negative samples of the target privacy category, and the classification model is used to identify whether the input sample belongs to the privacy data of the target privacy category.

11. The apparatus of claim 8, wherein, The second acquisition unit includes: The acquisition sub-unit is used to acquire positive samples of the target privacy information category specified by the user; A generation subunit is used to generate corresponding negative samples based on the positive samples obtained by the acquisition subunit using data augmentation.

12. The apparatus of claim 11, wherein, The generating subunit is specifically used to replace at least one character among the multiple characters included in the positive sample with other characters to obtain the corresponding negative sample; or, to change the order of the multiple characters included in the positive sample to obtain the corresponding negative sample; or, to obtain the corresponding negative sample by back-translating the first translation corresponding to the positive sample.

13. An apparatus for identifying privacy information, the apparatus comprising: The first acquisition unit is used to acquire the classification model trained by the device according to claim 8; The second acquisition unit is used to acquire several original data from the original data of each target field in the target database as input samples. The identification unit is used to obtain the identification result of whether each input sample obtained by the second acquisition unit belongs to the target privacy category of privacy data through the classification model obtained by the first acquisition unit; The determining unit is used to determine that the target field of the target database contains privacy data of the target privacy information category when the proportion of the identification results belonging to the target privacy category in the identification results obtained by the identification unit exceeds a preset threshold.

14. The apparatus of claim 13, wherein, The second acquisition unit is specifically used to acquire several original data from the original data of each target field in the target database using a random sampling method, and use them as input samples respectively.

15. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method of any one of claims 1-7.

16. A computing device comprising a memory and a processor, wherein the memory stores executable code, and the processor, when executing the executable code, implements the method of any one of claims 1-7.