Sensitive data identification method and device and data processing platform
By establishing a sensitive word dictionary and dividing the target data into strings for matching, the problem of low accuracy in sensitive data recognition in the prior art is solved, and more efficient sensitive data recognition and data desensitization processing are achieved.
Patent Information
- Application Number
- CN202410176195.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-07
- Publication Date
- 2025-08-08
AI Technical Summary
The existing sensitive data identification methods have low accuracy, which makes it difficult to effectively desensitize data, especially for sensitive data in categories such as names and addresses.
By establishing a sensitive word dictionary, recording multiple semantic elements and their corresponding sensitive strings, and dividing the target data into target strings, matching them with the sensitive strings in the sensitive word dictionary to identify the corresponding sensitive data.
It improves the accuracy of sensitive data recognition, reduces the recognition complexity, and can effectively perform data desensitization processing.
Smart Images

Figure CN120449197A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data security technology, and in particular to a method and device for identifying sensitive data, and a data processing platform. Background Art
[0002] Currently, all industries are undergoing a digital transformation. This digital transformation, coupled with the accumulation and processing of massive amounts of business data, has also brought about data security challenges. Industries across all industries need to achieve data sharing and data mining while protecting personal privacy and data security. Against this backdrop, data desensitization has become increasingly important. Data desensitization is a technical means of safeguarding data security by desensitizing sensitive data to protect personal privacy. Accurately identifying sensitive data is a prerequisite for data desensitization. However, current identification methods have low accuracy for sensitive data, making it difficult to effectively desensitize sensitive data. Summary of the Invention
[0003] In a first aspect, an embodiment of the present disclosure provides a method for identifying sensitive data, the method comprising: obtaining target data to be identified; segmenting the target data to obtain multiple target character strings; determining target semantic elements from a sensitive word dictionary, and matching the multiple target character strings with sensitive character strings corresponding to the target semantic elements in the sensitive word dictionary, respectively, wherein the sensitive word dictionary includes multiple semantic elements and sensitive character strings corresponding to each semantic element, and the semantic element is used to represent the semantic category of the corresponding character string; based on the matching results of the multiple target character strings, identifying sensitive data whose semantic category corresponds to the target semantic element from the target data.
[0004] In some embodiments, the target semantic element includes a surname semantic element for representing a surname and a name semantic element for representing a person's name; matching the multiple target character strings with the sensitive character strings corresponding to the target semantic elements in the sensitive word dictionary respectively includes: matching the first character string among the multiple target character strings with the sensitive character string corresponding to the surname semantic element in the sensitive word dictionary; if the match is successful, matching the second character string located after the first character string among the multiple target character strings with the sensitive character string corresponding to the person's name semantic element in the sensitive word dictionary; identifying sensitive data whose semantic category corresponds to the target semantic element from the target data based on the matching results of the multiple target character strings includes: determining that the target data includes sensitive data representing a name if the second character string successfully matches the sensitive character string corresponding to the person's name semantic element in the sensitive word dictionary.
[0005] In some embodiments, if the match is successful, the second character string located after the first character string in the multiple target character strings is matched with the sensitive character string corresponding to the semantic element of the name in the sensitive word dictionary, including: if the match is successful, performing a character bit count check on the second character string to determine the target character bit count of the second character string; matching the second character string with the sensitive character string corresponding to the semantic element of the name and having the target character bit count.
[0006] In some embodiments, the target semantic element includes an address semantic element for representing a geographic area, at least two semantic elements correspond to different levels, and the level corresponding to the semantic element is determined based on the level of the geographic area represented by the semantic element; matching the multiple target character strings with the sensitive character strings corresponding to the target semantic element in the sensitive word dictionary, respectively, includes: determining the target level of the geographic area represented by the target character string; obtaining the target semantic element corresponding to the target level in the sensitive word dictionary, and obtaining at least one target sensitive character string corresponding to the target semantic element of the target level in the sensitive word dictionary; matching the target character string with each target sensitive character string respectively; identifying sensitive data of a semantic category corresponding to the target semantic element from the target data based on the matching results of the multiple target characters, includes: if there is a target sensitive character string that successfully matches the target character string, determining that the target data includes sensitive data representing an address.
[0007] In some embodiments, the target semantic element includes an address; the identifying of sensitive data of a semantic category corresponding to the target semantic element from the target data based on the matching results of the multiple target strings includes: if the sensitive strings corresponding to the target semantic element in the sensitive word dictionary do not include a target sensitive string that successfully matches the target string, obtaining a first target sensitive string that successfully matches a portion of the target string among the target sensitive strings; obtaining a third character in the target string, and obtaining a fourth character in the first target sensitive string, the third character and the fourth character being characters that failed to match; if the similarity between the third character and the fourth character is greater than a preset similarity threshold, determining that the target string successfully matches the first target sensitive string, and determining that the target data includes sensitive data representing an address.
[0008] In some embodiments, the method further includes: obtaining pronunciation similarity and glyph similarity between the third character and the fourth character; and weighting the pronunciation similarity and the glyph similarity to obtain the similarity between the third character and the fourth character.
[0009] In some embodiments, the similarity between the third character and the fourth character includes the glyph similarity between the third character and the fourth character; the method further includes: obtaining the first character components constituting the third character, the first character structure of the third character, the second character components constituting the fourth character, and the second character structure of the fourth character; the character structure is used to represent the relative position relationship between the character components in the character, and the character component is the smallest divisible element that constitutes the character; based on the first character components, the first character structure, the second character components, and the second character structure, the glyph similarity between the third character and the fourth character is determined.
[0010] In some embodiments, determining the glyph similarity between the third character and the fourth character based on the respective first character components, the first character structure, the respective second character components, and the second character structure includes: determining the similarity between the character structures of the third character and the fourth character based on the third character structure and the fourth character structure; determining the similarity between the character components of the third character and the fourth character based on the respective first character components and the respective second character components; and weighting the similarity between the character structures and the similarity between the character components to obtain the glyph similarity between the third character and the fourth character.
[0011] In some embodiments, the similarity between the third character and the fourth character includes the glyph similarity between the third character and the fourth character; the method also includes: obtaining the first prefix component and the first tail component of the third character, and obtaining the second prefix component and the second tail component of the fourth character; the character component is the smallest separable element that constitutes the character; determining the similarity between the first prefix component and the second prefix component, and the similarity between the first tail component and the second tail component; weighting the similarity between the character structures of the third character and the fourth character, the similarity between the first prefix component and the second prefix component, and the similarity between the first tail component and the second tail component to obtain the glyph similarity between the third character and the fourth character.
[0012] In some embodiments, the weighting of the similarity between the character structures of the third character and the fourth character, the similarity between the first prefix component and the second prefix component, and the similarity between the first suffix component and the second suffix component to obtain the glyph similarity of the third character and the fourth character includes: determining a first weight based on the proportion of the number of strokes of the first prefix component in the number of strokes of the third character and the proportion of the number of components of the first prefix component in the number of components of the third character, and weighting the similarity between the first prefix component and the second prefix component based on the first weight to obtain a first weighted similarity; determining a second weight based on the proportion of the number of strokes of the first suffix component in the number of strokes of the third character and the proportion of the number of components of the first suffix component in the number of components of the third character, and weighting the similarity between the first suffix component and the second suffix component based on the second weight to obtain a second weighted similarity; and determining the glyph similarity of the third character and the fourth character based on the sum of the similarity between the character structures, the first weighted similarity, and the second weighted similarity.
[0013] In some embodiments, the target data is stored in a target database; the method further includes: obtaining an operation statement for the target database; and filtering the operation statement if it is detected that the operation statement includes a keyword in a preset keyword ban list.
[0014] In some embodiments, the method further includes: if it is detected that the operation statement does not include a keyword in a preset keyword ban list, sending the operation statement to the target database based on a database connection pre-established with the target database; wherein the database connection is established based on the following manner: obtaining the database type of the target database selected by the user; obtaining target connection information corresponding to the database type of the target database from a database connection pool; the database connection pool is used to maintain connection information corresponding to multiple database types; and establishing a connection with the target database based on the target connection information.
[0015] In a second aspect, an embodiment of the present disclosure provides a device for identifying sensitive data, the device comprising: a data acquisition module for acquiring target data to be identified; a segmentation module for segmenting the target data to obtain multiple target character strings; a matching module for determining target semantic elements from a sensitive word dictionary, and matching the multiple target character strings with sensitive character strings corresponding to the target semantic elements in the sensitive word dictionary, respectively, wherein the sensitive word dictionary includes multiple semantic elements and sensitive character strings corresponding to each semantic element, and the semantic element is used to represent the semantic category of the corresponding character string; an identification module for identifying sensitive data whose semantic category corresponds to the target semantic element from the target data based on the matching results of the multiple target character strings.
[0016] In some embodiments, the target semantic element includes a surname semantic element for representing a surname and a name semantic element for representing a person's name; the matching module is used to: match the first character string among the multiple target character strings with the sensitive character string corresponding to the surname semantic element in the sensitive word dictionary; if the match is successful, match the second character string located after the first character string among the multiple target character strings with the sensitive character string corresponding to the name semantic element in the sensitive word dictionary; the recognition module is used to: if the second character string successfully matches the sensitive character string corresponding to the name semantic element in the sensitive word dictionary, determine that the target data includes sensitive data representing a name.
[0017] In some embodiments, the matching module is used to: if the match is successful, perform a character bit check on the second character string to determine the target character bit number of the second character string; and match the second character string with a sensitive character string corresponding to the semantic element of the name and having the target character bit number.
[0018] In some embodiments, the target semantic element includes an address semantic element for representing a geographic area, at least two semantic elements correspond to different levels, and the level corresponding to the semantic element is determined based on the level of the geographic area represented by the semantic element; the matching module is used to: determine the target level of the geographic area represented by the target string; obtain the target semantic element corresponding to the target level in the sensitive word dictionary, and obtain at least one target sensitive string corresponding to the target semantic element of the target level in the sensitive word dictionary; match the target string with each target sensitive string respectively; the identification module is used to: if there is a target sensitive string that successfully matches the target string, determine that the target data includes sensitive data representing the address.
[0019] In some embodiments, the target semantic element includes an address; the recognition module is used to: if the sensitive character string corresponding to the target semantic element in the sensitive word dictionary does not include a target sensitive character string that successfully matches the target character string, obtain a first target sensitive character string that successfully matches a portion of the target character string in each target sensitive character string; obtain the third character in the target character string, and obtain the fourth character in the first target sensitive character string, the third character and the fourth character being characters that failed to match; if the similarity between the third character and the fourth character is greater than a preset similarity threshold, determine that the target character string successfully matches the first target sensitive character string, and determine that the target data includes sensitive data representing an address.
[0020] In some embodiments, the device further includes: a first similarity acquisition module, configured to acquire pronunciation similarity and glyph similarity between the third character and the fourth character; and weighting the pronunciation similarity and the glyph similarity to obtain the similarity between the third character and the fourth character.
[0021] In some embodiments, the similarity between the third character and the fourth character includes the glyph similarity between the third character and the fourth character; the device also includes: a second similarity acquisition module, used to acquire the various first character components constituting the third character, the first character structure of the third character, the various second character components constituting the fourth character, and the second character structure of the fourth character; the character structure is used to represent the relative position relationship between the various character components in the character, and the character component is the smallest divisible element that constitutes the character; based on the various first character components, the first character structure, the various second character components, and the second character structure, the glyph similarity between the third character and the fourth character is determined.
[0022] In some embodiments, the second similarity acquisition module is used to: determine the similarity between the character structures of the third character and the fourth character based on the third character structure and the fourth character structure; determine the similarity between the character components of the third character and the fourth character based on the respective first character components and the respective second character components; and weight the similarity between the character structures and the similarity between the character components to obtain the glyph similarity between the third character and the fourth character.
[0023] In some embodiments, the similarity between the third character and the fourth character includes the glyph similarity between the third character and the fourth character; the device also includes: a third similarity acquisition module, used to obtain the first prefix component and the first tail component of the third character, and obtain the second prefix component and the second tail component of the fourth character; the character component is the smallest separable element that constitutes the character; determine the similarity between the first prefix component and the second prefix component, and the similarity between the first tail component and the second tail component; weight the similarity between the character structures of the third character and the fourth character, the similarity between the first prefix component and the second prefix component, and the similarity between the first tail component and the second tail component to obtain the glyph similarity between the third character and the fourth character.
[0024] In some embodiments, the third similarity acquisition module is used to: determine a first weight based on the proportion of the number of strokes of the first prefix component in the number of strokes of the third character, and the proportion of the number of components of the first prefix component in the number of components of the third character, and weight the similarity between the first prefix component and the second prefix component based on the first weight to obtain a first weighted similarity; determine a second weight based on the proportion of the number of strokes of the first suffix component in the number of strokes of the third character, and the proportion of the number of components of the first suffix component in the number of components of the third character, and weight the similarity between the first suffix component and the second suffix component based on the second weight to obtain a second weighted similarity; determine the glyph similarity between the third character and the fourth character based on the sum of the similarity between the character structures, the first weighted similarity and the second weighted similarity.
[0025] In some embodiments, the target data is stored in a target database; the device further includes: a filtering module for obtaining an operation statement for the target database, and filtering the operation statement if it is detected that the operation statement includes a keyword in a preset keyword ban list.
[0026] In some embodiments, the device further includes: a sending module, configured to send the operation statement to the target database based on a database connection pre-established with the target database if no keywords in a preset keyword ban list are detected in the operation statement; wherein the database connection is established based on the following modules: a type acquisition module, configured to obtain the database type of the target database selected by the user; an information acquisition module, configured to obtain target connection information corresponding to the database type of the target database from a database connection pool; the database connection pool is configured to maintain connection information corresponding to multiple database types; and a connection establishment module, configured to establish a connection with the target database based on the target connection information.
[0027] In a third aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any embodiment of the present disclosure.
[0028] In a fourth aspect, an embodiment of the present disclosure provides a data management platform, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in any embodiment of the present disclosure when executing the program.
[0029] In an embodiment of the present disclosure, a sensitive word dictionary is established to record multiple semantic elements and the sensitive character strings corresponding to each semantic element. Since the semantic elements are used to represent the semantic categories of the corresponding character strings, the sensitive word dictionary can accurately record sensitive character strings of multiple semantic categories. After obtaining the target data, the target data is divided into target character strings, and each target character string is matched with the sensitive character string corresponding to the target semantic element in the sensitive word dictionary, so that the sensitive data corresponding to the target semantic element can be accurately matched. The above method improves the accuracy of sensitive data identification, thereby effectively performing data desensitization processing on sensitive data.
[0030] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The drawings herein are incorporated into the specification and constitute a part of the present disclosure. These drawings illustrate embodiments consistent with the present disclosure and, together with the specification, are used to explain the technical solutions of the present disclosure.
[0032] Figure 1 It is a schematic diagram of an application scenario of an embodiment of the present disclosure.
[0033] Figure 2 It is a flowchart of a method for identifying sensitive data according to an embodiment of the present disclosure.
[0034] Figure 3A and Figure 3B They are schematic diagrams of sensitive word dictionaries according to embodiments of the present disclosure.
[0035] Figure 4 It is a schematic diagram of the overall process of an embodiment of the present disclosure.
[0036] Figure 5 It is a schematic diagram of the functions of the data management platform of an embodiment of the present disclosure.
[0037] Figure 6 It is a program flow chart of an embodiment of the present disclosure.
[0038] Figure 7 It is a schematic diagram of the sensitive type identification process of an embodiment of the present disclosure.
[0039] Figure 8 It is a schematic diagram of the desensitization processing method of an embodiment of the present disclosure.
[0040] Figure 9 Schematic diagram of a sensitive data identification device according to an embodiment of the present disclosure.
[0041] Figure 10 Schematic diagram of a data management platform according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0042] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible embodiments consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
[0043] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit the disclosure. The singular forms "a", "the" and "the" used in this disclosure and the appended claims are also intended to include plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items. In addition, the term "at least one" herein means any combination of at least two of any one or more of a plurality of.
[0044] It should be understood that although the terms first, second, third, etc. may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining."
[0045] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present disclosure and to make the above-mentioned purposes, features and advantages of the embodiments of the present disclosure more obvious and easy to understand, the technical solutions in the embodiments of the present disclosure are further described in detail below with reference to the accompanying drawings.
[0046] Figure 1 Schematic diagram showing the application scenario of the embodiment of the present disclosure. Figure 1 As shown, business data is generated during business execution. This data can be written to a database for storage. For example, in the restaurant industry, business data may include data related to user ordering or membership registration, including but not limited to user account numbers, passwords, addresses, mobile phone numbers, email addresses, and bank card numbers. Operations and development personnel can log in to a data management platform. After successfully logging in, they establish a communication connection with the database through the platform and send database operations, such as data queries, to the database through this connection. After executing the query, the database returns the query results to the data management platform. To protect privacy, the data management platform can desensitize sensitive data in the query results and then return the desensitized query results to operations and development personnel. Desensitization refers to the processing of data to eliminate sensitive factors and ensure data security and reliability. To achieve this, the data management platform needs to accurately identify various categories of sensitive data. However, current identification methods have low accuracy for sensitive data, especially for sensitive data such as names and addresses, making it difficult to effectively identify them. This makes it difficult to effectively desensitize sensitive data.
[0047] Based on this, the present disclosure provides a method for identifying sensitive data. Figure 2 and Figure 7 , the method comprising:
[0048] Step S1: Obtain target data to be identified;
[0049] Step S2: Segment the target data to obtain multiple target character strings;
[0050] Step S3: Determine the target semantic element from the sensitive word dictionary, and match multiple target character strings with the sensitive character strings corresponding to the target semantic element in the sensitive word dictionary. The sensitive word dictionary includes multiple semantic elements and the sensitive character strings corresponding to each semantic element. The semantic element is used to represent the semantic category of the corresponding character string.
[0051] Step S4: Based on the matching results of the multiple target character strings, sensitive data whose semantic category corresponds to the target semantic element is identified from the target data.
[0052] The embodiment of the present disclosure records multiple semantic elements and the sensitive character strings corresponding to each semantic element by establishing a sensitive word dictionary. Since the semantic elements are used to represent the semantic categories of the corresponding character strings, the sensitive character strings of multiple semantic categories can be accurately recorded through the sensitive word dictionary. After acquiring the target data, the target data is divided into target character strings, and each target character string is matched with the sensitive character string corresponding to the target semantic element in the sensitive word dictionary, so that the sensitive data corresponding to the target semantic element can be accurately matched. In addition, the embodiment of the present disclosure divides the target data with larger granularity into target character strings with smaller granularity, thereby converting the recognition problem of the entire target data into the matching problem of multiple target character strings with the sensitive character strings in the sensitive word dictionary. Compared with the recognition process of target data with larger granularity, the matching process of target character strings with smaller granularity is less complex. Therefore, the above-mentioned recognition method can also effectively reduce the recognition complexity of sensitive data.
[0053] The following is a detailed description of the embodiments of the present disclosure.
[0054] In step S1, the target data to be identified can be data already stored in the database or data to be written to the database. In the former case, a database query instruction sent by a user (e.g., a developer or operator) can be obtained, and the target data can be retrieved from the database in response to the database query instruction. In the latter case, the target data to be written to the database can be obtained in response to a data write operation to the database.
[0055] In step S2, the target data may be segmented to obtain multiple target character strings, each of which includes one or more characters. The characters in each target character string may include, but are not limited to, at least one of Chinese characters, numbers, letters, and punctuation marks.
[0056] In some embodiments, the target data may be segmented to obtain multiple target character strings, each of which may be a word. For example, if the target data is "The weather is nice today," then through segmentation, three words, "today," "weather," and "nice," may be obtained, each of which may serve as a target character string.
[0057] In other embodiments, one or more keywords can be detected from the target data, and the target data can be segmented based on the detected keywords to obtain multiple target character strings. For example, the portion of the target data before the first detected keyword can be taken as a character string, the portion of the target data after the last detected keyword can be taken as another character string, and the portion of the target data between two adjacent detected keywords can also be taken as a character string. Keywords can be defined according to actual needs. For example, when the target data is an address, the keywords can include characters such as "province", "city", and "district" that represent administrative regions. Assuming that an address is AA Province, BB City, and CC District, the multiple target character strings segmented include "AA Province", "BB City", and "CC District".
[0058] In addition to the methods listed above, other methods can also be used to segment the target data, which are not listed here one by one.
[0059] In step S3, a sensitive word dictionary can be obtained. The sensitive word dictionary includes multiple semantic elements, wherein a semantic element refers to a semantic unit with complete semantics. A semantic element can represent the semantic category of a corresponding character string, for example, semantic categories such as name, address, telephone number, bank card number, and license plate number. In some embodiments, the same sensitive word dictionary includes multiple semantic elements. The various semantic elements in the sensitive word dictionary can be polled, and each time the poll is performed, the semantic element currently being polled is determined as the target semantic element. In other embodiments, different semantic elements are included in different sensitive word dictionaries. The sensitive word dictionary can be polled, and each time the poll is performed, the semantic element in the sensitive word dictionary currently being polled is determined as the target semantic element.
[0060] like Figure 3A As shown, the target semantic element may include a surname semantic element for representing a surname and a name semantic element for representing a person's name. In some embodiments, multiple sensitive word dictionaries corresponding to multiple semantic elements may be pre-established. For example, a sensitive word dictionary (called a surname dictionary) is established for the surname semantic element representing a surname, and another sensitive word dictionary (called a name dictionary) is established for the name semantic element representing a person's name. Of course, multiple semantic elements can also be recorded in the same sensitive word dictionary. Figure 3A The diagram shows how a surname dictionary and a name dictionary are created separately. The surname dictionary includes surnames such as "Zhao," "Qian," "Sun," and "Li," while the name dictionary includes names such as "Xiaoming," "Jianguo," and "Yangyang." It will be appreciated that in addition to the surnames and names listed above, the surname dictionary and name dictionary may also include other surnames and names, respectively.
[0061] like Figure 3B As shown, the target semantic elements may include semantic elements (called address semantic elements) used to represent geographical areas such as provinces, cities, districts, and streets. Correspondingly, the sensitive word dictionary including address semantic elements may be called a place name dictionary. Optionally, semantic elements may correspond to levels, and at least two of the multiple semantic elements correspond to different levels. For example, the level corresponding to a semantic element may be determined based on the level of the geographical area represented by the semantic element, and the subordinate relationship between semantic elements of different levels is determined based on the inclusion relationship between the geographical areas represented by the semantic elements. Among them, the level of the geographical area can be divided in advance. For example, assuming that geographical area B1 and geographical area B2 are two sub-areas in geographical area A, the level of geographical area A is higher than the level of geographical area B1 and geographical area B2, and geographical area B1 and geographical area B2 are subordinate to geographical area A. As Figure 3B As shown in the figure, the semantic elements in the place name dictionary include three levels: provincial, municipal, and district. Among them, provincial semantic elements correspond to provincial geographical areas, such as "Guangdong Province", "Jiangxi Province", and "Hunan Province"; municipal semantic elements correspond to municipal geographical areas, such as "Guangzhou City", "Shenzhen City", "Nanchang City", and "Changsha City"; district semantic elements correspond to district geographical areas, such as "Yuexiu District" and "Tianhe District". In addition, the municipal semantic elements "Guangzhou City" and "Shenzhen City" are subordinate to the provincial semantic element "Guangdong Province", the municipal semantic element "Nanchang City" is subordinate to the provincial semantic element "Jiangxi Province", the municipal semantic element "Changsha City" is subordinate to the provincial semantic element "Hunan Province", and the district semantic elements "Yuexiu District" and "Tianhe District" are subordinate to the municipal semantic element "Guangzhou City". It can be understood that in addition to the three levels of province, city, and district shown in the figure, the levels corresponding to semantic elements can also include other levels according to actual needs, such as counties and towns, which are not limited here.
[0062] In other examples, the sensitive word dictionary may also include other semantic elements, for example, semantic elements representing school, class, student ID and other student information, and elements representing birth date such as year, month and day, which are not listed here one by one.
[0063] In addition to semantic elements, the sensitive word dictionary also includes sensitive strings corresponding to each semantic element. Each sensitive string includes one or more characters. Furthermore, based on the number of bits of characters in the sensitive string, the sensitive strings can be divided into multiple groups, and the number of bits of sensitive strings in different groups is different. The number of bits of characters in a sensitive string refers to the number of characters included in the sensitive string. For example, see Figure 3AIn the case where the semantic elements include the semantic elements of names, the sensitive character strings corresponding to the semantic elements of names can be divided into single-character name strings (single-character names for short) and double-character name strings (double-character names for short), wherein the number of character bits of the single-character name string is 1, and the number of character bits of the double-character name string is 2. For another example, in the case where the semantic elements include the semantic elements for representing cities, the sensitive character strings corresponding to the semantic elements can be divided into character strings with a number of character bits of 2 (such as Guangzhou, Nanjing, etc.), character strings with a number of character bits of 3 (such as Harbin, Shijiazhuang, etc.), and character strings with a number of character bits of 4 (such as Hohhot), etc. Different sensitive word dictionaries can be established for sensitive character strings of different groups. Taking the name dictionary as an example, and assuming that the grouping method is to group based on the number of character bits of the sensitive string, a single-character name dictionary and a double-character name dictionary can be established respectively, wherein the single-character name dictionary is used to store names with a number of character bits of 1, and the double-character name dictionary is used to store names with a number of character bits of 2. Sensitive character strings of various character digits may also be constructed into the same sensitive word dictionary, which is not limited in the present disclosure.
[0064] In addition to grouping sensitive strings based on the number of character digits, sensitive strings can also be grouped based on the first letter of the sensitive string, or based on the number of strokes of the sensitive string, or other methods can be used to group sensitive strings based on actual needs.
[0065] Each target character string obtained in step S2 may be matched with a sensitive character string corresponding to a target semantic element in the sensitive word dictionary.
[0066] In the case where the target semantic element includes a surname semantic element for representing a surname and a name semantic element for representing a name, the first character string among the multiple target character strings can be matched with the sensitive character string corresponding to the surname semantic element in the sensitive word dictionary. The sensitive word dictionary may include at least one sensitive character string corresponding to the surname semantic element. When matching the first character string, the first character string can be matched with each sensitive character string corresponding to the surname semantic element in the sensitive word dictionary. In an embodiment where the sensitive character strings are grouped, the target group to which the first character string belongs can also be determined first, and then the first character string can be matched with the sensitive character strings belonging to the target group in the sensitive word dictionary. The grouping method of the first character string is similar to the grouping method of the sensitive character string. For example, the grouping can be based on the number of characters, the first letter or the number of strokes of the first character string. The specific grouping method is detailed in the aforementioned embodiment and will not be repeated here. By grouping the first character string and the sensitive character string, there is no need to match the first character string with all sensitive character strings in the sensitive word dictionary, thereby improving the matching efficiency of the first character string.
[0067] If there is a sensitive string in the sensitive word dictionary that corresponds to the surname semantic element and is the same as the first string, it indicates that the first string matches successfully; otherwise, it indicates that the first string fails to match. Assume that the sensitive word dictionary includes Figure 3A the surname dictionary shown in the figure. If the first string is "Wu", then the first string is the same as the surname "Wu" in the surname dictionary that corresponds to the surname semantic element, so it can be determined that the first string matches successfully. If the first string is "Pen", then the first string is not the same as any surname in the surname dictionary, so it can be determined that the first string fails to match.
[0068] If the first string matches successfully, the second string after the first string in the multiple target strings can be matched with the sensitive strings in the sensitive word dictionary that correspond to the personal name semantic element. Among them, the second string can be the next string adjacent to the first string in the multiple target strings. If there is a sensitive string in the sensitive word dictionary that corresponds to the personal name semantic element and is the same as the second string, it indicates that the second string matches successfully; otherwise, it indicates that the second string fails to match. Assume that the sensitive word dictionary includes Figure 3A the personal name dictionary shown in the figure. If the second string is "Xiaoming", then the second string is the same as the personal name "Xiaoming" in the personal name dictionary that corresponds to the personal name semantic element, so it can be determined that the second string matches successfully. If the second string is "table", then the second string is not the same as any personal name in the personal name dictionary, so it can be determined that the second string fails to match.
[0069] Furthermore, if the first string matches successfully, the character digit verification can be performed on the second string to determine the target character digit of the second string. Then, the second string can be matched with the sensitive strings that correspond to the personal name semantic element and have the target character digit. For example, assume that the sensitive strings that correspond to the personal name semantic element include personal names with 1 character digit (i.e., single-character personal names) and personal names with 2 character digits (i.e., double-character personal names). When the target character digit of the second string is 1, the second string can be matched with the single-character personal names; when the target digit of the second string is 2, the second string can be matched with the double-character personal names. Furthermore, if the sensitive strings that correspond to the personal name semantic element and have the target character digit are not obtained, it can be directly determined that the second string fails to match. In this way, on the one hand, when the character digits do not match, there is no need to match the character content, which improves the matching efficiency of the second string; on the other hand, only the sensitive strings with the corresponding character digits need to be matched, without matching all the sensitive strings, reducing the amount of data in the matching process and further improving the matching efficiency of the second string.
[0070] In an embodiment where the target semantic element includes an address semantic element for representing a geographic area, the target level of the geographic area represented by the target string can be determined, the target semantic element corresponding to the target level in the sensitive word dictionary can be obtained, and at least one target sensitive string corresponding to the target semantic element of the target level in the sensitive word dictionary can be obtained, and the target string can be matched with each target sensitive string respectively.
[0071] The target level can be determined based on the keywords related to the target level included in the target string. For example, if the target string includes the keyword "province", it means the target level is provincial level; if the target string includes the keyword "city", it means the target level is city level. When matching the target string with the target sensitive string, if the characters in the target string correspond to the characters in the sensitive string one by one, it can be determined that the target string and the sensitive string match successfully; otherwise, it is determined that the target string and the sensitive string match failed. Figure 3B Taking the illustrated embodiment as an example, assuming the target string is "Guangdong Province," there is a one-to-one correspondence between the target string and the sensitive string corresponding to the provincial semantic elements in the place name dictionary. Therefore, the target string and the sensitive string are determined to be matched successfully. Assuming the target string is "Guangnan Province," the target string and the sensitive string corresponding to each provincial semantic element in the place name dictionary do not meet the one-to-one correspondence condition. Therefore, the target string and the sensitive string match fail.
[0072] In step S4, sensitive data can be identified from the target data based on the matching results of multiple target character strings. For example, in an embodiment of name matching, if the second character string successfully matches the sensitive character string corresponding to the semantic element of a person's name in the sensitive word dictionary, it is determined that the target data includes sensitive data representing the name; if the second character string fails to match the sensitive character string corresponding to the semantic element of a person's name in the sensitive word dictionary, it is determined that the target data does not include sensitive data representing the name. For another example, in an embodiment of place name matching, if there is a target sensitive character string that successfully matches the target character string, it is determined that the target data includes sensitive data representing the address; if there is no target sensitive character string that successfully matches the target character string, it is determined that the target data does not include sensitive data representing the address.
[0073] In some embodiments, characters in the target string may fail to match successfully with the sensitive strings in the sensitive word dictionary due to input errors or other reasons. For example, the target string should originally be "Changsha City", but is wrongly input as "Changsha City", or the target string should originally be "Tianhe District", but is wrongly input as "Dahe District". In this way, when matching the target string with the sensitive string, it will be determined that the characters in the target string and the characters in the sensitive string cannot correspond one by one, thus misjudging that the target string does not match the sensitive string.
[0074] To solve the above problem, if there is no target sensitive string that matches the target string successfully, the first target sensitive string that partially matches the target string in each target sensitive string can be obtained, the third character in the target string can be obtained, and the fourth character in the first target sensitive string can be obtained. Among them, the third character and the fourth character are the characters that fail to match. If the similarity between the third character and the fourth character is greater than the preset similarity threshold, it is determined that the target string matches the first target sensitive string successfully, and it is determined that the target data includes sensitive data representing an address.
[0075] Among them, the target sensitive string partially matching the target string means that at least one character in the target sensitive string matches at least one character in the target string, and at least one character in the target sensitive string fails to match at least one character in the target string. For example, if the target sensitive string is "Future Mansion" and the target string is "Future Mansion", then the two characters "Lai" and "Mansion" in the target sensitive string and the target string match successfully, and the "Wei" in the target sensitive string and the "Mo" in the target string fail to match. Therefore, the target sensitive string "Future Mansion" partially matches the target string "Future Mansion". The character in the target string that fails to match the target sensitive string is called the third character. In the above example, "Mo" is the third character. The character in the target sensitive string that fails to match the target string is called the fourth character. In the above example, "Wei" is the fourth character. The characters "Wei" and "Mo" can be matched. If their similarity is greater than the preset similarity threshold, it is determined that the target sensitive string "Future Mansion" matches the target string "Future Mansion" successfully.
[0076] In the embodiments of the present disclosure, the target string and the target sensitive string are further split into finer-grained characters for character matching. For the characters that fail to match in the target string and the first target sensitive string, it is determined whether the target string matches the first target sensitive string successfully according to their similarity. In this way, the situation where the characters in the target string and the target sensitive string cannot correspond one by one due to character input errors or other reasons, resulting in misjudging that the target string does not match the target sensitive string, is reduced.
[0077] Among them, the similarity between the third character and the fourth character may include at least one of the glyph similarity and the pronunciation similarity. The glyph similarity is used to represent the character structure feature of the character. When manually inputting the target data, the input person may misread one character as another character with a similar character structure due to visual observation errors, resulting in input errors. For example, inputting "未" as "末". The pronunciation similarity is used to represent the pronunciation feature of the character. When inputting the target data through the pinyin input method, the input person may input a certain character as another character with the same pronunciation as that character, resulting in input errors. For example, inputting "柳" as "留". By discriminating the glyph similarity and the pronunciation similarity, the input errors caused by the above situations can be effectively reduced, and the matching accuracy of the string can be improved.
[0078] In some embodiments, the pronunciation similarity and the glyph similarity can be weighted to obtain the similarity between the third character and the fourth character. Among them, the weights corresponding to the pronunciation similarity and the glyph similarity can both be real numbers greater than or equal to 0 and less than or equal to 1. When the weight corresponding to the pronunciation similarity is 0, it means that only the glyph similarity is used as the similarity between the third character and the fourth character; when the weight corresponding to the glyph similarity is 0, it means that only the pronunciation similarity is used as the similarity between the third character and the fourth character. The specific methods for obtaining the glyph similarity and the pronunciation similarity are respectively illustrated by examples below.
[0079] Glyph similarity
[0080] The respective first character components forming the third character, the first character structure of the third character, the respective second character components forming the fourth character, and the second character structure of the fourth character can be obtained, and based on the respective first character components, the first character structure, the respective second character components, and the second character structure, the glyph similarity between the third character and the fourth character can be determined.
[0081] Among them, the character component is the smallest separable element forming the character. The character component can be a complete and inseparable character. A character component being separable means that a character component can be split into two or more characters, and a character component being inseparable means that the character component cannot be split into two or more characters. For example, assuming a character is "尖", then this character can be split into two characters "大" and "小", and both the characters "大" and "小" cannot be further split into two or more characters. Therefore, the character components forming the character "尖" include "大" and "小". For the convenience of processing, each component can be numbered. Assuming a character is denoted as A, the numbers of the respective character components forming this character are denoted as w1, w2,..., w n, then this character can be denoted as A = {w1, w2,..., w n}.
[0082] Since the character components cannot be split, thus, the character components can also be called atomic components, and a character composed of multiple atomic components can also be called a composite component.
[0083] The character structure is used to represent the relative positional relationship between each character component in a character, including but not limited to left - right structure, up - down structure, full - enclosure structure, semi - enclosure structure, single - character structure, etc. The left - right structure means that each character component forming the character is arranged in a left - to - right positional relationship. For example, the character components forming the character "school" include "wood" and "jiao", and the character components "wood" and "jiao" are arranged from left to right. Therefore, the character structure of the character "school" is a left - right structure. The up - down relationship means that each character component forming the character is arranged in an up - to - down positional relationship. For example, the character components forming the character "sharp" include "big" and "small", and the character components "big" and "small" are arranged from up to down. Therefore, the character structure of the character "sharp" is an up - down structure. The full - enclosure structure means that a certain character component forming the character is completely enclosed by another character component. For example, the character components forming the character "country" include "mouth" and "jade", and the character component "jade" is completely enclosed by the character component "mouth". Therefore, the character structure of the character "country" is a full - enclosure structure. The semi - enclosure structure means that a certain character component forming the character is partially enclosed by another character component. For example, the character components forming the character "flash" include "door" and "person", and the character component "person" is partially enclosed by the character component "door". Therefore, the character structure of the character "flash" is a semi - enclosure structure. The single - character structure means that the character is composed of a single character component. For example, the characters "wood", "jiao", "big", "small".
[0084] After determining the character components and the character structure of a character, the character can be regarded as a mathematical expression with the character structure as the operation operator and the character components as the operation objects. This mathematical expression is called a character expression. The Chinese character structure can be segmented by using a recursive binary method, and finally a Chinese character expression can be obtained. Assume that the operation operators corresponding to the character structure are denoted as S1, S2,..., S x , then the character expression of character A can be denoted as A = {S1w1w2, S2w3w4,...}.
[0085] Table 1 shows the character structures and their corresponding operators in some embodiments. On this basis, taking the character "sharp" as an example, assume that the numbers of the character components "big" and "small" of the character "sharp" are w1 and w2 respectively. Then the character expression of the character "sharp" can be denoted as A = { / w1w2}.
[0086] Table 1 Character Structures and Their Corresponding Operators
[0087]
[0088] It can be understood that, in addition to the above-listed cases, the types of the above character structures and their corresponding operators may also include other types and operators, which will not be listed one by one here.
[0089] Character components can be used to determine the components of a character, and character structures can be used to determine the arrangement of the components in a character. Therefore, the similarity of characters can be determined based on character components and character structures together. Specifically, based on the first character structure and the second character structure, the similarity between the character structures of the third character and the fourth character can be determined, and based on each first character component and each second character component, the similarity between the character components of the third character and the fourth character can be determined. Then, the similarity between the character structures and the similarity between the character components are weighted to obtain the glyph similarity between the third character and the fourth character.
[0090] In an embodiment where the similarity between the third character and the fourth character includes the glyph similarity between the third character and the fourth character, the glyph similarity can be determined based on the following method: Obtain the first prefix component and the first suffix component of the third character, and obtain the second prefix component and the second suffix component of the fourth character, and determine the similarity between the first prefix component and the second prefix component, and the similarity between the first suffix component and the second suffix component. Then, the similarity between the character structures, the similarity between the first prefix component and the second prefix component, and the similarity between the first suffix component and the second suffix component are weighted to obtain the glyph similarity between the third character and the fourth character.
[0091] Among them, the prefix component and the suffix component can be determined according to the positions of each character component. For example, the character component closest to the upper left vertex of the character is determined as the prefix component, and the character component closest to the lower right vertex of the character is determined as the suffix component. Alternatively, the prefix component and the suffix component can be determined according to the glyph structure of the character. For example, for a character with a left-right structure, its prefix component is the leftmost character component, and its suffix component is the rightmost character component. Taking the character "chi" as an example, its prefix component is "horse", and its suffix component is "also". For a character with an up-down structure, its prefix component is the uppermost character component, and its suffix component is the lowermost character component. Taking the character "jian" as an example, its prefix component is "small", and its suffix component is "big".
[0092] The similarity between character structures is used to indicate whether the character structures are the same. When the character structures of two characters are the same, the similarity between the character structures of these two characters can be recorded as 1; otherwise, the similarity between the character structures of these two characters can be recorded as 0. Similarly, if two character components are the same, the similarity between these two character components can be recorded as 1; otherwise, the similarity between these two character components can be recorded as 0.
[0093] In some embodiments, the first weight can be determined based on the proportion of the number of strokes of the first prefix component in the number of strokes of the third character and the proportion of the number of components of the first prefix component in the number of components of the third character, and the similarity between the first prefix component and the second prefix component can be weighted based on the first weight to obtain the first weighted similarity. Also, the second weight can be determined based on the proportion of the number of strokes of the first suffix component in the number of strokes of the third character and the proportion of the number of components of the first suffix component in the number of components of the third character, and the similarity between the first suffix component and the second suffix component can be weighted based on the second weight to obtain the second weighted similarity. Then, based on the similarity between the character structures, the sum of the first weighted similarity and the second weighted similarity, the glyph similarity between the first character and the second character is determined.
[0094] Assume that the third character and the fourth character are "chi" and "chi" respectively. Then the first prefix component is "horse", the second prefix component is "bow", the first suffix component and the second suffix component are both "ye", and the character structures of the third character and the fourth character are both left-right structures. The number of strokes of the first prefix component, the second prefix component, the first suffix component and the second suffix component is all 3, the number of strokes of the third character and the fourth character is all 6, the number of components of the first prefix component, the second prefix component, the first suffix component and the second suffix component is all 1, and the number of components of the third character and the fourth character is all 2. Therefore, both the first weight and the second weight are 1.
[0095] In some embodiments, a glyph similarity model is used to determine the glyph similarity. This model introduces a similarity calculation function and a similarity matrix to quantify the similarity between two characters. The similarity calculation involves information such as the structural constraint function of character components, the number of strokes, and the number of components. Among them, to quantify the similarity between two Chinese characters, f(A1,A2) is introduced to represent the similarity calculation function. First, the similarity between the first prefix component and the second prefix component, and the similarity between the first suffix component and the second suffix component can be determined, and then the above two similarities are weighted to obtain the weighted similarity. Then, based on the similarity between the character structures of the third character and the fourth character, the weighted similarity is weighted again to obtain the glyph similarity between the third character and the fourth character. Its specific representation form is as follows:
[0096]
[0097]
[0098]
[0099] Among them, A1 and A2 respectively represent the third character and the fourth character, Q represents the similarity between the character structures of the third character and the fourth character, α represents the first weight, β represents the second weight, and w 11 、w 12 、w 21 and w 22 respectively represent the first prefix component, the first suffix component, the second prefix component, and the second suffix component.
[0100] Continuing with the previous example, the character structures of the characters "驰" and "弛" are the same, both being left-right structures. Therefore, Q(A1,A2) is 1. The first prefix components and the second prefix components are different. Therefore, f(w 11 ,w 21 ) is 0. The first suffix components and the second suffix components are the same. Therefore, f(w 12 ,w 22 ) is 1. Substituting the above values into the similarity calculation function f(A1,A2), we get f(A1,A2) = 0.5.
[0101] The value range of this formula is between [0,1]. When f(A1,A2) = 1, it means the two characters are exactly the same; when f(A1,A2) = 0, it means the two characters have no similar parts; when f(A1,A2) is greater than a preset similarity threshold (such as 0.8), it is determined that the two characters are very similar, and this similarity threshold can be flexibly adjusted according to needs.
[0102] Pronunciation similarity
[0103] The pronunciation similarity of two characters can be determined based on the similarity between the pinyin of these two characters. If the pinyin of two characters is the same, it is determined that the pronunciation similarity of these two characters is 1; otherwise, it is determined that the pronunciation similarity of these two characters is 0. For example, the pinyin of the characters "驰" and "吃" is both "chi", so the pronunciation similarity of the characters "驰" and "吃" is 1. The pinyin of the characters "驰" and "驶" is "chi" and "shi" respectively. Therefore, the pronunciation similarity of the characters "驰" and "驶" is 0.
[0104] See Figure 7In addition to verifying whether the target data includes sensitive data representing a name and address, it is also possible to verify whether the target data includes sensitive data representing a bank card number. Specifically, if the target data includes a numeric string, a bank card number verification algorithm (e.g., the Luhn verification algorithm) can be used to verify the numeric string. If the verification is successful, it is determined that the target data includes sensitive data representing a bank card number. Otherwise, it is determined that the target data does not include sensitive data representing a bank card number. The specific method of the bank card number verification algorithm in some embodiments is as follows: the numeric string to be verified is read from right to left, digit by digit, with the digits in the even positions unchanged and the digits in the odd positions multiplied by 2. If the result of multiplying a number by 2 is greater than or equal to 10, the units digit and tens digit of this result are added together to obtain the new value of the number. The new values of all the digits are added together to obtain a sum. If this sum is divisible by 10, the verification is successful; otherwise, the verification fails. By using the bank card number verification algorithm to verify the numeric string, it is possible to quickly verify whether the numeric string is a valid bank card number without having to decrypt the numeric string or query a database.
[0105] Continue to see Figure 7 , you can also verify whether the target data contains sensitive data representing a mobile phone number. Specifically, if the target data contains a numeric string, you can match the numeric string based on a regular expression corresponding to the mobile phone number. The regular expression for the mobile phone number is determined based on the valid number segment of the mobile phone number prefix and the number of valid digits in the mobile phone number. If a match is successful, it is determined that the target data contains sensitive data representing a mobile phone number. Otherwise, it is determined that the target data does not contain sensitive data representing a mobile phone number.
[0106] Taking Chinese mobile phone numbers as an example, the prefix of a mobile phone number is the first three digits of the number. The valid number range is generally "137," "188," "157," and so on. The number of valid digits in a mobile phone number is 11. Therefore, the regular expression corresponding to the mobile phone number can include the valid number range of the first three digits of the mobile phone number and the number of valid digits of the mobile phone number. If the prefix of a string of digits is consistent with the valid number range, and the number of digits in the string of digits is consistent with the valid number range, the match is determined to be successful. If the prefix of the string of digits is inconsistent with the valid number range, or the number of digits in the string of digits is inconsistent with the valid number range, the match is determined to be unsuccessful.
[0107] Continue to see Figure 7, it can also verify whether the target data includes sensitive data representing an email address. Specifically, the target data can be matched against a regular expression corresponding to an email address, where the regular expression includes a valid domain name and a separator used to separate the username and domain name. If a match is successful, it is determined that the target data includes sensitive data representing an email address. Otherwise, it is determined that the target data does not include sensitive data representing an email address.
[0108] Valid domain names include, but are not limited to, gmail.com, 163.com, and qq.com. Usernames can be customized, and the delimiter between the username and domain name is typically @. If the target data includes a delimiter and the domain name matches a valid domain name, the match is considered successful. If the target data does not include a delimiter, or the domain name does not match a valid domain name, the match is considered unsuccessful.
[0109] After determining that the target data includes sensitive data, the sensitive data can be desensitized based on its category, thereby protecting personal privacy and improving data security. Different categories of sensitive data can use the same or different desensitization methods. Desensitization methods include but are not limited to at least one of the following methods:
[0110] Overwrite: Overwrites sensitive data with specified characters or strings, such as "*" or "xxx". For example, if the sensitive data is the name "Zhang San", you can replace it with "**".
[0111] Random replacement: Sensitive data is randomly replaced with other data that meets the rules, such as randomly generating a new mobile phone number to replace it. For example, if the original mobile phone number is 13912345678, a new mobile phone number such as 13998765432 can be randomly generated.
[0112] Mapping: Map sensitive data into another set of data, such as mapping a mobile phone number into a randomly generated new number. For example, each digit except the prefix can be mapped to the value obtained by adding 1 to the number. Assuming the original mobile phone number is 13912345678, the new number generated after mapping is 13923456789.
[0113] Encryption: Encrypt sensitive data using symmetric and asymmetric encryption methods, such as Advanced Encryption Standard (AES) encryption of bank card numbers, and then save the encrypted data.
[0114] Figure 8Examples of various desensitization methods are shown in more detail. Among them, coverage can be covering the prefix or suffix of sensitive data, or hiding the middle or full text of sensitive data. Random replacement can be randomly generating new data, randomly replacing bits, randomly replacing desensitization templates, or encrypting them. Mapping can include but is not limited to hash mapping, data mapping, dictionary mapping, encryption mapping, etc. Encryption can include but is not limited to symmetric encryption, asymmetric encryption, hash encryption, obfuscated encryption, etc. In addition to the various desensitization processing methods shown in the figure, other desensitization processing methods can also be used, which will not be listed here one by one.
[0115] A mapping relationship between the type of sensitive data and the desensitizing processing method can be established in advance. After the sensitive data is identified, the desensitizing processing method corresponding to the type of sensitive data is searched based on the pre-established mapping relationship, and the sensitive data is desensitized based on the desensitizing processing method found.
[0116] In some embodiments, the target data is stored in a target database. The user can perform operations such as adding, deleting, checking, and modifying the database through operation statements on the database. However, some database operations will cause the content of the target data stored in the database to change. In order to avoid the content of the target data from being changed and to improve data security, it is necessary to filter out these database operations that will cause the data content to change. Therefore, after obtaining the operation statement on the target database, the key points in the operation statement can be detected. If it is detected that the operation statement includes keywords in a disabled list of preset keywords, the operation statement is filtered. Among them, the keywords in the disabled list of keywords are keywords corresponding to the operation statement that causes the content of the target data in the database to change, for example, delete keywords (DELETE), insert keywords (INSERT), update keywords (UPDATE), etc.
[0117] If the operation statement does not contain a keyword from a preset keyword ban list, the operation statement can be sent to the target database based on a pre-established database connection with the target database, causing the target database to execute the operation statement and return an execution result. For example, the operation statement can be a query statement, and the target database can execute the query statement to search for target data that meets the conditions and return the searched target data.
[0118] Among them, the database connection is established based on the following method: obtaining the database type of the target database selected by the user, obtaining the target connection information corresponding to the database type of the target database from the database connection pool, the database connection pool is used to maintain the connection information corresponding to multiple database types, and establishing a connection with the target database based on the target connection information. The database type may include but is not limited to Mysql, Oracle, SqlServer, PostgreSql, TiDB, MongoDB and other types. The connection information of databases of various database types can be stored in the database connection pool in advance. The connection information includes the host name of the database server, Internet Protocol (IP) address, port number, database user name, password, database name, etc. The user can select the database type of the target database on the front page and send the selection information including the database type to the database connection pool. The database connection pool can select the connection information corresponding to the database type of the target database from the connection information of each database and establish a connection with the target database based on the selected connection information.
[0119] Since databases of different database types are often used to store different types of target data, and different types of target data can adopt different data desensitizing processing methods, it is also possible to pre-establish a mapping relationship between the database type and the desensitizing processing method, and based on the mapping relationship, determine the target desensitizing processing method corresponding to the database type of the target database, and after processing the data in the target database based on the target desensitizing processing method, return the execution result of the operation statement.
[0120] The aforementioned masking process can be dynamic masking. Dynamic masking dynamically masks sensitive data while the database is running to protect data privacy and security. Unlike static masking, dynamic masking allows for real-time masking of data as needed, eliminating the need to mask all data at the time of storage. Dynamic masking can be performed during data transmission or on specific nodes in the database, ensuring that only authorized users can view the original data value.
[0121] In some embodiments, a desensitization processing template can also be customized, which includes the data type of the sensitive data that needs to be desensitized, the desensitization processing method and / or specific parameters in the desensitization processing method. The data type of sensitive data can be common sensitive data types such as name, address, mobile phone number, or other customized sensitive data types. The desensitization processing method can be encryption, overwriting, mapping, etc. The specific parameters in the desensitization processing method can be the data bits that need to be processed in the sensitive data, the specific parameter values in the encryption algorithm, the mapping rules in the mapping algorithm, etc.
[0122] The overall process of the embodiment of the present disclosure is as follows: Figure 4 As shown in the figure, users can access the database, select or create a new database connection, and perform database queries based on that connection. Taking the restaurant industry as an example, the data being queried includes, but is not limited to, order data, delivery data, and customer service data. The database can execute query statements, query the data within the database, and then return the query results. After establishing a connection with the database, the database can maintain effective responsiveness for a certain period of time, meaning it can accept and process user requests and return results in a timely manner.
[0123] In related technologies, in order to ensure data security, users usually need to log in to the bastion host, which makes the user operation complicated and tedious. Figure 5 The disclosed embodiments can integrate various database connection types, sensitive data identification, sensitive data desensitization, and database operation statement filtering functions into a data management platform. The data management platform can provide users with an operation page where they can directly enter database operation statements. The data management platform will filter the operation statements, execute the corresponding database operations in response to the filtered operation statements, obtain the operation results, and desensitize the sensitive data in the operation results before returning them to the user. In addition, users can customize the desensitization processing template as needed.
[0124] Compared with existing database connection tools, the data management platform of the disclosed embodiment can quickly connect to various types of databases, accurately identify various types of sensitive data, and use corresponding desensitizing algorithms to desensitize sensitive data according to user needs. In addition, it can also filter out operation statements that may cause changes to the data in the database. In the process of sensitive data identification, for address sensitive data, related technologies may not be able to identify it due to typos and similar characters. The disclosed embodiment adopts a character similarity algorithm to improve the accuracy of character sensitive data identification. In summary, the data management platform of the disclosed embodiment has richer functions and stronger data security protection capabilities, can effectively protect the security of sensitive data, and meet the data desensitization needs in different scenarios.
[0125] The overall workflow of the data management platform is as follows: Figure 6As shown, first, the data management platform can receive an operation statement for the database, which can be a Structured Query Language (SQL) statement. Then, the SQL statement can be intercepted and filtered based on the keywords in the SQL statement. If the SQL statement includes keywords in the banned list of keywords, the SQL statement is a high-risk SQL statement and can be intercepted and filtered. If the SQL statement does not include keywords in the banned list of keywords, the SQL statement is not a high-risk SQL statement. The SQL statement can be pre-compiled, and then database driver matching and creation (i.e., determining the type of database to be connected) are performed, and a connection is established with the database, and the SQL statement is sent to the database for execution. For example, if the SQL statement is a query statement, the database performs a data query. The queried data can be used to identify sensitive data. If sensitive data is identified, the desensitization algorithm is matched according to the type of sensitive data, and data desensitization processing is performed, and then the execution result is returned. If sensitive data is not identified, the execution result is directly returned.
[0126] The present disclosure also provides a device for identifying sensitive data. Figure 9 , the device comprises:
[0127] The data acquisition module 11 is used to acquire target data to be identified;
[0128] A segmentation module 12 is used to segment the target data to obtain multiple target character strings;
[0129] a matching module 13, configured to determine a target semantic element from a sensitive word dictionary and match the multiple target character strings with sensitive character strings corresponding to the target semantic element in the sensitive word dictionary, wherein the sensitive word dictionary includes multiple semantic elements and sensitive character strings corresponding to each semantic element, wherein the semantic element is used to represent the semantic category of the corresponding character string;
[0130] The identification module 14 is configured to identify, from the target data, sensitive data whose semantic category corresponds to the target semantic element based on the matching results of the multiple target character strings.
[0131] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments. For the sake of brevity, it will not be repeated here.
[0132] An embodiment of the present disclosure further provides a data management platform, which includes at least a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in any of the aforementioned embodiments when executing the program.
[0133] Figure 10 FIG2 shows a more specific hardware structure diagram of a data management platform provided by an embodiment of the present disclosure. The data management platform may include: a processor 21, a memory 22, an input / output interface 23, a communication interface 24, and a bus 25. The processor 21, the memory 22, the input / output interface 23, and the communication interface 24 are connected to each other within the data management platform via the bus 25.
[0134] The processor 21 can be implemented using a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present disclosure. The processor 21 can also include a graphics card, which can be an Nvidia Titan X graphics card or an 1080Ti graphics card.
[0135] The memory 22 can be implemented in the form of a read-only memory (ROM), a random access memory (RAM), a static storage device, a dynamic storage device, etc. The memory 22 can store an operating system and other application programs. When the technical solutions provided by the embodiments of the present disclosure are implemented through software or firmware, the relevant program codes are stored in the memory 22 and are called and executed by the processor 21.
[0136] The input / output interface 23 is used to connect to input / output modules to enable information input and output. The input / output modules can be configured as components within the device (not shown) or can be externally connected to the device to provide corresponding functions. Input devices may include a keyboard, mouse, touch screen, microphone, various sensors, etc., and output devices may include a display, speaker, vibrator, indicator light, etc.
[0137] The communication interface 24 is used to connect to a communication module (not shown) to enable communication between the data management platform and other platforms. The communication module can communicate via a wired method (such as USB, network cable, etc.) or a wireless method (such as mobile network, WiFi, Bluetooth, etc.).
[0138] The bus 25 comprises a pathway for transmitting information between the various components of the data management platform (eg, the processor 21 , the memory 22 , the input / output interface 23 , and the communication interface 24 ).
[0139] It should be noted that although the above data management platform only shows the processor 21, memory 22, input / output interface 23, communication interface 24, and bus 25, in a specific implementation, the data management platform may also include other components necessary for normal operation. In addition, those skilled in the art will understand that the above data management platform may only include the components necessary to implement the embodiments of the present disclosure, and does not necessarily include all the components shown in the figure.
[0140] An embodiment of the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, which implements the method described in any of the aforementioned embodiments when the program is executed by a processor.
[0141] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a data management platform. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.
[0142] Each embodiment in the present disclosure is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described above is merely illustrative, wherein the modules described as separate components may or may not be physically separated, and when implementing the embodiment of the present disclosure, the functions of each module can be implemented in the same one or more software and / or hardware. It is also possible to select some or all of the modules according to actual needs to achieve the purpose of the embodiment. A person of ordinary skill in the art can understand and implement it without paying any creative work.
[0143] The above is only a specific implementation of the embodiment of the present disclosure. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the embodiment of the present disclosure. These improvements and modifications should also be regarded as the scope of protection of the embodiment of the present disclosure.
Claims
1. A method for identifying sensitive data, characterized in that: The method comprises: Obtain target data to be identified; Segmenting the target data to obtain multiple target character strings; Determining a target semantic element from a sensitive word dictionary, and matching the multiple target character strings with sensitive character strings corresponding to the target semantic element in the sensitive word dictionary, wherein the sensitive word dictionary includes multiple semantic elements and sensitive character strings corresponding to each semantic element, wherein the semantic element is used to represent the semantic category of the corresponding character string; Based on the matching results of the multiple target character strings, sensitive data whose semantic category corresponds to the target semantic element is identified from the target data.
2. The method according to claim 1, characterized in that The target semantic elements include a surname semantic element for representing a surname and a name semantic element for representing a person's name; and matching the multiple target character strings with sensitive character strings corresponding to the target semantic elements in a sensitive word dictionary, respectively, includes: Matching a first character string among the multiple target character strings with a sensitive character string corresponding to the surname semantic element in the sensitive word dictionary; If the match is successful, matching a second character string located after the first character string in the multiple target character strings with a sensitive character string corresponding to the semantic element of the name in the sensitive word dictionary; The step of identifying, from the target data, sensitive data whose semantic category corresponds to the target semantic element based on the matching results of the multiple target character strings includes: If the second character string successfully matches the sensitive character string corresponding to the semantic element of the name in the sensitive word dictionary, it is determined that the target data includes sensitive data representing the name.
3. The method according to claim 2, characterized in that If the match is successful, matching a second character string located after the first character string in the multiple target character strings with a sensitive character string corresponding to the semantic element of the name in the sensitive word dictionary includes: If the match is successful, performing a character number check on the second character string to determine a target character number of the second character string; The second character string is matched with a sensitive character string corresponding to the semantic element of the name and having the target number of characters.
4. The method according to claim 1, wherein The target semantic element includes an address semantic element for representing a geographical area, at least two semantic elements correspond to different levels, and the level corresponding to the semantic element is determined based on the level of the geographical area represented by the semantic element; and matching the multiple target character strings with the sensitive character strings corresponding to the target semantic elements in the sensitive word dictionary respectively includes: determining a target level for the geographic area represented by the target string; Obtaining a target semantic element corresponding to the target level in the sensitive word dictionary, and obtaining at least one target sensitive character string corresponding to the target semantic element of the target level in the sensitive word dictionary; Match the target string with each target sensitive string respectively; The step of identifying, from the target data, sensitive data whose semantic category corresponds to the target semantic element based on the matching results of the multiple target character strings includes: If there is a target sensitive character string that successfully matches the target character string, it is determined that the target data includes sensitive data representing an address.
5. The method according to claim 1, wherein The target semantic element includes an address; and identifying, from the target data, sensitive data whose semantic category corresponds to the target semantic element based on the matching results of the multiple target character strings, includes: If the sensitive character strings corresponding to the target semantic element in the sensitive word dictionary do not include a target sensitive character string that successfully matches the target character string, obtaining a first target sensitive character string that successfully partially matches the target character string among the target sensitive character strings; Obtaining the third character in the target string and obtaining the fourth character in the first target sensitive string, wherein the third character and the fourth character are characters for which a match fails; If the similarity between the third character and the fourth character is greater than a preset similarity threshold, it is determined that the target character string successfully matches the first target sensitive character string, and it is determined that the target data includes sensitive data representing an address.
6. The method according to claim 5, characterized in that The method further comprises: Obtaining pronunciation similarity and glyph similarity between the third character and the fourth character; The pronunciation similarity and the character shape similarity are weighted to obtain the similarity between the third character and the fourth character.
7. The method according to claim 5, characterized in that The similarity between the third character and the fourth character includes a glyph similarity between the third character and the fourth character; the method further includes: Obtaining the first character components constituting the third character, the first character structure of the third character, the second character components constituting the fourth character, and the second character structure of the fourth character; the character structure is used to represent the relative positional relationship between the character components in a character, and the character component is the smallest separable element constituting a character; Based on the first character components, the first character structure, the second character components, and the second character structure, the glyph similarity between the third character and the fourth character is determined.
8. The method according to claim 7, characterized in that The determining of the glyph similarity between the third character and the fourth character based on the first character components, the first character structure, the second character components, and the second character structure includes: determining, based on the third character structure and the fourth character structure, a similarity between the character structures of the third character and the fourth character; determining a similarity between character components of the third character and the fourth character based on the respective first character components and the respective second character components; The similarities between the character structures and the similarities between the character components are weighted to obtain the glyph similarity between the third character and the fourth character.
9. The method according to claim 5, characterized in that The similarity between the third character and the fourth character includes a glyph similarity between the third character and the fourth character; the method further includes: Obtaining a first prefix component and a first suffix component of the third character, and obtaining a second prefix component and a second suffix component of the fourth character; a character component is the smallest separable element that constitutes a character; determining a similarity between the first prefix component and the second prefix component, and a similarity between the first suffix component and the second suffix component; The similarity between the character structures of the third character and the fourth character, the similarity between the first prefix component and the second prefix component, and the similarity between the first suffix component and the second suffix component are weighted to obtain the glyph similarity between the third character and the fourth character.
10. The method according to claim 9, characterized in that The weighting of the similarity between the character structures of the third character and the fourth character, the similarity between the first prefix component and the second prefix component, and the similarity between the first suffix component and the second suffix component to obtain the glyph similarity between the third character and the fourth character includes: Determining a first weight based on a ratio of the number of strokes of the first prefix component to the number of strokes of the third character, and a ratio of the number of components of the first prefix component to the number of components of the third character, and weighting the similarity between the first prefix component and the second prefix component based on the first weight to obtain a first weighted similarity; Determining a second weight based on a ratio of the number of strokes of the first suffix component to the number of strokes of the third character, and a ratio of the number of components of the first suffix component to the number of components of the third character, and weighting the similarity between the first suffix component and the second suffix component based on the second weight to obtain a second weighted similarity; The glyph similarity between the third character and the fourth character is determined based on the sum of the similarity between the character structures, the first weighted similarity, and the second weighted similarity.
11. The method according to claim 1, wherein The target data is stored in a target database; the method further comprises: Obtaining an operation statement for the target database; If it is detected that the operation statement includes a keyword in a preset forbidden list of keywords, the operation statement is filtered.
12. The method according to claim 11, characterized in that The method further comprises: If it is detected that the operation statement does not include a keyword in a preset keyword ban list, the operation statement is sent to the target database based on a database connection pre-established with the target database; wherein the database connection is established in the following manner: Obtaining the database type of the target database selected by the user; Obtaining target connection information corresponding to the database type of the target database from a database connection pool; the database connection pool is used to maintain connection information corresponding to multiple database types; A connection is established with the target database based on the target connection information.
13. A sensitive data identification device, characterized in that: The device comprises: A data acquisition module, used to acquire target data to be identified; A segmentation module, configured to segment the target data to obtain multiple target character strings; a matching module, configured to determine a target semantic element from a sensitive word dictionary and match the multiple target character strings with sensitive character strings corresponding to the target semantic element in the sensitive word dictionary, wherein the sensitive word dictionary includes multiple semantic elements and sensitive character strings corresponding to each semantic element, wherein the semantic element is used to represent the semantic category of the corresponding character string; An identification module is configured to identify, from the target data, sensitive data whose semantic category corresponds to the target semantic element based on the matching results of the multiple target character strings.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 12 is implemented.
15. A data management platform comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 12 is implemented.