Sensitive information processing method, device, electronic device and storage medium
By desensitizing database statements and execution results, the problem of sensitive data leakage in the big data platform is solved, and effective protection of sensitive information is achieved.
Patent Information
- Application Number
- CN201811537807.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-12-15
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2038-12-15
AI Technical Summary
In big data platforms, users may lead to leakage of sensitive, confidential and private data when querying data, and the prior art is difficult to effectively prevent such leakage.
By obtaining database statements and preprocessing them, we can determine whether the parameter information contains sensitive information. If included, desensitization will be performed, including filtering or updating the parameter information and sensitive content in the execution results, ensuring that the data does not occur during query and execution. Leak sensitive information.
Effectively prevent sensitive data leakage and ensure that the data does not contain sensitive information during processing, thereby protecting user privacy and security.
Smart Images

Figure CN109829327B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information processing technology, and in particular to a sensitive information processing method, device, electronic device and storage medium. Background Art
[0002] With the application and development of big data technology, the value of data is increasingly reflected with the development of technology, and data in the traditional information field is fully explored and utilized. After the data is placed on the big data platform, since the data may contain sensitive, confidential and private data, if the user's big data platform queries the data with these characteristics, it will lead to the leakage of sensitive, confidential and private data. Summary of the invention
[0003] In view of the above, it is necessary to propose a sensitive information processing method, device, electronic device and storage medium to prevent sensitive data leakage.
[0004] A first aspect of the present invention provides a sensitive information processing method, the method comprising:
[0005] Obtaining a database statement, and preprocessing the database statement to obtain parameter information corresponding to the database statement;
[0006] Determining whether the parameter information of the database statement contains sensitive information according to the sensitive information table;
[0007] When the parameter information of the database statement does not contain sensitive information, executing the database statement to obtain a corresponding execution result;
[0008] Determining whether the execution result contains sensitive information; and
[0009] When the execution result contains sensitive information, the execution result is desensitized.
[0010] Preferably, the method further comprises:
[0011] When the parameter information of the database statement contains sensitive information, the database statement is desensitized.
[0012] Preferably, the parameter information includes a database table and a database field.
[0013] Preferably, the sensitive information table includes one or more sensitive records, and the sensitive records represent sensitive content involved in the corresponding database table, database field or all field records under the database field, and one or more regular expressions are set for each of the sensitive records.
[0014] Preferably, the method further comprises:
[0015] The database statement is matched by the regular expression to determine whether the parameter information of the database statement contains sensitive information.
[0016] Preferably, the desensitizing the database statement includes:
[0017] Filter parameter information containing sensitive information in the database statement; or
[0018] Update the field record corresponding to the parameter information.
[0019] Preferably, the desensitizing the execution result includes:
[0020] Filter field records containing sensitive information in the execution result; or
[0021] Update the field record containing sensitive information in the execution result.
[0022] A second aspect of the present invention provides a sensitive information processing device, the device comprising:
[0023] A preprocessing module, used to obtain a database statement and preprocess the database statement to obtain parameter information corresponding to the database statement;
[0024] A first judgment module, used to judge whether the parameter information of the database statement contains sensitive information according to the sensitive information table;
[0025] A first execution module, used for executing the database statement to obtain a corresponding execution result when the parameter information of the database statement does not contain sensitive information;
[0026] A second judgment module is used to judge whether the execution result contains sensitive information; and
[0027] The second execution module is used to desensitize the execution result when the execution result contains sensitive information.
[0028] A third aspect of the present invention provides an electronic device, comprising a processor and a memory, wherein the processor is configured to implement the sensitive information processing method when executing a computer program stored in the memory.
[0029] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, and the computer program implements the sensitive information processing method when executed by a processor.
[0030] The sensitive information processing method, device, electronic device and storage medium described in the present invention can desensitize database statements and database statement execution results by judging whether the parameter information contained in the database statement contains sensitive information, and further judging whether the database statement execution result contains sensitive information when the parameter information contained in the database statement does not contain sensitive information, thereby effectively preventing sensitive data leakage. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0032] Figure 1 It is a flowchart of the sensitive information processing method provided in Example 1 of the present invention.
[0033] Figure 2 It is a functional module diagram of the sensitive information processing device provided in the second embodiment of the present invention.
[0034] Figure 3 It is a schematic diagram of an electronic device provided in Embodiment 3 of the present invention.
[0035] The following specific implementation manner will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION
[0036] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.
[0037] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. The embodiments described are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0038] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.
[0039] The terms "first", "second", "third", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any variation thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.
[0040] The sensitive information processing method of the embodiment of the present invention is applied in an electronic device. For the electronic device that needs to process sensitive information, the sensitive information processing function provided by the method of the present invention can be directly integrated on the electronic device, or a client for implementing the method of the present invention can be installed. For another example, the method provided by the present invention can also be run on a server or other device in the form of a software development kit (SDK), and an interface for the sensitive information processing function is provided in the form of SDK, and the electronic device or other device can implement the sensitive information processing function through the provided interface.
[0041] Embodiment 1
[0042] Figure 1 This is a flow chart of a sensitive information processing method provided in Embodiment 1 of the present invention. According to different requirements, the execution order in the flow chart can be changed, and some steps can be omitted.
[0043] Step S01: obtaining a database statement, and preprocessing the database statement to obtain parameter information corresponding to the database statement.
[0044] In this implementation, the parameter information includes a database table and a database field.
[0045] It can be understood that the database may include one or more database tables, each database table may include one or more database fields, and each database field may include one or more field records. When operating the database through database statements, the user may enter the corresponding database statements in the database. Preferably, the database statements may include corresponding database tables and / or database fields to operate the field records of the database tables, including but not limited to operations such as adding, deleting, searching, and updating.
[0046] In one embodiment, the database may include a first database table and a second database table. The first database table may include a first database field and a second database field. The second database table may include a third database field.
[0047] When the database statement is preprocessed, it includes obtaining the database table and database field contained in the database statement. For example, the first database statement may include "SELECT first database field FROM first database table". At this time, after the first database statement is preprocessed, it can be known that the parameter information contained in the first database statement is the first database field and the first database table. The second database statement may include "SELECT first database field, second database field FROM first database table". It can be known that the parameter information contained in the second database statement is the first database field, the second database field and the first database table.
[0048] It is understandable that the database statement may include wildcards. Therefore, the database statement containing wildcards may be parsed to obtain corresponding parameter information.
[0049] For example, the third database statement may include "SELECT * FROM the first database table". At this time, since the third database statement includes a wildcard, all database fields included in the first database table can be obtained when the third database statement is preprocessed. Since the first database table includes the first database field and the second database field, at this time, the parameter information included in the third database statement is the first database field, the second database field and the first database table. Similarly, if the fourth database statement is "SELECT * FROM the second database table", the parameter information included in the fourth database statement is the third database field and the second database table.
[0050] Step S02, judging whether the parameter information contains sensitive information according to the sensitive information table, if the parameter information contains sensitive information, the process executes step S03; if the parameter information does not contain sensitive information, the process executes step S04.
[0051] It can be understood that the sensitive information table may include one or more sensitive records, and each sensitive record may be set with one or more regular expressions. Each sensitive record may indicate that the corresponding database table, database field or field record involves sensitive content. For example, when a database table is marked as sensitive content, it means that all fields contained in the database table are sensitive content; when a database field is marked as sensitive content, it means that all field records under the database field are sensitive content; when a field record is marked as sensitive content, sensitive information exists in the field record.
[0052] For example, the user login database includes a user login record data table, and the user login record data table includes database fields such as user identification, user name, ID number, brief description, etc.
[0053] When the user login record data table is marked as sensitive content (such as setting a first regular expression), it means that the field records contained in the user login record data table are all sensitive information. Therefore, the database statement can be matched by the first regular expression to determine whether the parameter information corresponding to the database statement contains sensitive information. It can be understood that the first regular expression can correspond to the table name of the database table, that is, the first regular expression can be used to determine whether the user login record data table is the table name of the user login record data table; when the parameter information contains the table name of the user login record data table, it can be determined that the user login record data table contains sensitive information.
[0054] When the database field of the ID card number is sensitive content (such as setting the first regular expression), it means that the field record corresponding to the database field of the ID card number in the user login record data table is sensitive information. Therefore, the database statement can be matched by the second regular expression to determine whether the parameter information corresponding to the database statement contains sensitive information. It can be understood that the second regular expression can correspond to the field name of the database field, that is, the second regular expression can be used to determine whether the database field table is the field name of the database field of the ID card number; when the parameter information contains the field name of the database field of the ID card number, it can be determined that the database field in the user login record data table contains sensitive information.
[0055] In other implementations, whether the parameter information contains sensitive information may be determined in other ways, for example, by string matching.
[0056] Step S03: When the parameter information of the database statement contains sensitive information, desensitizing the database statement.
[0057] In this implementation, desensitizing the database statement includes 1) filtering parameter information containing sensitive information in the database statement, or 2) updating the field record corresponding to the parameter information.
[0058] Among them, 1) filtering the parameter information containing sensitive information in the database statement may include removing the parameter information containing sensitive information.
[0059] For example, when the user login record data table is marked as sensitive content, it can be determined according to the first regular expression that the user login record data table contains sensitive information. Therefore, the user login record data table can be removed from the database statement. When the user login record data table is removed, the format of the database statement may be incorrect, resulting in the inability to execute the database statement. At this time, a corresponding warning message can be returned.
[0060] According to the second regular expression, it can be determined that the database field of the ID card number contains sensitive information. Therefore, the database field of the ID card number in the database statement can be removed. Furthermore, when the database statement is executed, since the database field of the ID card number has been removed, the execution result at this time will not include the field record corresponding to the database field of the ID card number.
[0061] 2) Updating the field record corresponding to the parameter information may include updating the content of the field record.
[0062] For example, according to the second regular expression, it can be determined that the database field of the ID card number contains sensitive information. Since the ID card request is mainly to avoid leaking the user's complete ID card number. However, part of the ID card number can be displayed. Therefore, when executing the database statement, some characters in the field record corresponding to the database field of the ID card number can be hidden or replaced by other symbols (such as replacing the characters related to the user's date of birth in the ID card number with "*").
[0063] In this embodiment, when the parameter information of the database statement contains sensitive information, the database statement is desensitized. After the parameter information is desensitized, the method further includes recording attribute information corresponding to the database statement. The attribute information includes information such as the database statement, the selected database contained in the database statement, the execution result of the database statement, and the user IP who executes and inputs the database statement.
[0064] Preferably, the method can also provide an interface for querying the attribute information in the electronic device, so that the administrator can track the data of the information when the desensitization operation is performed after discovering sensitive information, so as to have evidence to verify.
[0065] Step S04: when the parameter information of the database statement does not contain sensitive information, execute the database statement to obtain a corresponding execution result.
[0066] Step S05, determining whether the execution result contains sensitive information. If the execution result contains sensitive information, the process proceeds to step S06. If the execution result does not contain sensitive information, the process ends.
[0067] In one implementation, although the parameter information corresponding to the database statement does not include sensitive information, the execution result including the field record obtained after executing the database statement may include sensitive information.
[0068] Therefore, it can be determined whether several field records obtained after executing the database statement contain sensitive information.
[0069] For example, when the field record contained in the database field of the brief description contains sensitive content (such as setting a third regular expression), it means that the field record of the brief description in the user login record data table is sensitive information. It can be understood that the time when the user logs in can be recorded in the field record of the brief description. In one embodiment, the time of the login before a preset time may not be provided. Therefore, when the brief description contains the login record before the preset time, it means that the field record contains sensitive information. Furthermore, the field record obtained by the query can be matched by the third regular expression to determine whether the field record obtained when the database statement is executed contains sensitive information. When the field record obtained after executing the database statement contains the content before the preset time, it can be determined that the field record contains sensitive information.
[0070] Step S06: When the execution result contains sensitive information, desensitize the execution result.
[0071] In this implementation, desensitizing the execution result includes 1) filtering field records containing sensitive information in the execution result, or 2) updating field records containing sensitive information in the execution result.
[0072] Among them, 1) filtering the field records containing sensitive information in the execution result may include deleting the field records containing sensitive information.
[0073] For example, according to the third expression, it can be determined that the field record before the preset time contains sensitive information. Therefore, the field record before the preset time in the execution result can be deleted, and when the database statement is executed, the execution result will not contain the field record of sensitive information.
[0074] 2) Update the field record containing sensitive information in the execution result.
[0075] For example, according to the second regular expression, it can be determined that the database field of the ID card number contains sensitive information. Since the ID card request is mainly to avoid leaking the user's complete ID card number. However, part of the ID card number can be displayed. Therefore, when executing the database statement, some characters in the field record corresponding to the database field of the ID card number can be hidden or replaced by other symbols (such as replacing the characters related to the user's date of birth in the ID card number with "*").
[0076] In this embodiment, when the execution result contains sensitive information, the attribute information of the database statement will be recorded after the execution result is desensitized, so that the administrator can query the attribute information. The attribute information includes the database statement, the selected database contained in the database statement, the execution result of the database statement, the execution time, the user IP of the user who input the database statement, and other information.
[0077] Preferably, the method can also provide an interface for querying the attribute information in the electronic device, so that the administrator can track the data of the information when the desensitization operation is performed after discovering sensitive information, so as to have evidence to verify.
[0078] In summary, the sensitive information processing method provided by the present invention includes obtaining a database statement and preprocessing the database statement to obtain parameter information corresponding to the database statement; judging whether the parameter information of the database statement contains sensitive information according to a sensitive information table; when the parameter information of the database statement does not contain sensitive information, executing the database statement to obtain a corresponding execution result; judging whether the execution result contains sensitive information; and when the execution result contains sensitive information, desensitizing the execution result. The present invention can desensitize database statements and database statement execution results by judging whether the parameter information contained in the database statement contains sensitive information, and further judging whether the database statement execution result contains sensitive information when the parameter information contained in the database statement does not contain sensitive information, thereby effectively preventing sensitive data leakage.
[0079] The above is only a specific implementation of the present invention, but the protection scope of the present invention is not limited thereto. For ordinary technicians in this field, improvements can be made without departing from the creative concept of the present invention, but these all belong to the protection scope of the present invention.
[0080] The functional modules and hardware structure of the electronic device that implements the above-mentioned sensitive information processing method are introduced below in conjunction with Figures 2 to 3.
[0081] Embodiment 2
[0082] Figure 2 It is a functional module diagram of a preferred embodiment of the sensitive information processing device of the present invention.
[0083] In some embodiments, the sensitive information processing device 20 runs in an electronic device. The sensitive information processing device 20 may include a plurality of functional modules composed of program code segments. The program code of each program segment in the sensitive information processing device 20 may be stored in a memory and executed by at least one processor to execute (see Figure 1 and its related description) anti-theft function.
[0084] In this embodiment, the sensitive information processing device 20 can be divided into multiple functional modules according to the functions it performs. The functional modules may include: a preprocessing module 201, a first judgment module 202, a first execution module 203, a second judgment module 204 and a second execution module 205. The module referred to in the present invention refers to a series of computer program segments that can be executed by at least one processor and can complete fixed functions, which are stored in a memory. In some embodiments, the functions of each module will be described in detail in subsequent embodiments.
[0085] The preprocessing module 201 is used to obtain a database statement and preprocess the database statement to obtain parameter information corresponding to the database statement, wherein the parameter information includes a database table and a database field.
[0086] It can be understood that the database may include one or more database tables, each database table may include one or more database fields, and each database field may include one or more field records. When operating the database through database statements, the user may enter the corresponding database statements in the database. Preferably, the database statements may include corresponding database tables and / or database fields to operate the field records of the database tables, including but not limited to operations such as adding, deleting, searching, and updating.
[0087] In one embodiment, the database may include a first database table and a second database table. The first database table may include a first database field and a second database field. The second database table may include a third database field.
[0088] When the database statement is preprocessed, it includes obtaining the database table and database field contained in the database statement. For example, the first database statement may include "SELECT first database field FROM first database table". At this time, after the first database statement is preprocessed, it can be known that the parameter information contained in the first database statement is the first database field and the first database table. The second database statement may include "SELECT first database field, second database field FROM first database table". It can be known that the parameter information contained in the second database statement is the first database field, the second database field and the first database table.
[0089] It is understandable that the database statement may include wildcards. Therefore, the database statement containing wildcards may be parsed to obtain corresponding parameter information.
[0090] For example, the third database statement may include "SELECT * FROM the first database table". At this time, since the third database statement includes a wildcard, all database fields included in the first database table can be obtained when the third database statement is preprocessed. Since the first database table includes the first database field and the second database field, at this time, the parameter information included in the third database statement is the first database field, the second database field and the first database table. Similarly, if the fourth database statement is "SELECT * FROM the second database table", the parameter information included in the fourth database statement is the third database field and the second database table.
[0091] The first determination module 202 is used to determine whether the parameter information contains sensitive information according to the sensitive information table.
[0092] It can be understood that the sensitive information table may include one or more sensitive records, and each sensitive record may be set with one or more regular expressions. Each sensitive record may indicate that the corresponding database table, database field or field record involves sensitive content. For example, when a database table is marked as sensitive content, it means that all fields contained in the database table are sensitive content; when a database field is marked as sensitive content, it means that all field records under the database field are sensitive content; when a field record is marked as sensitive content, sensitive information exists in the field record.
[0093] For example, the user login database includes a user login record data table, and the user login record data table includes database fields such as user identification, user name, ID number, brief description, etc.
[0094] When the user login record data table is marked as sensitive content (such as setting a first regular expression), it means that the field records contained in the user login record data table are all sensitive information. Therefore, the database statement can be matched by the first regular expression to determine whether the parameter information corresponding to the database statement contains sensitive information. It can be understood that the first regular expression can correspond to the table name of the database table, that is, the first regular expression can be used to determine whether the user login record data table is the table name of the user login record data table; when the parameter information contains the table name of the user login record data table, it can be determined that the user login record data table contains sensitive information.
[0095] When the database field of the ID card number is sensitive content (such as setting the first regular expression), it means that the field record corresponding to the database field of the ID card number in the user login record data table is sensitive information. Therefore, the database statement can be matched by the second regular expression to determine whether the parameter information corresponding to the database statement contains sensitive information. It can be understood that the second regular expression can correspond to the field name of the database field, that is, the second regular expression can be used to determine whether the database field table is the field name of the database field of the ID card number; when the parameter information contains the field name of the database field of the ID card number, it can be determined that the database field in the user login record data table contains sensitive information.
[0096] In other implementations, whether the parameter information contains sensitive information may be determined in other ways, for example, by string matching.
[0097] The first execution module 203 is used to execute the database statement to obtain a corresponding execution result when the parameter information of the database statement does not contain sensitive information.
[0098] The first execution module 203 is further configured to perform desensitization processing on the database statement when the parameter information of the database statement contains sensitive information.
[0099] In this implementation, desensitizing the database statement includes 1) filtering parameter information containing sensitive information in the database statement, or 2) updating the field record corresponding to the parameter information.
[0100] Among them, 1) filtering the parameter information containing sensitive information in the database statement may include removing the parameter information containing sensitive information.
[0101] For example, when the user login record data table is marked as sensitive content, it can be determined according to the first regular expression that the user login record data table contains sensitive information. Therefore, the user login record data table can be removed from the database statement. When the user login record data table is removed, the format of the database statement may be incorrect, resulting in the inability to execute the database statement. At this time, a corresponding warning message can be returned.
[0102] According to the second regular expression, it can be determined that the database field of the ID card number contains sensitive information. Therefore, the database field of the ID card number in the database statement can be removed. Furthermore, when the database statement is executed, since the database field of the ID card number has been removed, the execution result at this time will not include the field record corresponding to the database field of the ID card number.
[0103] 2) Updating the field record corresponding to the parameter information may include updating the content of the field record.
[0104] For example, according to the second regular expression, it can be determined that the database field of the ID card number contains sensitive information. Since the ID card request is mainly to avoid leaking the user's complete ID card number. However, part of the ID card number can be displayed. Therefore, when executing the database statement, some characters in the field record corresponding to the database field of the ID card number can be hidden or replaced by other symbols (such as replacing the characters related to the user's date of birth in the ID card number with "*").
[0105] In this embodiment, when the parameter information of the database statement contains sensitive information, the database statement is desensitized. After the parameter information is desensitized, the first execution module 203 is further used to record the attribute information corresponding to the database statement. The attribute information includes the database statement, the selected database contained in the database statement, the execution result of the database statement, the user IP who executes and inputs the database statement, and other information.
[0106] Preferably, the first execution module 203 is also used to provide an interface for querying the attribute information in the electronic device, so that the administrator can track the data of the information when the desensitization operation is performed after discovering sensitive information, and the second judgment module 204 is used to judge whether the execution result contains sensitive information.
[0107] In one implementation, although the parameter information corresponding to the database statement does not include sensitive information, the execution result including the field record obtained after executing the database statement may include sensitive information.
[0108] Therefore, it can be determined whether several field records obtained after executing the database statement contain sensitive information.
[0109] For example, when the field record contained in the database field of the brief description contains sensitive content (such as setting a third regular expression), it means that the field record of the brief description in the user login record data table is sensitive information. It can be understood that the time when the user logs in can be recorded in the field record of the brief description. In one embodiment, the time of the login before a preset time may not be provided. Therefore, when the brief description contains the login record before the preset time, it means that the field record contains sensitive information. Furthermore, the field record obtained by the query can be matched by the third regular expression to determine whether the field record obtained when the database statement is executed contains sensitive information. When the field record obtained after executing the database statement contains the content before the preset time, it can be determined that the field record contains sensitive information.
[0110] The second execution module 205 is used to perform desensitization processing on the execution result when the execution result contains sensitive information.
[0111] In this implementation, desensitizing the execution result includes 1) filtering field records containing sensitive information in the execution result, or 2) updating field records containing sensitive information in the execution result.
[0112] Among them, 1) filtering the field records containing sensitive information in the execution result may include deleting the field records containing sensitive information.
[0113] For example, according to the third expression, it can be determined that the field record before the preset time contains sensitive information. Therefore, the field record before the preset time in the execution result can be deleted, and when the database statement is executed, the execution result will not contain the field record of sensitive information.
[0114] 2) Update the field record containing sensitive information in the execution result.
[0115] For example, according to the second regular expression, it can be determined that the database field of the ID card number contains sensitive information. Since the ID card request is mainly to avoid leaking the user's complete ID card number. However, part of the ID card number can be displayed. Therefore, when executing the database statement, some characters in the field record corresponding to the database field of the ID card number can be hidden or replaced by other symbols (such as replacing the characters related to the user's date of birth in the ID card number with "*").
[0116] In this embodiment, when the execution result contains sensitive information, the attribute information of the database statement will be recorded after the execution result is desensitized, so that the administrator can query the attribute information. The attribute information includes the database statement, the selected database contained in the database statement, the execution result of the database statement, the execution time, the user IP of the user who input the database statement, and other information.
[0117] Preferably, the second execution module 205 can also provide an interface for querying the attribute information in the electronic device, so that the administrator can track the information when performing the desensitization operation after discovering sensitive information, which is well documented.
[0118] In summary, the sensitive information processing device 20 of the present invention includes a preprocessing module 201, a first judgment module 202, a first execution module 203, a second judgment module 204 and a second execution module 205. The preprocessing module 201 is used to obtain a database statement and preprocess the database statement to obtain parameter information corresponding to the database statement; the first judgment module 202 is used to judge whether the parameter information of the database statement contains sensitive information according to the sensitive information table; the first execution module 203 is used to execute the database statement when the parameter information of the database statement does not contain sensitive information to obtain the corresponding execution result; the second judgment module 204 is used to judge whether the execution result contains sensitive information; and the second execution module 205 is used to desensitize the execution result when the execution result contains sensitive information. The present invention can desensitize the database statement and the execution result of the database statement by judging whether the parameter information contained in the database statement contains sensitive information, and further judging whether the execution result of the database statement contains sensitive information when the parameter information contained in the database statement does not contain sensitive information, so as to effectively prevent the leakage of sensitive data.
[0119] The above-mentioned integrated unit implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, and includes a number of instructions for enabling a computer device (which can be a personal computer, a dual-screen device, or a network device, etc.) or a processor to execute a part of the method described in each embodiment of the present invention.
[0120] Figure 3 This is a schematic diagram of an electronic device provided in Embodiment 3 of the present invention.
[0121] The electronic device 3 includes: a memory 31 , at least one processor 32 , a computer program 33 stored in the memory 31 and executable on the at least one processor 32 , and at least one communication bus 34 .
[0122] When the at least one processor 32 executes the computer program 33, the steps in the above-mentioned sensitive information processing method embodiment are implemented.
[0123] Exemplarily, the computer program 33 may be divided into one or more modules / units, which are stored in the memory 31 and executed by the at least one processor 32 to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, and the instruction segments are used to describe the execution process of the computer program 33 in the electronic device 3.
[0124] The electronic device 3 may be a mobile phone, a tablet computer, a personal digital assistant (PDA), or other device with an application installed. Figure 3 It is only an example of the electronic device 3 and does not constitute a limitation of the electronic device 3. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device 3 may also include input and output devices, network access devices, buses, etc.
[0125] The at least one processor 32 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 32 may be a microprocessor or any conventional processor, etc. The processor 32 is the control center of the electronic device 3, and uses various interfaces and lines to connect various parts of the entire electronic device 3.
[0126] The memory 31 can be used to store the computer program 33 and / or modules / units. The processor 32 realizes various functions of the electronic device 3 by running or executing the computer program and / or modules / units stored in the memory 31 and calling the data stored in the memory 31. The memory 31 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the electronic device 3 (such as audio data, a phone book, etc.), etc. In addition, the memory 31 can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0127] If the module / unit integrated in the electronic device 3 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0128] In the several embodiments provided by the present invention, it should be understood that the disclosed electronic device and method can be implemented in other ways. For example, the electronic device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation.
[0129] In addition, each functional unit in each embodiment of the present invention may be integrated into the same processing unit, each unit may exist physically separately, or two or more units may be integrated into the same unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0130] It is obvious to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "comprising" does not exclude other units or, and the singular does not exclude the plural. Multiple units or devices stated in the system claim may also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
[0131] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. A method for processing sensitive information, It is characterized in that The method comprises: Obtaining a database statement, and preprocessing the database statement to obtain parameter information corresponding to the database statement; Determining whether the parameter information of the database statement contains sensitive information according to the sensitive information table; When the parameter information of the database statement contains sensitive information, the database statement is desensitized and the attribute information corresponding to the database statement is recorded; When the parameter information of the database statement does not contain sensitive information, executing the database statement to obtain a corresponding execution result; Determining whether the execution result contains sensitive information; and When the execution result contains sensitive information, the execution result is desensitized and attribute information corresponding to the database statement is recorded, wherein the attribute information includes the database statement, the selected database contained in the database statement, the execution result of the database statement, and the user IP who executes and inputs the database statement.
2. The sensitive information processing method according to claim 1, It is characterized in that The parameter information includes database tables and database fields.
3. The sensitive information processing method according to claim 2, It is characterized in that The sensitive information table includes one or more sensitive records, and the sensitive records represent sensitive content involved in the corresponding database table, database field, or all field records under the database field. One or more regular expressions are set for each of the sensitive records.
4. The sensitive information processing method according to claim 3, It is characterized in that The method further comprises: The database statement is matched by the regular expression to determine whether the parameter information of the database statement contains sensitive information.
5. The sensitive information processing method according to claim 1, It is characterized in that The desensitizing process of the database statement includes: Filter parameter information containing sensitive information in the database statement; or Update the field record corresponding to the parameter information.
6. The sensitive information processing method according to claim 1, It is characterized in that The desensitizing the execution result includes: Filter field records containing sensitive information in the execution result; or Update the field record containing sensitive information in the execution result.
7. A sensitive information processing device, It is characterized in that The device comprises: A preprocessing module, used to obtain a database statement and preprocess the database statement to obtain parameter information corresponding to the database statement; A first judgment module, used to judge whether the parameter information of the database statement contains sensitive information according to the sensitive information table; A first execution module, configured to, when the parameter information of the database statement contains sensitive information, perform desensitization processing on the database statement and record attribute information corresponding to the database statement; and, when the parameter information of the database statement does not contain sensitive information, execute the database statement to obtain a corresponding execution result; A second judgment module is used to judge whether the execution result contains sensitive information; and The second execution module is used to desensitize the execution result when the execution result contains sensitive information, and record attribute information corresponding to the database statement, wherein the attribute information includes the database statement, the selected database contained in the database statement, the execution result of the database statement, and the user IP who executes and inputs the database statement.
8. An electronic device, It is characterized in that The electronic device includes a processor and a memory, and the processor is used to implement the sensitive information processing method as described in any one of claims 1 to 6 when executing a computer program stored in the memory.
9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the sensitive information processing method as described in any one of claims 1 to 6 is implemented.
