Data processing method and device, equipment, storage medium and computer program product

By converting the string to be detected into auxiliary information and using a trie for matching, sensitive characters are identified and processed, solving the problem of inaccurate identification of sensitive characters in existing technologies, improving the effectiveness of sensitive word processing, and maintaining the quality of the network environment.

CN116955720BActive Publication Date: 2026-03-17TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202210413723.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-19
Publication Date
2026-03-17
Estimated Expiration
2042-04-19

AI Technical Summary

Technical Problem

Existing technologies have low accuracy in identifying sensitive characters, making it impossible to effectively process sensitive words and affecting the maintenance of the network environment.

Method used

By converting the string to be detected into auxiliary information (such as initial letter, pinyin, stroke count), and using the target trie for matching, sensitive characters are identified and processed, and the target string is output.

Benefits of technology

It improves the accuracy of sensitive character recognition, enhances the effectiveness of sensitive word processing, and ensures the good maintenance of the network environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116955720B_ABST
    Figure CN116955720B_ABST
Patent Text Reader

Abstract

A data processing method, device, equipment, storage medium and computer program product, the method comprising: obtaining a detection request, the detection request comprising a to-be-detected string; converting the to-be-detected string into auxiliary information, the auxiliary information comprising one or more of the following: a first letter corresponding to the to-be-detected string, a pinyin corresponding to the to-be-detected string, and a stroke corresponding to the to-be-detected string; obtaining a target dictionary tree, the target dictionary tree being a dictionary tree constructed from a sensitive word set, a sensitive word first letter set, a sensitive word pinyin set, and a sensitive word stroke set; matching the to-be-detected string and the auxiliary information with the target dictionary tree to obtain a sensitive character in the to-be-detected string; performing sensitive word processing on the to-be-detected string according to the sensitive character in the to-be-detected string to obtain a target string, and outputting the target string. By using the method of the present application, the accuracy of sensitive character recognition can be improved, and the effectiveness of sensitive word processing can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a data processing method, a data processing apparatus, a computer device, a computer-readable storage medium, and a computer program product. Background Technology

[0002] In today's rapidly developing information age, people can express their opinions through online communication platforms. Sometimes, these opinions contain sensitive characters that do not comply with internet usage norms or even violate national regulations, which is detrimental to maintaining a healthy online environment. Therefore, it is necessary to process opinions containing sensitive characters. However, the accuracy of sensitive character recognition is currently low, making it impossible to effectively process sensitive words. Summary of the Invention

[0003] This application provides a data processing method, apparatus, device, storage medium, and computer program product that can improve the accuracy of sensitive character recognition and the effectiveness of sensitive word processing.

[0004] On one hand, embodiments of this application provide a data processing method, the method comprising:

[0005] Obtain a detection request, the detection request including the string to be detected;

[0006] The string to be detected is converted into auxiliary information, which includes one or more of the following: the first letter of the string to be detected, the pinyin of the string to be detected, and the number of strokes of the string to be detected;

[0007] Obtain the target trie, which is a trie constructed from the set of sensitive words, the set of the first letters of sensitive words, the set of the pinyin of sensitive words, and the set of the strokes of sensitive words;

[0008] The string to be detected and the auxiliary information are matched with the target trie to obtain the sensitive characters in the string to be detected;

[0009] The target string is obtained by processing the target string based on the sensitive characters in the target string, and then the target string is output.

[0010] On the one hand, embodiments of this application provide a text processing method, the method comprising:

[0011] Display the application interface, which includes the string to be detected;

[0012] When a sensitive word is detected in the string to be detected, a first prompt message is displayed, which is used to prompt the sensitive word in the string to be detected; and a second prompt message is displayed, which includes N synonyms corresponding to the sensitive word in the string to be detected, where N is a positive integer.

[0013] When a selection operation for a target synonym is received, the target string is displayed on the application interface. The target string is the string after the sensitive words in the string to be detected have been replaced with the target synonym.

[0014] On one hand, embodiments of this application provide a data processing apparatus, the apparatus comprising:

[0015] An acquisition unit is used to acquire a detection request, wherein the detection request includes a string to be detected;

[0016] The processing unit is configured to convert the string to be detected into auxiliary information, the auxiliary information including one or more of the following: the first letter of the string to be detected, the pinyin of the string to be detected, and the number of strokes of the string to be detected;

[0017] The acquisition unit is also used to acquire a target dictionary tree, which is a dictionary tree constructed from a set of sensitive words, a set of the first letters of sensitive words, a set of the pinyin of sensitive words, and a set of the strokes of sensitive words;

[0018] The processing unit is further configured to match the string to be detected and the auxiliary information with the target trie to obtain the sensitive characters in the string to be detected;

[0019] The processing unit is further configured to perform sensitive word processing on the string to be detected based on the sensitive characters in the string to be detected, to obtain a target string, and to output the target string.

[0020] On one hand, embodiments of this application provide a text processing apparatus, the apparatus comprising:

[0021] A display unit is used to display an application interface, the application interface including the string to be detected;

[0022] The display unit is further configured to, when a sensitive word is detected in the string to be detected, display a first prompt message, the first prompt message being used to prompt the sensitive word in the string to be detected; and display a second prompt message, the second prompt message including N synonyms corresponding to the sensitive word in the string to be detected, where N is a positive integer;

[0023] The display unit is further configured to display a target string on the application interface when a selection operation for a target synonym is received. The target string is the string after the sensitive words in the string to be detected have been replaced with the target synonym.

[0024] On one hand, embodiments of this application provide a computer device, which includes a processor, a communication interface, and a memory. The processor, the communication interface, and the memory are interconnected. The memory stores a computer program, and the processor is used to call the computer program to execute the data processing method of any of the above possible implementations.

[0025] On one hand, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements a data processing method of any possible implementation.

[0026] Accordingly, this application also provides a computer program product, which includes a computer program or computer instructions, and the computer program or computer instructions are executed by a processor to implement the steps of the data processing method provided in this application.

[0027] Accordingly, this application also provides a computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the data processing method provided in this application.

[0028] In this embodiment, a detection request can be obtained, which includes a string to be detected. The string to be detected is converted into one or more of the following: the first letter of the string, the pinyin of the string, and the number of strokes of the string, to obtain auxiliary information. The string to be detected and the auxiliary information are matched with a target trie to obtain sensitive characters in the string to be detected. Then, sensitive word processing is performed on the string to be detected based on the sensitive characters in the string to be detected to obtain the target string, which is then output. Using the method of this application, sensitive characters in the string to be detected can be identified from multiple dimensions, improving the accuracy of sensitive character identification and the effectiveness of sensitive word processing. Attached Figure Description

[0029] To more clearly illustrate the technical methods of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0030] Figure 1 This application provides a schematic diagram of the system architecture of a data processing system.

[0031] Figure 2 A flowchart illustrating a data processing method provided in this application embodiment. Figure 1 ;

[0032] Figure 3 A flowchart illustrating a data processing method provided in this application embodiment. Figure 2 ;

[0033] Figure 4 A schematic diagram of a trie generated based on the AC automata algorithm provided in this application embodiment;

[0034] Figure 5 A flowchart illustrating a word segmentation method provided in an embodiment of this application;

[0035] Figure 6 Example schematic diagrams of word pinyin mapping tables and word segmentation pinyin mapping tables provided in embodiments of this application;

[0036] Figure 7 This is a schematic diagram of multi-coroutine parallel processing provided in an embodiment of this application;

[0037] Figure 8 A schematic diagram of a sensitive word configuration interface provided in an embodiment of this application;

[0038] Figure 9 This is a schematic diagram illustrating a sensitive word alert interface provided in an embodiment of this application.

[0039] Figure 10 This application provides an example of sensitive word processing. Figure 1 ;

[0040] Figure 11 A flowchart illustrating a data processing method provided in this application embodiment. Figure 3 ;

[0041] Figure 12 A flowchart illustrating a data processing method provided in this application embodiment. Figure 4 ;

[0042] Figure 13A flowchart illustrating a text processing method provided in an embodiment of this application;

[0043] Figure 14 This application provides an example of sensitive word processing. Figure 2 ;

[0044] Figure 15 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application;

[0045] Figure 16 This is a schematic diagram of the structure of a text processing device provided in an embodiment of this application;

[0046] Figure 17 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0047] The technical methods in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0048] Please see Figure 1 , Figure 1 This application provides a schematic diagram of the system architecture of a data processing system. Figure 1 The system architecture shown can be used to implement the data processing method proposed in the embodiments of this application. For example... Figure 1 As shown, the system architecture includes: server 10 and multiple terminals 11 (three are shown as an example in the figure).

[0049] Server 10 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. Terminal 11 can be a smartphone, tablet, laptop, desktop computer, smart voice interaction device, smart home appliance, in-vehicle terminal, etc., but is not limited to these. Figure 1 The terminal 11 shown is connected to the server 10 via a network.

[0050] Figure 1The system architecture shown can implement the data processing method provided in this application embodiment. Taking the joint execution of this method by server 10 and terminal 11 as an example, its implementation process roughly includes: ① Terminal 11 sends a detection request to server 10, which includes a string to be detected; ② Server 10 receives the detection request sent by terminal 11 and converts the string to be detected in the detection request into auxiliary information, which includes one or more of the following: the first letter corresponding to the string to be detected, the pinyin corresponding to the string to be detected, and the strokes corresponding to the string to be detected; ③ Server 10 obtains a target dictionary tree, which is a dictionary tree constructed from a set of sensitive words, a set of sensitive word first letters, a set of sensitive word pinyin, and a set of sensitive word strokes; ④ Server 10 matches the string to be detected and the auxiliary information with the target dictionary tree to obtain sensitive characters in the string to be detected; ⑤ Server 10 performs sensitive word processing on the string to be detected based on the sensitive characters in the string to be detected to obtain the target string (i.e., the string to be detected after sensitive word processing); ⑥ Server 10 publishes the output target string to a network communication platform. By using the method of this application, the accuracy of sensitive character recognition and the effectiveness of sensitive word processing can be improved.

[0051] It is understood that the system architecture diagrams described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0052] The specific implementation of the data processing method will be explained in detail below.

[0053] Please see Figure 2 , Figure 2 A flowchart illustrating a data processing method provided in this application embodiment. Figure 1 The data processing method described in the embodiments of this application can be derived from... Figure 1 The data processing method, executed by server 10 or terminal 11, includes, but is not limited to, the following steps:

[0054] S201. Obtain a detection request, wherein the detection request includes a string to be detected.

[0055] The detection request is used to request the identification of sensitive characters in the string to be detected. The string to be detected can contain Chinese characters, Chinese character strokes, punctuation marks, letters (including one or two of the pinyin letters and English letters), etc. The string to be detected can be comments published on online communication platforms, text extracted from images or videos, text obtained through speech-to-text conversion, bullet comments in videos, etc.

[0056] S202. Convert the to-be-detected string into auxiliary information, where the auxiliary information includes one or more of the following: the first letter corresponding to the to-be-detected string, the pinyin corresponding to the to-be-detected string, and the strokes corresponding to the to-be-detected string.

[0057] The auxiliary information can be obtained by converting the to-be-detected string. In one embodiment, when the auxiliary information includes the pinyin corresponding to the to-be-detected string, the Chinese characters included in the to-be-detected string can be obtained, the pinyin corresponding to the included Chinese characters can be found, and the Chinese characters in the to-be-detected string can be replaced with the pinyin corresponding to the included Chinese characters to obtain the pinyin corresponding to the to-be-detected string. For example, the pinyin corresponding to the to-be-detected string "我们去KTV唱歌" is "womenquKTVchangge". When the auxiliary information includes the first letter corresponding to the to-be-detected string, the Chinese characters included in the to-be-detected string can be obtained, the pinyin corresponding to the included Chinese characters can be found, and then the first letter in the pinyin corresponding to the included Chinese characters can be extracted, and the Chinese characters in the to-be-detected string can be replaced with the first letter in the pinyin corresponding to the included Chinese characters to obtain the first letter corresponding to the to-be-detected string. For example, the pinyin corresponding to the to-be-detected string "我们去KTV唱歌" is "wmqKTVcg". If the to-be-detected string itself contains pinyin, the first letter of the included pinyin can also be extracted, and the included pinyin in the to-be-detected string can be replaced with the first letter of the included pinyin.

[0058] In a feasible embodiment, when the auxiliary information includes the strokes corresponding to the to-be-detected string, the Chinese characters included in the to-be-detected string can be split to obtain the strokes corresponding to the included Chinese characters, and the Chinese characters included in the to-be-detected string can be replaced with the strokes corresponding to the included Chinese characters to obtain the strokes corresponding to the to-be-detected string. In one implementation, the Chinese characters included can be split according to the stroke order. For example, after splitting, "去" is "一一丨厶"; or the Chinese characters included can be split according to the radical. For example, after splitting, "们" is "亻门".

[0059] S203. Obtain a target trie, where the target trie is a trie constructed from a sensitive word set, a sensitive word first letter set, a sensitive word pinyin set, and a sensitive word stroke set.

[0060] The sensitive word set includes one or more sensitive words. The sensitive word initial letter set includes one or more initial letters of sensitive words. The initial letter of the sensitive word can be the initial letter corresponding to the sensitive word in the sensitive word set, or the initial letter corresponding to the sensitive word outside the sensitive word set. The sensitive word pinyin set includes one or more pinyins of sensitive words. The pinyin of the sensitive word can be the pinyin corresponding to the sensitive word in the sensitive word set, or the pinyin corresponding to the sensitive word outside the sensitive word set. The sensitive word stroke set includes one or more strokes of sensitive words. The stroke of the sensitive word can be the stroke corresponding to the sensitive word in the sensitive word set, or the stroke corresponding to the sensitive word outside the sensitive word set.

[0061] The sensitive string is the data in the sensitive word set, the sensitive word initial letter set, the sensitive word pinyin set or the sensitive word stroke set. That is, the sensitive string can be the sensitive word in the sensitive word set, or the initial letter of the sensitive word in the sensitive word initial letter set, or the pinyin of the sensitive word in the sensitive word pinyin set, or the stroke of the sensitive word in the sensitive word stroke set. In one embodiment, the target trie can be constructed using the sensitive word set, the sensitive word initial letter set, the sensitive word pinyin set and the sensitive word stroke set. Taking the sensitive string as an example, a node in the target trie can be used to represent a character in the sensitive string, and the string formed by traversing from the root node of the target trie to a certain node can be the sensitive string.

[0062] S204. Match the to-be-detected string and the auxiliary information with the target trie to obtain the sensitive characters in the to-be-detected string.

[0063] In one embodiment, the detection string and the auxiliary information can be concurrently matched with the target trie to obtain one or more matching strings. The matching string can be a pinyin string, a stroke string, a Chinese character string, or an initial letter string. Further, it can be checked whether the to-be-detected string directly contains the matching string. The characters in the matching string directly contained in the to-be-detected string are sensitive characters. If the to-be-detected string does not directly contain the matching string, the sensitive string corresponding to the matching string in the to-be-detected string is found, and the characters in the sensitive string corresponding to the matching string are used as sensitive characters. For example, if the matching string is "women" or "wm", then "我们" in the to-be-detected string is the corresponding sensitive string.

[0064] S205. Perform sensitive word processing on the to-be-detected string according to the sensitive characters in the to-be-detected string to obtain the target string, and output the target string.

[0065] In one embodiment, sensitive characters in the string to be detected can be used to perform sensitive word processing on the string to be detected, thereby obtaining the target string. For example, sensitive characters in the string to be detected can be deleted, or sensitive characters in the string to be detected can be replaced with replacement symbols. Furthermore, the target string can be output, for example, published on an online communication platform.

[0066] In this embodiment, a detection request can be obtained, which includes a string to be detected. The string to be detected is converted into one or more of the following: the first letter of the string, the pinyin of the string, and the number of strokes of the string, to obtain auxiliary information. By matching the string to be detected and the auxiliary information with a target trie, sensitive characters in the string to be detected are obtained. Then, based on the sensitive characters in the string to be detected, sensitive word processing is performed on the string to be detected to obtain the target string, which is then output. Using the method of this application, sensitive characters in the string to be detected can be identified from multiple dimensions, improving the accuracy of sensitive character identification and the effectiveness of sensitive word processing.

[0067] Please see Figure 3 , Figure 3 A flowchart illustrating a data processing method provided in this application embodiment. Figure 2 The data processing method described in the embodiments of this application can be derived from... Figure 1 The data processing method, executed by server 10 or terminal 11, includes, but is not limited to, the following steps:

[0068] S301. Obtain a detection request, wherein the detection request includes a string to be detected.

[0069] In one embodiment, a string to be detected can be entered through the input field of the application interface, and the entered string is displayed on the input field. When the send button of the application interface is triggered, a detection request including the string to be detected can be generated. The application interface can be an interface in a game community used for posting dynamic content, which can include text, images, videos, and audio. The string to be detected can be the posted text, the posted image, or text extracted from the video image, or text obtained by converting posted audio. Alternatively, the application interface can also be a bullet screen playback interface or a short video comment interface; this application does not limit this to any particular type.

[0070] S302. Convert the string to be detected into auxiliary information, the auxiliary information including one or more of the following: the first letter of the string to be detected, the pinyin of the string to be detected, and the number of strokes of the string to be detected.

[0071] In one embodiment, the detection request further includes the verification level of the string to be detected. The verification level can be determined based on the publication scenario of the string to be detected. For example, strings to be detected published in game review scenarios, nickname naming scenarios, and video barrage scenarios may have different verification levels. The verification level can be used to determine the data included in the auxiliary information. When the verification level is the first level, the auxiliary information may include the first letter corresponding to the string to be detected, or the pinyin corresponding to the string to be detected, or the strokes corresponding to the string to be detected. When the verification level is the second level, the auxiliary information may include the first letter corresponding to the string to be detected and the pinyin corresponding to the string to be detected, or the first letter corresponding to the string to be detected and the strokes corresponding to the string to be detected, or the pinyin corresponding to the string to be detected and the strokes corresponding to the string to be detected. When the verification level is the third level, the auxiliary information may include the first letter corresponding to the string to be detected, the pinyin corresponding to the string to be detected, and the strokes corresponding to the string to be detected. Through this embodiment, the verification level can be used to determine the quantity of data included in the auxiliary information.

[0072] In a feasible embodiment, the verification level can be further divided in a more detailed manner. For example, when the verification level is the first level, the auxiliary information may include the first letter corresponding to the string to be detected. When the verification level is the second level, the auxiliary information may include the pinyin corresponding to the string to be detected. When the verification level is the third level, the auxiliary information may include the strokes corresponding to the string to be detected. When the verification level is the fourth level, the auxiliary information includes the first letter corresponding to the string to be detected and the pinyin corresponding to the string to be detected. When the verification level is the fifth level, the auxiliary information includes the first letter corresponding to the string to be detected and the strokes corresponding to the string to be detected. When the verification level is the sixth level, the auxiliary information includes the pinyin corresponding to the string to be detected and the strokes corresponding to the string to be detected. When the verification level is the seventh level, the auxiliary information includes the pinyin corresponding to the string to be detected, the first letter corresponding to the string to be detected, and the strokes corresponding to the string to be detected.

[0073] In one implementation manner, when the auxiliary information includes the strokes corresponding to the string to be detected, the string to be detected is split to obtain the strokes corresponding to the string to be detected. Specifically, the Chinese characters included in the string to be detected can be split to obtain the strokes corresponding to the included Chinese characters, and the strokes corresponding to the included Chinese characters are used to replace the Chinese characters included in the string to be detected to obtain the strokes corresponding to the string to be detected. In one implementation, the included Chinese characters can be split according to the stroke order. For example, the split "去" is "一一丨厶"; or the included Chinese characters can be split according to the radical. For example, the split "们" is "亻门".

[0074] In one embodiment, when the auxiliary information includes the pinyin corresponding to the string to be detected, the string to be detected can be matched with the word segmentation dictionary to obtain M matching words and N non-matching characters, where M and N are integers.

[0075] This word segmentation dictionary can be obtained by loading a word segmentation lexicon using a finite state automaton algorithm (AC automaton algorithm). This lexicon includes multiple word segments, which can be words derived from standard Chinese or new words (words with new content and form that do not exist in the original vocabulary system). The original dictionary refers to nodes representing characters, where a string can be formed from the root node to any node. The dictionary generated by the AC automaton algorithm, compared to the original dictionary, adds mismatch pointers to the nodes. If the mismatch pointer of node [i] points to node [j], then the string formed from the root node to node [j] is the longest suffix of the string formed from the root node to node [i]. If node [j] does not exist for node [i], then the mismatch pointer of node [i] points to the root node. Figure 4 Taking an example, the string from the root node to node 1 is "abch", and the string from the root node to node 2 is "ch". It's clear that "ch" is the longest suffix of "abch", so the mismatch pointer of node 1 points to node 2. The string from the root node to node 3 is "abd". It's evident that there is no path from the root node to any node that forms the suffix "d" or "bd", so the mismatch pointer of node 3 points to the root node. In the original trie, if a character and node do not match, it's necessary to backtrack to the root node and restart the traversal. However, the trie generated based on the AC automaton algorithm can move to the node pointed to by the mismatch pointer to continue matching when a character and node do not match, without needing to backtrack. For example, in... Figure 4 In the trie, when matching the string "abchn", if "abch" is matched, the process will traverse to node 1. Since the next node of node 1 is not "n", the process will obtain node 2, which is pointed to by the mismatch pointer of node 1, and continue matching "n" from node 2.

[0076] In each node of the word segmentation dictionary tree, in addition to having a mismatch pointer, the node representing the last character of the word segmentation A (any one of multiple word segmentations) also contains an end flag and the character count of the word segmentation A. For example, from the root node (which can represent the empty character) to node a (representing "min"), to node b (representing "gan"), to node c ("ci"), the word segmentation A "sensitive word" can be obtained. Then node c contains the end flag and the character count 3. When the current character ("ci") in the string to be detected ("What is the sensitive word") matches the character represented by node c, and it is found that node c has an end flag, the character count 3 contained in node c can be obtained, and then the characters represented by the two nodes counted backwards can be obtained, or, two characters can be obtained from the current character in the string to be detected going forward, so as to determine the matching word "sensitive word".

[0077] As Figure 5 shown, a word segmentation dictionary tree can be constructed using the word segmentation dictionary, the input string to be detected is matched with the word segmentation dictionary tree, a reference node including an end flag is extracted from the nodes matching the current character, the character count contained in the reference node is obtained, and the matching word is searched in the word segmentation dictionary tree using the character count contained in the reference node. Finally, when the matching of the string to be detected and the word segmentation dictionary tree ends, M matching words can be obtained, and the Chinese characters other than the matching words in the string to be detected can be used as unmatched characters. In a feasible embodiment, new word segmentations can also be added to the word segmentation dictionary, and the word segmentation dictionary tree can be reloaded using the added word segmentation dictionary.

[0078] Furthermore, the word segmentation pinyin mapping table contains multiple word segmentations in the word segmentation dictionary and the pinyin corresponding to each of the multiple word segmentations. The word pinyin mapping table includes multiple words and the pinyin corresponding to each of the multiple words. As Figure 6 shown,[[]] Figure 6 on the left is an example of the word pinyin mapping table,[[]] Figure 6 on the right is an example of the word segmentation pinyin mapping table. The word pinyin mapping table contains the Unicode code of Chinese characters (such as 3416 in U+3416). The pinyin corresponding to the M matching words is found using the word segmentation pinyin mapping table, and the pinyin corresponding to the N unmatched characters is found using the word pinyin mapping table. Then, the pinyin corresponding to the string to be detected is generated using the pinyin corresponding to the M matching words and the pinyin corresponding to the N unmatched characters. Specifically, the M matching words in the string to be detected are replaced with the pinyin corresponding to the M matching words, and the N unmatched characters in the string to be detected are replaced with the pinyin corresponding to the N unmatched characters to obtain the pinyin corresponding to the string to be detected.

[0079] In one embodiment, when the auxiliary information includes the first letter of the string to be detected, the first letter of the string to be detected is extracted using the pinyin corresponding to the string to be detected. This can be achieved by extracting the first letter of the pinyin corresponding to each word in the string to be detected, and replacing the string to be detected with the first letter of the pinyin corresponding to each word. Alternatively, the first letter of the M matching words can be determined using the pinyin corresponding to the M matching words, and the first letter of the N non-matching characters can be determined using the pinyin corresponding to the N non-matching characters. The first letter of the M matching words is then used to replace the M matching words in the string to be detected, and the first letter of the N non-matching characters is used to replace the N non-matching characters in the string to be detected, thus obtaining the first letter of the string to be detected.

[0080] like Figure 7 As shown, after using the word segmentation dictionary to segment the string to be detected and obtaining the segmentation result of the string to be detected, the word pinyin mapping table and the pinyin in the word segmentation pinyin mapping table can be loaded, and the pinyin corresponding to the string to be detected and the first letter corresponding to the string to be detected can be obtained by using a multi-coroutine parallel processing method.

[0081] S303. Obtain the target trie, which is a trie constructed from the sensitive word set, the sensitive word initial letter set, the sensitive word pinyin set, and the sensitive word stroke set.

[0082] In one embodiment, the target trie is constructed by loading a set of sensitive words, a set of sensitive word initials, a set of sensitive word pinyin, and a set of sensitive word strokes based on the AC state automaton algorithm. The sensitive string is data from the set of sensitive words, the set of sensitive word initials, the set of sensitive word pinyin, or the set of sensitive word strokes; that is, the sensitive string can be a sensitive word in the set of sensitive words, the first letter of a sensitive word in the set of sensitive word initials, the pinyin of a sensitive word in the set of sensitive word pinyin, or the stroke of a sensitive word in the set of sensitive word strokes. A node in the target trie can represent a character in the sensitive string. The string formed by traversing from the root node of the target trie to a certain node can be a sensitive string, and each node has a mismatch pointer. The node corresponding to the last character of the sensitive string contains an end marker and the number of characters in the sensitive string.

[0083] In one embodiment, the server can respond to a sensitive word management command and display a sensitive word management interface according to the object permissions corresponding to the command. The sensitive word management interface includes one or more of the following: a sensitive word configuration area, a sensitive word initial letter configuration area, a sensitive word pinyin configuration area, and a sensitive word stroke configuration area. The sensitive word configuration area receives the input sensitive word; the sensitive word initial letter configuration area receives the input sensitive word initial letter; the sensitive word pinyin configuration area receives the input sensitive word pinyin; and the sensitive word stroke configuration area receives the input sensitive word stroke. The permission identifier corresponding to the object permission can be included in the sensitive word management command. Different object permissions have different configuration rights. For example, they can be divided according to operations personnel, developers, and product personnel. When a sensitive word management command is initiated by an operations personnel, the sensitive word management interface includes the sensitive word configuration area and the sensitive word initial letter configuration area; when a sensitive word management command is initiated by a developer, the sensitive word management interface includes the sensitive word configuration area, the sensitive word stroke configuration area, and the sensitive word initial letter configuration area.

[0084] Furthermore, the target set can be updated using the received data. This received data can be one or more of the following: sensitive words entered in the sensitive word configuration area, the first letters of sensitive words entered in the sensitive word initial letter configuration area, the pinyin of sensitive words entered in the sensitive word pinyin configuration area, and the strokes of sensitive words entered in the sensitive word stroke configuration area. The received data can be added to the target set. The target set is the set of sensitive words, sensitive word initial letters, sensitive word pinyin, and sensitive word strokes that matches the type of the received data. A preset period for loading the target trie can be set in the sensitive word management interface. When the preset period arrives, the updated target set and the unupdated set are loaded based on a finite state automaton algorithm to generate a new target trie.

[0085] In one embodiment, the sensitive word management interface further includes a business scenario list, which includes at least one business scenario, such as a general scenario, a game application scenario, a video application scenario, etc. The server can respond to a trigger operation targeting a target business scenario in the business scenario list. The target business scenario is any one of the at least one business scenario. In this case, the data input in the sensitive word management interface is configured for the target business scenario. Then, based on the finite state automaton algorithm, the updated target set and the unupdated set are loaded, and the generated new target dictionary tree is applicable to the target business scenario. The target dictionary tree can be associated and stored with the target business scenario. When the detection request contains an application identifier, the business scenario to which the application belongs is obtained. If the business scenario to which the application belongs matches the target business scenario, the target dictionary tree is read. When the detection request does not contain an application identifier, a dictionary tree applicable to the general scenario can be obtained as the target dictionary tree.

[0086] In feasible embodiments, in addition to receiving input sensitive words in the sensitive word configuration area, such as Figure 8 As shown, the sensitive word configuration area also allows for the deletion of existing sensitive words from the sensitive word set and the setting of applicable business scenarios for each sensitive word. Similarly, the sensitive word initial letter configuration area, sensitive word pinyin configuration area, and sensitive word stroke configuration area can also include deletion and business scenario configuration functions. For each business scenario, there can be a corresponding sensitive word set, sensitive word initial letter set, sensitive word pinyin set, and sensitive word stroke set. Based on the AC automaton algorithm, the sensitive word set, sensitive word initial letter set, sensitive word pinyin set, and sensitive word stroke set corresponding to each business scenario can be loaded to obtain a dictionary tree applicable to each business scenario. When the detection request contains an application identifier, the business scenario to which the application belongs is obtained, and the dictionary tree applicable to the business scenario to which the application belongs is used as the target dictionary tree. When the detection request does not contain an application identifier, a dictionary tree applicable to general scenarios can be obtained as the target dictionary tree.

[0087] In one embodiment, the sensitive word set, sensitive word initial letter set, sensitive word pinyin set, and sensitive word stroke set can be deployed in isolation. Specifically, each of the multiple data isolation models includes a primary data storage unit and a backup data storage unit. The multiple primary data storage units can be used to store the sensitive word set, sensitive word initial letter set, sensitive word pinyin set, and sensitive word stroke set, respectively. The backup data storage unit in each data isolation model automatically synchronizes the data in the corresponding primary data storage unit. When loading the sensitive word set, sensitive word initial letter set, sensitive word pinyin set, and sensitive word stroke set based on the finite state automaton algorithm to generate the target trie, if the primary data storage unit has not crashed, data is retrieved from each primary data storage unit; if a primary data storage unit has crashed, data is retrieved from the corresponding backup data storage unit. This embodiment ensures high data reliability.

[0088] In feasible embodiments, isolation deployment can also be performed according to business scenarios. The target data isolation model among multiple data isolation models can be used to store the sensitive word set, sensitive word initial letter set, sensitive word pinyin set, and sensitive word stroke set corresponding to the target business scenario. Each data isolation model includes a primary data storage unit and a backup data storage unit. When loading the sensitive word set, sensitive word initial letter set, sensitive word pinyin set, and sensitive word stroke set corresponding to the target business scenario based on the finite state automaton algorithm, if the primary data storage unit of the target data isolation model has not crashed, data is retrieved from the primary data storage unit; if the primary data storage unit of the target data isolation model has crashed, data is retrieved from the backup data storage unit. This embodiment ensures high data reliability.

[0089] S304. Match the string to be detected with the target trie to obtain the first matching result.

[0090] When the target trie is obtained based on the AC automaton algorithm, the target trie includes multiple nodes and mismatch pointers for each node. The node corresponding to the last character of the sensitive string contains an end marker and the number of characters in the sensitive string. The sensitive string is data from the sensitive word set, the sensitive word first letter set, the sensitive word pinyin set, or the sensitive word stroke set.

[0091] In one embodiment, matching the string to be detected with the target trie to obtain a first matching result includes: traversing the string to be detected to extract the current character for the current matching, and determining the target node corresponding to the current character from the target trie; matching the current character with the target node. If the current character matches the target node successfully, determine the next node to be matched corresponding to the target node according to the successful matching strategy, use the next character of the current character as the new current character, use the next node to be matched determined by the successful matching strategy as the new target node, and execute the step of matching the current character with the target node. Among them, the successful matching strategy is specifically: if the target node is a leaf node, the next node to be matched determined by the successful matching strategy is the next node of the node pointed to by the mismatch pointer of the target node; if the target node is not a leaf node, the next node to be matched determined by the successful matching strategy is the next node of the target node. If the current character fails to match the target node, determine whether the target node is the next node of the root node; if so, use the next character of the current character as the new current character, and execute the step of matching the current character with the target node; if not, determine the next node to be matched corresponding to the target node according to the failed matching strategy, use the next node to be matched determined by the failed matching strategy as the new target node, and execute the step of matching the current character with the target node. The failed matching strategy is specifically: if the target node is the root node, since the root node is an empty character and will default to a failed match with the current character, the next node to be matched determined by the failed matching strategy is the next node of the root node; if the target node is not the root node, the next node to be matched determined by the failed matching strategy is the next node of the node pointed to by the mismatch pointer of the parent node of the target node. When the traversal of the string to be detected is completed, extract the target nodes containing the end identifier from all the target nodes that match successfully, and extract the first matching result from the target trie according to the number of characters contained in the extracted target nodes. For example, when the current character ("word") currently being matched in the string to be detected is the same as the character represented by node c, and it is found that node c has an end identifier, then the number of characters 3 contained in node c can be used, and then obtain the characters "sensitive" and "word" represented by the two nodes counted up from the bottom, determine the sensitive string "sensitive word", and the first matching result can include one or more sensitive strings, and the sensitive string can be a pinyin string, a stroke string, a Chinese character string, or an initial letter string.

[0092] With Figure 4This example illustrates the matching process for the target trie and the string to be tested, "sabchni". Starting with the current character "s" (initially the first character of the string to be tested), it is matched against the root node (the initial target node is the root node). If the match fails, the next nodes "a", "c", and "i" of the root node are used as new target nodes. The current character "s" is then matched against the target nodes "a", "c", and "i". If this also fails, the next character "a" of the current character "s" is used as the new current character and matched against the target nodes "a", "c", and "i". If this match succeeds, the next character "b" of the current character "a" is used as the new current character. The next node "b" of the target node is then used as the new target node, and matching continues. If this match succeeds, the next character "c" of the current character is used as the new current character. The next nodes "d" and "c" of the target node are used as new target nodes for matching. Since a match is successful, the next character "h" of the current character is used as the new current character, and the next node "h" of the target node is used as the new target node for matching. Since a match is successful, the next character "n" of the current character is used as the new current character, and the next node "i" of the target node is used as the new target node for matching. Since a match fails, the next node "n" of the node pointed to by the mismatch pointer of the target node's parent node is used as the new target node for matching with the current character "n". Since a match is successful, the next character "i" of the current character is used as the new current character. Furthermore, since the target node "n" is a leaf node, the next nodes "a", "c", and "i" of the node pointed to by the mismatch pointer of the target node are used as new target nodes. Finally, a match is performed and successful. The target trie constructed based on the AC automaton algorithm can improve the matching speed of the string to be detected.

[0093] S305. Match the auxiliary information with the target trie to obtain a second matching result.

[0094] In one embodiment, the pinyin (or the first letter of the string to be detected, or the strokes of the string to be detected) corresponding to the target trie is matched with the target trie to obtain a second matching result. This includes: traversing the pinyin (or the first letter of the string to be detected, or the strokes of the string to be detected) to extract the current character used for the current match, and determining the target node corresponding to the current character from the target trie; matching the current character with the target node. If the current character matches the target node successfully, the next node to be matched corresponding to the target node is determined according to the matching success strategy. The next character of the current character is taken as the new current character, and the next node to be matched determined by the matching success strategy is taken as the new target node, and the step of matching the current character with the target node is executed. Specifically, the matching success strategy is as follows: if the target node is a leaf node, the next node to be matched determined by the matching success strategy is the next node of the node pointed to by the mismatch pointer of the target node; if the target node is not a leaf node, the next node to be matched determined by the matching success strategy is the next node of the target node. If the current character fails to match the target node, determine whether the target node is the next node of the root node. If yes, take the next character of the current character as the new current character and execute the step of matching the current character with the target node. If no, determine the next node to be matched corresponding to the target node according to the matching failure strategy, take the next node to be matched determined by the matching failure strategy as the new target node, and execute the step of matching the current character with the target node. The matching failure strategy is as follows: if the target node is the root node, since the root node is an empty character, it will default to failing to match the current character, and the next node to be matched determined by the matching failure strategy is the next node of the root node. If the target node is not the root node, the next node to be matched determined by the matching failure strategy is the next node of the node pointed to by the mismatch pointer of the target node's parent node. When the traversal of the pinyin (or the first letter of the string to be detected, or the strokes of the string to be detected) is completed, extract the target node containing the end marker from all successfully matched target nodes, and extract the second matching result from the target trie according to the number of characters contained in the extracted target node.

[0095] When matching the pinyin corresponding to the string to be detected with the target trie, the sensitive string included in the second matching result can be the pinyin string. When matching the first letter of the pinyin corresponding to the string to be detected with the target trie, the sensitive string included in the second matching result can be the first letter string. When matching the strokes corresponding to the strokes of the string to be detected with the target trie, the sensitive string included in the second matching result can be the stroke string.

[0096] S306. Merge the first matching result and the second matching result to obtain the sensitive characters in the string to be detected.

[0097] In one embodiment, the first matching result and the second matching result can be merged. For example, find the intersection or union of the sensitive strings included in the first matching result and the sensitive strings included in the second matching result. First, in the string to be detected, find the string corresponding to the sensitive string included in the second matching result. When finding the intersection, take the common part of the string included in the first matching result and the string corresponding to the sensitive string included in the second matching result. For example, the common part of "sensitive" and "sensitive word" is "sensitive", and the characters included in "sensitive" can be used as sensitive characters. When finding the union, the characters in the sensitive string included in the first matching result in the string to be detected can be used as sensitive characters; and obtain the string corresponding to the sensitive string included in the second matching result in the string to be detected, and use the characters included in the corresponding string as sensitive characters. For example, if the second matching result is "women", the string corresponding to the sensitive string "women" in the string to be detected is "我们".

[0098] S307. Perform sensitive word processing on the string to be detected according to the sensitive characters in the string to be detected to obtain a target string, and output the target string.

[0099] In one embodiment, a sensitive word prompt interface can be displayed. The sensitive word prompt interface contains Q synonyms, and the Q synonyms are obtained based on the sensitive characters in the string to be detected, where Q is a positive integer. Specifically, the sensitive characters in the string to be detected can be the characters included in the sensitive string, or the characters included in the string corresponding to the sensitive string in the string to be detected. The sensitive string can be determined by using the sensitive characters in the string to be detected. If the sensitive string is the letters, pinyin, or strokes corresponding to the sensitive word, first convert the sensitive string into a sensitive word, and then perform a synonym conversion process on the converted sensitive word to obtain Q synonyms. If the sensitive string is a sensitive word, directly perform a synonym conversion process on the sensitive string to obtain Q synonyms. As Figure 9 ​​​In another embodiment, the number of sensitive characters in the string to be detected can be obtained. The number of sensitive characters is used to determine a sensitive word processing strategy. This strategy includes one of the following: a first strategy instructing the deletion of sensitive characters in the string to be detected; a second strategy instructing the deletion of sensitive characters in the string to be detected; and a third strategy instructing the replacement of sensitive characters in the string to be detected using substitution symbols. Specifically, if the number of sensitive characters is greater than or equal to a first threshold (which can be manually set), the first strategy of deleting sensitive characters in the string to be detected is executed. When the first strategy is used, the string to be detected after sensitive word processing is empty, so the output is empty. If the number of sensitive characters is greater than or equal to a second threshold (which can be manually set) but less than the first threshold, the second strategy of deleting sensitive characters in the string to be detected is executed, resulting in the string to be detected after sensitive word processing. If the number of sensitive characters is greater than or equal to a third threshold (which can be manually set) but less than the second threshold, the third strategy of replacing sensitive characters in the string to be detected using substitution symbols is executed, resulting in the string to be detected after sensitive word processing. The string to be detected after sensitive word processing is the target string, which can be output. Specifically, the target string can be displayed as a text message in the application interface.

[0101] In one feasible embodiment, when the string to be detected does not contain sensitive characters, the string to be detected can be directly output, specifically displayed as a text message in the application interface. When the string to be detected contains sensitive characters, a list of processing strategies can be displayed. This list includes one or more of the following: a first processing strategy instructing the deletion of the string to be detected; a second processing strategy instructing the deletion of sensitive characters in the string to be detected; a third processing strategy instructing the replacement of sensitive characters in the string to be detected using substitution symbols (e.g., "#", "*"); and a fourth processing strategy instructing the replacement of sensitive characters in the string to be detected using synonyms. Additionally, a warning message can be displayed first to indicate the presence of sensitive characters in the string to be detected. Upon receiving confirmation of the warning message, the list of processing strategies is displayed.

[0102] Furthermore, when a target processing strategy is selected from the processing strategy list, sensitive word processing is performed on the string to be detected according to the target processing strategy. For example, when the target processing strategy is the first processing strategy, the string to be detected after sensitive word processing is empty; when the target processing strategy is the second processing strategy, sensitive characters in the string to be detected are deleted; when the target processing strategy is the third processing strategy, sensitive characters in the string to be detected are replaced with replacement symbols; and when the target processing strategy is the fourth processing strategy, sensitive characters in the string to be detected are replaced with synonyms. Synonyms can replace sensitive characters consisting of one or more sensitive characters. A confirmation message about the string to be detected after sensitive word processing can be displayed. When a confirmation operation occurs in response to the confirmation message, the string to be detected after sensitive word processing is used as the target string and output. When outputting the target string, it can be displayed as a text message in the application interface. For example, ... Figure 10 As indicated by the 100 indicator, the user can enter the string "xx sales champion" to be detected in the input field of the application interface and click the "Send" control to generate a detection request containing "xx sales champion". When the detection request is responded to and it is determined that the string "xx sales champion" contains sensitive characters, as shown... Figure 10 As indicated by instruction 101, a list of processing strategies can be displayed in the application interface. When a target processing strategy (replacing "sales champion" in "xx sales champion" with "high sales") is selected, the target processing strategy is used to process the string to be detected for sensitive words, resulting in the target string "xx sales high". This target string "xx sales high" can then be displayed in the display area, as shown below. Figure 10 As indicated by instruction 102, "xx has high sales" can be displayed in "My Activity".

[0103] In this embodiment, a target dictionary tree constructed using the AC automaton algorithm can be used to achieve complete and partial matching of the string to be detected and auxiliary information. The search speed does not increase with the size of the dictionary, thus improving the search speed for sensitive characters. Simultaneously, sensitive strings can be efficiently configured through a sensitive word management interface, improving the convenience of constructing the target dictionary tree. Furthermore, sensitive character recognition can be performed from multiple dimensions using the string to be detected, its first letter, its pinyin, and its stroke count, improving the accuracy of sensitive character recognition and enhancing the effectiveness of sensitive word processing.

[0104] Please see Figure 11 , Figure 11 A flowchart illustrating a data processing method provided in this application embodiment. Figure 3 The method includes:

[0105] In one embodiment, the string to be detected can be input into a word segmentation model, which includes a word segmentation dictionary, to obtain M matching words and N non-matching characters. The M matching words and N non-matching characters are then input into a pinyin and initial letter model, which includes a word segmentation pinyin mapping table and a word pinyin mapping table, to obtain the pinyin and initial letter corresponding to the string to be detected. Alternatively, the string to be detected can be input into a stroke division model to obtain the strokes corresponding to the string. By inputting the string to be detected, its corresponding strokes, its corresponding pinyin, and its corresponding initial letter into a multi-level sensitive word filtering model, a detection result can be obtained, which includes sensitive characters in the string to be detected.

[0106] This multi-level sensitive word filtering model includes a target dictionary tree, such as... Figure 12 As shown, the target trie can be constructed by the sensitive word management system based on the Aho-Corasick automaton algorithm, using a set of sensitive words, a set of sensitive word initials, a set of sensitive word pinyin, and a set of sensitive word strokes. The data in these sets can be configured through the sensitive word management interface provided by the system. Furthermore, data can be added or deleted from these sets, and the target trie can be reloaded. In one implementation, based on the verification level of the string to be detected, strings matching the target trie are selected from the string to be detected, its corresponding strokes, its corresponding pinyin, and its corresponding initials. The sensitive characters in the string to be detected are then obtained based on the matching results.

[0107] This embodiment allows for multi-dimensional sensitive character recognition by utilizing the string to be detected, its first letter, its pinyin, and its stroke count, thereby improving the accuracy of sensitive character recognition.

[0108] Please see Figure 13 , Figure 13 This is a flowchart illustrating a text processing method provided in an embodiment of this application. It can be derived from... Figure 1 The method is executed in terminal 11. The method includes the following steps:

[0109] S1301. Display the application interface, which includes the string to be detected.

[0110] The application interface can be related to game scenarios, social scenarios, etc., such as the interface for posting dynamic content in a game community, the interface for playing bullet comments, the interface for commenting on short videos, etc. This application does not limit it to this.

[0111] In one embodiment, the application interface may include an input field, and the string to be detected may be characters entered in the input field of the application interface. After the user enters the string to be detected in the input field, such as... Figure 14 As indicated by 140, the user can trigger the "Send" control in the application interface to generate a sensitive word recognition request for the string to be detected. When the terminal receives the sensitive word recognition request for the string to be detected, it can check whether there are sensitive words in the string to be detected. Specifically, it can perform the above steps S301-306 or steps S201-S204 to perform sensitive word recognition.

[0112] In another embodiment, the application interface can be in a sensitive word detection mode. The string to be detected in the application interface can be a string entered in the application interface or interface text in the application interface. When the application interface is in sensitive word detection mode, steps S301-306 or steps S201-S204 above can be automatically executed to identify sensitive words in the string to be detected.

[0113] S1302. When a sensitive word is detected in the string to be detected, a first prompt message is displayed, the first prompt message being used to prompt the sensitive word in the string to be detected; and a second prompt message is displayed, the second prompt message including N synonyms corresponding to the sensitive word in the string to be detected, where N is a positive integer.

[0114] When a sensitive word is detected in the string to be detected, a first prompt message and a second prompt message can be displayed. The first prompt message can be used to indicate the sensitive word in the string to be detected. The second prompt message includes N (positive integer) synonyms corresponding to the sensitive word in the string to be detected. Synonyms can be words with the same or similar meaning as the sensitive word, or they can be the word groups corresponding to the sensitive word in the string to be detected after the overall semantic transformation of the string to be detected. For example, if the overall semantic transformation of "technical garbage" is "technology needs improvement", then the synonym of the sensitive word "garbage" in "technical garbage" is "needs improvement".

[0115] In one embodiment, a pop-up window or overlay can be generated on the application interface, and a first prompt message and a second prompt message can be displayed simultaneously in the pop-up window or overlay, for example, such as Figure 14As indicated by indicator 142, the message displays the first warning message: "The sensitive word 'sales champion' exists in 'xx sales champion'", and the second warning message: "High sales", "Hot selling", "Best-selling". The pop-up or overlay also provides an "OK" control. When the "OK" control is triggered, the selection of the target synonym is confirmed, and the user-selected synonym is used as the target synonym. Furthermore, sensitive words included in the string to be detected in the first warning message can be highlighted, and synonyms in the second warning message can also be highlighted.

[0116] In another embodiment, the first prompt message and the second prompt message can be displayed sequentially. Specifically, a first pop-up window or a first floating layer can be generated on the application interface to display the first prompt information. For example, ... Figure 14 As indicated by instruction 141, a first pop-up window is displayed on the application interface, showing the first prompt message: the sensitive word in the string "xx sales champion" to be detected is "sales champion". The first pop-up window also provides "OK" and "Cancel" controls. When the "OK" control is triggered, confirmation of the first prompt message is confirmed. Upon receiving confirmation of the first prompt message, the first pop-up window or first floating layer displaying the first prompt message can disappear. Specifically, the first pop-up window or first floating layer can disappear according to a pre-set disappearance effect, such as sliding disappearance or fade-out disappearance. Furthermore, a second prompt message can be displayed. Specifically, a second pop-up window or second floating layer can be generated on the application interface to display the second prompt message. For example, a second floating layer can be displayed on the application interface, and the second prompt message displayed in the second floating layer can include: "High sales", "Hot selling", or "Best-selling". The second pop-up or floating layer also provides an "OK" control. After selecting a synonym, the user can trigger the "OK" control. When the "OK" control is triggered, the selection of the target synonym is confirmed, and the target synonym is the synonym selected by the user. The second pop-up or floating layer displaying the second prompt message can disappear, specifically according to a pre-set disappearance effect, such as sliding away or fading away.

[0117] S1303. When a selection operation for a target synonym is received, the target string is displayed on the application interface. The target string is the string after the sensitive words in the string to be detected have been replaced with the target synonym.

[0118] In one embodiment, when a selection operation for a target synonym is received, the target synonym can be used to replace sensitive words in the string to be detected, resulting in the target string. The system then redirects to the display area of ​​the application interface, displaying the target string as a text message in the display area, for example... Figure 14 As indicated by instruction 144, "xx has high sales" can be displayed in "My Activity".

[0119] In one implementation, such as Figure 14 As indicated by instruction 143, the second prompt message displayed in the pop-up or overlay includes not only N synonyms for the sensitive words in the string to be detected, such as "high sales," "hot-selling," and "best-selling," but also the replacement result strings for each synonym, such as "xx high sales," "xx hot-selling," and "xx best-selling." Each replacement result string is obtained by replacing the sensitive words in the string to be detected with that synonym. After selecting a replacement result string, the user can trigger the "OK" control in the pop-up or overlay. When the trigger occurs, it confirms the selection of the target string, and the user-selected replacement result string is used as the target string and displayed as a text message on the application interface. Synonyms in the replacement result strings of the second prompt message can be highlighted.

[0120] In feasible embodiments, the second prompt information may further include a first deletion result string "xx" and a second deletion result string "xx#". The first deletion result string is the string after sensitive words in the string to be detected have been deleted, and the second deletion result string is the string after sensitive words in the string to be detected have been replaced with replacement symbols (such as "#" or "*"). Compared with the replacement result string, the second deletion result string obtained by using replacement symbols lacks semantics and cannot fully express the text information of the string to be detected. Users can also select either the first deletion result string or the second deletion result string, and further, the user-selected first deletion result string or second deletion result string can be displayed on the application interface in the form of a text message.

[0121] In this embodiment, when a string to be detected contains sensitive words, the sensitive characters in the string to be detected can be processed to obtain a target string that does not contain sensitive characters. Finally, the target string is displayed on the application interface in the form of a text message, which can improve the convenience and effectiveness of sensitive word processing.

[0122] It is understood that in the specific implementation of this application, data such as the string to be detected are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0123] The methods of the embodiments of this application have been described in detail above. To facilitate better implementation of the methods of the embodiments of this application, the apparatus of the embodiments of this application is provided below. Please refer to... Figure 15 , Figure 15 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application. The data processing device 150 may include:

[0124] Acquisition unit 1501 is used to acquire a detection request, the detection request including a string to be detected;

[0125] Processing unit 1502 is used to convert the string to be detected into auxiliary information, the auxiliary information including one or more of the following: the first letter of the string to be detected, the pinyin of the string to be detected, and the number of strokes of the string to be detected;

[0126] The acquisition unit 1501 is also used to acquire a target dictionary tree, which is a dictionary tree constructed from a set of sensitive words, a set of sensitive words with their first letters, a set of sensitive words with their pinyin, and a set of sensitive words with their strokes.

[0127] The processing unit 1502 is further configured to match the string to be detected and the auxiliary information with the target trie to obtain the sensitive characters in the string to be detected;

[0128] The processing unit 1502 is further configured to perform sensitive word processing on the string to be detected based on the sensitive characters in the string to be detected, obtain the target string, and output the target string.

[0129] In one embodiment, the processing unit 1502 is specifically configured to: respond to a sensitive word management instruction, display a sensitive word management interface according to the object permissions corresponding to the sensitive word management instruction, the sensitive word management interface including one or more of a sensitive word configuration area, a sensitive word initial letter configuration area, a sensitive word pinyin configuration area, and a sensitive word stroke configuration area, wherein the sensitive word configuration area is used to receive input sensitive words, the sensitive word initial letter configuration area is used to receive input sensitive word initial letters, the sensitive word pinyin configuration area is used to receive input sensitive word pinyin, and the sensitive word stroke configuration area is used to receive input sensitive word strokes; update the target set according to the received data, wherein the target set is the set of sensitive words, the sensitive word initial letter set, the sensitive word pinyin set, and the sensitive word stroke set that are of the same type as the received data; and when a preset period arrives, load the updated target set and the unupdated set based on a finite state automaton algorithm to generate a new target trie.

[0130] In one embodiment, the sensitive word management interface further includes a business scenario list, which includes at least one business scenario; the processing unit 1502 is specifically configured to: in response to a trigger operation for a target business scenario in the business scenario list, associate and store the target dictionary tree with the target business scenario; obtain the business scenario to which the application corresponding to the application identifier belongs; if the business scenario to which the application belongs matches the target business scenario, then read the target dictionary tree.

[0131] In one embodiment, the processing unit 1502 is specifically configured to: when the auxiliary information includes the strokes corresponding to the string to be detected, split the string to be detected to obtain the strokes corresponding to the string to be detected; when the auxiliary information includes the pinyin corresponding to the string to be detected, match the string to be detected with a word segmentation dictionary tree to obtain M matching words and N non-matching characters, where M and N are integers; determine the pinyin corresponding to the M matching words using a word segmentation pinyin mapping table, and determine the pinyin corresponding to the N non-matching characters using a word pinyin mapping table; generate the pinyin corresponding to the string to be detected using the pinyin corresponding to the M matching words and the pinyin corresponding to the N non-matching characters; when the auxiliary information includes the first letter corresponding to the string to be detected, extract the first letter corresponding to the string to be detected using the pinyin corresponding to the string to be detected.

[0132] In one embodiment, the processing unit 1502 is specifically configured to: match the string to be detected with the target trie to obtain a first matching result; match the auxiliary information with the target trie to obtain a second matching result; and merge the first matching result and the second matching result to obtain the sensitive character in the string to be detected.

[0133] In one embodiment, the target trie includes multiple nodes and a mismatch pointer for each node. The node corresponding to the last character of the sensitive string contains an end identifier and the number of characters in the sensitive string. The sensitive string is data from the sensitive word set, the sensitive word initial letter set, the sensitive word pinyin set, or the sensitive word stroke set. The processing unit 1502 is specifically used to: traverse the string to be detected to extract the current character used for the current match, and determine the target node corresponding to the current character from the target trie; match the current character with the target node; if the current character matches the target node successfully, determine the next node to be matched corresponding to the target node according to the matching success strategy, take the next character of the current character as the new current character, and set the next node to be matched according to the matching success strategy. As a new target node, the step of matching the current character with the target node is executed; if the current character fails to match the target node, it is determined whether the target node is the next node of the root node; if so, the next character of the current character is taken as the new current character, and the step of matching the current character with the target node is executed; if not, the next node to be matched corresponding to the target node is determined according to the matching failure strategy, the next node to be matched determined by the matching failure strategy is taken as the new target node, and the step of matching the current character with the target node is executed; when the string to be detected is traversed, the target node containing the end identifier is extracted from all successfully matched target nodes, and the first matching result is extracted from the target trie according to the number of characters contained in the extracted target node.

[0134] In one embodiment, the processing unit 1502 is specifically configured to: display a sensitive word prompt interface, the sensitive word prompt interface containing Q synonyms, the Q synonyms being obtained based on sensitive characters in the string to be detected, where Q is a positive integer; and, in response to a selection operation of a target synonym for the sensitive word prompt interface, replace the sensitive characters in the string to be detected with the target synonym.

[0135] In one embodiment, the detection request further includes a verification level of the string to be detected. The verification level is used to determine the data included in the auxiliary information. When the verification level is a first level, the auxiliary information includes the first letter of the string to be detected, or the pinyin of the string to be detected, or the strokes of the string to be detected. When the verification level is a second level, the auxiliary information includes the first letter of the string to be detected and the pinyin of the string to be detected, or the first letter of the string to be detected and the strokes of the string to be detected, or the pinyin of the string to be detected and the strokes of the string to be detected. When the verification level is a third level, the auxiliary information includes the first letter of the string to be detected, the pinyin of the string to be detected, and the strokes of the string to be detected.

[0136] In one embodiment, the acquisition unit 1501 is specifically used to: acquire the number of sensitive characters in the string to be detected;

[0137] The processing unit 1502 is specifically used to: determine a sensitive word processing strategy based on the number of sensitive characters, the sensitive word processing strategy including a first processing strategy that indicates the deletion of the string to be detected, a second processing strategy that indicates the deletion of sensitive characters in the string to be detected, and a third processing strategy that indicates the replacement of sensitive characters in the string to be detected with a replacement symbol; and perform sensitive word processing on the string to be detected according to the sensitive word processing strategy.

[0138] It is understood that the functions of each functional unit of the data processing device described in the embodiments of this application can be specifically implemented according to the methods in the above method embodiments, and the specific implementation process can be referred to the relevant descriptions in the above method embodiments, which will not be repeated here.

[0139] In this embodiment, a detection request can be obtained, which includes a string to be detected. The string to be detected is converted into one or more of the following: the first letter of the string, the pinyin of the string, and the number of strokes of the string, to obtain auxiliary information. The string to be detected and the auxiliary information are matched with a target trie to obtain sensitive characters in the string to be detected. Then, sensitive word processing is performed on the string to be detected based on the sensitive characters in the string to be detected to obtain the target string, which is then output. Using the method of this application, sensitive characters in the string to be detected can be identified from multiple dimensions, improving the accuracy of sensitive character identification and the effectiveness of sensitive word processing.

[0140] Please see Figure 16 , Figure 16This is a schematic diagram of the structure of a text processing device provided in an embodiment of this application. The text processing device 160 may include:

[0141] Display unit 1601 is used to display an application interface, the application interface including the string to be detected;

[0142] The display unit 1601 is further configured to display a first prompt message when a sensitive word is detected in the string to be detected, the first prompt message being used to prompt the sensitive word in the string to be detected; and to display a second prompt message, the second prompt message including N synonyms corresponding to the sensitive word in the string to be detected, where N is a positive integer;

[0143] The display unit 1601 is further configured to display a target string on the application interface when a selection operation for a target synonym is received. The target string is the string after the sensitive words in the string to be detected have been replaced with the target synonym.

[0144] It is understood that the functions of each functional unit of the text processing device described in the embodiments of this application can be specifically implemented according to the methods in the above method embodiments, and the specific implementation process can be referred to the relevant descriptions in the above method embodiments, which will not be repeated here.

[0145] In this embodiment, when a string to be detected contains sensitive words, the sensitive characters in the string to be detected can be processed to obtain a target string that does not contain sensitive characters. Finally, the target string is displayed on the application interface in the form of a text message, which can improve the convenience and effectiveness of sensitive word processing.

[0146] like Figure 17 As shown, Figure 17 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. The internal structure of the computer device 170 is as follows: Figure 17 As shown, it includes: one or more processors 1701, memory 1702, and communication interface 1703. The processors 1701, memory 1702, and communication interface 1703 can be connected via bus 1704 or other means. This embodiment of the application takes the connection via bus 1704 as an example.

[0147] The processor 1701 (or CPU, Central Processing Unit) is the computing and control core of the computer device 170. It can parse various instructions within the computer device 170 and process various data. For example, the CPU can parse power-on / off commands sent by the user to the computer device 170 and control the computer device 170 to perform power-on / off operations; it can also transmit various interactive data between internal structures of the computer device 170, and so on. The communication interface 1703 may optionally include a standard wired interface or a wireless interface (such as Wi-Fi, mobile communication interface, etc.), controlled by the processor 1701 for sending and receiving data. The memory 1702 is the storage device in the computer device 170, used to store computer programs and data. It can be understood that the memory 1702 here can include both the computer device 170's built-in memory and extended memory supported by the computer device 170. The memory 1702 provides storage space for storing the operating system of the computer device 170, which may include, but is not limited to, Windows, Linux, Android, iOS, etc., and this application does not limit this to any particular system. In one embodiment, the processor 1701 performs the following operations by running the computer program stored in the memory 1702:

[0148] Obtain a detection request, the detection request including the string to be detected;

[0149] The string to be detected is converted into auxiliary information, which includes one or more of the following: the first letter of the string to be detected, the pinyin of the string to be detected, and the number of strokes of the string to be detected;

[0150] Obtain the target trie, which is a trie constructed from the set of sensitive words, the set of the first letters of sensitive words, the set of the pinyin of sensitive words, and the set of the strokes of sensitive words;

[0151] The string to be detected and the auxiliary information are matched with the target trie to obtain the sensitive characters in the string to be detected;

[0152] The target string is obtained by processing the target string based on the sensitive characters in the target string, and then the target string is output.

[0153] In one embodiment, the processor 1701 is specifically configured to: respond to a sensitive word management instruction, display a sensitive word management interface according to the object permissions corresponding to the sensitive word management instruction, the sensitive word management interface including one or more of a sensitive word configuration area, a sensitive word initial letter configuration area, a sensitive word pinyin configuration area, and a sensitive word stroke configuration area, wherein the sensitive word configuration area is used to receive input sensitive words, the sensitive word initial letter configuration area is used to receive input sensitive word initial letters, the sensitive word pinyin configuration area is used to receive input sensitive word pinyin, and the sensitive word stroke configuration area is used to receive input sensitive word strokes; update a target set according to the received data, wherein the target set is the set of sensitive words, the sensitive word initial letter set, the sensitive word pinyin set, and the sensitive word stroke set that are of the same type as the received data; and when a preset period arrives, load the updated target set and the unupdated set based on a finite state automaton algorithm to generate a new target trie.

[0154] In one embodiment, the sensitive word management interface further includes a business scenario list, which includes at least one business scenario; the processor 1701 is specifically configured to: in response to a trigger operation for a target business scenario in the business scenario list, associate and store the target dictionary tree with the target business scenario; obtain the business scenario to which the application corresponding to the application identifier belongs; if the business scenario to which the application belongs matches the target business scenario, then read the target dictionary tree.

[0155] In one embodiment, the processor 1701 is specifically configured to: when the auxiliary information includes the strokes corresponding to the string to be detected, split the string to be detected to obtain the strokes corresponding to the string to be detected; when the auxiliary information includes the pinyin corresponding to the string to be detected, match the string to be detected with a word segmentation dictionary to obtain M matching words and N non-matching characters, where M and N are integers; determine the pinyin corresponding to the M matching words using a word segmentation pinyin mapping table, and determine the pinyin corresponding to the N non-matching characters using a word pinyin mapping table; generate the pinyin corresponding to the string to be detected using the pinyin corresponding to the M matching words and the pinyin corresponding to the N non-matching characters; when the auxiliary information includes the first letter corresponding to the string to be detected, extract the first letter corresponding to the string to be detected using the pinyin corresponding to the string to be detected.

[0156] In one embodiment, the processor 1701 is specifically configured to: match the string to be detected with the target trie to obtain a first matching result; match the auxiliary information with the target trie to obtain a second matching result; and merge the first matching result and the second matching result to obtain the sensitive character in the string to be detected.

[0157] In one embodiment, the target trie includes multiple nodes and a mismatch pointer for each node. The node corresponding to the last character of the sensitive string contains an end identifier and the number of characters in the sensitive string. The sensitive string is data from the sensitive word set, the sensitive word initial letter set, the sensitive word pinyin set, or the sensitive word stroke set. The processor 1701 is specifically configured to: traverse the string to be detected to extract the current character for the current match and determine the target node corresponding to the current character from the target trie; match the current character with the target node; if the current character matches the target node successfully, determine the next node to be matched corresponding to the target node according to the matching success strategy, take the next character of the current character as the new current character, and set the next node to be matched according to the matching success strategy. As a new target node, the step of matching the current character with the target node is executed; if the current character fails to match the target node, it is determined whether the target node is the next node of the root node; if so, the next character of the current character is taken as the new current character, and the step of matching the current character with the target node is executed; if not, the next node to be matched corresponding to the target node is determined according to the matching failure strategy, the next node to be matched determined by the matching failure strategy is taken as the new target node, and the step of matching the current character with the target node is executed; when the string to be detected is traversed, the target node containing the end identifier is extracted from all successfully matched target nodes, and the first matching result is extracted from the target trie according to the number of characters contained in the extracted target node.

[0158] In one embodiment, the processor 1701 is specifically configured to: display a sensitive word suggestion interface, the sensitive word suggestion interface containing Q synonyms, the Q synonyms being obtained based on sensitive characters in the string to be detected, where Q is a positive integer; and, in response to a selection operation for a target synonym of the sensitive word suggestion interface, replace the sensitive characters in the string to be detected with the target synonym.

[0159] In one embodiment, the detection request further includes a verification level of the string to be detected. The verification level is used to determine the data included in the auxiliary information. When the verification level is a first level, the auxiliary information includes the first letter of the string to be detected, or the pinyin of the string to be detected, or the strokes of the string to be detected. When the verification level is a second level, the auxiliary information includes the first letter of the string to be detected and the pinyin of the string to be detected, or the first letter of the string to be detected and the strokes of the string to be detected, or the pinyin of the string to be detected and the strokes of the string to be detected. When the verification level is a third level, the auxiliary information includes the first letter of the string to be detected, the pinyin of the string to be detected, and the strokes of the string to be detected.

[0160] In one embodiment, the processor 1701 is specifically configured to: obtain the number of sensitive characters in the string to be detected; determine a sensitive word processing strategy using the number of sensitive characters, the sensitive word processing strategy including one of the following: a first processing strategy indicating deletion of the string to be detected, a second processing strategy indicating deletion of sensitive characters in the string to be detected, and a third processing strategy indicating replacement of sensitive characters in the string to be detected using a substitution symbol; and perform sensitive word processing on the string to be detected according to the sensitive word processing strategy.

[0161] In specific implementations, the processor 1701, memory 1702, and communication interface 1703 described in the embodiments of this application can execute the implementation method described in the data processing method provided in the embodiments of this application, or they can execute the implementation method described in the data processing device provided in the embodiments of this application, which will not be repeated here.

[0162] In this embodiment, a detection request can be obtained, which includes a string to be detected. The string to be detected is converted into one or more of the following: the first letter of the string, the pinyin of the string, and the number of strokes of the string, to obtain auxiliary information. The string to be detected and the auxiliary information are matched with a target trie to obtain sensitive characters in the string to be detected. Then, sensitive word processing is performed on the string to be detected based on the sensitive characters in the string to be detected to obtain the target string, which is then output. Using the method of this application, sensitive characters in the string to be detected can be identified from multiple dimensions, improving the accuracy of sensitive character identification and the effectiveness of sensitive word processing.

[0163] In one embodiment, processor 1701 performs the following operations by running a computer program stored in memory 1702:

[0164] Display the application interface, which includes the string to be detected;

[0165] When a sensitive word is detected in the string to be detected, a first prompt message is displayed, which is used to prompt the sensitive word in the string to be detected; and a second prompt message is displayed, which includes N synonyms corresponding to the sensitive word in the string to be detected, where N is a positive integer.

[0166] When a selection operation for a target synonym is received, the target string is displayed on the application interface. The target string is the string after the sensitive words in the string to be detected have been replaced with the target synonym.

[0167] In specific implementations, the processor 1701, memory 1702, and communication interface 1703 described in the embodiments of this application can execute the implementation method described in the text processing method provided in the embodiments of this application, or the implementation method described in the text processing device provided in the embodiments of this application, which will not be repeated here.

[0168] In this embodiment, when a string to be detected contains sensitive words, the sensitive characters in the string to be detected can be processed to obtain a target string that does not contain sensitive characters. Finally, the target string is displayed on the application interface in the form of a text message, which can improve the convenience and effectiveness of sensitive word processing.

[0169] This application also provides a computer-readable storage medium storing a computer program that, when run on a computer device, causes the computer device to perform the data processing method described in any of the possible implementations above. Specific implementations are described above and will not be repeated here.

[0170] This application also provides a computer program product, which includes a computer program or computer instructions. When executed by a processor, the computer program or computer instructions implement the steps of the data processing method provided in this application. The specific implementation method can be found in the foregoing description and will not be repeated here.

[0171] This application also provides a computer program comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the data processing method provided in this application. Specific implementation details are provided above and will not be repeated here.

[0172] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0173] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.

[0174] The above-disclosed embodiments are only some of the embodiments of this application, and should not be construed as limiting the scope of this application. Therefore, any equivalent changes made in accordance with the claims of this application shall still fall within the scope of this application.

Claims

1. A data processing method, characterized by, The method comprises: obtaining a detection request, the detection request comprising a to-be-detected string and a verification level of the to-be-detected string; converting the to-be-detected string into auxiliary information; obtaining a target dictionary tree, the target dictionary tree being a dictionary tree constructed from a sensitive word set, a sensitive word initial letter set, a sensitive word pinyin set, and a sensitive word stroke set; matching the to-be-detected string and the auxiliary information with the target dictionary tree to obtain a sensitive character in the to-be-detected string; performing sensitive word processing on the to-be-detected string according to the sensitive character in the to-be-detected string to obtain a target string, and outputting the target string; wherein the verification level is used to determine data included in the auxiliary information, when the verification level is a first level, the auxiliary information includes any one of an initial letter corresponding to the to-be-detected string, a pinyin corresponding to the to-be-detected string, and a stroke corresponding to the to-be-detected string; when the verification level is a second level, the auxiliary information includes any two of the initial letter corresponding to the to-be-detected string, the pinyin corresponding to the to-be-detected string, and the stroke corresponding to the to-be-detected string; when the verification level is a third level, the auxiliary information includes the initial letter corresponding to the to-be-detected string, the pinyin corresponding to the to-be-detected string, and the stroke corresponding to the to-be-detected string.

2. The method of claim 1, wherein, The method further comprises: in response to a sensitive word management instruction, displaying a sensitive word management interface according to an object permission corresponding to the sensitive word management instruction, the sensitive word management interface comprising one or more of a sensitive word configuration area, a sensitive word initial letter configuration area, a sensitive word pinyin configuration area, and a sensitive word stroke configuration area, the sensitive word configuration area being used to receive an input sensitive word, the sensitive word initial letter configuration area being used to receive an input sensitive word initial letter, the sensitive word pinyin configuration area being used to receive an input sensitive word pinyin, and the sensitive word stroke configuration area being used to receive an input sensitive word stroke; updating a target set according to received data, the target set being a set consistent with a type of the received data among the sensitive word set, the sensitive word initial letter set, the sensitive word pinyin set, and the sensitive word stroke set; when a preset period arrives, loading the updated target set and an un-updated set based on a finite state automaton algorithm to generate a new target dictionary tree.

3. The method of claim 2, wherein, The sensitive word management interface further comprises a business scenario list, the business scenario list comprising at least one business scenario; the method further comprises: in response to a triggering operation on a target business scenario in the business scenario list, storing the target dictionary tree in association with the target business scenario; The detection request further comprises an application identifier, and the obtaining of the target dictionary tree comprises: obtaining a business scenario to which an application corresponding to the application identifier belongs; if the business scenario to which the application belongs matches the target business scenario, reading the target dictionary tree.

4. The method of claim 1, wherein, When the auxiliary information comprises strokes corresponding to the to-be-detected string, the converting the to-be-detected string into auxiliary information comprises: splitting the to-be-detected string to obtain strokes corresponding to the to-be-detected string; When the auxiliary information comprises pinyin corresponding to the to-be-detected string, the converting the to-be-detected string into auxiliary information comprises: matching the to-be-detected string with a token dictionary tree to obtain M matching words and N unmatched characters, M and N are integers, determining pinyin corresponding to the M matching words by using a token-pinyin mapping table, and determining pinyin corresponding to the N unmatched characters by using a word-pinyin mapping table, and generating pinyin corresponding to the to-be-detected string by using the pinyin corresponding to the M matching words and the pinyin corresponding to the N unmatched characters; When the auxiliary information comprises initial letters corresponding to the to-be-detected string, the converting the to-be-detected string into auxiliary information comprises: extracting initial letters corresponding to the to-be-detected string by using pinyin corresponding to the to-be-detected string.

5. The method of claim 1, wherein, The matching the to-be-detected string and the auxiliary information with the target dictionary tree to obtain sensitive characters in the to-be-detected string comprises: matching the to-be-detected string with the target dictionary tree to obtain a first matching result; matching the auxiliary information with the target dictionary tree to obtain a second matching result; merging the first matching result and the second matching result to obtain sensitive characters in the to-be-detected string.

6. The method of claim 5, wherein, The target dictionary tree comprises a plurality of nodes and mismatch pointers of each node, and a node corresponding to a last character of a sensitive string contains an end identifier and a character number of the sensitive string, the sensitive string being data in the sensitive word set, the sensitive word initial letter set, the sensitive word pinyin set or the sensitive word stroke set; The matching the to-be-detected string with the target dictionary tree to obtain a first matching result comprises: traversing the to-be-detected string to extract a current character used for current matching, and determining a target node corresponding to the current character from the target dictionary tree; matching the current character with the target node; if the current character and the target node match successfully, determining a next to-be-matched node corresponding to the target node according to a matching success strategy, taking a next character of the current character as a new current character, taking the next to-be-matched node determined by the matching success strategy as a new target node, and performing the matching the current character with the target node. If the current character fails to match the target node, it is determined whether the target node is a next node of a root node; if yes, a next character of the current character is taken as a new current character, and the step of matching the current character with the target node is performed; if no, a next node to be matched corresponding to the target node is determined according to a matching failure strategy, the next node to be matched determined by the matching failure strategy is taken as a new target node, and the step of matching the current character with the target node is performed; When the to-be-detected string is traversed, a target node containing an end identifier is extracted from all target nodes with which matching succeeds, and a first matching result is extracted from the target dictionary tree according to a number of characters contained in the extracted target node.

7. The method according to any one of claims 1 to 6, characterized in that, The processing of the to-be-detected string according to the sensitive character in the to-be-detected string to obtain a target string comprises: displaying a sensitive word prompt interface, the sensitive word prompt interface containing Q synonyms, the Q synonyms being obtained based on the sensitive character in the to-be-detected string, and Q being a positive integer; in response to a selection operation on a target synonym of the sensitive word prompt interface, replacing the sensitive character in the to-be-detected string with the target synonym to obtain a target string.

8. The method according to any one of claims 1-6, characterized in that, The processing of the to-be-detected string according to the sensitive character in the to-be-detected string to obtain a target string comprises: obtaining a number of sensitive characters in the to-be-detected string; determining a sensitive word processing strategy by using the number of sensitive characters, the sensitive word processing strategy comprising one of a first processing strategy indicating deletion of the to-be-detected string, a second processing strategy indicating deletion of the sensitive character in the to-be-detected string, and a third processing strategy indicating replacement of the sensitive character in the to-be-detected string with a replacement symbol; processing the to-be-detected string according to the sensitive word processing strategy to obtain a target string.

9. A text processing method characterized by, The method comprises: displaying an application interface, the application interface comprising a to-be-detected string; when it is detected that the to-be-detected string contains a sensitive word, displaying a first prompt message for prompting the sensitive word in the to-be-detected string, and displaying a second prompt message comprising N synonyms corresponding to the sensitive word in the to-be-detected string, N being a positive integer; wherein, when the application interface is in a sensitive word detection mode, the data processing method of claim 1 is executed to detect whether the to-be-detected string contains a sensitive word; when a selection operation on a target synonym is received, displaying a target string on the application interface, the target string being a string in which the sensitive word in the to-be-detected string is replaced with the target synonym.

10. A data processing apparatus, characterized by The device comprises: an obtaining unit configured to obtain a detection request, the detection request comprising a to-be-detected string and a verification level of the to-be-detected string; a processing unit configured to convert the to-be-detected string into auxiliary information; The acquisition unit is further configured to acquire a target dictionary tree, the target dictionary tree being a dictionary tree constructed from a sensitive word set, a sensitive word initial letter set, a sensitive word pinyin set, and a sensitive word stroke set; The processing unit is further configured to match the to-be-detected string and the auxiliary information with the target dictionary tree to obtain sensitive characters in the to-be-detected string. The processing unit is further configured to perform sensitive word processing on the to-be-detected string according to the sensitive characters in the to-be-detected string to obtain a target string, and output the target string. The verification level is used to determine data included in the auxiliary information. When the verification level is a first level, the auxiliary information includes any one of initial letters corresponding to the to-be-detected string, pinyin corresponding to the to-be-detected string, and strokes corresponding to the to-be-detected string. When the verification level is a second level, the auxiliary information includes any two of the initial letters corresponding to the to-be-detected string, the pinyin corresponding to the to-be-detected string, and the strokes corresponding to the to-be-detected string. When the verification level is a third level, the auxiliary information includes the initial letters corresponding to the to-be-detected string, the pinyin corresponding to the to-be-detected string, and the strokes corresponding to the to-be-detected string.

11. A text processing apparatus characterized by comprising: The apparatus includes: A display unit configured to display an application interface, the application interface including a to-be-detected string. The display unit is further configured to display a first prompt message when it is detected that the to-be-detected string includes a sensitive word, the first prompt message being used to prompt the sensitive word in the to-be-detected string; and display a second prompt message, the second prompt message including N synonymous words corresponding to the sensitive word in the to-be-detected string, N being a positive integer; wherein whether the to-be-detected string includes a sensitive word is determined by executing the data processing method of claim 1 when the application interface is in a sensitive word detection mode. The display unit is further configured to display a target string on the application interface when a selection operation on a target synonymous word is received, the target string being a string obtained by replacing the sensitive word in the to-be-detected string with the target synonymous word.

12. A computer device, comprising: The computer device includes a memory, a communication interface, and a processor, which are connected to each other. The memory stores a computer program, and the processor invokes the computer program stored in the memory to implement the data processing method of any one of claims 1-8 or the text processing method of claim 9.

13. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the data processing method of any one of claims 1-8 or the text processing method of claim 9.

14. A computer program product, characterised in that, The computer program product comprises computer programs or computer instructions which, when executed by a processor, implement the data processing method as claimed in any one of claims 1-8, or implement the text processing method as claimed in claim 9.

Citation Information

Patent Citations

  • Method and equipment for determining sensitivity of target text

    CN102184188A

  • Sensitive data identifying method and apparatus

    CN105824825A

  • Sensitive word verification method and device, computer device, and storage medium

    CN109033150A

  • Sensitive word filtering method and device, computer equipment and storage medium

    CN109684469A

  • Automatic sensitive word processing method and system

    CN112948664A