Sensitive information detection method, device, terminal and medium
By establishing a database of sensitive words and conventional words in the terminal, combining word segmentation processing and judgment rules, the problem of low accuracy in sensitive information detection in the prior art is solved, and efficient monitoring and control of sensitive information is achieved.
Patent Information
- Application Number
- CN202010159920.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-10
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2040-03-10
AI Technical Summary
The existing sensitive information detection methods mainly rely on character matching and cannot effectively monitor emerging sensitive information, resulting in low monitoring accuracy and efficiency, and cannot effectively curb the spread of sensitive information.
By establishing a sensitive word database and a conventional word database in the terminal, combining the target acquisition method and pre-set judgment rules, text data is segmented and detected to determine whether it contains sensitive information, and update the acquisition method according to the detection results to improve monitoring Accuracy and efficiency.
By establishing dual databases and rule judgments, the accuracy and efficiency of sensitive information monitoring are significantly improved, and new emerging sensitive information can be effectively identified and controlled, which improves the ability to curb the dissemination of sensitive information.
Smart Images

Figure CN111460814B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a sensitive information detection method, device, terminal and medium. Background Art
[0002] As network technology becomes more and more advanced, the ways of information transmission are diversified. People are getting information on the Internet or transmitting information more frequently. The openness of the network also allows sensitive information to be transmitted. Therefore, it is necessary to monitor sensitive information and control the spread of sensitive information on the network.
[0003] The existing method of determining sensitive information is mainly based on character matching. For example, if a text contains sensitive words, the text is determined to contain sensitive information. However, with the continuous emergence of new words, relying solely on character matching technology is unable to monitor newly emerging sensitive information, resulting in the control means and technologies for sensitive information not being able to achieve a high accuracy rate, and the spread of sensitive information has not been well curbed. Utility Model Content
[0004] Embodiments of the present invention provide a sensitive information detection method, device, terminal and medium, which can improve the accuracy and efficiency of monitoring sensitive information.
[0005] In a first aspect, an embodiment of the present invention provides a sensitive information detection method, the method comprising:
[0006] Acquiring text data from a target source object based on a target acquisition method, wherein the target acquisition method includes a target acquisition frequency and a target acquisition time period for the target source object;
[0007] Performing word segmentation processing on the text data to obtain at least one phrase;
[0008] Detecting whether each of the at least one phrase is stored in a preset database, wherein the preset database includes a sensitive word database or a regular word database, wherein the sensitive word database stores at least one sensitive phrase, and the regular word database stores at least one non-sensitive phrase;
[0009] If it is detected that each of the at least one phrase is stored in the preset database, determining whether the text data contains sensitive information according to the preset database;
[0010] If it is detected that there is a target phrase in the at least one phrase that is not stored in the preset database, determining whether the text data contains sensitive information according to a preset sensitive information determination rule;
[0011] If the text data contains sensitive information, the target acquisition method is updated according to the sensitive information.
[0012] In a second aspect, an embodiment of the present invention provides a sensitive information detection device, the device comprising:
[0013] An acquisition module, configured to acquire text data from a target source object based on a target acquisition method, wherein the target acquisition method includes a target acquisition frequency and a target acquisition time period for the target source object;
[0014] A processing module, used for performing word segmentation processing on the text data to obtain at least one phrase;
[0015] A detection module, configured to detect whether each of the at least one phrase is stored in a preset database, wherein the preset database includes a sensitive word database or a regular word database, wherein the sensitive word database stores at least one sensitive phrase, and the regular word database stores at least one non-sensitive phrase;
[0016] a judgment module, configured to judge whether the text data contains sensitive information according to the preset database if it is detected that each of the at least one phrase is stored in the preset database;
[0017] The judgment module is further configured to judge whether the text data contains sensitive information according to a preset sensitive information judgment rule if it is detected that there is a target phrase in the at least one phrase that is not stored in the preset database;
[0018] An updating module is used to update the target acquisition method according to the sensitive information if the text data contains sensitive information.
[0019] In a third aspect, an embodiment of the present invention provides a terminal, comprising a processor, an input interface, an output interface and a memory, wherein the processor, input interface, output interface and memory are interconnected, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method described in the first aspect.
[0020] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the method described in the first aspect.
[0021] In an embodiment of the present invention, the terminal obtains text data from a target source object based on a target acquisition method, performs word segmentation processing on the text data to obtain at least one phrase, and detects whether each phrase in the at least one phrase is stored in a preset database. If it is detected that each phrase in the at least one phrase is stored in the preset database, the terminal determines whether the text data contains sensitive information according to the preset database; if it is detected that there is a target phrase in the at least one phrase that is not stored in the preset database, the terminal determines whether the text data contains sensitive information according to a preset sensitive information judgment rule. If the text data contains sensitive information, the terminal updates the target acquisition method according to the sensitive information. By establishing a sensitive word database and a non-sensitive word database, it is determined from two aspects whether the text contains sensitive information. If the database cannot obtain a judgment result, the preset rule is used for judgment, thereby improving the accuracy and efficiency of sensitive information monitoring. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0023] Figure 1 It is a flowchart of a sensitive information detection method provided by an embodiment of the present invention;
[0024] Figure 2 is a flow chart of another sensitive information detection method provided by an embodiment of the present invention;
[0025] Figure 3 is a structural schematic diagram of a sensitive information detection device provided by an embodiment of the present invention;
[0026] Figure 4 It is a schematic diagram of the structure of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not 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.
[0028] The sensitive information detection method provided in the embodiment of the present invention is implemented in a terminal, and the terminal includes electronic devices such as a smart phone, a tablet computer, a digital audio and video player, an e-reader, a handheld game console, or a vehicle-mounted electronic device.
[0029] Figure 1 FIG. 1 is a flow chart of a sensitive information detection method according to an embodiment of the present invention. Figure 1 As shown, the process of the sensitive information detection method in this embodiment may include:
[0030] S101. The terminal obtains text data from a target source object based on a target acquisition method.
[0031] In an embodiment of the present invention, the target acquisition method includes a target acquisition frequency and a target acquisition time period for a target source object. The source object may be an application (APP) installed in the terminal, and the target source object may be any application installed in the terminal. For different source objects, the terminal may use different acquisition methods to acquire text data in the source object, wherein the target source object and the target acquisition time period may be pre-set by the user, or determined based on sensitive information historically detected from the target source object. The more sensitive phrases there are in the sensitive information, the longer the target acquisition time period and the higher the target acquisition frequency.
[0032] Specifically, the terminal can obtain the user input data (such as chat data, session data, etc.) from the background server of the target source object based on the target acquisition frequency within the target time period, where the user input data can be in the form of voice or text. For voice data, the terminal can convert the voice data into text data based on the voice-to-text algorithm. For text data, the terminal can directly determine the text data as text data.
[0033] Alternatively, the terminal may also monitor the target source object within the target time period, directly obtain the data input by the user using the target source object, and extract the data input by the user based on the target acquisition frequency to obtain text data. For example, if the user installs a social APP in the terminal, and the terminal needs to monitor the data input by the user and the data received in the social APP within the target time period, then when the user inputs data for the social APP, the terminal records the input data and extracts the text data in the user input data based on the target acquisition frequency.
[0034] S102: The terminal performs word segmentation processing on the text data to obtain at least one phrase.
[0035] In the embodiment of the present invention, after the terminal acquires the text data, it performs word segmentation processing on the text data to obtain at least one phrase.
[0036] In one implementation, the specific method for the terminal to perform word segmentation on text data can be that the terminal performs word segmentation on the text data based on a character matching algorithm, such as matching a text string in the text data with a phrase in a preset database according to preset rules. If a phrase in the Chinese string is found in the preset database, the match is successful, and the successfully matched phrase is split from the string and determined as a phrase.
[0037] In one implementation, the terminal may perform word segmentation on text data in a specific manner such that the terminal determines whether to group individual characters into a phrase based on the frequency or probability of adjacent co-occurrence of characters. For example, the terminal counts the frequency of combinations of adjacent co-occurring characters in the text data and calculates their adjacent co-occurrence probabilities. If the adjacent co-occurrence probability of a character combination is greater than a preset threshold, the character combination is determined to be a phrase.
[0038] In one implementation, the terminal implements word segmentation processing on text data by learning the rules of word segmentation based on a large amount of text that has been segmented, thereby obtaining at least one phrase.
[0039] S103: The terminal detects whether each phrase in at least one phrase is stored in a preset database.
[0040] In an embodiment of the present invention, the preset database includes a sensitive word database or a regular word database, the sensitive word database stores at least one sensitive word group, and the regular word database stores at least one non-sensitive word group. After the terminal performs word segmentation processing on the text data and obtains at least one word group, it will detect whether each word group in the at least one word group is stored in the preset database.
[0041] Specifically, developers can pre-determine multiple sensitive phrases and non-sensitive phrases, and put the sensitive phrases into the sensitive word database, and the non-sensitive words into the regular word database to establish a sensitive word database and a regular word database. For example, mood phrases such as "happy", "happy", and "sad" are non-sensitive phrases, then mood phrases such as "happy", "happy", and "sad" can be added to the regular word database in advance to establish a regular word database.
[0042] Furthermore, a database update rule may be pre-established. When a new sensitive phrase is determined, it is added to the sensitive phrase database. When a new regular phrase is determined, it is added to the regular phrase database, so as to update the data stored in the preset database.
[0043] S104: If it is detected that each of the at least one phrase is stored in a preset database, the terminal determines whether the text data contains sensitive information according to the preset database.
[0044] In an embodiment of the present invention, after the terminal detects whether each of the at least one phrase is stored in a preset database, if it is detected that each of the at least one phrase is stored in the preset database, the terminal determines whether the text data contains sensitive information based on the preset database.
[0045] In a specific implementation, the terminal may determine whether the text data contains sensitive information according to the preset database in a specific manner: if each of the at least one phrase obtained by the word segmentation process exists in the regular word database, the terminal determines that the text data does not contain sensitive information; if the at least one phrase obtained by the word segmentation process exists in the sensitive word database, the terminal determines that the text data contains sensitive information, and the entire text data is sensitive information. If some of the at least one phrase obtained by the word segmentation process is stored in the sensitive word database, and some of the phrases are stored in the regular word database, the terminal determines that the text data contains sensitive information, and determines the sensitive phrases stored in the sensitive word database in the text data as sensitive information.
[0046] For example, the sensitive word database stores sensitive word groups "phrase A, phrase B and phrase C", and the regular word database stores non-sensitive word groups "phrase D, phrase E and phrase F". If at least one phrase obtained by word segmentation includes "phrase A" and "phrase C", the terminal determines that all text data is sensitive information; if the phrases obtained by word segmentation include "phrase D" and "phrase E", the terminal determines that the text data does not contain sensitive information; if at least one phrase obtained by word segmentation includes "phrase A" and "phrase D", the terminal determines that the text data contains sensitive information, and the sensitive information is "phrase A".
[0047] In one implementation, if the terminal detects that there is a target phrase in the at least one phrase that is not stored in the preset database, step S105 is executed.
[0048] S105: If it is detected that at least one phrase contains a target phrase that is not stored in the preset database, the terminal determines whether the text data contains sensitive information according to a preset sensitive information determination rule.
[0049] In an embodiment of the present invention, if the terminal detects that there is a target phrase that is not stored in the preset database in at least one phrase obtained by the word segmentation process, the terminal determines whether the text data contains sensitive information according to a pre-set sensitive information judgment rule. The sensitive information judgment rule is that for a phrase stored in the sensitive word database, it is judged as sensitive information in the text data, for a phrase stored in the conventional word database, it is judged as non-sensitive information in the text data, and for a target phrase that is not stored in the preset database, the terminal determines the length of the target phrase and the format of the target phrase. Specifically, the terminal obtains the length of the target phrase and the format of the target phrase; and determines a target format matching model from at least one format matching model according to the length of the target phrase; the terminal detects whether the format of the target phrase matches the target format matching model; if the format of the target phrase matches the target format matching model, the target phrase is determined to be sensitive information in the text data.
[0050] For example, at least one format matching model includes a mobile phone number format matching model, wherein the length corresponding to the mobile phone number format matching model is 11. If the target phrase consists of 11 characters, the length of the target phrase is 11. After the terminal determines the length of the target phrase, it determines the mobile phone number format matching model as the target format matching model, wherein the mobile phone number format matching model has fixed prefixes and suffixes. The terminal detects whether the format of the target phrase has the fixed prefixes and suffixes. If so, the terminal determines the target phrase as a mobile phone number and determines the target phrase as sensitive information in the text data.
[0051] In one implementation, when there is no format matching model corresponding to the length of the target phrase, or when the format of the target phrase does not match the target format matching model, the terminal can perform context analysis on the target phrase, and match the context data of the target phrase in the semantic model. The semantic model will pre-process and store a batch of relevant data of sensitive information context for model training, train each classification model according to different sensitive information sources, and then use a small amount of labeled training data to adjust the original model. When performing context semantic matching each time, the matching degree is scored. After each scoring, the data warehouse of the semantic model will be updated, and the semantic model will continue to be trained using the updated data set. The original model will be gradually tuned to increase the accuracy of sensitive information matching. The optimized semantic model is used to determine whether the target phrase is sensitive information in the text data. Specifically, if the probability that the semantic model outputs that the target phrase is sensitive information is greater than a preset threshold, the terminal determines the target phrase as sensitive information.
[0052] Furthermore, after the terminal determines that the target phrase is sensitive information in the text data, the target phrase is added to the sensitive word database to update the sensitive phrases stored in the sensitive word database. In addition, the terminal can issue a prompt message to indicate that the text data contains sensitive information.
[0053] S106: If the text data contains sensitive information, the terminal updates the target acquisition method according to the sensitive information.
[0054] In the embodiment of the present invention, after the terminal determines that the text data contains sensitive information, the target acquisition method is updated according to the sensitive information.
[0055] In one implementation, the terminal may update the target acquisition method according to the sensitive information in a specific manner that the terminal obtains the number of sensitive phrases in the sensitive information, and determines the target frequency increase for the target acquisition frequency according to the corresponding relationship between the number and the frequency increase; and determines the target time period increase for the target acquisition time period according to the corresponding relationship between the number and the time period increase. Further, the terminal updates the target acquisition method according to the target frequency increase and the target time period increase, wherein the corresponding relationship between the number and the frequency increase and the corresponding relationship between the time period and the frequency increase may be pre-set by the user. The higher the number, the higher the frequency increase and the higher the time period increase. The method for updating the target acquisition frequency according to the target frequency increase may be to superimpose the target frequency increase on the basis of the target acquisition frequency. The method for updating the target acquisition time period according to the target time period increase may be to superimpose the target time period increase in the target acquisition time period. For example, the corresponding relationship between the number and the frequency increase and the corresponding relationship between the number and the time period increase are specifically shown in Table 1:
[0056] Table 1
[0057] In the initial target acquisition method, the target acquisition frequency is 10 times / hour, and the target acquisition time period is 2:00-5:00. If the terminal detects that the sensitive information contains two sensitive phrases, the corresponding target frequency increase is determined to be 20 times / hour, and the target time period increase is 2 hours. The target acquisition method is updated according to the target frequency increase and the target time period increase, and the updated target acquisition frequency is 30 times / hour, and the updated target acquisition time period is 1:00-6:00. It should be noted that the maximum acquisition frequency and the longest acquisition time period can be pre-set. When the updated target acquisition frequency is greater than the maximum acquisition frequency, the terminal determines the maximum acquisition frequency as the text data acquisition frequency for the target source object. When the updated target time period is longer than the longest acquisition time period, the terminal determines the longest acquisition time period as the text data acquisition time period for the target source object.
[0058] In one implementation, a specific method for the terminal to update the target acquisition method based on the sensitive information may be that the terminal obtains the category of sensitive phrases in the sensitive information, and determines the target frequency increase for the target acquisition frequency based on the correspondence between the category and the frequency increase; and determines the target time period increase for the target acquisition time period based on the correspondence between the quantity and the time period increase, wherein the category may include a first category, a second category, and a third category, the sensitivity of the sensitive phrases in the first category is higher than that in the second category, and the sensitivity of the sensitive phrases in the second category is higher than that in the third category, which may be pre-set by the user, such as pre-labeling each sensitive phrase with the first category, the second category, or the third category in a preset sensitive phrase database, or determining the category of the sensitive phrase by a pre-set judgment rule. The specific method for the terminal to determine the target frequency increase for the target acquisition frequency according to the correspondence between the category and the frequency increase can be: if there is a sensitive phrase of the first category in the sensitive information, the target frequency increase is determined to be the first frequency increase; if there is no sensitive phrase of the first category in the sensitive information, but there is a sensitive phrase of the second category, the target frequency increase is determined to be the second frequency increase; if there is only a sensitive phrase of the third category in the sensitive information, the target frequency increase is determined to be the third frequency increase. Among them, the first frequency increase is greater than the second frequency increase, and the second frequency increase is greater than the third frequency amplitude. Further, the terminal updates the target acquisition method according to the target frequency increase and the target time period increase. For example, in the initial target acquisition method, the target acquisition frequency is 10 times / hour, and the target acquisition time period is 2:00-5:00. If the terminal detects that the sensitive information contains two sensitive phrases, and there are sensitive phrases of the first category, the corresponding target frequency increase is determined to be the first frequency increase (30 times / hour), and the target time period increase is 2 hours. The target acquisition method is updated according to the target frequency increase and the target time period increase, and the updated target acquisition frequency is 40 times / hour, and the updated target acquisition time period is 1:00-6:00. It should be noted that the maximum acquisition frequency and the longest acquisition time period can be pre-set. When the updated target acquisition frequency is greater than the maximum acquisition frequency, the terminal determines the maximum acquisition frequency as the text data acquisition frequency for the target source object. When the updated target time period is longer than the longest acquisition time period, the terminal determines the longest acquisition time period as the text data acquisition time period for the target source object.
[0059] In an embodiment of the present invention, the terminal obtains text data from a target source object based on a target acquisition method, performs word segmentation processing on the text data to obtain at least one phrase, and detects whether each phrase in the at least one phrase is stored in a preset database. If it is detected that each phrase in the at least one phrase is stored in the preset database, the terminal determines whether the text data contains sensitive information according to the preset database; if it is detected that there is a target phrase in the at least one phrase that is not stored in the preset database, the terminal determines whether the text data contains sensitive information according to a preset sensitive information judgment rule. If the text data contains sensitive information, the terminal updates the target acquisition method according to the sensitive information. By establishing a sensitive word database and a non-sensitive word database, it is determined from two aspects whether the text contains sensitive information. If the database cannot obtain a judgment result, the preset rule is used for judgment, thereby improving the accuracy and efficiency of sensitive information monitoring.
[0060] Figure 2 FIG. 1 is a flow chart of another sensitive information detection method according to an embodiment of the present invention. Figure 2 As shown, the process of the sensitive information detection method in this embodiment may include:
[0061] S201: The terminal obtains text data from a target source object based on a target acquisition method, and performs word segmentation processing on the text data to obtain at least one phrase.
[0062] In an embodiment of the present invention, the target acquisition method includes a target acquisition frequency and a target acquisition time period for a target source object. The source object may be an application (APP) installed in the terminal, and the target source object may be any application installed in the terminal. For different source objects, the terminal may use different acquisition methods to acquire text data in the source object, wherein the target source object and the target acquisition time period may be pre-set by the user, or determined based on sensitive information historically detected from the target source object. The more sensitive phrases there are in the sensitive information, the longer the target acquisition time period and the higher the target acquisition frequency.
[0063] After the terminal obtains the text data, it will perform word segmentation on the text data to obtain at least one phrase, wherein the specific method of word segmentation can be to perform word segmentation on the text data based on a character matching algorithm, or to determine whether to group each character into a phrase based on the frequency or probability of co-occurrence of adjacent characters, or to use a statistical machine learning model to learn the rules of word segmentation to achieve word segmentation of the text data.
[0064] S202: If it is detected that there is a target phrase in at least one phrase that is not stored in the preset database, the terminal obtains the length of the target phrase and the format of the target phrase.
[0065] In the embodiment of the present invention, after the terminal performs word segmentation processing on the text data to obtain at least one phrase, it will detect whether each phrase in the at least one phrase is stored in the preset database. If each phrase exists in the preset database, the terminal determines whether the text data contains sensitive information based on the preset database, that is, if it is detected that at least one phrase contains a target sensitive phrase stored in the sensitive word database, the target sensitive phrase is determined as the sensitive information contained in the text data; if it is detected that each phrase in the at least one phrase exists in the conventional word database, it is determined that the text data does not contain sensitive information.
[0066] If it is detected that there is a target phrase in at least one phrase that is not stored in the preset database, the terminal determines the phrase in at least one phrase stored in the sensitive word database as sensitive information in the text data, and determines the phrase in at least one phrase stored in the regular word database as non-sensitive information in the text data, and obtains the length of the target phrase and the format of the target phrase, wherein the length of the target phrase is determined by the number of characters constituting the target phrase, and the format of the target phrase includes prefixes, suffixes, special fields, and the order of characters constituting the target phrase.
[0067] S203: The terminal determines a target format matching model from at least one format matching model according to the length of the target phrase.
[0068] In an embodiment of the present invention, after the terminal obtains the length and format of the target phrase, it will determine the target format matching model from at least one format matching model based on the length of the target phrase, wherein at least one format matching model includes a mobile phone number format matching model, and each format matching has a fixed format. For example, the mobile phone number format matching model has a fixed prefix and suffix, and each format matching model can correspond to a different length. For example, the length corresponding to the mobile phone number format matching model is 11. Through the above method, after the terminal obtains the length of the target phrase, it can determine the corresponding target format matching model based on the length.
[0069] S204: If the format of the target phrase does not match the target format matching model, the terminal inputs the target phrase into a preset deep learning model.
[0070] In the implementation of the present invention, after the terminal determines the target format matching model according to the length of the target phrase, it will detect whether the format of the target phrase matches the target format matching model. If the format of the target phrase matches the target format matching model, the terminal determines that the target phrase is sensitive information in the text data, and adds the target phrase to the sensitive word database to update the sensitive phrases stored in the sensitive word database.
[0071] If the format of the target phrase does not match the target format matching model, the terminal inputs the target phrase into a preset deep learning model. The preset deep learning model includes a sensitive word learning model and a regular word learning model. The sensitive word learning model is used to output the probability that the phrase belongs to a sensitive word, and the regular word learning model is used to output the probability that the phrase belongs to a regular word.
[0072] Specifically, training can be performed in advance based on a large number of already determined sensitive phrases to obtain a sensitive word learning model for determining whether a phrase is a sensitive phrase, and training can be performed based on a large number of already determined regular phrases to obtain a regular word learning model for determining whether a phrase is a regular phrase. The terminal inputs the target phrase into the sensitive word learning model, and the sensitive word learning model can output a probability that the target phrase is a sensitive phrase, represented by a first probability, and the terminal inputs the target phrase into the regular word learning model, and the sensitive word learning model can output a probability that the target phrase is a regular phrase, represented by a second probability.
[0073] S205. The terminal determines whether the target phrase is sensitive information contained in the text data according to the output result of the preset deep learning model.
[0074] In an embodiment of the present invention, after the terminal inputs the target phrase into the preset deep learning model, it will obtain the output result of the threshold deep model, and determine whether the target phrase is sensitive information contained in the text data according to the output result of the preset deep learning model. Specifically, the terminal can obtain the first probability output by the sensitive word learning model and the second probability output by the regular word learning model, and determine whether the target phrase is sensitive information in the text data according to the first probability and the second probability.
[0075] In one implementation, a specific method for the terminal to determine whether the target phrase is sensitive information in the text data based on the first probability and the second probability is that the terminal detects the size relationship between the first probability and the second probability; if the first probability is greater than the second probability, the target phrase is determined to be sensitive information in the text data, and the target phrase is added to the sensitive word database; if the first probability is less than the second probability, the target phrase is determined not to be sensitive information in the text data, and the target phrase is added to the regular word database.
[0076] In one implementation, in order to avoid misjudgment caused by the difference between the first probability and the second probability being too small, the terminal can determine whether the target phrase is sensitive information in the text data according to the first probability and the second probability in a specific manner that the terminal calculates the absolute value of the difference between the first probability and the second probability; if the absolute value of the difference is greater than a preset value, the terminal detects the magnitude of the first probability and the second probability; if the first probability is greater than the second probability, the target phrase is determined to be sensitive information in the text data, and the target phrase is added to the sensitive word database; if the first probability is less than the second probability, the target phrase is determined not to be sensitive information in the text data, and the target phrase is added to the regular word database. In the above manner, misjudgment caused by the difference between the first probability and the second probability being too small can be avoided.
[0077] S206: If the text data contains sensitive information, the terminal updates the target acquisition method according to the sensitive information.
[0078] In the embodiment of the present invention, after the terminal determines that the text data contains sensitive information, the target acquisition method is updated according to the sensitive information.
[0079] In one implementation, a specific method for the terminal to update the target acquisition method based on the sensitive information may be that the terminal obtains the number of sensitive phrases in the sensitive information, and determines a target frequency increase for the target acquisition frequency based on a correspondence between the number and the frequency increase; and determines a target time period increase for the target acquisition time period based on a correspondence between the number and the time period increase. Further, the terminal updates the target acquisition method based on the target frequency increase and the target time period increase.
[0080] In one implementation, a specific method for the terminal to update the target acquisition method based on the sensitive information may be that the terminal obtains the category of sensitive phrases in the sensitive information, and determines the target frequency increase for the target acquisition frequency based on the correspondence between the category and the frequency increase; and determines the target time period increase for the target acquisition time period based on the correspondence between the quantity and the time period increase. Further, the terminal updates the target acquisition method based on the target frequency increase and the target time period increase.
[0081] In one implementation, a specific method for the terminal to update the target acquisition method based on the sensitive information may be that the terminal obtains the category of sensitive phrases in the sensitive information, and determines the target frequency increase for the target acquisition frequency based on the correspondence between the category and the frequency increase; and determines the target time period increase for the target acquisition time period based on the correspondence between the category and the time period increase. Further, the terminal updates the target acquisition method based on the target frequency increase and the target time period increase.
[0082] In one implementation, after the terminal obtains the text data, if the text data does not contain sensitive information, the terminal obtains a target number of text data corresponding to at least one text data obtained historically that does not contain sensitive information, and determines to update the target acquisition method based on the target number. Specifically, a target frequency reduction for the target acquisition frequency is determined based on the correspondence between the target number and the frequency reduction; and a target time period reduction for the target acquisition time period is determined based on the correspondence between the number and the time period reduction. Furthermore, the terminal updates the target acquisition method based on the target frequency reduction and the target time period reduction. For example, in the initial target acquisition method, the target acquisition frequency is 20 times / hour, and the target acquisition time period is 2:00-5:00. If the terminal detects that there is no sensitive information in the text data, the terminal obtains the target number of text data that does not contain sensitive information in at least one text data acquired historically, and determines that the first reduction corresponding to the target number is 1 time / hour, and the reduction in the target acquisition time period is 1 hour, then the terminal updates the target acquisition method according to the reduction in the target frequency and the reduction in the target time period, and obtains an updated target acquisition frequency of 19 times / hour, and an updated target acquisition time period of 2:30-4:30. It should be noted that the minimum acquisition frequency and the shortest acquisition time period can be pre-set. When the updated target acquisition frequency is less than the minimum acquisition frequency, the terminal determines the minimum acquisition frequency as the text data acquisition frequency for the target source object. When the updated target time period is shorter than the minimum acquisition time period, the terminal determines the shortest acquisition time period as the text data acquisition time period for the target source object.
[0083] Furthermore, after the updated target acquisition method is used to acquire the text data generated by the target source object, it is detected whether the text data contains sensitive information. When sensitive information is detected, a corresponding alarm can be issued to indicate that the text data contains sensitive information.
[0084] In an embodiment of the present invention, the terminal obtains text data from the target source object based on the target acquisition method. When the preset database determines whether the text data contains sensitive information, the terminal determines whether the text data contains sensitive information based on the preset database. If the preset database cannot determine, the terminal determines whether the text data contains sensitive information based on the preset rules. If the preset rules cannot determine, the terminal determines whether the text data contains sensitive information based on the neural network model. Furthermore, the terminal can also determine the data acquisition method for the application that generates the text data based on the sensitive information. By implementing the above method, the accuracy and efficiency of monitoring sensitive information are improved.
[0085] Based on the description of the above sensitive information detection method embodiment, the present invention also discloses a sensitive information detection device. The sensitive information detection device can be a computer program (including program code) running in a terminal, or a physical device included in the terminal. The sensitive information detection device can execute Figure 1-Figure 2 See the method shown in Figure 3 The sensitive information detection device 30 includes: an acquisition module 301, a processing module 302, a detection module 303, a judgment module 304, and an update module 305.
[0086] An acquisition module 301 is used to acquire text data from a target source object based on a target acquisition method, wherein the target acquisition method includes a target acquisition frequency and a target acquisition time period for the target source object;
[0087] A processing module 302 is used to perform word segmentation processing on the text data to obtain at least one phrase;
[0088] A detection module 303 is used to detect whether each of the at least one phrase is stored in a preset database, wherein the preset database includes a sensitive word database or a regular word database, wherein the sensitive word database stores at least one sensitive phrase, and the regular word database stores at least one non-sensitive phrase;
[0089] A determination module 304, configured to determine whether the text data contains sensitive information according to the preset database if it is detected that each of the at least one phrase is stored in the preset database;
[0090] The determination module 304 is further configured to determine whether the text data contains sensitive information according to a preset sensitive information determination rule if it is detected that the at least one phrase contains a target phrase that is not stored in the preset database;
[0091] The updating module 305 is used to update the target acquisition method according to the sensitive information if the text data contains sensitive information.
[0092] In one implementation, the determination module 304 is specifically configured to:
[0093] If it is detected that the at least one phrase contains a target sensitive phrase stored in the sensitive phrase database, determining the target sensitive phrase as sensitive information contained in the text data;
[0094] If it is detected that each of the at least one word group is stored in the regular word database, it is determined that the text data does not contain sensitive information.
[0095] In one implementation, the sensitive information determination rule is specifically used to determine the length of the target phrase and the format of the target phrase, and the determination module 304 is specifically used to:
[0096] Acquire the length of the target phrase and the format of the target phrase;
[0097] Determining a target format matching model from at least one format matching model according to the length of the target phrase;
[0098] Detecting whether the format of the target phrase matches the target format matching model;
[0099] If the format of the target phrase matches the target format matching model, the target phrase is determined to be sensitive information in the text data.
[0100] In one implementation, the update module 305 is specifically used to:
[0101] The target phrase is added to the sensitive word database to update the sensitive phrase stored in the sensitive word database.
[0102] In one implementation, the determination module 304 is specifically configured to:
[0103] If the format of the target phrase does not match the target format matching model, the target phrase is input into a preset deep learning model, wherein the preset deep learning model includes a sensitive word learning model and a regular word learning model, wherein the sensitive word learning model is used to output the probability that the phrase belongs to a sensitive phrase, and the regular word learning model is used to output the probability that the phrase belongs to a regular phrase;
[0104] Obtaining a first probability output by the sensitive word learning model and a second probability output by the regular word learning model;
[0105] It is determined whether the target phrase is sensitive information in the text data according to the first probability and the second probability.
[0106] In one implementation, the determination module 304 is specifically configured to:
[0107] calculating an absolute value of a difference between the first probability and the second probability;
[0108] If the absolute value of the difference is greater than a preset value, detecting the magnitude of the first probability and the second probability;
[0109] If the first probability is greater than the second probability, determining that the target phrase is sensitive information in the text data;
[0110] If the first probability is less than the second probability, it is determined that the target phrase is not sensitive information in the text data.
[0111] In one implementation, the update module 305 is specifically used to:
[0112] Obtaining the number of sensitive phrases in the sensitive information;
[0113] Determining a target frequency increase for the target acquisition frequency according to a corresponding relationship between the quantity and the frequency increase;
[0114] Determine a target time period increase for the target acquisition time period according to a corresponding relationship between the quantity and the time period increase;
[0115] The target acquisition method is updated according to the target frequency increase and the target time period increase.
[0116] In the embodiment of the present invention, the acquisition module 301 acquires text data from the target source object based on the target acquisition method, the processing module 302 performs word segmentation processing on the text data to obtain at least one phrase, and the detection module 303 detects whether each phrase in the at least one phrase is stored in the preset database. If it is detected that each phrase in the at least one phrase is stored in the preset database, the judgment module 304 judges whether the text data contains sensitive information according to the preset database; if it is detected that there is a target phrase in at least one phrase that is not stored in the preset database, the judgment module 304 judges whether the text data contains sensitive information according to the preset sensitive information judgment rule. If the text data contains sensitive information, the update module updates the target acquisition method according to the sensitive information. By implementing the above method, the accuracy and efficiency of sensitive information monitoring can be improved.
[0117] See also Figure 4 , is a schematic diagram of the structure of a terminal provided by an embodiment of the present invention. Figure 4 As shown, the terminal includes: at least one processor 401, an input device 403, an output device 404, a memory 405, and at least one communication bus 402. The communication bus 402 is used to realize the connection and communication between these components. The memory 405 can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. The memory 405 can also be at least one storage device located away from the aforementioned processor 401. The processor 401 can be combined with Figure 3 In the described apparatus, a set of program codes is stored in the memory 405, and the processor 401, the input device 403, and the output device 404 call the program codes stored in the memory 405 to perform the following operations:
[0118] Processor 401, acquires text data from a target source object based on a target acquisition method, wherein the target acquisition method includes a target acquisition frequency and a target acquisition time period for the target source object;
[0119] Processor 401, configured to perform word segmentation processing on the text data to obtain at least one phrase;
[0120] Processor 401, configured to detect whether each of the at least one phrase is stored in a preset database, wherein the preset database includes a sensitive word database or a regular word database, wherein the sensitive word database stores at least one sensitive phrase, and the regular word database stores at least one non-sensitive phrase;
[0121] Processor 401, configured to determine whether the text data contains sensitive information according to the preset database if it is detected that each of the at least one phrase is stored in the preset database;
[0122] Processor 401, configured to determine whether the text data contains sensitive information according to a preset sensitive information determination rule if it is detected that there is a target phrase in the at least one phrase that is not stored in the preset database;
[0123] The processor 401 is configured to update the target acquisition method according to the sensitive information if the text data contains sensitive information.
[0124] In one implementation, the processor 401 is specifically configured to:
[0125] If it is detected that the at least one phrase contains a target sensitive phrase stored in the sensitive phrase database, determining the target sensitive phrase as sensitive information contained in the text data;
[0126] If it is detected that each of the at least one word group is stored in the regular word database, it is determined that the text data does not contain sensitive information.
[0127] In one implementation, the sensitive information determination rule is specifically used to determine the length of the target phrase and the format of the target phrase, and the processor 401 is specifically used to:
[0128] Acquire the length of the target phrase and the format of the target phrase;
[0129] Determining a target format matching model from at least one format matching model according to the length of the target phrase;
[0130] Detecting whether the format of the target phrase matches the target format matching model;
[0131] If the format of the target phrase matches the target format matching model, the target phrase is determined to be sensitive information in the text data.
[0132] In one implementation, the processor 401 is specifically configured to:
[0133] The target phrase is added to the sensitive word database to update the sensitive phrase stored in the sensitive word database.
[0134] In one implementation, the processor 401 is specifically configured to:
[0135] If the format of the target phrase does not match the target format matching model, the target phrase is input into a preset deep learning model, wherein the preset deep learning model includes a sensitive word learning model and a regular word learning model, wherein the sensitive word learning model is used to output the probability that the phrase belongs to a sensitive phrase, and the regular word learning model is used to output the probability that the phrase belongs to a regular phrase;
[0136] Obtaining a first probability output by the sensitive word learning model and a second probability output by the regular word learning model;
[0137] It is determined whether the target phrase is sensitive information in the text data according to the first probability and the second probability.
[0138] In one implementation, the processor 401 is specifically configured to:
[0139] calculating an absolute value of a difference between the first probability and the second probability;
[0140] If the absolute value of the difference is greater than a preset value, detecting the magnitude of the first probability and the second probability;
[0141] If the first probability is greater than the second probability, determining that the target phrase is sensitive information in the text data;
[0142] If the first probability is less than the second probability, it is determined that the target phrase is not sensitive information in the text data.
[0143] In one implementation, the processor 401 is specifically configured to:
[0144] Obtaining the number of sensitive phrases in the sensitive information;
[0145] Determining a target frequency increase for the target acquisition frequency according to a corresponding relationship between the quantity and the frequency increase;
[0146] Determine a target time period increase for the target acquisition time period according to a corresponding relationship between the quantity and the time period increase;
[0147] The target acquisition method is updated according to the target frequency increase and the target time period increase.
[0148] In an embodiment of the present invention, processor 401 acquires text data from a target source object based on a target acquisition method, processor 401 performs word segmentation processing on the text data to obtain at least one phrase, and processor 401 detects whether each phrase in at least one phrase is stored in a preset database. If it is detected that each phrase in at least one phrase is stored in the preset database, processor 401 determines whether the text data contains sensitive information according to the preset database; if it is detected that there is a target phrase in at least one phrase that is not stored in the preset database, processor 401 determines whether the text data contains sensitive information according to a preset sensitive information judgment rule. If the text data contains sensitive information, processor 401 updates the target acquisition method according to the sensitive information. By implementing the above method, the accuracy and efficiency of sensitive information monitoring can be improved.
[0149] The modules described in the embodiments of the present invention may be implemented by a general integrated circuit, such as a CPU (Central Processing Unit), or by an ASIC (Application Specific Integrated Circuit).
[0150] It should be understood that in the embodiment of the present invention, the processor 401 may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0151] The bus 402 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus 402 may be divided into a location bus, a data bus, a control bus, etc. For ease of representation, Figure 4 It is represented by only one thick line, but it does not mean that there is only one bus or one type of bus.
[0152] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The computer-readable storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0153] The above disclosure is only the preferred embodiment of the present invention, which certainly cannot be used to limit the scope of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope of the present invention.
Claims
1. A sensitive information detection method, characterized in that: The method comprises: Acquiring text data from a target source object based on a target acquisition method, wherein the target acquisition method includes a target acquisition frequency and a target acquisition time period for the target source object, and the target acquisition method is pre-set by a user; Performing word segmentation processing on the text data to obtain at least one phrase; Detecting whether each of the at least one phrase is stored in a preset database, wherein the preset database includes a sensitive word database or a regular word database, wherein the sensitive word database stores at least one sensitive phrase, and the regular word database stores at least one non-sensitive phrase; If it is detected that each of the at least one phrase is stored in the preset database, determining whether the text data contains sensitive information according to the preset database; If it is detected that there is a target phrase that is not stored in the preset database in the at least one phrase, whether the text data contains sensitive information is determined according to a preset sensitive information determination rule; the sensitive information determination rule is specifically used to determine the length of the target phrase and the format of the target phrase, and determining whether the text data contains sensitive information according to the preset sensitive information determination rule includes: Acquire the length of the target phrase and the format of the target phrase; Determining a target format matching model from at least one format matching model according to the length of the target phrase; detecting whether the format of the target phrase matches the target format matching model; If the format of the target phrase matches the target format matching model, determining that the target phrase is sensitive information in the text data, and adding the target phrase to the sensitive word database to update the sensitive phrases stored in the sensitive word database; If the format of the target phrase does not match the target format matching model, the target phrase is input into a preset deep learning model, wherein the preset deep learning model includes a sensitive word learning model and a regular word learning model, wherein the sensitive word learning model is used to output the probability that the phrase belongs to a sensitive phrase, and the regular word learning model is used to output the probability that the phrase belongs to a regular phrase; Obtaining a first probability output by the sensitive word learning model and a second probability output by the regular word learning model; calculating an absolute value of a difference between the first probability and the second probability; If the absolute value of the difference is greater than a preset value, detecting the magnitude of the first probability and the second probability; If the first probability is greater than the second probability, determining that the target phrase is sensitive information in the text data; If the first probability is less than the second probability, determining that the target phrase is not sensitive information in the text data; If the text data contains sensitive information, the target acquisition method is updated according to the sensitive information.
2. The method according to claim 1, characterized in that The determining whether the text data contains sensitive information according to the preset database includes: If it is detected that the at least one phrase contains a target sensitive phrase stored in the sensitive phrase database, determining the target sensitive phrase as sensitive information contained in the text data; If it is detected that each of the at least one word group is stored in the regular word database, it is determined that the text data does not contain sensitive information.
3. The method according to claim 1, characterized in that The updating of the target acquisition method according to the sensitive information includes: Obtaining the number of sensitive phrases in the sensitive information; Determining a target frequency increase for the target acquisition frequency according to a corresponding relationship between the quantity and the frequency increase; Determine a target time period increase for the target acquisition time period according to a corresponding relationship between the quantity and the time period increase; The target acquisition method is updated according to the target frequency increase and the target time period increase.
4. A sensitive information detection device, characterized in that: The device comprises: An acquisition module, used for acquiring text data from a target source object based on a target acquisition method, wherein the target acquisition method includes a target acquisition frequency and a target acquisition time period for the target source object, and the target acquisition method is pre-set by a user; A processing module, used for performing word segmentation processing on the text data to obtain at least one phrase; A detection module, configured to detect whether each of the at least one phrase is stored in a preset database, wherein the preset database includes a sensitive word database or a regular word database, wherein the sensitive word database stores at least one sensitive phrase, and the regular word database stores at least one non-sensitive phrase; a judgment module, configured to judge whether the text data contains sensitive information according to the preset database if it is detected that each of the at least one phrase is stored in the preset database; The judgment module is further configured to judge whether the text data contains sensitive information according to a preset sensitive information judgment rule if it is detected that there is a target phrase in the at least one phrase that is not stored in the preset database; the sensitive information judgment rule is specifically used to judge the length of the target phrase and the format of the target phrase, and the judgment module is specifically used to: Acquire the length of the target phrase and the format of the target phrase; Determining a target format matching model from at least one format matching model according to the length of the target phrase; detecting whether the format of the target phrase matches the target format matching model; If the format of the target phrase matches the target format matching model, determining that the target phrase is sensitive information in the text data, and adding the target phrase to the sensitive word database to update the sensitive phrases stored in the sensitive word database; If the format of the target phrase does not match the target format matching model, the target phrase is input into a preset deep learning model, wherein the preset deep learning model includes a sensitive word learning model and a regular word learning model, wherein the sensitive word learning model is used to output the probability that the phrase belongs to a sensitive phrase, and the regular word learning model is used to output the probability that the phrase belongs to a regular phrase; Obtaining a first probability output by the sensitive word learning model and a second probability output by the regular word learning model; calculating an absolute value of a difference between the first probability and the second probability; If the absolute value of the difference is greater than a preset value, detecting the magnitude of the first probability and the second probability; If the first probability is greater than the second probability, determining that the target phrase is sensitive information in the text data; If the first probability is less than the second probability, determining that the target phrase is not sensitive information in the text data; An updating module is used to update the target acquisition method according to the sensitive information if the text data contains sensitive information.
5. A terminal, characterized in that: The method comprises a processor, an input interface, an output interface and a memory, wherein the processor, the input interface, the output interface and the memory are interconnected, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method according to any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 3.
