Information desensitization processing method, system, device and medium based on group chat
By preprocessing group chat information and identifying sensitive information, and processing sensitive information in combination with desensitization rules, the problem of difficulty in identifying and processing sensitive information in multiple chat information in the prior art is solved, and a more comprehensive and effective chat information desensitization is achieved.
Patent Information
- Application Number
- CN202410827658.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2044-06-25
AI Technical Summary
Existing chat information desensitization technologies are difficult to identify and process sensitive information in multiple chat information, especially when sensitive information is sent through segments, it cannot effectively protect the user's sensitive information.
By defining sensitive information, obtaining group chat information for pre-processing, extracting character information and text information, identifying sensitive information, obtaining sensitive chat information, and desensitizing rules to desensitize it.
It realizes the identification and desensitization of sensitive information of multiple group chat information, improves the comprehensiveness and effectiveness of desensitization of chat information, and ensures effective protection of user sensitive information.
Smart Images

Figure CN118734358B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of chat information desensitization, and in particular to an information desensitization processing method, system, device and medium based on group chat. Background Art
[0002] Chat information desensitization technology refers to a technology used to protect personal privacy. By processing chat data, sensitive information cannot be directly identified or associated with specific individuals. Its purpose is to minimize potential privacy leakage risks while retaining data availability.
[0003] Existing chat information desensitization technology usually identifies sensitive information in a single chat message, and it is difficult to identify sensitive information interspersed with symbols or other irrelevant characters in the sensitive information. At the same time, the existing chat information desensitization technology is difficult to identify sensitive information in multiple chat messages. If group members send sensitive information to the group by dividing the sensitive information into multiple chat messages, the existing chat information desensitization technology cannot identify and desensitize it. For example, in a Chinese patent application with application publication number CN116662510A, an online human-computer conversation desensitization method and software product using an artificial intelligence algorithm are disclosed. When identifying sensitive information, this solution can only identify a single conversation text, and cannot identify multiple texts sent continuously by the user, resulting in sensitive information being sent in the form of separate pieces. The existing chat information desensitization technology also has the problem of only being able to identify sensitive information in a single chat message, resulting in the inability to effectively protect the user's sensitive information. Summary of the invention
[0004] The present invention aims to solve one of the technical problems in the prior art to at least a certain extent, by defining sensitive information, obtaining group chat information after the definition is completed, performing information preprocessing on the group chat information, extracting character information and text information in multiple group chat messages, then performing sensitive information identification on the character information and text information to obtain sensitive chat information, and then defining desensitization rules, and desensitizing the sensitive chat information based on the desensitization rules, so as to solve the problem that the existing chat information desensitization technology can only identify sensitive information for a single chat message, resulting in an inability to effectively protect the user's sensitive information.
[0005] To achieve the above objectives, in a first aspect, the present application provides a method for desensitizing information based on group chat, comprising the following steps:
[0006] Define sensitive information;
[0007] Obtain group chat information, perform information preprocessing on the group chat information, and extract character information and text information from the group chat information;
[0008] Perform sensitive information identification on character information and text information to obtain sensitive chat information;
[0009] Define desensitization rules and desensitize sensitive chat information based on the desensitization rules.
[0010] Furthermore, the definition of sensitive information includes defining name, address, telephone number, email address and ID number as sensitive information.
[0011] Furthermore, obtaining the group chat information, performing information preprocessing on the group chat information, and extracting character information and text information from the group chat information includes the following sub-steps:
[0012] Get group chat information based on user name and mark it as user speech information;
[0013] Number the user's speech information, using the symbol UM n It represents, where n is a positive integer and n is the sequence number of UM;
[0014] Starting from n=1, the first number of UMs are obtained in sequence n , namely UM1 to UM N , N is the first number, UM1 to UM N The corresponding user speech information is combined in the order of n from small to large to obtain the initial combination information; n+1 is added to obtain UM2 to UM N+1 And combine to obtain new initial combination information; and so on, obtain several pieces of initial combination information of the user;
[0015] Number the characters in the initial combination information, using the symbol ICI m Represents, where m is a positive integer and m is the serial number of the ICI;
[0016] Starting with m=1, search for ICI m Whether it is a Chinese character, a comma or a period, if so, output a text information signal; if not, output a character information signal;
[0017] If the text information signal is output, ICI m Incorporate text information; if outputting character information signals, ICI m Including character information; ICI in the text information and character information m They are arranged in order from small to large m.
[0018] Furthermore, performing sensitive information identification on the character information and text information to obtain sensitive chat information includes the following sub-steps:
[0019] The text information is identified through the named entity recognition model to search for names and addresses therein. If a name is found in the text information, the corresponding name is marked as name information to be processed; if an address is found in the text information, the corresponding address is marked as address information to be processed;
[0020] Check whether the symbol "@" exists in the character information. If it does, output a mailbox search signal; if it does not, output a no mailbox signal;
[0021] If the mailbox search signal is output, the second number of letters, numbers and underscores are searched forward starting from the symbol "@", and the second number of letters, numbers and underscores before the symbol "@" are combined and marked as mailbox name information; the symbol "." is searched backward, and the letters and numbers between the "@" and the "." are combined and marked as domain name information; the third number of letters and numbers after the symbol "." are combined and marked as suffix information;
[0022] Combine the mailbox name information, domain name information and suffix information in the format of "mailbox name information@domain name information.suffix information" to obtain the mailbox information to be verified;
[0023] The mailbox information to be verified is verified through the mailbox regular expression "^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*". If the mailbox information to be verified is an email, a mailbox confirmation signal is output; if the mailbox information to be verified is not an email, a no mailbox information signal is output;
[0024] If the mailbox confirmation signal is output, the mailbox information to be verified is marked as mailbox information to be processed, and the mailbox information to be processed is removed from the character information;
[0025] If there is no mailbox signal output, the numbers in the character information are extracted in the order of m from small to large, and the digital information is obtained by combining them;
[0026] Identify sensitive digital information.
[0027] Furthermore, the sensitive information identification of digital information includes the following sub-steps:
[0028] Number the numbers in the digital information, using the symbol NUM i Indicates, where i is a positive integer and i is the sequence number of NUM;
[0029] Find the NUM of the number "1" in the digital information i , mark the corresponding i as j;
[0030] Set the fourth quantity, represented by the symbol t, to NUM j to NUMj+t-1 The corresponding numbers are combined and marked as numbers to be verified;
[0031] The number to be verified is verified through the number regular expression "^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$". If the number to be verified is a phone number, a number confirmation signal is output; if the number to be verified is not a phone number, a no number information signal is output;
[0032] If a number confirmation signal is output, the number to be verified is marked as number information to be processed;
[0033] Verify whether the ID number exists in the digital information.
[0034] Furthermore, verifying whether the ID card number exists in the digital information includes the following sub-steps:
[0035] Set the fifth digit, represented by the symbol g, to NUM i to NUM i+g-1 The digital combination is marked as the ID card to be verified, 1≤i≤max(i)-g, max(i) is the maximum value of i;
[0036] The ID card to be verified is verified through the ID card regular expression " / ^([1-6][1-9]|50)\d{4}(18|19|20)\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$ / ". If the ID card to be verified is the ID card number, the ID card confirmation signal is output; if the ID card to be verified is not the ID card number, the non-identity information signal is output;
[0037] If the ID card confirmation signal is output, the ID card to be verified will be marked as identity information to be processed.
[0038] Furthermore, desensitization rules are defined, and desensitization processing of sensitive chat information based on the desensitization rules includes the following sub-steps:
[0039] The sensitive chat information includes name information to be processed, address information to be processed, email information to be processed, phone number information to be processed, and identity information to be processed;
[0040] Replace the text corresponding to the name information to be processed with [Name A]. If it is not in the same group chat message, replace the corresponding text in the group chat message sent later, and directly delete the corresponding text in the group chat message that has been sent;
[0041] Replace the text corresponding to the address information to be processed with [Address A]. If the text is not in the same group chat message, replace the corresponding text in the group chat message sent later, and directly delete the corresponding text in the group chat message that has been sent;
[0042] Replace the characters corresponding to the mailbox information to be processed with [Mailbox A]. If the characters are not in the same group chat message, replace the corresponding characters in the group chat message sent later, and directly delete the corresponding characters in the group chat message that has been sent;
[0043] Replace the number corresponding to the number to be processed with [number A]. If the number is not in the same group chat message, replace the corresponding number in the group chat message sent later, and directly delete the corresponding number in the group chat message that has been sent;
[0044] Replace the number corresponding to the identity information to be processed with [Identity A]. If the number is not in the same group chat message, replace the corresponding number in the group chat message sent later, and directly delete the corresponding number in the group chat message that has been sent;
[0045] After the replacement is completed, the original sensitive chat information will be deleted.
[0046] In a second aspect, the present application provides an information desensitization processing system based on group chat, including a sensitive information definition module, a chat information extraction module, a sensitive information identification module and an information desensitization processing module; the sensitive information definition module, the chat information extraction module and the information desensitization processing module are respectively connected to the sensitive information identification module data;
[0047] The sensitive information definition module is used to define sensitive information;
[0048] The chat information extraction module is used to obtain group chat information, perform information preprocessing on the group chat information, and extract character information and text information from the group chat information;
[0049] The sensitive information identification module is used to perform sensitive information identification on character information and text information to obtain sensitive chat information;
[0050] The information desensitization processing module is used to define desensitization rules and perform desensitization processing on sensitive chat information based on the desensitization rules.
[0051] In a third aspect, the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps in any one of the methods described above are executed.
[0052] In a fourth aspect, the present application provides a storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps in any one of the methods described above are executed.
[0053] Beneficial effects of the present invention: The present invention defines sensitive information, obtains group chat information after the definition is completed, performs information preprocessing on the group chat information, and extracts character information and text information from multiple group chat messages. The advantage is that the extraction of multiple group chat messages can combine the chat messages sent by users, and the scope of recognition is wider, rather than only being able to identify sensitive information for a single chat message, thereby improving the comprehensiveness and effectiveness of chat information desensitization;
[0054] The present invention performs sensitive information identification on character information and text information to obtain sensitive chat information, and then defines desensitization rules to perform desensitization processing on the sensitive chat information based on the desensitization rules. The advantage is that sensitive information identification is performed on character information and text information respectively, which can effectively prevent the problem of recognition failure caused by other irrelevant texts or characters inserted in sensitive information, thereby improving the accuracy and effectiveness of chat information desensitization.
[0055] The present invention deletes the original sensitive chat information after desensitizing the sensitive chat information. The advantage is that if the sensitive chat information is encrypted, it still carries the risk of being cracked, but direct deletion can avoid this risk, thereby improving the security of chat information desensitization. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 is a functional block diagram of the system of the present invention;
[0057] Figure 2 A schematic diagram of numbering user speech information according to the present invention;
[0058] Figure 3 This is a schematic diagram of the present invention after desensitizing sensitive chat information;
[0059] Figure 4 The figure is a flow chart of the steps of the method of the present invention. DETAILED DESCRIPTION
[0060] 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 only 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.
[0061] Example 1, please refer to Figure 1As shown, the present application provides an information desensitization processing system based on group chat, including a sensitive information definition module, a chat information extraction module, a sensitive information identification module and an information desensitization processing module; the sensitive information definition module, the chat information extraction module and the information desensitization processing module are respectively connected to the sensitive information identification module data;
[0062] The sensitive information definition module is used to define sensitive information; the definition of sensitive information includes defining name, address, telephone number, email address and ID number as sensitive information;
[0063] The chat information extraction module is used to obtain group chat information, perform information preprocessing on the group chat information, and extract character information and text information from the group chat information;
[0064] The chat information extraction module is configured with a chat information extraction strategy, which includes:
[0065] Get group chat information based on user name and mark it as user speech information;
[0066] See also Figure 2 As shown, the user speech information is numbered and represented by the symbol UM n It represents, where n is a positive integer and n is the sequence number of UM;
[0067] Starting from n=1, the first number of UMs are obtained in sequence n , namely UM1 to UM N , N is the first number, UM1 to UM N The corresponding user speech information is combined in the order of n from small to large to obtain the initial combination information; n+1 is added to obtain UM2 to UM N+1 And combine to obtain new initial combination information; and so on, obtain several pieces of initial combination information of the user;
[0068] In practical applications, since the longest sensitive information to be determined is the ID card number, which is 18 digits, the first number is set to 18, and the numbering is obtained from UM1 to UM 12 UM not obtained 13 To UM 18 , so it is not analyzed, only UM1 to UM 12 After analysis, the initial combination information is obtained as "Please remember my phone number 1+3+8+888-8*8#888". Assuming that the current initial combination information is UM1 to UM 18 At this time, n+1, that is, UM2 to UM 19 Combine into new initial combination information;
[0069] Number the characters in the initial combination information, using the symbol ICI m Represents, where m is a positive integer and m is the serial number of the ICI;
[0070] Starting with m=1, search for ICI m Whether it is a Chinese character, a comma or a period, if so, output a text information signal; if not, output a character information signal;
[0071] If the text information signal is output, ICI m Incorporate text information; if outputting character information signals, ICI m Inclusion of character information; text information and ICI in character information m They are arranged in order from small to large m;
[0072] In actual application, the initial combination information is "Please remember my phone number 1+3+8+888-8*8#888", and the characters are numbered to obtain ICI1 to ICI 25 They are "you", "remember", "one", "next", "I", "of", "telephone", "1", "+", "3", "+", "8", "+", "8", "8", "8", "-", "8", "*", "8", "#", "8", "8" and "8" respectively. Through searching and comparing, the text information obtained is "Please remember my phone number" and the character information is "1+3+8+888-8*8#888".
[0073] The sensitive information recognition module is used to perform sensitive information recognition on character information and text information to obtain sensitive chat information; the sensitive information recognition module includes a character and text recognition unit, a number recognition unit, and an ID card recognition unit;
[0074] The character recognition unit is configured with a character recognition strategy, which includes:
[0075] The text information is identified through the named entity recognition model to search for names and addresses therein. If a name is found in the text information, the corresponding name is marked as name information to be processed; if an address is found in the text information, the corresponding address is marked as address information to be processed;
[0076] In practical applications, the named entity recognition model is implemented using the existing ALBERT+Bi-LSTM model. Since the existing model technology is used, this embodiment will not give examples of the analysis process, but only show the analysis results; if the name and address do not exist in the text information, no marking is required;
[0077] Check whether the symbol "@" exists in the character information. If it does, output a mailbox search signal; if it does not, output a no mailbox signal;
[0078] If the mailbox search signal is output, the second number of letters, numbers and underscores are searched forward starting from the symbol "@", and the second number of letters, numbers and underscores before the symbol "@" are combined and marked as mailbox name information; the symbol "." is searched backward, and the letters and numbers between the "@" and the "." are combined and marked as domain name information; the third number of letters and numbers after the symbol "." are combined and marked as suffix information;
[0079] Combine the mailbox name information, domain name information and suffix information in the format of "mailbox name information@domain name information.suffix information" to obtain the mailbox information to be verified;
[0080] The mailbox information to be verified is verified through the mailbox regular expression "^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*". If the mailbox information to be verified is an email, a mailbox confirmation signal is output; if the mailbox information to be verified is not an email, a no mailbox information signal is output;
[0081] In actual applications, verification through mailbox regular expressions is performed by Python code, specifically:
[0082]
[0083] If the output is True, it means that the email address to be verified is an email address. If the output is False, it means that the email address to be verified is not an email address.
[0084] If the mailbox confirmation signal is output, the mailbox information to be verified is marked as mailbox information to be processed, and the mailbox information to be processed is removed from the character information;
[0085] If there is no mailbox signal output, the numbers in the character information are extracted in the order of m from small to large, and the digital information is obtained by combining them;
[0086] In actual application, it is found that the symbol "@" does not exist in the character information, and a no mailbox signal is output. At this time, the character information is "1+3+8+888-8*8#888", and the digital information extracted is "13888888888". Since the mailbox search signal is not output, the mailbox analysis process is not specifically displayed in this embodiment, and only a partial explanation is given. Starting with the symbol "@", search forward for the second number of letters, numbers and underscores, and merge the second number of letters, numbers and underscores before the symbol "@" as mailbox name information; search backward for the symbol ".", and merge the letters and numbers between the "@" and the "." as domain name information; merge the third number of letters and numbers after the symbol "." as suffix information; wherein the second number is the upper limit of the character length of the mailbox name, which is generally 16 bits, the domain name information is the letters and numbers between the symbols "@" and ".", and the third number is the upper limit of the suffix information, which is generally 3 bits, and the mailbox name supports the format of numbers, letters and underscores, and the suffix information supports the format of numbers and letters;
[0087] The digital identification unit is configured with a digital identification strategy, which includes:
[0088] Number the numbers in the digital information, using the symbol NUM i Indicates, where i is a positive integer and i is the sequence number of NUM;
[0089] Find the NUM of the number "1" in the digital information i , mark the corresponding i as j;
[0090] Set the fourth quantity, represented by the symbol t, to NUM j to NUM j+t-1 The corresponding numbers are combined and marked as numbers to be verified;
[0091] In actual applications, the digital information is "13888888888", and the numbers NUM1 to NUM 11 The numbers are "1", "3", "8", "8", "8", "8", "8", "8", "8", "8", and "8" respectively. The number "1" corresponds to NUM1, i=1, and 1 is marked as j, that is, j=1 at this time. Since the number of digits in a mobile phone number is usually 11 and the landline number is usually not sensitive information, the number of digits in the landline number is not considered, and only the number of digits in the mobile phone number is considered. Therefore, the fourth number is set to 11, that is, NUM1 to NUM 11 The numbers are combined and marked as the number to be verified. At this time, the number to be verified is "13888888888";
[0092] The number to be verified is verified through the number regular expression "^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$". If the number to be verified is a phone number, a number confirmation signal is output; if the number to be verified is not a phone number, a no number information signal is output;
[0093] If a number confirmation signal is output, the number to be verified is marked as number information to be processed;
[0094] In actual applications, verification through number regular expressions is performed through Python code, specifically:
[0095]
[0096]
[0097] Outputting True means that the number to be verified is a mobile phone number, and a number confirmation signal is output at this time; marking "13888888888" as the number information to be processed;
[0098] The ID card recognition unit is configured with an ID card recognition strategy, which includes:
[0099] Set the fifth digit, represented by the symbol g, to NUM i to NUM i+g-1 The digital combination is marked as the ID card to be verified, 1≤i≤max(i)-g, max(i) is the maximum value of i;
[0100] In actual application, since the ID card number is 18 digits, the fifth digit is set to 18, that is, NUM i to NUM i+18-1 The numbers are combined and marked as the ID card to be verified. If the number is less than 18 digits, an "X" is added to the end of the number to be verified before verification. If the number has 18 digits, whether the ID card ends with "X" has no effect on the verification result. At this time, the number to be verified is "13888888888", which is less than 18 digits, so "X" is added to get the ID card to be verified "13888888888X";
[0101] The ID card to be verified is verified through the ID card regular expression " / ^([1-6][1-9]|50)\d{4}(18|19|20)\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$ / ". If the ID card to be verified is the ID card number, the ID card confirmation signal is output; if the ID card to be verified is not the ID card number, the non-identity information signal is output;
[0102] If the ID card confirmation signal is output, the ID card to be verified is marked as identity information to be processed;
[0103] In actual applications, verification through ID card regular expression is performed through Python code, specifically:
[0104]
[0105]
[0106] If True is output, it means that the ID card to be verified is the ID card number; if False is output, it means that the ID card to be verified is not the ID card number.
[0107] The information desensitization processing module is used to define desensitization rules and perform desensitization processing on sensitive chat information based on the desensitization rules;
[0108] The information desensitization processing module is configured with information desensitization processing strategies, which include:
[0109] See also Figure 3 As shown, sensitive chat information includes name information to be processed, address information to be processed, email information to be processed, phone number information to be processed, and identity information to be processed;
[0110] Replace the text corresponding to the name information to be processed with [Name A]. If it is not in the same group chat message, replace the corresponding text in the group chat message sent later, and directly delete the corresponding text in the group chat message that has been sent;
[0111] Replace the text corresponding to the address information to be processed with [Address A]. If the text is not in the same group chat message, replace the corresponding text in the group chat message sent later, and directly delete the corresponding text in the group chat message that has been sent;
[0112] Replace the characters corresponding to the mailbox information to be processed with [Mailbox A]. If the characters are not in the same group chat message, replace the corresponding characters in the group chat message sent later, and directly delete the corresponding characters in the group chat message that has been sent;
[0113] Replace the number corresponding to the number to be processed with [number A]. If the number is not in the same group chat message, replace the corresponding number in the group chat message sent later, and directly delete the corresponding number in the group chat message that has been sent;
[0114] Replace the number corresponding to the identity information to be processed with [Identity A]. If the number is not in the same group chat message, replace the corresponding number in the group chat message sent later, and directly delete the corresponding number in the group chat message that has been sent;
[0115] After the replacement is completed, the original sensitive chat information will be deleted;
[0116] In actual application, in this embodiment, only the pending number information appears, and the pending number information is "13888888888", and the pending number information is not in the same group chat information, then the last sent number "8" is replaced with [number A], and then the number corresponding to the previous pending number information is deleted. At this time, the chat content in the group changes, such as Figure 3 As shown, after the replacement is completed, the original sensitive chat information will be deleted, that is, it will be forcibly shredded, and the original information will not be retained.
[0117] Example 2, please refer to Figure 4 As shown, the present application provides an information desensitization processing method based on group chat, comprising the following steps:
[0118] Step S1, defining sensitive information; defining sensitive information includes defining name, address, telephone number, email address and ID number as sensitive information;
[0119] Step S2, obtaining group chat information, performing information preprocessing on the group chat information, and extracting character information and text information in the group chat information; Step S2 includes the following sub-steps:
[0120] Step S201, obtaining group chat information based on the user name and marking it as user speech information;
[0121] Step S202: number the user speech information, using the symbol UM n It represents, where n is a positive integer and n is the sequence number of UM;
[0122] Step S203, starting from n=1, sequentially obtain the first number of UM n , namely UM1 to UM N , N is the first number, UM1 to UM N The corresponding user speech information is combined in the order of n from small to large to obtain the initial combination information; n+1 is added to obtain UM2 to UM N+1And combine to obtain new initial combination information; and so on, obtain several pieces of initial combination information of the user;
[0123] Step S204: number the characters in the initial combination information, using the symbol ICI m Represents, where m is a positive integer and m is the serial number of the ICI;
[0124] Step S205, starting with m=1, search for ICI m Whether it is a Chinese character, a comma or a period, if so, output a text information signal; if not, output a character information signal;
[0125] Step S206: If a text information signal is output, ICI m Incorporate text information; if outputting character information signals, ICI m Inclusion of character information; text information and ICI in character information m They are arranged in order from small to large m;
[0126] Step S3, performing sensitive information identification on the character information and text information to obtain sensitive chat information; Step S3 includes the following sub-steps:
[0127] Step S301, identifying the text information through a named entity recognition model, searching for names and addresses therein, and if a name is found in the text information, marking the corresponding name as name information to be processed; if an address is found in the text information, marking the corresponding address as address information to be processed;
[0128] Step S302, searching whether the symbol "@" exists in the character information, if so, outputting a mailbox search signal; if not, outputting a no mailbox signal;
[0129] Step S303, if the mailbox search signal is output, the second number of letters, numbers and underscores are searched forward starting from the symbol "@", and the second number of letters, numbers and underscores before the symbol "@" are combined and marked as mailbox name information; the symbol "." is searched backward, and the letters and numbers between the "@" and the "." are combined and marked as domain name information; the third number of letters and numbers after the symbol "." are combined and marked as suffix information;
[0130] Step S304, combining the mailbox name information, domain name information and suffix information in the format of "mailbox name information@domain name information.suffix information" to obtain the mailbox information to be verified;
[0131] Step S305, verify the mailbox information to be verified by using the mailbox regular expression "^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*", if the mailbox information to be verified is an e-mail, output a mailbox confirmation signal; if the mailbox information to be verified is not an e-mail, output a no mailbox information signal;
[0132] Step S306, if the mailbox confirmation signal is output, the mailbox information to be verified is marked as mailbox information to be processed, and the mailbox information to be processed is removed from the character information;
[0133] Step S307, if the no mailbox signal is output, the numbers in the character information are extracted in the order of m from small to large, and combined to obtain digital information;
[0134] Step S308, identifying sensitive information of the digital information;
[0135] Step S308 includes the following sub-steps:
[0136] Step S3081: Number the numbers in the digital information by using the symbol NUM i Indicates, where i is a positive integer and i is the sequence number of NUM;
[0137] Step S3082, searching for the NUM of the number "1" in the digital information i , mark the corresponding i as j;
[0138] Step S3083, set a fourth number, represented by symbol t, and replace NUM j to NUM j+t-1 The corresponding numbers are combined and marked as numbers to be verified;
[0139] Step S3084, verify the number to be verified by using the number regular expression "^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$", if the number to be verified is a phone number, output a number confirmation signal; if the number to be verified is not a phone number, output a no number information signal;
[0140] Step S3085: if a number confirmation signal is output, the number to be verified is marked as number information to be processed;
[0141] Step S3086, verifying whether the ID card number exists in the digital information;
[0142] Step S3086 includes the following sub-steps:
[0143] Step S308601, set the fifth number, represented by the symbol g, and change NUM i to NUM i+g-1 The digital combination is marked as the ID card to be verified, 1≤i≤max(i)-g, max(i) is the maximum value of i;
[0144] Step S308602, verify the identity card to be verified through the identity card regular expression " / ^([1-6][1-9]|50)\d{4}(18|19|20)\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$ / ", if the identity card to be verified is the identity card number, output the identity card confirmation signal; if the identity card to be verified is not the identity card number, output the non-identity information signal;
[0145] Step S308603, if the ID card confirmation signal is output, the ID card to be verified is marked as identity information to be processed;
[0146] Step S4, defining desensitization rules, and desensitizing sensitive chat information based on the desensitization rules; Step S4 includes the following sub-steps:
[0147] Step S401, sensitive chat information includes name information to be processed, address information to be processed, email information to be processed, number information to be processed, and identity information to be processed;
[0148] Step S402, replace the text corresponding to the name information to be processed with [Name A]. If the name is not in the same group chat message, replace the corresponding text in the group chat message sent later, and directly delete the corresponding text in the group chat message that has been sent;
[0149] Step S403, replace the text corresponding to the address information to be processed with [Address A]. If the text is not in the same group chat message, replace the corresponding text in the group chat message sent later, and directly delete the corresponding text in the group chat message that has been sent;
[0150] Step S404, replace the characters corresponding to the mailbox information to be processed with [Mailbox A]. If the characters are not in the same group chat message, replace the corresponding characters in the group chat message sent later, and directly delete the corresponding characters in the group chat message that has been sent;
[0151] Step S405, replace the number corresponding to the number information to be processed with [number A]. If the number is not in the same group chat message, replace the corresponding number in the group chat message sent later, and directly delete the corresponding number in the group chat message that has been sent;
[0152] Step S406, replace the number corresponding to the identity information to be processed with [Identity A]. If the number is not in the same group chat message, replace the corresponding number in the group chat message sent later, and directly delete the corresponding number in the group chat message that has been sent;
[0153] Step S407, after the replacement is completed, the original sensitive chat information is deleted.
[0154] Embodiment 3, the present application provides an electronic device, including a processor and a memory, the memory storing computer-readable instructions, when the computer-readable instructions are executed by the processor, the steps in the above method are executed. Through the above technical solution, the processor and the memory are interconnected and communicate with each other through a communication bus and / or other forms of connection mechanisms, the memory stores a computer program executable by the processor, when the electronic device is running, the processor executes the computer program to execute the method in any optional implementation of the above embodiment, to achieve the following functions: obtain group chat information, perform information preprocessing on the group chat information, extract character information and text information in the group chat information; perform sensitive information identification on the character information and text information to obtain sensitive chat information; define desensitization rules, and desensitize sensitive chat information based on the desensitization rules.
[0155] Embodiment 4, the present application provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps in any of the above methods are executed. Through the above technical solution, when the computer program is executed by the processor, the method in any optional implementation of the above embodiment is executed to achieve the following functions: obtain group chat information, perform information preprocessing on the group chat information, extract character information and text information in the group chat information; perform sensitive information identification on the character information and text information to obtain sensitive chat information; define desensitization rules, and perform desensitization processing on sensitive chat information based on the desensitization rules.
[0156] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0157] It should be understood by those skilled in the art that the embodiments of the present invention can be provided as methods, systems or computer program products. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program codes. Among them, the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read Only Memory, referred to as EPROM), programmable read-only memory (Programmable Read-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic memory, flash memory, disk or optical disk. These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0158] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
Claims
1. An information desensitization processing method based on group chat, characterized in that: The steps include: Define sensitive information; Obtain group chat information, perform information preprocessing on the group chat information, and extract character information and text information from the group chat information; Perform sensitive information identification on character information and text information to obtain sensitive chat information; Define desensitization rules and perform desensitization processing on sensitive chat information based on the desensitization rules; Acquiring group chat information, preprocessing the group chat information, and extracting character information and text information from the group chat information includes the following sub-steps: Get group chat information based on user name and mark it as user speech information; Number the user's speech information, using the symbol UM n It represents, where n is a positive integer and n is the sequence number of UM; Starting from n=1, the first number of UMs are obtained in sequence n , namely UM1 to UM N , N is the first number, UM1 to UM N The corresponding user speech information is combined in the order of n from small to large to obtain the initial combination information; n+1 is added to obtain UM2 to UM N+1 And combine to obtain new initial combination information; and so on, obtain several pieces of initial combination information of the user; Number the characters in the initial combination information, using the symbol ICI m Represents, where m is a positive integer and m is the serial number of the ICI; Starting with m=1, search for ICI m Whether it is a Chinese character, a comma or a period, if so, output a text information signal; if not, output a character information signal; If the text information signal is output, ICI m Incorporate text information; if outputting character information signals, ICI m Including character information; ICI in the text information and character information m They are arranged in order from small to large m; Performing sensitive information identification on character information and text information to obtain sensitive chat information includes the following sub-steps: The text information is identified through the named entity recognition model to search for names and addresses therein. If a name is found in the text information, the corresponding name is marked as name information to be processed; if an address is found in the text information, the corresponding address is marked as address information to be processed; Check whether the symbol "@" exists in the character information. If it does, output the mailbox search signal; if it does not, output the no mailbox signal; If the mailbox search signal is output, the second number of letters, numbers and underscores are searched forward starting from the symbol "@", and the second number of letters, numbers and underscores before the symbol "@" are combined and marked as mailbox name information; the symbol "." is searched backward, and the letters and numbers between "@" and "." are combined and marked as domain name information; the third number of letters and numbers after the symbol "." are combined and marked as suffix information; Combine the mailbox name information, domain name information and suffix information in the format of "mailbox name information@domain name information.suffix information" to obtain the mailbox information to be verified; The mailbox information to be verified is verified through the mailbox regular expression "^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*". If the mailbox information to be verified is an email, a mailbox confirmation signal is output; if the mailbox information to be verified is not an email, a no-mailbox information signal is output; If the mailbox confirmation signal is output, the mailbox information to be verified is marked as mailbox information to be processed, and the mailbox information to be processed is removed from the character information; If there is no mailbox signal output, the numbers in the character information are extracted in the order of m from small to large, and the digital information is obtained by combining them; Identify sensitive digital information.
2. The information desensitization processing method based on group chat according to claim 1 is characterized in that: The definition of sensitive information includes name, address, telephone number, email address and ID number.
3. The information desensitization processing method based on group chat according to claim 2 is characterized in that: Sensitive information identification of digital information includes the following sub-steps: Number the numbers in the digital information, using the symbol NUM i Indicates, where i is a positive integer and i is the sequence number of NUM; Find the NUM of the number "1" in the digital information i , mark the corresponding i as j; Set the fourth quantity, represented by the symbol t, to NUM j to NUM j+t-1 The corresponding numbers are combined and marked as numbers to be verified; The number to be verified is verified through the number regular expression "^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$". If the number to be verified is a phone number, a number confirmation signal is output; if the number to be verified is not a phone number, a no number information signal is output; If a number confirmation signal is output, the number to be verified is marked as number information to be processed; Verify whether the ID number exists in the digital information.
4. The information desensitization processing method based on group chat according to claim 3 is characterized in that: Verifying whether the ID card number exists in the digital information includes the following sub-steps: Set the fifth digit, represented by the symbol g, to NUM i to NUM i+g-1 The digital combination is marked as the ID card to be verified, 1≤i≤max(i)-g, max(i) is the maximum value of i; The ID card to be verified is verified through the ID card regular expression " / ^([1-6][1-9]|50)\d{4}(18|19|20)\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$ / ". If the ID card to be verified is the ID card number, the ID card confirmation signal is output; if the ID card to be verified is not the ID card number, the non-identity information signal is output; If the ID card confirmation signal is output, the ID card to be verified will be marked as identity information to be processed.
5. The information desensitization processing method based on group chat according to claim 4 is characterized in that: Defining desensitization rules and desensitizing sensitive chat information based on the desensitization rules includes the following sub-steps: The sensitive chat information includes name information to be processed, address information to be processed, email information to be processed, phone number information to be processed, and identity information to be processed; Replace the text corresponding to the name information to be processed with [Name A]. If it is not in the same group chat message, replace the corresponding text in the group chat message sent later, and directly delete the corresponding text in the group chat message that has been sent; Replace the text corresponding to the address information to be processed with [Address A]. If the text is not in the same group chat message, replace the corresponding text in the group chat message sent later, and directly delete the corresponding text in the group chat message that has been sent; Replace the characters corresponding to the mailbox information to be processed with [Mailbox A]. If the characters are not in the same group chat message, replace the corresponding characters in the group chat message sent later, and directly delete the corresponding characters in the group chat message that has been sent; Replace the number corresponding to the number to be processed with [number A]. If the number is not in the same group chat message, replace the corresponding number in the group chat message sent later, and directly delete the corresponding number in the group chat message that has been sent; Replace the number corresponding to the identity information to be processed with [Identity A]. If the number is not in the same group chat message, replace the corresponding number in the group chat message sent later, and directly delete the corresponding number in the group chat message that has been sent; After the replacement is completed, the original sensitive chat information will be deleted.
6. The information desensitization processing system based on group chat is applicable to the information desensitization processing method based on group chat according to any one of claims 1 to 5, characterized in that: It includes a sensitive information definition module, a chat information extraction module, a sensitive information identification module, and an information desensitization processing module; The sensitive information definition module, the chat information extraction module and the information desensitization processing module are respectively connected to the sensitive information identification module; The sensitive information definition module is used to define sensitive information; The chat information extraction module is used to obtain group chat information, perform information preprocessing on the group chat information, and extract character information and text information from the group chat information; The sensitive information identification module is used to identify sensitive information of character information and text information to obtain sensitive chat information; The information desensitization processing module is used to define desensitization rules and perform desensitization processing on sensitive chat information based on the desensitization rules.
7. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the steps in the method according to any one of claims 1 to 5 are executed.
8. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are executed.
Citation Information
Patent Citations
Online man-machine conversation desensitization method adopting artificial intelligence algorithm and software product
CN116662510A
User data desensitization method and device, electronic equipment and storage medium
CN112329055A
Intelligent chat analysis monitoring system based on big data
CN114048102A