Sensitive data intelligent classification method and device
Through the support vector machine model, the data is vectorized and combined with regular expression verification, the problem of low efficiency of sensitive data detection in the existing technology is solved, fast and accurate classification of sensitive data, and the performance of large data processing is improved And ensures protection of sensitive information.
Patent Information
- Application Number
- CN202411335738.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2044-09-24
AI Technical Summary
Existing rules-based sensitive data probing techniques are inefficient, especially when processing large data volumes, and cannot effectively identify sensitive information in Chinese data.
The support vector machine model is used to vectorize the target data and combine regular expression verification to quickly identify and classify sensitive data, improving classification efficiency and accuracy.
Through the combination of support vector machines and regular expressions, fast and accurate classification of sensitive data is achieved, the error judgment rate is reduced, the performance of large data processing is improved, and the protection of sensitive information is ensured.
Smart Images

Figure CN119293603A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure belongs to the technical field of information classification and identification, and more specifically, to a method and device for intelligent classification of sensitive data. Background Art
[0002] In the course of daily operations, governments, enterprises and other institutions accumulate a large amount of sensitive information, including but not limited to personal identity information, biometric identification information, various certificate numbers and medical records. According to the requirements of laws and regulations such as China's Data Security Law and Personal Information Protection Law, these sensitive information needs to be strictly encrypted or desensitized. In order to effectively implement this processing measure, the first task is to conduct a detailed exploration of structured data to accurately identify and locate the sensitive information fields that need to be processed.
[0003] Currently, in this field, the mainstream strategy for structured sensitive data detection is to use rule-based sensitive information detection technology. This technology requires that the features of sensitive information be manually summarized in advance, and then these features are refined into standardized formats such as regular expressions and lookup tables. However, due to the complexity of sensitive information types, complex rules and vague expressions, especially when Chinese data is involved, manual induction of comprehensive rules becomes time-consuming and laborious. In addition, when applying rule-based detection technology, the smallest unit of structured data needs to be repeatedly traversed. The efficiency of traversal is directly limited by the character length of the smallest unit, resulting in unsatisfactory performance when processing large amounts of data. Summary of the invention
[0004] The purpose of the present disclosure is to provide a method for intelligent classification of sensitive data to solve the problem of low efficiency of traditional rule-based inspection technology.
[0005] A first aspect of the embodiments of the present disclosure provides a method for intelligently classifying sensitive data, including: Vectorize the target data to obtain a first data vector. The target data includes sensitive data.
[0006] The first data vector is input into the support vector machine model to obtain a first sensitive data classification result corresponding to the first data vector.
[0007] The first sensitive data classification result is verified based on the regular expression to obtain a second sensitive data classification result corresponding to the first data vector.
[0008] A second aspect of the embodiments of the present disclosure provides a sensitive data intelligent classification device, including: The vectorization module is used to vectorize the target data to obtain a first data vector. The target data includes sensitive data.
[0009] The first classification module is used to input the first data vector into the support vector machine model to obtain a first sensitive data classification result corresponding to the first data vector.
[0010] The second classification module is used to verify the first sensitive data classification result based on a regular expression to obtain a second sensitive data classification result corresponding to the first data vector.
[0011] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the steps of the above-mentioned method for intelligent classification of sensitive data when executing the computer program.
[0012] According to a fourth aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned method for intelligent classification of sensitive data are implemented.
[0013] The beneficial effects of the sensitive data intelligent classification method and device provided by the embodiments of the present disclosure are: the embodiments of the present disclosure perform sensitive data inspection on structured data through a method combining a support vector machine with a regular expression, thereby solving the shortcomings of rule-based inspection, difficulty in forming rules, time-consuming identification, and inability to perform fuzzy identification.
[0014] Specifically, the disclosed embodiment can use the powerful classification ability of the model to quickly obtain preliminary sensitive data classification results by vectorizing the target data and inputting it into the support vector machine model, thereby improving the efficiency of classification. Verifying the preliminary results based on regular expressions can ensure the accuracy of the classification results and reduce the possibility of misjudgment. This method combines the advantages of machine learning and regular expressions, can quickly process large amounts of data, and can ensure the accuracy of classification, effectively protect sensitive information, and has important practical application value.
[0015] The vectorization method of the present application performs better than the bag-of-words method, which cannot capture a lot of information about the string, such as the length, the position of each character in the string, etc. The vectorization method of the present application can capture these feature points well and improve the performance of the support vector machine. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0017] Figure 1A flowchart of a method for intelligent classification of sensitive data provided by an embodiment of the present disclosure; Figure 2 A schematic diagram of a support vector machine model classification process provided by an embodiment of the present disclosure; Figure 3 A schematic diagram of a process for generating a data dictionary provided in an embodiment of the present disclosure; Figure 4 A schematic diagram of a data vectorization process provided by an embodiment of the present disclosure; Figure 5 A flowchart of another method for intelligent classification of sensitive data provided by an embodiment of the present disclosure; Figure 6 A flowchart of another method for intelligent classification of sensitive data provided by an embodiment of the present disclosure; Figure 7 A structural block diagram of a sensitive data intelligent classification device provided in an embodiment of the present disclosure; Figure 8 A schematic block diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0018] In the following description, specific details such as specific system structures and technologies are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present disclosure. However, it should be clear to those skilled in the art that the present disclosure may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obstructing the description of the present disclosure with unnecessary details.
[0019] In order to make the purpose, technical solutions and advantages of the present disclosure more clear, specific embodiments will be described below in conjunction with the accompanying drawings.
[0020] Please refer to Figure 1 , Figure 1 A flowchart of a method for intelligent classification of sensitive data provided in one embodiment of the present disclosure, the method may include S101 to S103.
[0021] S101: Vectorize the target data to obtain a first data vector. The target data includes sensitive data. In this embodiment, vectorizing the target data may include: acquiring data row information from a database, and vectorizing multiple data item information in the data row information to obtain a first data vector.
[0022] Exemplarily, in a data processing scenario involving user privacy protection, a database containing multiple user information is set, including but not limited to sensitive data such as name, ID number and phone number. Accurately extract data rows from the database. For example, a user's information includes the name "Zhang San", ID number "123456789012345678" and phone number "13812345678". Specific vectorization technology can be used to process the extracted data items. This process aims to convert unstructured information such as name, ID number and phone number into a structured vector form, namely the first data vector.
[0023] In the vectorization process, the ID card number can be converted based on its unique digital sequence characteristics, while the telephone number is vectorized by considering its digital combination pattern and fixed digits. This method can realize vectorization processing of large-scale target data, laying a solid foundation for subsequent sensitive information classification.
[0024] These vectorized first data vectors are input into the pre-built sensitive data classification model. Based on advanced algorithms and logic, the sensitive data classification model can further classify and identify the input data vectors in detail, thereby achieving effective management and protection of user sensitive information.
[0025] S102: Input the first data vector into a support vector machine model to obtain a first sensitive data classification result corresponding to the first data vector.
[0026] like Figure 2 As shown, in this embodiment, the support vector machine model extracts a feature vector based on the input first data vector, and classifies the first data vector based on the feature vector to obtain a first sensitive data classification result.
[0027] Exemplarily, a vector V (V=[V_1, V_2, ..., V_30]) is input into a support vector machine model for classification. The support vector machine model outputs a digital sequence R (classification result), whose length is consistent with the number of defined sensitive data types. In this sequence, the size of each number reflects the probability level of the input vector V being classified as the corresponding sensitive data type; specifically, the larger the value, the higher the probability that the vector V belongs to the sensitive category.
[0028] Assume that there are four types of sensitive data: mobile phone number (T_1), ID card number (T_2), passport number (T_3), and bank card number (T_4). When the support vector machine outputs the digital sequence [-6, 15, -12, 8], it means that R_1=-6, corresponding to mobile phone number (T_1); R_2=15, corresponding to ID card number (T_2); R_3=-12, corresponding to passport number (T_3); R_4=3, corresponding to bank card number (T_4).
[0029] Select the two most sensitive data types with the largest numbers. The ID card number (T_2) is the most likely sensitive data type for vector V to be classified, because its corresponding number (15) is the largest in the sequence. The second is the bank card number (T_4), because its corresponding number (3) is the largest among the remaining items.
[0030] S103: Verify the first sensitive data classification result based on the regular expression to obtain a second sensitive data classification result corresponding to the first data vector.
[0031] In this embodiment, the first sensitive data classification result corresponding to the first data vector includes evaluation values corresponding to multiple sensitive data types.
[0032] In this embodiment, the first sensitive data classification result is verified based on the regular expression to obtain the second sensitive data classification result corresponding to the first data vector, including: N sensitive data types are selected from the multiple sensitive data types based on evaluation values corresponding to the multiple sensitive data types.
[0033] Calculate the regular expressions corresponding to N sensitive data types respectively.
[0034] Verify the target data based on the regular expressions corresponding to N sensitive data types.
[0035] In this embodiment, a regular expression is a tool for matching and operating text patterns, which can check whether data conforms to a specific pattern according to predefined rules. By matching the first sensitive data classification result with the regular expression, if the match is successful, it is considered that the classification result is verified, thereby obtaining the second sensitive data classification result corresponding to the first data vector.
[0036] Exemplarily, according to the classification result R obtained in the above embodiment, two sensitive data types with the largest values, i.e., the highest probability, are selected. These two types are verified based on regular expressions. Taking R=[-6, 15, -12, 3] as an example, the sensitive data type T contains ['mobile phone number', 'ID number', 'passport number', 'bank card number'], then the two largest values in R are R_2 and R_4, which correspond to T_2 (ID number) and T_4 (bank card number) in the sensitive category T, respectively.
[0037] Use the regular expressions of ID card number and bank card number to check the original data. If the regular expression matching verification of a sensitive data type is successful, the original data item is confirmed to be of the sensitive data type. If the matching verification of both regular expressions fails, it is considered a false positive, and it is determined that the original data does not fall into the category of sensitive data. For sensitive information that does not have a corresponding regular expression, such as a person's name, further manual review can be used.
[0038] From the above, it can be concluded that this embodiment uses a method that combines support vector machines with regular expressions to perform sensitive data checks on structured data, thereby solving the shortcomings of rule-based checks, such as difficulty in forming rules, time-consuming recognition, and inability to perform fuzzy recognition.
[0039] Specifically, this embodiment can use the powerful classification ability of the model to quickly obtain preliminary sensitive data classification results by vectorizing the target data and inputting it into the support vector machine model, thereby improving the efficiency of classification. Verifying the preliminary results based on regular expressions can ensure the accuracy of the classification results and reduce the possibility of misjudgment. This method combines the advantages of machine learning and regular expressions, can quickly process large amounts of data, and can ensure the accuracy of classification, effectively protect sensitive information, and has important practical application value.
[0040] The vectorization method of this embodiment performs better than the bag-of-words method, which cannot capture much information of the string, such as the length, the position of each character in the string, etc. The vectorization method of this application can capture these feature points well and improve the performance of the support vector machine.
[0041] In one embodiment of the present disclosure, the method for intelligently classifying sensitive data further includes: Label the training data set with sensitive data types. The training data set includes multiple sensitive data.
[0042] The labeled training data set is vectorized to obtain a second data vector.
[0043] The preset support vector machine model is trained based on the second data vector to obtain a support vector machine model.
[0044] In this embodiment, the support vector machine model is a classification model based on machine learning and needs to be trained before use.
[0045] In this embodiment, a preset support vector machine model is trained based on the second data vector to obtain a support vector machine model including: Training a preset support vector machine model based on the second data vector to determine target parameters; The support vector machine classification model is obtained based on the target parameters.
[0046] For example, in order to automatically find the target parameters (i.e., the optimal parameters) of the support vector machine model, a grid search method can be used. The specific steps are as follows: Determine the initial search range of C and gamma. The range of C is set from arrive , the range of gamma is arrive The search step size is increased by a power of 2, that is, the search sequence of C is , , , , ..., , and the search sequence for gamma is , ..., At this point, you can select a portion of the training data, perform 5-fold cross validation for each combination of C and gamma, and use the f-1 score as the performance evaluation standard. Within this range, find the combination of C and gamma that can maximize the f-1 score. Use it as the initial optimal parameter and set a more refined search range accordingly. For example, if the initial search result is C: , gamma: , then the C range of the fine search can be set to arrive , the range of gamma is arrive , the search step size is adjusted to 0.25. Through this dual search strategy, the optimal parameters of the support vector machine model can be accurately determined.
[0047] Compared with the traditional method of relying on manual inspection of model performance and manual adjustment of parameters, this automated search method has significant advantages. Faced with huge amounts of data and complex data types, it is difficult for humans to accurately obtain the best parameters through data analysis and other means. Manual search is not only inefficient, but also has limited accuracy, and it is difficult to guarantee the best classification effect. The automated grid search uses a coarse-to-fine search strategy to first determine the approximate range of the best parameters and then further refine the search. The entire process is simple and efficient, does not require manual intervention, and can ensure that the selected parameters are globally optimal.
[0048] In addition, manual determination of the best parameters requires the trainer to have a deep professional background and rich experience, and places high demands on the operator. However, the automated search for the best parameters completely breaks free from the constraints of manual work and reduces the requirements on the operator.
[0049] Exemplarily, based on the classification requirements of sensitive data types, the corresponding training data sets are obtained in advance and the data are labeled. Specifically, if the sensitive data types include ['mobile phone number', 'ID number', 'passport number', 'bank card number'], four independent CSV files are prepared, and the naming of each file can follow the English name specifications of each sensitive data type. For example, Phone_number.csv is used to store mobile phone number data, Ssn.csv is used to store ID number data, Passport_number.csv is used to store passport number data, and Credit_card_number.csv is used to store bank card number data. Each file contains only string data of the corresponding type.
[0050] Furthermore, in order to efficiently process these sensitive data, a sensitive type tagging system can be created. This system will tag different sensitive data types based on their index position in the list, such as mobile phone numbers are marked as 0, ID numbers are marked as 1, and so on. This tagging system can be applied to the data processing process without the need to build additional complex data structures to store tag information.
[0051] This embodiment achieves efficient and accurate classification of sensitive data by annotating training data sets, vectorizing and training support vector machine models. This method simplifies the data processing process, improves classification efficiency, and ensures classification accuracy through machine learning models, effectively reducing the risk of data leakage.
[0052] like Figure 3 As shown, in one embodiment of the present disclosure, the labeled training data set is vectorized to obtain a second data vector, including: Generate a data dictionary based on the training dataset.
[0053] Data conversion is performed on the data of the training data set based on the data dictionary to obtain a second data vector.
[0054] In this embodiment, the data dictionary includes M non-repeated characters in the training data set.
[0055] In this embodiment, data conversion is performed on the data of the training data set based on the data dictionary to obtain multiple second data vectors, including: calculating vector values corresponding to M non-repeating characters based on an assignment function.
[0056] The vector values corresponding to the M non-repeating characters are concatenated to obtain a second data vector.
[0057] The assignment function is:
[0058] Among them, F_i represents the vector value corresponding to the i-th character, x represents the set constant, and M represents the total number of non-repeated characters in the data dictionary.
[0059] For example, in the process of building a data dictionary, a normalization process can be performed based on the training data set to ensure that the data dictionary fully covers all characters in the data set and assigns values to these characters one by one. This process begins by extracting unique characters from the training data set, assigning values to all characters one by one, and storing these key-value pairs in the data dictionary.
[0060] For the specific strategy of value assignment, a dynamic adjustment method can be adopted. For example, the space character (' ') is fixed to 0, and the other characters are assigned values by linear interpolation according to the total number of characters n in the data dictionary. Specifically, the assignment of these characters starts from the non-zero minimum value and gradually increases to 1. The data dictionary is constructed in the form of a Python dictionary and is persistently stored in the JSON file format. Its structure is as follows: { " ": 0.0, "K_1": F_1, "K_2": F_2, ... "K_n": F_n } Among them, K_i represents the i-th character in the data dictionary, and F_i represents the value corresponding to the i-th character in the data dictionary. The value range of i is 1 to n, and n is the total number of characters (excluding spaces) in the data dictionary. F_n is explicitly assigned 1 as the upper limit of the value range.
[0061] During the value assignment process, if the data dictionary contains n characters excluding spaces, the value of each character is calculated using the formula F_i=0+(1 / n)*i, where i represents the character number (starting from 1). Taking the 26 English letters as an example, if n=26, the value of the first character a is 0.03846153846 (i.e. 0+(1 / 26)*1), the value of the second character 'b' is 0.07692307692 (i.e. 0+(1 / 26)*2), and so on, until the last character 'z', which is assigned a value of 1 (i.e. 0+(1 / 26)*26).
[0062] So for a dictionary containing the 26 English letters, its structure would look like this: { " ": 0, "a": 0.03846153846, "b": 0.07692307692, ... "z": 1 } like Figure 3 As shown in the figure, the process is divided into two parts. The first part is to find all non-repeating characters from the training data, and the second part is to assign values to the non-repeating characters found in the first part. The format of the training data is a string (String), the length is 0, and there are a total of S_1 to S_o strings. The length of each string is m, and the content is a character (Char), including C_1 to C_m.
[0063] First, read the training data into a list named L_1, where each item in L_1 is a string in the training data. During initialization, create two integer variables as loop indexes, such as the first-level index i and the second-level index j. Create a data dictionary D with the initial content {" ": "0.0"} and an empty list L_2. Create a two-layer loop: the first-level loop iterates over all strings in L_1, and the second-level loop iterates over all characters in the string. Use the in instruction to determine whether the character in the string can be found in L_2. If not, use the append instruction to add it to L_2. After completing the traversal of all strings, a list L_2 containing non-repeated characters in all training data is obtained, with a length of n and each item being a character.
[0064] Enter the assignment process, create an integer variable p as the loop index, traverse the characters in L_2, and calculate the assignment F_p (variable type is double) through the formula. Use the current character K_p as the key of the data dictionary D, and F_p as the value corresponding to the key. Use the update instruction to update {"K_p": "F_p"} to the dictionary. After completing all traversals, you will get a data dictionary whose keys are all non-repeating characters in the training data, and the values corresponding to the keys are the assignments of the characters. You can then vectorize the data through the data dictionary D.
[0065] For example, Figure 4As shown in the figure, the process is to convert a string S of length m into a vector of length 30, and the conversion rule is based on the pre-created data dictionary D. The specific steps are as follows: Create a list V of length 30, and initialize each item of the list V to 0. Create an integer variable i as a loop index. Traverse each character C_i in the string S, and use the in instruction to determine whether the character C_i is a key in the data dictionary D. If the character C_i exists in the data dictionary D, the value of the corresponding V_i item in V is updated to the corresponding value in D; if the character C_i does not exist in the data dictionary D, the corresponding V_i item is assigned to -1. If the length of S is less than or equal to 30, the value of V starting from the mth item remains 0. If the length of S is greater than 30, the characters after the 30th item are not counted in V. The final V is the vector corresponding to the string S. This ensures that each character of the string S is converted according to the assignment in the data dictionary D, and the final vector V always maintains a length of 30.
[0066] Specifically, a data dictionary can be used to convert all the data in the training data set into a vector of length 30. The vector structure is as follows: [V_1, V_2, V_3, ..., V_30], where V_1, V_2, V_3, ..., V_30 are F_i in the data dictionary. The specific conversion method is as follows: If a string of characters is "C_1, C_2, C_3, ..., C_n", then V_1 is the value assigned to C_1 in the dictionary, V_2 is the value assigned to C_2 in the dictionary, and so on. If n<30, the redundant position values are all 0; if n 30, the characters after 30 are not included in the vector. For example, there is a string "abcd" in the training data set. The converted result is V_1=0.03846153846, V_2=0.07692307692, V_3=0.1153846154, V_4=0.1538461538, and the rest are 0. The vector is: [0.03846153846, 0.07692307692, 0.1153846154, 0.1538461538, 0, 0, 0, ..., 0].
[0067] This embodiment effectively improves data processing efficiency and model training accuracy by vectorizing the labeled training data set. Specifically, by constructing a data dictionary and assigning and concatenating the characters in the training data set one by one, not only the integrity and coverage of the data dictionary are ensured, but also reasonable values are assigned to the characters by linear interpolation, so that the relative relationship between characters can be accurately expressed in the vector space.
[0068] In one embodiment of the present disclosure, the method for intelligently classifying sensitive data further includes: Extract data rows from the target database to obtain target data.
[0069] In this embodiment, extracting data rows from the target database to obtain target data may include: acquiring data row information and data row source information from the target database; The data row information includes a plurality of data item information; the data row source information includes data row identification information and data item identification information.
[0070] For example, in the financial field, in order to ensure the security and compliance of customer data, sensitive data needs to be classified. For example, a bank extracts data rows from its target database to obtain relevant information about customers. Through the database data extraction module, data row information and data row source information are obtained from the target database. Data row information may include multiple data item information such as the customer's name, ID number, bank card number, etc.; data row source information may include data row identification information (such as customer number, transaction serial number, etc.) and data item identification information (such as the name of the table to which it belongs, the name of the field to which it belongs, etc.). For example, a data row of a certain customer is extracted from a bank database, including information such as the name "Zhang San", ID number "123456789012345678", and bank card number "6212345678901234", and at the same time, it is recorded that the data row comes from the "customer information table", and the ID number field name is "IDNumber" and other source information.
[0071] This embodiment achieves comprehensive coverage and efficient classification of sensitive data by accurately extracting and identifying data row information and its source from the target database. This not only improves the accuracy of data processing, but also enhances data security and compliance, and has significant practical application value in the financial and other fields.
[0072] In one embodiment of the present disclosure, the method for intelligently classifying sensitive data further includes: Determine the server connection parameters, primary identifier, secondary identifier, data row extraction method, and number of data rows to be extracted for the target database. The primary identifier is the target database name, and the secondary identifier is the table name.
[0073] The target database includes a plurality of data row information.
[0074] In this embodiment, the primary identifier may include a target database name or a target database number, and the secondary identifier may include a table name or a table number. The target database, table, data extraction method, and data extraction quantity may be selected from a configured database server.
[0075] In the medical industry, to ensure patient privacy and data security, it is crucial to classify sensitive data. Determine the connection parameters of the target database server, which can include key information such as server address, user name and password. Use the database name (such as "hospital patient database") as the primary identifier and the table name (such as "patient basic information table") as the secondary identifier to achieve accurate data positioning.
[0076] According to actual needs, select the appropriate data row extraction strategy, which can include the extraction method of the entire table range, or the extraction method of partial data rows based on specific conditions, and clearly specify the amount of data to be extracted, such as extracting 1,000 data rows for subsequent analysis. For example, select "Hospital Patient Database" as the operation object from the configured database server, specify "Patient Basic Information Table" as the secondary identifier, adopt the full table extraction strategy, and set to extract 500 data rows as the analysis sample.
[0077] This embodiment provides an efficient and accurate means of classifying and managing sensitive data in multi-domain databases, effectively ensuring the security and privacy of user data.
[0078] like Figure 5 As shown, in one embodiment of the present disclosure, the sensitive data intelligent classification method can be divided into an algorithm initialization module, a database data extraction module, a data vectorization module, a support vector machine data category detection module, and a rule-based verification module. Specifically, the algorithm initialization module can read and store information such as models, model configurations, and regular expressions, and provide necessary support for the support vector machine data category detection module and the rule-based verification module. At the same time, key information such as server configuration information, model selection information, and check data configuration information is determined.
[0079] The database data extraction module can extract data rows from the target database and record the source of the data rows (table name, database name, server configuration, etc.) and the source of the data items (table name, field name, field index number, etc.).
[0080] The data vectorization module can vectorize the data items in the data rows extracted from the target database so that the support vector machine can process them.
[0081] The support vector machine data category detection module can use the support vector machine model to classify the vectorized data and record the category.
[0082] The rule-based verification module can use rule-based detection methods to verify the classification results of the support vector machine model to reduce the error rate and false alarm rate.
[0083] like Figure 6As shown, in one embodiment of the present disclosure, the method can be divided into the following processes: algorithm initialization, extracting inspection data from the database, vectorizing the inspection data, classifying through the support vector machine model, using the regular expression (i.e., regular expression) corresponding to the classification result to check the data category (i.e., sensitive data type), and verifying whether the classification result is consistent with the regular expression. If they are consistent, the data belongs to sensitive information, and if they are inconsistent, the data does not belong to sensitive information.
[0084] Corresponding to the sensitive data intelligent classification method in the above embodiment, Figure 7 This is a structural block diagram of a sensitive data intelligent classification device provided by an embodiment of the present disclosure. For ease of explanation, only the parts related to the embodiment of the present disclosure are shown. Figure 7 , the sensitive data intelligent classification device 20 comprises: The vectorization module 21 is used to vectorize the target data to obtain a first data vector. The target data includes sensitive data.
[0085] The first classification module 22 is used to input the first data vector into the support vector machine model to obtain a first sensitive data classification result corresponding to the first data vector.
[0086] The second classification module 23 is used to verify the first sensitive data classification result based on the regular expression to obtain the second sensitive data classification result corresponding to the first data vector.
[0087] In one embodiment of the present disclosure, the sensitive data intelligent classification device 20 further includes: The first training module is used to label the sensitive data types of the training data set. The training data set includes multiple sensitive data.
[0088] The second training module is used to vectorize the labeled training data set to obtain a second data vector.
[0089] The third training module is used to train a preset support vector machine model based on the second data vector to obtain a support vector machine model.
[0090] In one embodiment of the present disclosure, the second training module includes: The first computing unit is used to generate a data dictionary based on the training data set.
[0091] The second computing unit is used to perform data conversion on the data of the training data set based on the data dictionary to obtain a second data vector.
[0092] In one embodiment of the present disclosure, the data dictionary includes M non-repeating characters in the training data set, and the second calculation unit is specifically used to calculate the vector values corresponding to the M non-repeating characters based on the assignment function.
[0093] The vector values corresponding to the M non-repeating characters are concatenated to obtain a second data vector.
[0094] The assignment function is:
[0095] Among them, F_i represents the vector value corresponding to the i-th character, x represents the set constant, and M represents the total number of non-repeated characters in the data dictionary.
[0096] In one embodiment of the present disclosure, the first sensitive data classification result corresponding to the first data vector includes evaluation values corresponding to multiple sensitive data types, and the second classification module 23 is specifically used to select N sensitive data types from multiple sensitive data types based on the evaluation values corresponding to the multiple sensitive data types.
[0097] Calculate the regular expressions corresponding to N sensitive data types respectively.
[0098] Verify the target data based on the regular expressions corresponding to N sensitive data types.
[0099] In one embodiment of the present disclosure, the sensitive data intelligent classification device 20 further includes: The first data acquisition module is used to extract data rows from the target database to obtain target data.
[0100] In one embodiment of the present disclosure, the sensitive data intelligent classification device 20 further includes: The second data acquisition module is used to determine the server connection parameters, the primary identifier, the secondary identifier, the data row extraction method and the data row extraction quantity of the target database. The primary identifier is the target database name, and the secondary identifier is the table name.
[0101] The target database includes a plurality of data row information.
[0102] See also Figure 8 , Figure 8 A schematic block diagram of an electronic device provided by an embodiment of the present disclosure. Figure 8 The electronic device 300 in the embodiment shown may include: one or more processors 301, one or more input devices 302, one or more output devices 303 and one or more memories 304. The processors 301, input devices 302, output devices 303 and memories 304 communicate with each other via a communication bus 305. The memory 304 is used to store computer programs, which include program instructions. The processor 301 is used to execute the program instructions stored in the memory 304. The processor 301 is configured to call the program instructions to execute the functions of each module / unit in the above-mentioned device embodiments, such as Figure 7 The functions of modules 21 to 23 are shown.
[0103] It should be understood that in the embodiment of the present disclosure, the processor 301 may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0104] The input device 302 may include a touch panel, a fingerprint collection sensor (for collecting the user's fingerprint information and fingerprint direction information), a microphone, etc., and the output device 303 may include a display (LCD, etc.), a speaker, etc.
[0105] The memory 304 may include a read-only memory and a random access memory, and provide instructions and data to the processor 301. A portion of the memory 304 may also include a non-volatile random access memory. For example, the memory 304 may also store information about the device type.
[0106] In a specific implementation, the processor 301, input device 302, and output device 303 described in the embodiments of the present disclosure can execute the implementation methods described in the first and second embodiments of the method for intelligent classification of sensitive data provided in the embodiments of the present disclosure, and can also execute the implementation methods of the electronic device 300 described in the embodiments of the present disclosure, which will not be repeated here.
[0107] In another embodiment of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by the processor, all or part of the processes in the above-mentioned embodiment method are implemented, and the computer program can also be completed by instructing the relevant hardware through the computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, the steps of each of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0108] The computer-readable storage medium may be an internal storage unit of the electronic device of any of the aforementioned embodiments, such as a hard disk or memory of the electronic device. The computer-readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Further, the computer-readable storage medium may also include both an internal storage unit of the electronic device and an external storage device. The computer-readable storage medium is used to store computer programs and other programs and data required by the electronic device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.
[0109] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this disclosure.
[0110] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the electronic devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0111] In the several embodiments provided in the present application, it should be understood that the disclosed electronic devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces or units, or it can be an electrical, mechanical or other form of connection.
[0112] 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 embodiments of the present disclosure.
[0113] In addition, each functional unit in each embodiment of the present disclosure 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. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0114] The above are only specific embodiments of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present disclosure, and these modifications or replacements should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A method for intelligent classification of sensitive data, characterized in that: include: Vectorizing the target data to obtain a first data vector; the target data includes sensitive data; Inputting the first data vector into a support vector machine model to obtain a first sensitive data classification result corresponding to the first data vector; The first sensitive data classification result is verified based on a regular expression to obtain a second sensitive data classification result corresponding to the first data vector.
2. The method for intelligent classification of sensitive data according to claim 1, characterized in that: Also includes: Label the training dataset with sensitive data types; The training data set includes multiple sensitive data; Vectorizing the labeled training data set to obtain a second data vector; A preset support vector machine model is trained based on the second data vector to obtain the support vector machine model.
3. The method for intelligent classification of sensitive data according to claim 2, characterized in that: The step of vectorizing the labeled training data set to obtain a second data vector includes: generating a data dictionary based on the training data set; Data conversion is performed on the data of the training data set based on the data dictionary to obtain a second data vector.
4. The method for intelligent classification of sensitive data according to claim 3, characterized in that: The data dictionary includes M non-repeated characters in the training data set, and the data conversion of the training data set based on the data dictionary to obtain multiple second data vectors includes: Calculate the vector values corresponding to the M non-repeating characters based on the assignment function; Concatenate the vector values corresponding to the M non-repeating characters to obtain the second data vector; The assignment function is: Among them, F_i represents the vector value corresponding to the i-th character, x represents the set constant, and M represents the total number of non-repeated characters in the data dictionary.
5. The method for intelligent classification of sensitive data according to claim 1, characterized in that: The first sensitive data classification result corresponding to the first data vector includes evaluation values corresponding to multiple sensitive data types, and the first sensitive data classification result is verified based on the regular expression to obtain a second sensitive data classification result corresponding to the first data vector, including: Selecting N sensitive data types from the multiple sensitive data types based on evaluation values corresponding to the multiple sensitive data types; Calculate regular expressions corresponding to the N sensitive data types respectively; The target data is verified based on regular expressions corresponding to the N sensitive data types.
6. The method for intelligent classification of sensitive data according to claim 1, characterized in that: Also includes: Extract data rows from the target database to obtain the target data.
7. The method for intelligent classification of sensitive data according to claim 1, characterized in that: Also includes: Determine the server connection parameters, primary identifier, secondary identifier, data row extraction method, and number of data rows to be extracted of the target database; The first-level identifier is the target database name, and the second-level identifier is the table name; The target database includes a plurality of data row information.
8. A sensitive data intelligent classification device, characterized in that: include: A vectorization module, used to vectorize the target data to obtain a first data vector; the target data includes sensitive data; A first classification module, used for inputting the first data vector into a support vector machine model to obtain a first sensitive data classification result corresponding to the first data vector; The second classification module is used to verify the first sensitive data classification result based on a regular expression to obtain a second sensitive data classification result corresponding to the first data vector.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Device and method for recognizing character
CN101373519A
Car logo classification method based on sparse coding
CN105160314A
Sensitive emoji package detection method and device, and electronic equipment
CN110879963A
Power sensitive data processing method and device, electronic equipment and storage medium
CN116628584A
Medical data item asset sensitivity identification method and system, terminal and medium
CN118116609A