Chat Encryption Method, System, Device and Medium Based on Sensitive Information Recognition

By using sensitive feature refinement method in chat records to obtain the percentage of digitally sensitive encoding and text sensitivity, and analyzing and encrypting chat records in real time, the problems of inaccurate screening of digitally sensitive information and inflexible encryption methods in the prior art are solved, and information security is improved.

CN118643512BActive Publication Date: 2025-06-27HAINAN JIKE TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410795294.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-19
Publication Date
2025-06-27
Estimated Expiration
2044-06-19

AI Technical Summary

Technical Problem

In the prior art, the screening of sensitive information of digital types is not accurate enough and the encryption method is not flexible enough, resulting in the risk of leakage of sensitive information of digital types.

Method used

By obtaining multiple chat records marked as sensitive information, the percentage of digitally sensitive encodings and text sensitivity is obtained based on the sensitive feature refinement method, the chat records are analyzed in real time and encrypted based on these encodings and percentages.

Benefits of technology

Improves the accuracy and encryption flexibility of digital-type sensitive information, reducing the risk of sensitive information leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118643512B_ABST
    Figure CN118643512B_ABST
Patent Text Reader

Abstract

The present invention discloses a chat encryption method, system, device and medium based on sensitive information recognition, relating to the field of information encryption technology, including: obtaining chat records with sensitive information, and obtaining digital sensitive codes and text sensitive percentages based on the sensitive feature extraction method; analyzing the chat records, and encrypting the chat records based on the analysis results; encrypting the chat records based on the number of encrypted sentences in the chat records; The present invention is used to solve the problems in the prior art that in the screening of sensitive information of digital types and the encryption of chat records, the screening of sensitive information of digital types is not accurate enough and the encryption method is not flexible enough, resulting in the easier leakage of sensitive information of digital types and encrypted information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information encryption technology, and particularly to a chat encryption method, system, device and medium based on sensitive information recognition. Background Art

[0002] Chat encryption is an important means to protect personal privacy and information security. By using encrypted chat software and taking other security measures, it is possible to effectively prevent chat content from being stolen or tampered with by unauthorized third parties.

[0003] Existing methods for encrypting chats based on sensitive information usually encrypt the information within the chat window. For example, in the patent application publication number CN107846351A, a chat message sensitive information encryption method and device are disclosed. This solution determines the current chat window presented by the chat application program; receives a trigger operation on the chat message in the chat window; detects whether the trigger operation is a trigger event for encrypting the sensitive information of the chat message; if so, encrypts the sensitive information of the chat message; and presents the encrypted chat message in the chat window. Other improvements for chat encryption usually encrypt chat information through encryption functions. However, there are problems in the existing technology that the screening of sensitive information of the digital type is not accurate enough and the encryption method is not flexible enough. When sensitive information of the digital type appears in chat information, it is impossible to timely screen the conversation where the sensitive information of the digital type is located and then perform encryption processing in a timely manner, resulting in a risk of leakage of sensitive information of the digital type. At the same time, the inflexible encryption method will cause the encrypted information to be more likely to be leaked. In view of this, it is necessary to improve the existing chat encryption based on sensitive information. Summary of the Invention

[0004] The present invention aims to solve at least one of the technical problems in the existing technology to some extent. By providing a chat encryption method, system, device and medium based on sensitive information recognition, it is used to solve the problems in the existing technology that the screening of sensitive information of the digital type is not accurate enough and the encryption method is not flexible enough. When sensitive information of the digital type appears in chat information, it is impossible to timely screen the conversation where the sensitive information of the digital type is located and then perform encryption processing in a timely manner, resulting in a risk of leakage of sensitive information of the digital type. At the same time, the inflexible encryption method will cause the encrypted information to be more likely to be leaked.

[0005] To achieve the above object, in the first aspect, the present invention provides a chat encryption method based on sensitive information recognition, including:

[0006] Obtain multiple chat records marked as having sensitive information, and obtain digital sensitive codes and text sensitive percentages based on the sensitive feature extraction method;

[0007] Obtain chat records in real time, analyze the chat records based on digital sensitive coding and text sensitive percentage, and encrypt the chat records based on the analysis results;

[0008] Encrypt the chat records based on the number of encrypted statements in the chat records.

[0009] Furthermore, obtain multiple chat records marked as having sensitive information, and obtain digital sensitive coding and text sensitive percentage based on the sensitive feature extraction method, including:

[0010] Obtain multiple chat records marked as having sensitive information, and sequentially record them as sensitive information record 1 to sensitive information record N;

[0011] Analyze the sensitive information records using the sensitive feature extraction method, and obtain digital sensitive coding;

[0012] Analyze the text sensitive text using the sensitive feature extraction method, and obtain the text sensitive percentage.

[0013] Furthermore, the sensitive feature extraction method includes a digital extraction sub-method and a text extraction sub-method, and the sensitive feature extraction method includes:

[0014] For any one sensitive information record N1 among sensitive information record 1 to sensitive information record N, obtain the number of digits and the positions where the digits are located in all conversations in sensitive information record N1. When the number of digits is greater than 0 and the positions where the digits are located are marked as sensitive information, use the digital extraction sub-method to analyze sensitive information record N1, where N1 is a positive integer greater than or equal to 1 and less than or equal to N;

[0015] The digital extraction sub-method includes: obtaining all texts in sensitive information record N1 that contain digits and the positions where the digits are located are marked as sensitive information, and sequentially recording them as information text N1~1 to information text N1~G; for any one information text N1~G1 among information text N1~1 to information text N1~G, mark the area marked as sensitive information in information text N1~G1 as a sensitive text segment, and sequentially mark the Chinese characters, letters, and digits in the sensitive text segment as sensitive characters 1 to sensitive characters K, where K is the total number of Chinese characters, letters, and digits in the sensitive text segment; mark the sensitive characters corresponding to the digits among sensitive characters 1 to sensitive characters K as digital characters;

[0016] Denote the largest numerical character among the sensitive characters 1 to sensitive character K as sensitive character end, and denote the smallest numerical character among the sensitive characters 1 to sensitive character K as sensitive character sta; for any two numerical characters A and B in the sensitive fields from sensitive field sta to sensitive field end, when the number of sensitive characters between numerical character A and numerical character B is greater than the standard discontinuous quantity and the number of numerical characters is 0, denote numerical character A as sensitive character end and denote numerical character B as sensitive character sta;

[0017] Obtain all digital analysis segments in the sensitive text segment, and denote them as digital analysis segment 1 to digital analysis segment G in sequence, where the digital analysis segment is a text segment starting from sensitive field sta and ending at sensitive field end, and there is no sensitive field sta or sensitive field end between sensitive field sta and sensitive field end, and G is a positive integer less than K and greater than or equal to 1;

[0018] For any digital analysis segment G1 among digital analysis segment 1 to digital analysis segment G, label the Chinese characters, letters, and numbers in digital analysis segment G1 as digital analysis character 1 to digital analysis character H in sequence from front to back, obtain the numbers corresponding to all numerical characters among digital analysis character 1 to digital analysis character H, arrange the numbers from smallest to largest, and denote the arranged code as the digital code of digital analysis segment G1;

[0019] Obtain the digital codes of all digital analysis segments, and denote the digital codes after deleting duplicates as the sensitive codes of sensitive information record N1;

[0020] Process all sensitive information records based on the processing method of sensitive information record N1, and obtain the sensitive codes of all sensitive information records based on the processing results, and denote the sensitive codes obtained after deleting duplicates as digital sensitive codes.

[0021] Furthermore, the sensitive feature extraction method further includes:

[0022] For any sensitive information record N1 among sensitive information record 1 to sensitive information record N, perform word segmentation on all the text marked as sensitive information in sensitive information record N1, and denote the Chinese words obtained by word segmentation as the duplicate sensitive words of sensitive information record N1, and denote the remaining duplicate sensitive words after deleting duplicates in the duplicate sensitive words as the sensitive words of sensitive information record N1;

[0023] Obtain the sensitive words corresponding to all sensitive information records, and divide all sensitive words into sensitive word libraries 1CK to NCK based on the sensitive information records where the sensitive words are located, where sensitive word library 1CK stores the sensitive words corresponding to sensitive information record 1, and so on;

[0024] Analyze all sensitive word libraries using the text refinement sub - method.

[0025] Further, the text refinement sub - method includes:

[0026] For any one sensitive word library N1CK among the sensitive word libraries 1CK to NCK, record the number of Chinese words in the sensitive word library N1CK as P; use text detection to perform sensitive word detection on the Chinese words in the sensitive word library N1CK, and record the number of detected sensitive words as Q, and record as the sensitive percentage of the sensitive word library N1CK.

[0027] Obtain the sensitive percentages of all sensitive word libraries, and record the minimum value of all sensitive percentages as the text sensitive percentage.

[0028] Further, obtain the chat record in real - time, and analyze the chat record based on the digital sensitive coding and the text sensitive percentage. Encrypting the chat record based on the analysis result includes:

[0029] Obtain the latest chat conversation in the chat record in real - time, denoted as the conversation to be analyzed. When there are numbers in the conversation to be analyzed, obtain the first digital character that appears in the conversation to be analyzed based on the digital refinement sub - method, denoted as the digital character sta to be analyzed, obtain the last digital character that appears in the conversation to be analyzed, denoted as the digital character end to be analyzed, and record the text segment between the digital character sta to be analyzed and the digital character end to be analyzed as the digital text segment to be analyzed; based on the analysis method of the digital analysis segment, analyze the digital text segment to be analyzed and obtain the digital coding of the digital text segment to be analyzed. When the digital coding of the digital text segment to be analyzed is equal to any one of the digital sensitive codings, denote the conversation to be analyzed as a sensitive conversation, and encrypt the conversation to be analyzed using the digital coding of the digital text segment to be analyzed;

[0030] When there are no numbers in the conversation to be analyzed or the digital coding of the digital text segment to be analyzed is not equal to all digital sensitive codings, perform word segmentation on the conversation to be analyzed, and use text detection to detect the Chinese words after word segmentation; based on the method of obtaining the sensitive percentage of the sensitive word library in the text refinement sub - method, obtain the sensitive percentage of the conversation to be analyzed. When the sensitive percentage of the conversation to be analyzed is greater than or equal to the text sensitive percentage, denote the conversation to be analyzed as a sensitive conversation, and encrypt the conversation to be analyzed using the sensitive percentage of the conversation to be analyzed.

[0031] Further, encrypt the chat record based on the number of encrypted statements in the chat record includes:

[0032] Obtain the number of chat conversations and the number of sensitive conversations in the chat record in real - time, denoted as A1 and A2 respectively, and record Denoted as the conversation sensitivity rate, whenever the latest chat conversation is obtained and analyzed, the conversation sensitivity rate is immediately obtained. When the conversation sensitivity rate is greater than the sensitivity percentage, the chat record is encrypted using the conversation sensitivity rate obtained in real time.

[0033] In a second aspect, the present invention further provides a chat encryption system based on sensitive information recognition, including a sensitive extraction module, a sensitive encryption module, and a real-time encryption module;

[0034] The sensitive extraction module is used to obtain multiple chat records marked as having sensitive information, and obtain a digital sensitive code and a text sensitive percentage based on the sensitive feature extraction method;

[0035] The sensitive encryption module is used to obtain chat records in real time, analyze the chat records based on the digital sensitive code and the text sensitive percentage, and encrypt the chat records based on the analysis results;

[0036] The real-time encryption module is used to encrypt the chat records based on the number of encrypted statements in the chat records.

[0037] In a third aspect, the present invention provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method are run.

[0038] In a fourth aspect, the present invention provides an electronic device, including a processor and a memory. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the steps in the above method are run.

[0039] Advantages of the present invention: The present invention first obtains multiple chat records marked as having sensitive information, and obtains a digital sensitive code and a text sensitive percentage based on the sensitive feature extraction method; then obtains chat records in real time, analyzes the chat records based on the digital sensitive code and the text sensitive percentage, and encrypts the chat records based on the analysis results; finally, encrypts the chat records based on the number of encrypted statements in the chat records. The advantage of this is that by obtaining the digital sensitive code, it is possible to more conveniently and quickly screen the sensitive information of the digital type in the chat records, and encrypt based on the screened sensitive information during screening, making the encryption more flexible; by obtaining the text sensitive percentage, it is possible to effectively encrypt the sensitive text in the chat records, and at the same time use the sensitive percentage to encrypt the conversation to be analyzed, which can also make the encryption more flexible and avoid leakage of encrypted information. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 is a block diagram of the principle of the system of the present invention;

[0041] Figure 2 It is a flowchart of the steps of the method of the present invention;

[0042] Figure 3 It is a schematic diagram of the steps of the sensitive feature extraction method of the present invention;

[0043] Figure 4 It is a schematic diagram of the electronic device of the present invention. Specific embodiments

[0044] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0045] Embodiment 1, please refer to Figure 1 As shown, on the first hand, the present application provides a chat encryption system based on sensitive information recognition, including a sensitive extraction module, a sensitive encryption module, and a real-time encryption module;

[0046] The sensitive extraction module is used to obtain a plurality of chat records marked as having sensitive information, and obtain a digital sensitive code and a text sensitive percentage based on the sensitive feature extraction method;

[0047] The sensitive extraction module includes: obtaining a plurality of chat records marked as having sensitive information, and sequentially recording them as sensitive information record 1 to sensitive information record N;

[0048] In the specific implementation process, after obtaining the sensitive information record, the area where the sensitive information is located in the sensitive information record should be marked to facilitate subsequent analysis;

[0049] The sensitive extraction module is configured with a digital extraction strategy and a text extraction strategy. The digital extraction strategy is used to analyze the sensitive information record using the sensitive feature extraction method and obtain a digital sensitive code; the text extraction strategy is used to analyze the text sensitive text using the sensitive feature extraction method and obtain a text sensitive percentage;

[0050] Please refer to Figure 3 As shown, among them, the steps corresponding to M1 are the steps of the digital extraction sub-method, and the steps corresponding to M2 are the steps of the text extraction sub-method; the sensitive feature extraction method includes a digital extraction sub-method and a text extraction sub-method, and the sensitive feature extraction method includes:

[0051] For any one of the sensitive information records N1 from sensitive information record 1 to sensitive information record N, obtain the number of digits and the positions where the digits are located in all the conversations in the sensitive information record N1. When the number of digits is greater than 0 and the positions where the digits are located are marked as sensitive information, use the digit extraction sub-method to analyze the sensitive information record N1, where N1 is a positive integer greater than or equal to 1 and less than or equal to N;

[0052] The digit extraction sub-method includes: obtaining all the texts in the sensitive information record N1 that contain digits and the positions where the digits are located are marked as sensitive information, and sequentially denoting them as information text N1~1 to information text N1~G; for any one of the information texts N1~1 to information text N1~G, denoted as information text N1~G1, denote the area marked as sensitive information in the information text N1~G1 as the sensitive text segment, and sequentially mark the Chinese characters, letters, and digits in the sensitive text segment as sensitive character 1 to sensitive character K, where K is the total number of Chinese characters, letters, and digits in the sensitive text segment; denote the sensitive characters corresponding to the digits among the sensitive characters 1 to sensitive character K as digit characters;

[0053] Denote the digit character with the largest number among the sensitive characters 1 to sensitive character K as sensitive character end, and denote the digit character with the smallest number among the sensitive characters 1 to sensitive character K as sensitive character sta; for any two digit characters A and digit character B among the sensitive fields sta to sensitive field end, when the number of sensitive characters between the digit character A and the digit character B is greater than the standard break quantity and the number of digit characters is 0, denote the digit character A as sensitive character end and denote the digit character B as sensitive character sta; in the specific implementation process, the standard break quantity is set to 4, that is, when the number of sensitive characters between the digit character A and the digit character B is greater than 4 and the number of digit characters is 0, denote the digit character A as sensitive character end and denote the digit character B as sensitive character sta. In the specific implementation, the standard break quantity can be adjusted according to the intervals between the digit characters with sensitive information in the specific situation;

[0054] In the specific implementation process, for example, in a data processing process, the sensitive text segment is "Taking the G103 high-speed train from Beijing to Shanghai on January 1, 2020". Through analysis, it can be obtained that K is 26, the digit character with the smallest number is 2, that is, sensitive character 2 is sensitive character sta, and the digit character with the largest number is 3, that is, sensitive character 24 is sensitive character end. Through further analysis, it can be obtained that sensitive character 9 is sensitive character end and sensitive character 22 is sensitive character sta. At the same time, through subsequent analysis, it can be obtained that the digit analysis segments in the sensitive text segment are "January 1, 2020" and "103";

[0055] Obtain all digital analysis segments in the sensitive text segment, and denote them as digital analysis segment 1 to digital analysis segment G in sequence, where the digital analysis segment is a text segment starting from the sensitive field sta and ending at the sensitive field end, and there is no sensitive field sta or sensitive field end between the sensitive field sta and the sensitive field end, and G is a positive integer less than K and greater than or equal to 1;

[0056] For any digital analysis segment G1 among digital analysis segment 1 to digital analysis segment G, mark the Chinese characters, letters, and numbers in digital analysis segment G1 as digital analysis character 1 to digital analysis character H in sequence from front to back, obtain the numbers corresponding to all digital characters among digital analysis character 1 to digital analysis character H, and arrange the numbers in ascending order. Denote the encoded result after arrangement as the digital code of digital analysis segment G1; for example, in a data processing, it is detected that the digital analysis segments in the sensitive text segment are "January 1, 2020" and "103" respectively. Then, through analysis, the digital code of the digital analysis segment "January 1, 2020" is 123468, and the digital code of the digital analysis segment "103" is 123;

[0057] Obtain the digital codes of all digital analysis segments, and denote the digital codes after removing duplicates as the sensitive codes of the sensitive information record N1;

[0058] Process all sensitive information records based on the processing method of the sensitive information record N1, and obtain the sensitive codes of all sensitive information records based on the processing results. After removing duplicates, denote the obtained sensitive codes as digital sensitive codes.

[0059] The sensitive feature extraction method also includes: for any sensitive information record N1 among sensitive information record 1 to sensitive information record N, perform word segmentation on all texts marked as sensitive information in the sensitive information record N1, and denote the Chinese words obtained by word segmentation as the duplicate sensitive words of the sensitive information record N1. After removing duplicates from the duplicate sensitive words, denote the remaining duplicate sensitive words as the sensitive words of the sensitive information record N1;

[0060] In the specific implementation process, when non-Chinese words appear during the word segmentation process, translate the non-Chinese words, and denote the corresponding Chinese words after translation as duplicate sensitive words;

[0061] Obtain the sensitive words corresponding to all sensitive information records, and divide all sensitive words into sensitive word libraries 1CK to NCK based on the sensitive information records where the sensitive words are located. Among them, the sensitive word library 1CK stores the sensitive words corresponding to the sensitive information record 1, and so on;

[0062] Analyze all sensitive word libraries using the text extraction sub-method.

[0063] The text refinement sub - method includes: for any one of the sensitive word libraries N1CK from the sensitive word library 1CK to the sensitive word library NCK, record the number of Chinese words in the sensitive word library N1CK as P; use text detection to detect sensitive words in the Chinese words of the sensitive word library N1CK, and record the number of detected sensitive words as Q ×100%

[0064] Q, and record P as the sensitivity percentage of the sensitive word library N1CK;

[0065] In the specific implementation process, for example, in a data analysis process, the number of Chinese words obtained is 100, and the number of sensitive words is 42. Through calculation, the sensitivity percentage can be obtained as 42%;

[0066] Obtain the sensitivity percentages of all sensitive word libraries, and record the minimum value of all sensitivity percentages as the text sensitivity percentage.

[0067] The sensitive encryption module is used to obtain chat records in real - time, analyze the chat records based on the digital sensitive encoding and the text sensitivity percentage, and encrypt the chat records based on the analysis results.

[0068] The sensitive encryption module is configured with a dialogue encryption policy. The dialogue encryption policy includes: obtain the latest chat dialogue in the chat records in real - time, denoted as the dialogue to be analyzed. When there are numbers in the dialogue to be analyzed, based on the digital refinement sub - method, obtain the first digital character that appears in the dialogue to be analyzed, denoted as the digital character sta to be analyzed, obtain the last digital character that appears in the dialogue to be analyzed, denoted as the digital character end to be analyzed, and denote the text segment between the digital character sta to be analyzed and the digital character end to be analyzed as the digital text segment to be analyzed; based on the analysis method of the digital analysis segment, analyze the digital text segment to be analyzed and obtain the digital encoding of the digital text segment to be analyzed. When the digital encoding of the digital text segment to be analyzed is equal to any one of the digital sensitive encodings, denote the dialogue to be analyzed as a sensitive dialogue, and encrypt the dialogue to be analyzed using the digital encoding of the digital text segment to be analyzed; by encrypting the dialogue to be analyzed using the digital encoding of the analyzed text segment, it can be ensured that the text to be encrypted can be encrypted according to the actual text content. For example, in a data processing, if the dialogue to be analyzed is a sensitive dialogue and the digital encoding of the digital text segment to be analyzed is "1234689101215", then "1234689101215" can be directly set as the password after encrypting the dialogue to be analyzed, or the password can be designed based on "1234689101215" and then the dialogue to be analyzed can be encrypted;

[0069] When there are no numbers in the conversation to be analyzed or the digital encoding of the digital text segment to be analyzed is not equal to all digital sensitive encodings, the conversation to be analyzed is segmented, and the segmented Chinese words are detected using text detection; based on the method for obtaining the sensitive percentage of the sensitive word library in the text refinement sub-method, the sensitive percentage of the conversation to be analyzed is obtained. When the sensitive percentage of the conversation to be analyzed is greater than or equal to the text sensitive percentage, the conversation to be analyzed is recorded as a sensitive conversation, and the sensitive percentage of the conversation to be analyzed is used to encrypt the conversation to be analyzed. For example, in a data processing, the conversation to be analyzed is a sensitive conversation and the sensitive percentage of the conversation to be analyzed is 67%, then 67% can be directly set as the password after encrypting the conversation to be analyzed or the password is designed based on 67% and then the conversation to be analyzed is encrypted, so as to ensure that the password can be flexible.

[0070] The real-time encryption module is used to encrypt the chat record based on the number of encrypted statements in the chat record. The real-time encryption module is configured with a record of real-time encryption policies, and the record of real-time encryption policies includes:

[0071] Real-time obtain the number of chat conversations and the number of sensitive conversations in the chat record, and record them respectively as A1 ×100%

[0072] A1 and A2, record A2 as the conversation sensitivity rate. Whenever a new chat conversation is obtained and the chat conversation is analyzed, immediately obtain the conversation sensitivity rate. When the conversation sensitivity rate is greater than the sensitive percentage, use the real-time obtained conversation sensitivity rate to encrypt the chat record. The encryption method of the chat record can refer to the method of encrypting the conversation to be analyzed based on the sensitive percentage. At the same time, when the real-time obtained conversation sensitivity rate changes, the encrypted password should be updated in real time, so as to prevent the encrypted chat record from being leaked when new sensitive information appears and the old password is still used.

[0073] Embodiment 2, please refer to Figure 2 As shown, in the second aspect, the present invention provides a chat encryption method based on sensitive information recognition, including:

[0074] Step S1, obtain multiple chat records marked as having sensitive information, and obtain digital sensitive encodings and text sensitive percentages based on the sensitive feature extraction method.

[0075] Step S1 includes the following sub-steps:

[0076] Step S101, obtain multiple chat records marked as having sensitive information, and record them as sensitive information record 1 to sensitive information record N in sequence;

[0077] Step S102, analyze the sensitive information record using the sensitive feature extraction method, and obtain digital sensitive encodings;

[0078] The sensitive feature extraction method includes a digital extraction sub - method and a text extraction sub - method, and the sensitive feature extraction method includes:

[0079] Step S1021, for any one of the sensitive information records N1 from the sensitive information record 1 to the sensitive information record N, obtain the number of digits and the positions of the digits in all conversations in the sensitive information record N1. When the number of digits is greater than 0 and the positions of the digits are marked as sensitive information, use the digital extraction sub - method to analyze the sensitive information record N1, where N1 is a positive integer greater than or equal to 1 and less than or equal to N;

[0080] The digital extraction sub - method includes: Step S102101, obtain all texts in the sensitive information record N1 that contain digits and the positions of the digits are marked as sensitive information, and record them as information text N1~1 to information text N1~G in sequence; for any one of the information texts N1~1 to information text N1~G, namely information text N1~G1, mark the area marked as sensitive information in the information text N1~G1 as the sensitive text segment, and mark the Chinese characters, letters, and digits in the sensitive text segment as sensitive characters 1 to sensitive character K in sequence, where K is the total number of Chinese characters, letters, and digits in the sensitive text segment; mark the sensitive characters corresponding to the digits among the sensitive characters 1 to sensitive character K as digital characters;

[0081] Step S102102, mark the digital character with the largest number among the sensitive characters 1 to sensitive character K as the sensitive character end, and mark the digital character with the smallest number among the sensitive characters 1 to sensitive character K as the sensitive character sta; for any two digital characters A and digital character B among the sensitive fields sta to sensitive field end, when the number of sensitive characters between the digital character A and the digital character B is greater than the standard break quantity and the number of digital characters is 0, mark the digital character A as the sensitive character end, and mark the digital character B as the sensitive character sta;

[0082] Step S102103, obtain all digital analysis segments in the sensitive text segment, and record them as digital analysis segment 1 to digital analysis segment G in sequence, where the digital analysis segment is a text segment starting from the sensitive field sta and ending at the sensitive field end, and there is no sensitive field sta or sensitive field end between the sensitive field sta and the sensitive field end, and G is a positive integer less than K and greater than or equal to 1;

[0083] Step S102104: For any one digital analysis segment G1 among digital analysis segments 1 to G, label the Chinese characters, letters, and numbers in digital analysis segment G1 as digital analysis characters 1 to H from front to back, obtain the numbers corresponding to all digital characters among digital analysis characters 1 to H, arrange the numbers in ascending order, and denote the encoded result as the digital code of digital analysis segment G1.

[0084] Step S102105: Obtain the digital codes of all digital analysis segments, and denote the digital codes after removing duplicates as the sensitive codes of sensitive information record N1.

[0085] Step S102106: Process all sensitive information records based on the processing method for sensitive information record N1, and obtain the sensitive codes of all sensitive information records based on the processing results. After removing duplicates, denote the obtained sensitive codes as digital sensitive codes.

[0086] Step S103: Analyze the text-sensitive text using the sensitive feature extraction method and obtain the text-sensitive percentage.

[0087] The sensitive feature extraction method further includes: Step S1031: For any one sensitive information record N1 among sensitive information records 1 to N, perform word segmentation on all texts marked as sensitive information in sensitive information record N1, and denote the Chinese words obtained by word segmentation as the repeated sensitive words of sensitive information record N1. After removing duplicates from the repeated sensitive words, denote the remaining repeated sensitive words as the sensitive words of sensitive information record N1.

[0088] Step S1032: Obtain the sensitive words corresponding to all sensitive information records, and divide all sensitive words into sensitive word libraries 1CK to NCK based on the sensitive information records where the sensitive words are located. Among them, sensitive word library 1CK stores the sensitive words corresponding to sensitive information record 1, and so on.

[0089] Step S1033: Analyze all sensitive word libraries using the text extraction sub-method.

[0090] The text extraction sub-method includes: Step S103301: For any one sensitive word library N1CK among sensitive word libraries 1CK to NCK, denote the number of Chinese words in sensitive word library N1CK as P; perform sensitive word detection on the Chinese words in sensitive word library N1CK using text detection, and denote the number of sensitive words obtained by detection

[0091] Q ×100%

[0092] as Q, and denote P as the sensitive percentage of sensitive word library N1CK.

[0093] Step S103302: Obtain the sensitivity percentages of all sensitive word libraries, and record the minimum value of all sensitivity percentages as the text sensitivity percentage.

[0094] Step S2: Obtain the chat record in real time, analyze the chat record based on the digital sensitivity encoding and the text sensitivity percentage, and encrypt the chat record based on the analysis result.

[0095] Step S2 includes: Step S201: Obtain the latest chat conversation in the chat record in real time, denoted as the conversation to be analyzed. When there are numbers in the conversation to be analyzed, obtain the first digital character that appears in the conversation to be analyzed based on the digital extraction sub-method, denoted as the digital character sta to be analyzed, and obtain the last digital character that appears in the conversation to be analyzed, denoted as the digital character end to be analyzed. Denote the text segment between the digital character sta to be analyzed and the digital character end to be analyzed as the digital text segment to be analyzed. Analyze the digital text segment to be analyzed based on the analysis method of the digital analysis segment and obtain the digital encoding of the digital text segment to be analyzed. When the digital encoding of the digital text segment to be analyzed is equal to any one of the digital sensitivity encodings, denote the conversation to be analyzed as a sensitive conversation, and encrypt the conversation to be analyzed using the digital encoding of the digital text segment to be analyzed.

[0096] Step S202: When there are no numbers in the conversation to be analyzed or the digital encoding of the digital text segment to be analyzed is not equal to all digital sensitivity encodings, perform word segmentation on the conversation to be analyzed, and use text detection to detect the Chinese words after word segmentation. Based on the method for obtaining the sensitivity percentage of the sensitive word library in the text extraction sub-method, obtain the sensitivity percentage of the conversation to be analyzed. When the sensitivity percentage of the conversation to be analyzed is greater than or equal to the text sensitivity percentage, denote the conversation to be analyzed as a sensitive conversation, and encrypt the conversation to be analyzed using the sensitivity percentage of the conversation to be analyzed.

[0097] Step S3: Encrypt the chat record based on the number of encrypted statements in the chat record. Step S3 includes: Obtain the number of chat conversations and the number of sensitive conversations in the chat record in real time, denoted as A1 and A2 respectively. Denote it as the conversation sensitivity rate. Whenever a new chat conversation is obtained and analyzed, immediately obtain the conversation sensitivity rate. When the conversation sensitivity rate is greater than the sensitivity percentage, encrypt the chat record using the conversation sensitivity rate obtained in real time.

[0098] Example 3, Third aspect, please refer to Figure 4As shown in the figure, the present application provides an electronic device, including a processor 401 and a memory 402. The memory 402 stores computer-readable instructions. When the computer-readable instructions are executed by the processor 401, the steps in the above method are run. Through the above technical solution, the processor 401 and the memory 402 are interconnected and communicate with each other through a communication bus and / or other forms of connection mechanisms (not marked). The memory 402 stores a computer program executable by the processor 401. When the electronic device runs, the processor 401 executes the computer program to execute the method in any optional implementation manner of the above embodiments to achieve the following functions: First, obtain a plurality of chat records marked as having sensitive information, and obtain a digital sensitive code and a text sensitive percentage based on the sensitive feature extraction method; then, obtain chat records in real time, analyze the chat records based on the digital sensitive code and the text sensitive percentage, and encrypt the chat records based on the analysis results; finally, encrypt the chat records based on the number of encrypted statements in the chat records.

[0099] Embodiment 4, Fourth aspect, the present application provides a storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method are run. Through the above technical solution, when the computer program is executed by the processor, the method in any optional implementation manner of the above embodiments is executed to achieve the following functions: First, obtain a plurality of chat records marked as having sensitive information, and obtain a digital sensitive code and a text sensitive percentage based on the sensitive feature extraction method; then, obtain chat records in real time, analyze the chat records based on the digital sensitive code and the text sensitive percentage, and encrypt the chat records based on the analysis results; finally, encrypt the chat records based on the number of encrypted statements in the chat records.

[0100] In the above embodiments of the present application, the descriptions of each embodiment have their own emphases. For the parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.

[0101] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. 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 code. 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 (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk. These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured article including an instruction device, and the instruction device implements the processes Figure 1 one process or multiple processes and / or blocks Figure 1 the functions specified in one block or multiple blocks.

[0102] 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 only illustrative. For example, the division of the units is only a logical function division, and there can be other division methods in actual implementation. For another 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 displayed or discussed coupling or direct coupling or communication connection between each other can be through some communication interfaces. The indirect coupling or communication connection of the devices or units can be in an electrical, mechanical, or other form.

Claims

1. A chat encryption method based on sensitive information identification, characterized in that: include: Obtain multiple chat records marked as containing sensitive information, and obtain digital sensitive codes and text sensitive percentages based on the sensitive feature extraction method; Obtain chat records in real time, analyze them based on digital sensitivity codes and text sensitivity percentages, and encrypt them based on the analysis results; Encrypting the chat log based on the number of encrypted sentences in the chat log; The sensitive feature extraction method includes: For any sensitive information record N1 from sensitive information record 1 to sensitive information record N, obtain the number of numbers and the positions of the numbers in all conversations in sensitive information record N1. When the number of numbers is greater than 0 and the positions of the numbers are marked as sensitive information, use the number extraction sub-method to analyze sensitive information record N1, where N1 is a positive integer greater than or equal to 1 and less than or equal to N. The digital extraction sub-method includes: obtaining all texts in the sensitive information record N1 where numbers are located and the positions where the numbers are located are marked as sensitive information, and recording them as information text N1~1 to information text N1~G in sequence; for any information text N1~G1 among the information text N1~1 to the information text N1~G, recording the area marked as sensitive information in the information text N1~G1 as a sensitive text segment, and marking the Chinese characters, letters and numbers in the sensitive text segment from front to back as sensitive characters 1 to sensitive characters K in sequence, where K is the total number of Chinese characters, letters and numbers in the sensitive text segment; recording the sensitive characters corresponding to the numbers in sensitive characters 1 to sensitive characters K as digital characters; The numeric character with the largest number among sensitive characters 1 to sensitive characters K is recorded as sensitive character end, and the numeric character with the smallest number among sensitive characters 1 to sensitive characters K is recorded as sensitive character sta; for any two numeric characters A and numeric characters B in the sensitive field sta to the sensitive field end, when the number of sensitive characters between numeric characters A and B is greater than the number of standard breaks and the number of numeric characters is 0, numeric character A is recorded as sensitive character end, and numeric character B is recorded as sensitive character sta; Get all the digital analysis segments in the sensitive text segment and record them as digital analysis segment 1 to digital analysis segment G in sequence, where a digital analysis segment is a text segment starting from the sensitive field sta and ending at the sensitive field end, and there is no sensitive field sta or sensitive field end between the sensitive field sta and the sensitive field end, and G is a positive integer less than K and greater than or equal to 1; For any digital analysis segment G1 from digital analysis segment 1 to digital analysis segment G, mark the Chinese characters, letters and numbers in digital analysis segment G1 from front to back as digital analysis characters 1 to digital analysis characters H, obtain the numbers corresponding to all digital characters in digital analysis characters 1 to digital analysis characters H, and arrange the numbers from small to large, and record the code obtained after the arrangement as the digital code of digital analysis segment G1.

2. The chat encryption method based on sensitive information identification according to claim 1 is characterized in that: Obtain multiple chat records marked as containing sensitive information, and obtain digital sensitive codes and text sensitive percentages based on the sensitive feature extraction method, including: Obtain multiple chat records marked as containing sensitive information, and record them as sensitive information record 1 to sensitive information record N in sequence; Use sensitive feature extraction methods to analyze sensitive information records and obtain digital sensitive codes; Use the sensitive feature extraction method to analyze the text sensitive text and obtain the text sensitivity percentage.

3. The chat encryption method based on sensitive information identification according to claim 2 is characterized in that: The sensitive feature extraction method also includes: Obtain the digital codes of all digital analysis segments and record all digital codes after deleting duplicates as sensitive codes of sensitive information record N1; All sensitive information records are processed based on the processing method for sensitive information record N1, and sensitive codes of all sensitive information records are obtained based on the processing results. After deleting duplicate items, all obtained sensitive codes are recorded as digital sensitive codes.

4. The chat encryption method based on sensitive information identification according to claim 3 is characterized in that: The sensitive feature extraction method also includes: For any sensitive information record N1 among sensitive information records 1 to sensitive information records N, all texts marked as sensitive information in sensitive information record N1 are segmented, and the Chinese words obtained by the segmentation are recorded as repeated sensitive words of sensitive information record N1. After deleting the repeated sensitive words, the remaining repeated sensitive words are recorded as sensitive words of sensitive information record N1. Obtain sensitive words corresponding to all sensitive information records, and divide all sensitive words into sensitive word libraries 1CK to sensitive word libraries NCK based on the sensitive information records where the sensitive words are located, wherein sensitive word library 1CK stores sensitive words corresponding to sensitive information record 1, and so on; All sensitive word libraries are analyzed using the text extraction sub-method.

5. The chat encryption method based on sensitive information identification according to claim 4 is characterized in that: The text extraction sub-method comprises: For any sensitive word library N1CK from the sensitive word library 1CK to the sensitive word library NCK, the number of Chinese words in the sensitive word library N1CK is recorded as P; sensitive word detection is performed on the Chinese words in the sensitive word library N1CK using text detection, and the number of sensitive words detected is recorded as Q. It is recorded as the sensitivity percentage of the sensitive word library N1CK; Get the sensitivity percentages of all sensitive word libraries, and record the minimum value of all sensitivity percentages as the text sensitivity percentage.

6. The chat encryption method based on sensitive information identification according to claim 5 is characterized in that: The chat records are obtained in real time, and the chat records are analyzed based on the digital sensitivity coding and text sensitivity percentage. The chat records are encrypted based on the analysis results, including: The latest chat conversation in the chat record is obtained in real time and recorded as the conversation to be analyzed. When there are numbers in the conversation to be analyzed, the first numeric character appearing in the conversation to be analyzed is obtained based on the numeric extraction sub-method and recorded as the numeric character sta to be analyzed. The last numeric character appearing in the conversation to be analyzed is obtained and recorded as the numeric character end to be analyzed. The text segment between the numeric character sta to be analyzed and the numeric character end to be analyzed is recorded as the numeric text segment to be analyzed. Based on the analysis method for the numeric analysis segment, the numeric text segment to be analyzed is analyzed and the numeric code of the numeric text segment to be analyzed is obtained. When the numeric code of the numeric text segment to be analyzed is equal to any numeric sensitive code, the conversation to be analyzed is recorded as a sensitive conversation, and the numeric code of the numeric text segment to be analyzed is used to encrypt the conversation to be analyzed. When there are no numbers in the conversation to be analyzed or the digital code of the digital text segment to be analyzed is not equal to all digital sensitive codes, the conversation to be analyzed is segmented, and the Chinese words after the segmentation are detected using text detection; based on the method for obtaining the sensitivity percentage of the sensitive word library in the text extraction sub-method, the sensitivity percentage of the conversation to be analyzed is obtained; when the sensitivity percentage of the conversation to be analyzed is greater than or equal to the text sensitivity percentage, the conversation to be analyzed is recorded as a sensitive conversation, and the sensitivity percentage of the conversation to be analyzed is used to encrypt the conversation to be analyzed.

7. The chat encryption method based on sensitive information identification according to claim 6 is characterized in that: Encrypting chat logs based on the number of encrypted sentences in the chat log includes: Get the number of chat conversations and the number of sensitive conversations in the chat history in real time, record them as A1 and A2 respectively, and Recorded as the conversation sensitivity rate, every time the latest chat conversation is obtained and analyzed, the conversation sensitivity rate is immediately obtained. When the conversation sensitivity rate is greater than the sensitivity percentage, the chat record is encrypted using the conversation sensitivity rate obtained in real time.

8. A chat encryption system based on sensitive information identification, applicable to the chat encryption method based on sensitive information identification according to any one of claims 1 to 7, characterized in that: It includes sensitive extraction module, sensitive encryption module and real-time encryption module; The sensitive extraction module is used to obtain multiple chat records marked as containing sensitive information, and obtain digital sensitive codes and text sensitive percentages based on the sensitive feature extraction method; The sensitive encryption module is used to obtain chat records in real time, analyze the chat records based on digital sensitive codes and text sensitive percentages, and encrypt the chat records based on the analysis results; The real-time encryption module is used to encrypt the chat record based on the number of encrypted sentences in the chat record.

9. 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 7 are executed.

10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps in the method according to any one of claims 1 to 7 are executed.

Citation Information

Patent Citations

  • Method and apparatus for encrypting sensitive information of chat message

    CN107846351A

  • Protection of sensitive chat data

    CN107873096A

  • False traffic detection method and device, electronic equipment and storage medium

    CN113641696A