Message recognition method, device, equipment and storage medium

By obtaining fingerprint samples of messages from social media platforms and performing string matching, the problem of high computational cost and low accuracy in template-based message identification on social media platforms is solved, achieving efficient and accurate filtering of malicious messages.

CN114330263BActive Publication Date: 2025-11-18TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011047114.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-29
Publication Date
2025-11-18
Estimated Expiration
2040-11-24

AI Technical Summary

Technical Problem

Template-based message recognition on social platforms involves a large amount of computation, has low accuracy and efficiency, and is easily susceptible to harassment from malicious messages and threats to property security.

Method used

By obtaining fingerprint samples of messages and matching multiple reference strings with strings in the message, it is possible to determine whether the message belongs to the target type, thereby reducing the computational load of the model and making full use of the similar syntactic structure features of message templates.

Benefits of technology

It improves the accuracy and efficiency of message identification, reduces data processing costs, and effectively filters malicious messages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114330263B_ABST
    Figure CN114330263B_ABST
Patent Text Reader

Abstract

The application provides a message recognition method, device and equipment and a storage medium, and belongs to the technical field of Internet. The method comprises the following steps: for a message generated based on a template, a fingerprint sample of the template, that is, a plurality of reference strings capable of representing the edited text content in the message, is acquired, and the corresponding strings in the message are matched to determine whether the message belongs to a target type. By matching the strings representing the edited text content, the amount of data processing in the message recognition process is reduced, a large amount of model calculation is not required, the maintenance cost of the fingerprint sample is small, and in this way, the feature that the message generated based on the message template has similar or same syntax structures is fully utilized, the matching accuracy is high, and the accuracy and efficiency of message recognition are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Internet technology, and in particular to a message recognition method, apparatus, device, and storage medium. Background Technology

[0002] With the development of computer technology and the diversification of terminal functions, social applications provide a convenient social platform for users to communicate. On these platforms, communication can be achieved through message interaction. For example, social platforms offer a template-based message interaction method. Users can call upon fixed templates provided by the platform and edit them based on the formatting and information types specified in the template to generate messages to be pushed. However, some malicious users may exploit these messages for malicious purposes, such as sending advertisements or committing fraud, causing unnecessary harassment to users and potentially threatening their financial security.

[0003] In related technologies, in order to avoid harassment or threats to users' property security, the servers of social platforms will identify the content of the messages to be sent. Specific identification methods may include: directly inputting a large number of messages as text into a text recognition model, which will then identify the text to determine whether the message is malicious.

[0004] In the above process, due to the large number of messages to be identified, the server has to perform a lot of computation during the identification process, which requires a lot of data processing resources. In addition, since what is being identified is the complete text of the message, it contains a lot of redundant information, such as format information, which leads to low accuracy and efficiency of identification. Summary of the Invention

[0005] This application provides a message recognition method, apparatus, device, and storage medium, which improves the accuracy and efficiency of message recognition. The technical solution is as follows:

[0006] On the one hand, a message recognition method is provided, the method comprising:

[0007] Obtain the first message, which is generated based on a template;

[0008] A fingerprint sample is determined, the fingerprint sample including multiple reference strings obtained based on a sample message of a target type, the multiple reference strings being used to represent the edited text content of the sample message;

[0009] Obtain multiple strings included in the first message, wherein the multiple strings are used to represent the edited text content of the first message;

[0010] The plurality of reference strings and the plurality of strings are matched to obtain a matching result. In response to the matching result meeting the target condition, it is determined that the first message belongs to the target type.

[0011] On the other hand, a message recognition device is provided, the device comprising:

[0012] The message acquisition module is used to acquire the first message, which is generated based on a template.

[0013] A sample determination module is used to determine a fingerprint sample, wherein the fingerprint sample includes multiple reference strings obtained based on a sample message of a target type, and the multiple reference strings are used to represent the edited text content of the sample message;

[0014] A string acquisition module is used to acquire multiple strings included in the first message, wherein the multiple strings are used to represent the edited text content of the first message;

[0015] The matching module is used to match the plurality of reference strings and the plurality of strings to obtain the matching results;

[0016] A type determination module is used to determine that the first message belongs to the target type in response to the matching result meeting the target conditions.

[0017] In one alternative implementation, the matching result meeting the target condition means:

[0018] The number of successfully matched reference strings is greater than or equal to the target number;

[0019] The proportion of the number of successfully matched reference strings to the total number of reference strings is greater than or equal to the target proportion.

[0020] In one alternative implementation, the apparatus further includes:

[0021] The comparison module is used to periodically compare a first fingerprint set and a second fingerprint set, wherein the first fingerprint set includes fingerprint samples of the target type and the second fingerprint set includes fingerprint samples of non-target types.

[0022] The deletion module is used to delete the overlapping fingerprint samples from the first fingerprint set if there are overlapping fingerprint samples in the first fingerprint set and the second fingerprint set.

[0023] In one alternative implementation, the apparatus further includes:

[0024] A sample message acquisition module is used to acquire sample messages of the template, wherein the sample messages belong to the target type;

[0025] The deletion module is used to delete meaningless characters in the sample message, fill the deletion position with a target symbol, and obtain multiple first sample strings, with each pair of first sample strings separated by the target symbol.

[0026] The deletion module is further configured to delete the target sample string from the plurality of first sample strings, wherein the target sample string is a string in which the number of characters between two target symbols does not meet the character count threshold, thereby obtaining a plurality of second sample strings;

[0027] The reference string acquisition module is used to acquire the multiple reference strings from the multiple second sample strings.

[0028] On the other hand, a computer device is provided, the computer device including a processor and a memory, the memory being used to store at least one piece of program code, the at least one piece of program code being loaded and executed by the processor to implement the operations performed in the message recognition method of the present application embodiments.

[0029] On the other hand, a computer-readable storage medium is provided, wherein at least one piece of program code is stored in the computer-readable storage medium, the at least one piece of program code being loaded and executed by the processor to perform the operations performed as in the message recognition method in the embodiments of this application.

[0030] On the other hand, a computer program product is provided, comprising computer program code stored in a computer-readable storage medium. A processor of a computer device reads the computer program code from the computer-readable storage medium and executes the computer program code, causing the computer device to perform the message recognition method provided in the various optional implementations described above.

[0031] The beneficial effects of the technical solutions provided in this application are:

[0032] This application provides a message recognition method. For messages generated based on templates, fingerprint samples of such templates—that is, multiple reference strings that can represent the edited text content in the message—can be obtained and matched with corresponding strings in the message to determine whether the message belongs to the target type. By using matching between strings representing the edited text content, the computational amount of data processing during message recognition is reduced, eliminating the need for extensive model calculations. Furthermore, the maintenance cost of fingerprint samples is low. This method fully utilizes the characteristic that messages generated based on message templates have similar or identical syntactic structures, resulting in high matching accuracy and improving the accuracy and efficiency of message recognition. Attached Figure Description

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

[0034] Figure 1 This is a schematic diagram illustrating the implementation environment of the message recognition method provided in the embodiments of this application;

[0035] Figure 2 This is a flowchart of a message recognition method provided according to an embodiment of this application;

[0036] Figure 3 This is a flowchart of another message recognition method provided according to an embodiment of this application;

[0037] Figure 4 This is a flowchart of a fingerprint sample acquisition method provided according to an embodiment of this application;

[0038] Figure 5 This is a block diagram of a message recognition device according to an embodiment of this application;

[0039] Figure 6 This is a schematic diagram of the structure of a server according to an embodiment of this application. Detailed Implementation

[0040] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0041] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0042] The following describes the implementation environment of the message recognition method provided in the embodiments of this application. Figure 1 This is a schematic diagram of the implementation environment of the message recognition method provided according to the embodiments of this application. The implementation environment includes: terminal 101 and server 102.

[0043] Terminal 101 and server 102 can be connected directly or indirectly via wired or wireless communication, and this application does not impose any limitations on this connection. Optionally, terminal 101 can be a smartphone, tablet, laptop, desktop computer, etc., but is not limited to these. Terminal 101 can have an application installed and running. Optionally, the application is a social application that provides social-related functions such as conversational features. Illustratively, terminal 101 is a terminal used by a user, and the user's account is logged into the application running on terminal 101.

[0044] Server 102 is the server for a social application platform. A social application platform is a network architecture that connects people through social relationships and / or shared interests (or common benefits). Users can use the client provided by the social application platform for daily communication and to handle some daily tasks. Each user has a network identity that can be identified by other users on the social application platform.

[0045] On social networking platforms, different users can establish social relationships by mutually confirming each other's identities, such as adding each other as friends or following each other. Once two users establish a social relationship, they become each other's social network contacts. A group of users can form a social group by choosing their own methods to create social relationships with each other. Each member of this group is a social network contact for all other members in the group.

[0046] Users or organizations can establish a public social network identifier on a social application platform, allowing the public (e.g., any user on the platform) to communicate with this identifier. This communication can be based on a one-way confirmation mechanism, without requiring mutual confirmation between users. For example, users can choose to subscribe to messages or posts from a public social network identifier (e.g., "follow" the identifier), becoming a social network contact through this one-way confirmation method. The owner of the public social network identifier can also designate other users who have subscribed to their messages or posts as their social network contacts. The social application platform provides message templates for these public social network identifiers, enabling them to generate messages based on these templates and push messages in bulk. User identifiers with social relationships with this public social network identifier can then receive these bulk messages.

[0047] Each user and each public social network identifier on a social application platform has a list of social network contacts, allowing them to communicate with users or public social network identifiers on their list via instant messaging or other means. For example, users within a social group can communicate with each other through interfaces provided by the social application platform, and users can also communicate with each other through interfaces provided by the social application platform.

[0048] The server 102 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides 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, CDN, and big data and artificial intelligence platforms.

[0049] Optionally, during the message recognition process, server 102 undertakes the main computational work and terminal 101 undertakes the secondary computational work; or, server 102 undertakes the secondary computational work and terminal 101 undertakes the main computational work; or, server 102 or terminal 101 can each undertake the computational work independently.

[0050] Optionally, terminal 101 generally refers to one of multiple terminals; this embodiment only uses terminal 101 as an example. Those skilled in the art will understand that the number of terminals 101 can be greater. For example, there may be dozens or hundreds, or even more, terminals 101. In this case, the implementation environment of the message recognition method also includes other terminals. This application embodiment does not limit the number of terminals or the type of device.

[0051] Optionally, the aforementioned wireless or wired networks use standard communication technologies and / or protocols. The network is typically the Internet, but can be any network, including but not limited to Local Area Networks (LANs), Metropolitan Area Networks (MANs), Wide Area Networks (WANs), mobile, wired or wireless networks, private networks, or any combination of virtual private networks. In some embodiments, technologies and / or formats, including Hyper Text Markup Language (HTML), Extensible Markup Language (XML), etc., are used to represent data exchanged over the network. Furthermore, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Networks (VPNs), and Internet Protocol Security (IPsec) can be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technologies can be used to replace or supplement the aforementioned data communication technologies.

[0052] In this embodiment of the invention, a message identification method is provided, wherein the message is generated based on a message template. The formatted content of this type of message accounts for at least half of the message content. Apart from the formatted content, the content that the message sender can customize is very limited. Therefore, only the customized content needs to be checked, without the need for semantic analysis and word segmentation of the complete message, greatly reducing the workload. Moreover, some malicious message senders, in order to adapt to a work mode of multiple accounts, multiple templates, broad casting, and rapid content changes, inevitably need to reduce personalized content to enhance content reusability. At the same time, to accommodate rapidly changing needs, it is impossible to create a new message template for each call. Therefore, messages generated based on the same template, apart from the formatted content, usually have a highly consistent language style and grammatical structure in their customized content. This application embodiment fully utilizes the above features, processes the first message to be published to obtain a limited string, and identifies the message type of the first message to be published by matching it with a fingerprint sample. For a more detailed description, please refer to the following embodiments.

[0053] Figure 2 This is a flowchart of a message recognition method provided according to an embodiment of this application, such as... Figure 2As shown, this embodiment of the application uses a server as an example for explanation. The message recognition method includes the following steps:

[0054] 201. Obtain the first message, which is generated based on the template.

[0055] In this embodiment, the first message is either a message to be published or a published message stored in a user message database. Depending on the identification requirements, the message can come from different sources. For example, if it is necessary to identify a message to be published, the first message is extracted from the message publishing request for subsequent steps, and then the publishing-related steps are executed accordingly. The message publishing request is used to instruct the server to publish the message. If it is necessary to identify a published message, the first message is extracted from the user message database used to store published messages for subsequent steps, and then the relevant processing steps for the published message are executed accordingly. This embodiment does not limit this.

[0056] Here, the template is a predefined message template by the server, that is, a template used to send messages. In some embodiments, the first message is provided by a public social network identifier on the social application platform. The server extracts the first message from the message publishing request received by the public social network identifier, or the server extracts the first message from the published messages of the public social network identifier in the user message database.

[0057] 202. Determine the fingerprint sample, which includes multiple reference strings obtained based on the sample message of the target type. These multiple reference strings are used to represent the edited text content of the sample message.

[0058] In this embodiment, the fingerprint sample is obtained from a sample message belonging to a target type. This sample message is the original fingerprint text of the fingerprint sample, generated based on a message template. The target type refers to the fingerprint sample being of an abnormal type. The fingerprint sample includes multiple reference strings, which represent the editable text content of the sample message. This editable text content is custom content other than the template format content in the message template, obtained through user input and other editing operations.

[0059] 203. Obtain the multiple strings included in the first message, which are used to represent the edit text content of the first message.

[0060] In this embodiment of the application, the server processes the first message to obtain multiple strings that are used only to represent the edited text content.

[0061] 204. Match multiple reference strings and multiple strings to obtain matching results. In response to the matching results meeting the target conditions, determine that the first message belongs to the target type.

[0062] In this embodiment, the matching result refers to the number of times multiple reference strings in the fingerprint sample are successfully matched. The target condition is used to indicate that the first message and the sample message corresponding to the fingerprint sample are similar messages.

[0063] This application provides a message recognition method. For messages generated based on templates, fingerprint samples of such templates—that is, multiple reference strings that can represent the edited text content in the message—can be obtained and matched with corresponding strings in the message to determine whether the message belongs to the target type. By using matching between strings representing the edited text content, the computational amount of data processing during message recognition is reduced, eliminating the need for extensive model calculations. Furthermore, the maintenance cost of fingerprint samples is low. This method fully utilizes the characteristic that messages generated based on message templates have similar or identical syntactic structures, resulting in high matching accuracy and improving the accuracy and efficiency of message recognition.

[0064] Figure 3 This is a flowchart of a message recognition method provided according to an embodiment of this application, such as... Figure 3 As shown, this embodiment of the application uses the interaction between a terminal and a server as an example for illustration. The message recognition method includes the following steps:

[0065] 301. The terminal responds to the user's template-based editing operation and generates the first message.

[0066] In this embodiment of the application, the social application client of the terminal can provide a template-based message editing function. Users can select templates and input text based on templates through the message editing interface of the social application client to generate messages to be pushed.

[0067] In one optional implementation, the terminal's social application client provides at least one message template, such as a "credit card swipe notification" template or a "successful purchase reminder" template. The specific style of the "credit card swipe notification" template is "[Dear User]...[Your Account]...[Your Purchase Amount]...", where "Dear User", "Your Account", and "Your Purchase Amount" are preset fixed content in the message template, and the rest is user-customizable content.

[0068] In one optional implementation, the terminal's social application client displays a message editing interface, which includes at least one message template. The client retrieves the message template selected by the user in the editing interface, displays the template editing interface for the selected template, and further retrieves the text entered by the user in the displayed template editing interface to generate a first message. For example, if the user selects a "credit card swipe notification" template, the terminal's social application client displays the message editing interface based on this template, retrieves the text input by the user in the message editing interface, and generates: "[Dear User] If you want to increase your wealth, [your account] If you want to get rich overnight, [your spending amount] You should follow Teacher XXX's official WeChat account."

[0069] 302. In response to the message publishing instruction, the terminal sends a message publishing request to the server. The message publishing request carries the first message and the template identifier of the template.

[0070] In this embodiment, a message publishing instruction refers to a user's instruction to publish a message, and a template identifier refers to a unique identifier for each message template. In some embodiments, a user can trigger a corresponding message publishing instruction on the social application client of the terminal by clicking a message publishing button or through voice input. In response to the message publishing instruction, the terminal sends a message publishing request to the server, which instructs the server to publish the message.

[0071] 303. After receiving the message publishing request, the server determines the fingerprint sample corresponding to the template based on the template identifier. The fingerprint sample includes multiple reference strings, which are used to represent the edit text content of the sample message.

[0072] In this embodiment, the fingerprint sample includes multiple reference strings, which represent the editable text content of the sample message. This editable text content refers to custom content other than the template format content in the message template, obtained through user input and other editing operations. For example, a fingerprint sample may contain three reference strings, which represent the editable text content "wealth appreciation", "get rich overnight", and "follow Teacher XXX's official account".

[0073] In one optional implementation, the server is associated with a first fingerprint set, which includes fingerprint samples of a target type, where the target type refers to a fingerprint sample whose type is abnormal. In some embodiments, the first fingerprint set can be a black fingerprint set, where the content of the sample messages corresponding to the fingerprint samples in the first fingerprint set points to abnormal content. After receiving a message publishing request, the server uses the template identifier of the template as an index to query the fingerprint sample corresponding to the template in the first fingerprint set.

[0074] In one optional implementation, the server, in addition to associating with the first fingerprint set, also associates with a second fingerprint set. This second fingerprint set includes fingerprint samples of non-target types, where non-target types refer to fingerprint samples of normal types. In some embodiments, the second fingerprint set can be a white fingerprint set, where the content of the sample messages corresponding to the fingerprint samples in the second fingerprint set points to normal content. Furthermore, the second fingerprint set can supplement the first fingerprint set, preventing normal content from being identified as abnormal content.

[0075] In one alternative implementation, the second fingerprint set is used as a supplement: the server periodically compares the first and second fingerprint sets. Through this comparison, overlapping fingerprints are identified in both sets, and then these overlapping fingerprints are removed from the first fingerprint set. By periodically comparing these two fingerprint sets, the accuracy of the fingerprint samples can be ensured, preventing the subsequent misidentification of normal content as abnormal content and avoiding misprocessing.

[0076] For example, in the first fingerprint sample set, also known as the black fingerprint set, there is a fingerprint sample containing the content "continuous adherence and maintenance". When the server compares the two fingerprint sets, it detects that the second fingerprint sample set, also known as the white fingerprint set, also contains a fingerprint sample with the content "continuous adherence and maintenance". In this case, the server deletes the fingerprint sample from the black fingerprint set but retains it in the white fingerprint set. That is, the server needs to ensure that the black fingerprint set does not contain any fingerprint samples from the white fingerprint set. Therefore, when a government agency or other well-intentioned user sends a template message containing some fingerprint samples from the black fingerprint set, the server will not consider this information as abnormal content because it also contains fingerprint samples from the white fingerprint set.

[0077] It should be noted that steps 302 to 303 described above are one implementation method provided by the embodiments of this application for determining a corresponding fingerprint sample based on the template identifier of a template. In another optional implementation, after receiving a message publishing request, the server determines any fingerprint sample, which is a fingerprint sample based on any message template, and then the server continues to execute subsequent steps 304 to 311. The embodiments of this application do not impose specific limitations on this.

[0078] Additionally, it should be noted that the process of obtaining fingerprint samples in this embodiment will be described in subsequent steps 401 to 404, and therefore will not be repeated here.

[0079] 304. The server deletes meaningless characters from the first message and fills the deletion position with the target symbol, resulting in multiple first strings, with each pair of first strings separated by the target symbol.

[0080] In this embodiment, meaningless characters include symbols and characters not belonging to the target language, where the target language is the language to which the first message belongs. Target symbols are special symbols that will not exist in the text corresponding to the first message, such as "@", "#", "&", etc. The server deletes meaningless information from the first message, such as symbols, and also deletes characters not belonging to the target language. The server then fills the blank spaces after deletion with target symbols. This not only reduces the amount of data processed subsequently but also prepares for the splitting of the first message in advance.

[0081] The following example, using Chinese as the target language, illustrates the specific implementation of this step:

[0082] In one optional implementation, the server identifies each character in the first message sequentially from left to right. When a character is identified as a symbol, such as a punctuation mark or other ordinary symbol, the character is deleted. When a character is identified as non-Chinese content, such as a letter or number, the character is deleted. After deleting all symbols and non-Chinese content in the first message, the server fills all blank spaces in the first message that appear due to character deletion with the target symbol.

[0083] In one optional implementation, the server sequentially identifies each character in the first message from left to right. When a character is identified as a symbol or non-Chinese content, the character corresponding to that symbol or non-Chinese content is deleted, and the resulting blank space is filled with a target symbol. That is, for characters corresponding to symbols and non-Chinese content, the target symbol is filled in simultaneously with the deletion. Optionally, the server performs the above identification process from right to left; this embodiment does not limit this.

[0084] It should be noted that the above example uses Chinese as the target language of the first message. In another optional implementation, when the target language of the first message is English, the server deletes symbols and non-English content from the first message and fills the blank spaces after deletion with the target symbols, resulting in multiple first strings. This application does not limit the target language of the first message.

[0085] The above steps are one implementation method for deleting meaningless characters in the first message according to an embodiment of this application. The server may also have other methods for deleting meaningless characters, such as deleting interjections and quantifiers in the first message. This application does not impose specific limitations on these methods.

[0086] 305. The server deletes the target string from multiple first strings. The target string is a string where the number of characters between two target symbols does not meet the character count threshold, resulting in multiple second strings. These multiple second strings are used to represent the edit text content of the first message.

[0087] Step 305 above includes the following steps: the server checks the number of characters in each first string; if the number of characters in a first string is less than the word count threshold, then the first string is the target string and is deleted; if the number of characters in a first string is greater than or equal to the word count threshold, then the first string is retained; the multiple checked first strings are used as multiple second strings.

[0088] The server deletes target strings whose character count does not meet the character count threshold, retains the first string that meets the character count threshold, and obtains multiple second strings for the first message. This avoids recognizing text content in the message that has no practical meaning, and further reduces the amount of subsequent data processing.

[0089] For example, the server can set the character count threshold to the length of the Chinese content represented by the first string to 4 Chinese characters. That is, if the server detects that the length of the Chinese content represented by the first string is less than 4 Chinese characters, it will delete the first string; if the server detects that the length of the Chinese content represented by the first string is greater than or equal to 4 Chinese characters, it will retain the first string.

[0090] It should be noted that, in this embodiment, the server first acquires the fingerprint sample according to steps 303 to 305 in a forward-to-back order, then processes the first message to obtain multiple first strings, and then obtains multiple second strings. In another optional implementation, the server can first process the first message according to steps 304 and 305, obtain multiple second strings, and then execute step 303 to acquire the fingerprint sample corresponding to the first message. This embodiment does not impose specific limitations on this.

[0091] 306. The server matches multiple reference strings in the fingerprint sample of the template with multiple second strings to obtain the matching results.

[0092] In this embodiment, the fingerprint sample corresponding to the template contains multiple reference strings. By processing the first message, multiple second strings are also obtained. The server matches the multiple reference strings in the fingerprint sample with the multiple second strings. When two strings are identical, the two strings are considered to have matched successfully.

[0093] It should be noted that both the first message and the fingerprint sample are generated based on a template. They share a high degree of similarity with the original fingerprint text of the template in terms of grammatical structure, typesetting features, and language style. The multiple second strings obtained from processing the first message, along with the multiple reference strings in the fingerprint sample, all represent edited text content, obtained through user input and other editing operations. For example, the first string among the multiple second strings represents "Hello," while the first reference string of the fingerprint sample represents "Hello"; the second string among the multiple second strings represents "Come and follow," while the second reference string of the fingerprint sample represents "Just follow," and so on. These all represent custom content from the template, i.e., edited text content.

[0094] In one optional implementation, for each of the multiple reference strings in the fingerprint sample, the server determines a string from a plurality of second strings that has the same string number as the reference strings, based on the string number of each reference string. Then, the server matches the reference strings with the determined string. For example, if the server obtains the number of each reference string in the fingerprint sample and determines that all reference string numbers are odd numbers, then the server uses the strings with odd numbers from the multiple second strings as the strings to be matched. The server then performs a one-to-one match between the strings to be matched from the reference strings in the fingerprint sample to obtain the final matching result. This method of matching strings based on string numbers ensures the accuracy of the matching.

[0095] 307. Based on the matching results, the server determines whether the sample message corresponding to the first message and the fingerprint sample meets the target conditions. If yes, steps 308 to 311 are executed; otherwise, the processing flow ends.

[0096] In this embodiment of the application, the more successful matches are made between multiple reference strings and multiple second strings in the fingerprint sample of the template, the more identical text content is represented by the multiple reference strings and multiple second strings. Therefore, the accuracy is high in determining whether the sample message corresponding to the fingerprint sample of the first message meets the target conditions by the number of successful matches between the strings.

[0097] In one optional implementation, the server obtains the number of successful matches between multiple reference strings and multiple second strings in the fingerprint sample of the template. If the number of successfully matched reference strings is greater than or equal to the target number, or if the proportion of the number of successfully matched reference strings to the number of multiple reference strings is greater than or equal to the target proportion, then the first message and the sample message corresponding to the fingerprint sample are determined to be similar messages.

[0098] In one optional implementation, the server can pre-set a quantity threshold to represent the target condition. When the number of successfully matched reference strings is greater than or equal to the quantity threshold, the sample message corresponding to the first message and the fingerprint sample is determined to be a similar message. For example, the quantity threshold can be set to 10. In another optional implementation, the server can pre-set a proportion threshold to represent the target condition. When the proportion of the number of successfully matched reference strings to the total number of reference strings is greater than or equal to the proportion threshold, the sample message corresponding to the first message and the fingerprint sample is determined to be a similar message. For example, the proportion threshold can be set to 80%. When more than 80% of the strings in the multiple second strings successfully match the reference strings in the fingerprint sample, the sample message corresponding to the first message and the fingerprint sample is considered to be a similar message. This application does not specifically limit the specific value and representation type of the preset threshold.

[0099] 308. Based on the target type of the fingerprint sample, the server determines that the first message belongs to the target type.

[0100] In this embodiment of the application, after the server determines that the first message and the sample message corresponding to the fingerprint sample are similar messages, it determines that the target type of the first message is consistent with the target type of the fingerprint sample.

[0101] In one optional implementation, the target type includes advertising types or types carrying malicious fraudulent content. For example, if the server determines that the message type corresponding to the fingerprint sample is an advertising type, it means that the content of the message sample of the fingerprint sample is advertising in nature, and therefore the content of the first message can also be determined to be advertising in nature. This application embodiment does not impose specific limitations on the determination of the target type.

[0102] After steps 301-308, the server identifies the first message to be published. Since the target type of the first message is determined by fingerprint samples, there is no need to train a model. Furthermore, the maintenance cost of fingerprint samples is low and the amount of data processing is small. Therefore, the accuracy and efficiency of message recognition can be improved.

[0103] Optionally, after the server identifies the first message as the target type, it may also perform any one of the following processing steps 309 to 311 on the first message.

[0104] 309. The server does not publish the first message.

[0105] In this embodiment of the application, after the server determines that the first message belongs to the target type, it rejects the message publishing request sent by the terminal and does not publish the first message.

[0106] Steps 309 and 301-308 can constitute a possible implementation method: after determining that the first message belongs to the target type, that is, an abnormal type, the first message is refused to be published to avoid the first message causing trouble to the user.

[0107] 310. The server adds a first prompt message to the first message, receives a second message, and publishes the second message. The first prompt message is used to indicate that the content of the published message is risky.

[0108] In this embodiment, after determining that the first message belongs to the target type, the server adds a first prompt message to the first message, for example, the first prompt message is "This message contains advertisements, please browse with caution". The content of the first prompt message is not limited in this invention. Based on this, the server generates a second message and publishes the second message based on the message publishing request.

[0109] Steps 310 and 301-308 can constitute a possible implementation method: after determining that the first message belongs to the target type, that is, the abnormal type, a second message with prompt information is generated to remind the user to browse with caution.

[0110] 311. The server publishes a first message and a second warning message, the second warning message being used to indicate that the first message carries a risk.

[0111] In this embodiment, after determining that the first message belongs to the target type, the server publishes the first message based on the message publishing request, and simultaneously publishes a second prompt message, for example, "This first message is risky, please browse with caution." This invention does not limit the content of the second prompt message.

[0112] Steps 310 and 301-308 can constitute a possible implementation method: after determining that the first message belongs to the target type, that is, the abnormal type, a second prompt message is issued at the same time as the first message is issued, reminding the user to browse with caution.

[0113] It should be noted that the message identification method consisting of steps 301 to 311 described above identifies the message to be published by the user to determine whether and how to publish it. Based on the identification of the message type, malicious messages can be filtered during the message publishing process. In another possible implementation, the server extracts the user's published messages from the user message database for identification to determine whether to delete or prompt the published messages, thereby filtering malicious messages from the published messages. Accordingly, after the server identifies the first message as the target type, it also performs deletion or prompting on the first message. For example, it deletes the message from the user message database so that other users can no longer receive or access it; it adds a first prompt message to the published message; or it links a second prompt message to the published message. If the user clicks on the published message, the second prompt message is displayed simultaneously, achieving a warning effect.

[0114] Of course, the different implementation methods described above can be combined to form different implementation schemes, and the embodiments of the present invention do not impose specific limitations on this.

[0115] This application provides a message recognition method. For messages generated based on templates, fingerprint samples of such templates—that is, multiple reference strings that can represent the edited text content in the message—can be obtained and matched with corresponding strings in the message to determine whether the message belongs to the target type. By using matching between strings representing the edited text content, the computational amount of data processing during message recognition is reduced, eliminating the need for extensive model calculations. Furthermore, the maintenance cost of fingerprint samples is low. This method fully utilizes the characteristic that messages generated based on message templates have similar or identical syntactic structures, resulting in high matching accuracy and improving the accuracy and efficiency of message recognition.

[0116] The method for obtaining fingerprint samples in the above steps will be explained below. Figure 4 This is a flowchart of a fingerprint sample acquisition method provided according to an embodiment of this application, such as... Figure 4 As shown, this application embodiment uses a server as an example for illustration. The method includes the following steps:

[0117] 401. The server retrieves a sample message from the template, which belongs to the target type.

[0118] In this embodiment, the sample message is the original fingerprint of the fingerprint sample, which is a template message generated based on a template. That is, the sample message and the first message in steps 301-308 above are generated based on the same template. For example, the sample message is generated based on a "credit card swipe template", and the content of the sample message is "[Dear User] Do you want to increase your wealth? [Your Account] Do you want to get rich overnight? [Your Spending Amount] Come and follow Teacher XXX's official account."

[0119] 402. The server deletes meaningless characters from the sample message and fills the deletion position with the target symbol to obtain multiple first sample strings, with each pair of first sample strings separated by the target symbol.

[0120] In this embodiment, the server deletes meaningless characters from the sample message, including symbols and characters not belonging to the target language, and fills the blank spaces after deletion with the target symbols. This not only reduces the amount of data to be processed subsequently, but also prepares for the splitting of the sample message in advance. The specific implementation method is the same as the step of obtaining multiple first strings in step 304 above, so it will not be described again here.

[0121] 403. The server deletes the target string from multiple first sample strings. The target string is a string in which the number of characters between two target symbols does not meet the character count threshold, resulting in multiple second sample strings.

[0122] In this embodiment of the application, the process of obtaining multiple second sample strings is the same as the process of obtaining multiple second strings in step 305 above, so it will not be described again here.

[0123] 404. The server obtains multiple reference strings from multiple second sample strings as template fingerprint samples.

[0124] In this embodiment of the application, after obtaining multiple second sample strings, the server numbers the strings in the multiple second sample strings and randomly selects them to obtain multiple reference strings as fingerprint samples of the template.

[0125] In one optional implementation, the server can select odd-numbered strings from a plurality of second sample strings as reference strings. For example, the plurality of second sample strings can be "@S1@S2@S3@S4@S5@S6@". The selection of reference strings can be: Reference string 1: "S1", Reference string 2: "S3", Reference string 3: "S5", that is, selecting 3 strings with odd numbers from 6 strings as reference strings to obtain the fingerprint sample of the template. This application embodiment does not limit the method of string selection.

[0126] In one alternative implementation, the server stores the acquired fingerprint samples into a first fingerprint set.

[0127] It should be noted that steps 401 to 404 above are one implementation method for obtaining fingerprint samples from sample messages generated based on a template, according to an embodiment of this application, wherein the template and the message to be identified belong to the same template. In another optional implementation, fingerprint samples can be obtained from sample messages generated based on any template, and this embodiment of the application does not impose specific limitations on this.

[0128] In this application embodiment, a method for obtaining fingerprint samples is provided. By deleting meaningless characters in the sample message, and further deleting text content that does not meet the word count threshold in the sample message, the amount of data for subsequent processing is greatly reduced. Finally, multiple reference strings used to represent the edited text content of the sample message are selected as fingerprint samples to confirm the message type of the first message. The method has high accuracy and low maintenance cost of fingerprint samples.

[0129] Figure 5 This is a block diagram of a message recognition device according to an embodiment of this application. The device is used to perform the steps of the message recognition method described above, see below. Figure 5 The device includes: a message acquisition module 501, a sample determination module 502, a string acquisition module 503, a matching module 504, and a type determination module 505.

[0130] Message acquisition module 501 is used to acquire a first message, which is generated based on a template;

[0131] The sample determination module 502 is used to determine a fingerprint sample, which includes multiple reference strings obtained based on the sample message of the target type. These multiple reference strings are used to represent the edited text content of the sample message.

[0132] The string acquisition module 503 is used to acquire multiple strings included in the first message, which are used to represent the edit text content of the first message;

[0133] Matching module 504 is used to match multiple reference strings and multiple strings to obtain the matching results;

[0134] The type determination module 505 is used to determine that the first message belongs to the target type in response to the matching result meeting the target conditions.

[0135] In one alternative implementation, the string acquisition module 503 includes:

[0136] The first deletion unit is used to delete meaningless characters in the first message;

[0137] The padding unit is used to fill the deletion position with the target symbol to obtain multiple first strings, with each pair of first strings separated by the target symbol.

[0138] The second deletion unit is used to delete the target string from multiple first strings. The target string is a string in which the number of characters between two target symbols does not meet the character count threshold, resulting in multiple second strings.

[0139] In one alternative implementation, the first deletion unit is used for at least one of the following:

[0140] Delete the symbols in the first message;

[0141] Delete characters in the first message that do not belong to the target language, which is the language of the first message.

[0142] In one alternative implementation, the matching module 504 is used for:

[0143] For each of the multiple reference strings, based on the string number of each reference string, determine the string with the same string number as the multiple reference strings from the multiple strings, and match the reference string with the determined string.

[0144] In one alternative implementation, the message recognition device further includes:

[0145] The message publishing module is used for any of the following:

[0146] Do not release first news;

[0147] Add a first notification message to the first message to obtain a second message, and then publish the second message. The first notification message is used to indicate that the content of the published message is risky.

[0148] The system releases a first message and a second alert, with the second alert indicating that the first message carries a risk.

[0149] In one alternative implementation, a matching result meeting the target condition means:

[0150] The number of successfully matched reference strings is greater than or equal to the target number;

[0151] The proportion of the number of successfully matched reference strings to the total number of reference strings is greater than or equal to the target proportion.

[0152] In one alternative implementation, the message recognition device further includes:

[0153] The comparison module is used to periodically compare a first fingerprint set and a second fingerprint set. The first fingerprint set includes fingerprint samples of the target type, and the second fingerprint set includes fingerprint samples of non-target types.

[0154] The deletion module is used to delete the overlapping fingerprint samples from the first fingerprint set if there are overlapping fingerprint samples in the first fingerprint set and the second fingerprint set.

[0155] In one alternative implementation, the message recognition device further includes:

[0156] The sample message acquisition module is used to acquire sample messages of the template, which belong to the target type.

[0157] The deletion module is used to delete meaningless characters in the sample message and fill the deletion position with the target symbol to obtain multiple first sample strings, with each pair of first sample strings separated by the target symbol.

[0158] The deletion module is also used to delete target sample strings from multiple first sample strings. The target sample string is a string in which the number of characters between two target symbols does not meet the character count threshold, thus obtaining multiple second sample strings.

[0159] The reference string acquisition module is used to obtain multiple reference strings from multiple second sample strings.

[0160] This application provides a message recognition device that, for messages generated based on templates, can obtain fingerprint samples of such templates—that is, multiple reference strings that can represent the edited text content in the message—and match them with corresponding strings in the message to determine whether the message belongs to the target type. By using matching between strings representing the edited text content, the computational amount of data processing during message recognition is reduced, eliminating the need for extensive model calculations. Furthermore, the maintenance cost of fingerprint samples is low. This approach fully utilizes the characteristic that messages generated based on message templates have similar or identical syntactic structures, resulting in high matching accuracy and improving the accuracy and efficiency of message recognition.

[0161] It should be noted that the message recognition device provided in the above embodiments is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the message recognition device and message recognition method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0162] Figure 6This is a schematic diagram of a server structure according to an embodiment of this application. The server 600 can vary significantly due to different configurations or performance. It can include one or more Central Processing Units (CPUs) 601 and one or more memories 602. The memory 602 stores at least one line of program code, which is loaded and executed by the processor 601 to implement the message recognition method provided in the various method embodiments described above. Of course, the server can also have wired or wireless network interfaces, a keyboard, and input / output interfaces for input and output. The server can also include other components for implementing device functions, which will not be elaborated here.

[0163] This application also provides a computer-readable storage medium applied to a computer device. The computer-readable storage medium stores at least one piece of program code, which is loaded and executed by a processor to implement the operations performed by the computer device in the message recognition method of the above embodiments.

[0164] This application also provides a computer program product including computer program code stored in a computer-readable storage medium. A processor of a computer device reads the computer program code from the computer-readable storage medium and executes the computer program code, causing the computer device to perform the message recognition method provided in the various optional implementations described above.

[0165] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0166] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A message recognition method, characterized in that, Applied to a server, the method includes: Retrieve the user's first published message from the user message database; The first message is generated by the terminal based on the custom content entered by the user in the template editing interface. The template editing interface is the interface displayed by the terminal in response to the user selecting a message template to be edited in the message editing interface. The message editing interface includes at least one template. The message template includes preset fixed content and user-customizable content to be filled in. The first message includes the preset fixed content in the selected message template and the custom content entered by the user in the template editing interface. Using the template identifier of the message template as an index, a fingerprint sample corresponding to the message template is queried in the first fingerprint set, wherein the first fingerprint set includes fingerprint samples of the target type; The fingerprint sample is obtained from a sample message belonging to the target type. The fingerprint sample includes multiple reference strings. The sample message is generated based on the message template. The reference strings are user-inputted custom content in the sample message other than the fixed content preset in the message template. Obtain multiple first strings included in the first message, wherein the first strings are user-inputted custom content in the first message other than the fixed content preset in the message template; For each of the plurality of reference strings, based on the string number of the reference string, a string with the same string number as the reference string is determined from the plurality of first strings, and is used as the string to be matched; the plurality of reference strings and the string to be matched are matched one by one to obtain the matching result; In response to the matching result meeting the target conditions, it is determined that the first message belongs to the target type; The first message is deleted from the user message database so that other users can no longer receive or access the first message; or, a first prompt message is added to the published first message so that when the published first message is accessed by a user, the first prompt message can be displayed synchronously to warn that the content of the published message is risky. The method further includes: The first fingerprint set and the second fingerprint set are periodically compared, the second fingerprint set including fingerprint samples of non-target types; If there are overlapping fingerprint samples in the first fingerprint set and the second fingerprint set, then the overlapping fingerprint samples are deleted from the first fingerprint set.

2. The method according to claim 1, characterized in that, The acquisition of the multiple first strings included in the first message includes: Delete meaningless characters from the first message and fill the deletion positions with target symbols to obtain multiple first strings, with each pair of first strings separated by the target symbols; Delete the target string from the plurality of first strings, wherein the target string is a string in which the number of characters between two target symbols does not meet the character count threshold, to obtain a plurality of second strings.

3. The method according to claim 2, characterized in that, The deletion of meaningless characters in the first message includes at least one of the following: Delete the symbols in the first message; Delete characters in the first message that do not belong to the target language, where the target language is the language to which the first message belongs.

4. The method according to any one of claims 1 to 3, characterized in that, The matching result meeting the target condition means that: The number of successfully matched reference strings is greater than or equal to the target number; The proportion of the number of successfully matched reference strings to the total number of reference strings is greater than or equal to the target proportion.

5. The method according to claim 1, characterized in that, The method further includes: Obtain the sample message from the message template; Delete meaningless characters from the sample message and fill the deletion position with the target symbol to obtain multiple first sample strings, with each pair of first sample strings separated by the target symbol. Delete the target sample string from the plurality of first sample strings, wherein the target sample string is a string in which the number of characters between two target symbols does not meet the character count threshold, to obtain a plurality of second sample strings; Obtain the plurality of reference strings from the plurality of second sample strings.

6. A message recognition device, characterized in that, The device includes: The message retrieval module is used to extract the first message published by a user from the user message database; The first message is generated by the terminal based on the custom content entered by the user in the template editing interface. The template editing interface is the interface displayed by the terminal in response to the user selecting a message template to be edited in the message editing interface. The message editing interface includes at least one template. The message template includes preset fixed content and user-customizable content to be filled in. The first message includes the preset fixed content in the selected message template and the custom content entered by the user in the template editing interface. The sample determination module is used to query the fingerprint sample corresponding to the message template in the first fingerprint set, using the template identifier of the message template as an index. The first fingerprint set includes fingerprint samples of the target type. The fingerprint sample is obtained from a sample message belonging to the target type. The fingerprint sample includes multiple reference strings. The sample message is generated based on the message template. The reference strings are user-inputted custom content in the sample message other than the fixed content preset in the message template. The string acquisition module is used to acquire multiple first strings included in the first message, wherein the first string is user-inputted custom content in the first message other than the fixed content preset in the message template; The matching module is used to, for each of the plurality of reference strings, determine a string from the plurality of first strings that has the same string number as the reference string according to the string number of the reference string, and use it as the string to be matched; and perform one-to-one matching between the plurality of reference strings and the string to be matched to obtain the matching result; A type determination module is used to determine that the first message belongs to the target type in response to the matching result meeting the target conditions; The message publishing module is used to delete the first message from the user message database so that other users can no longer receive or access the first message, or to add a first prompt message to the published first message so that the first prompt message can be displayed synchronously when the published first message is accessed by a user to warn that the content of the published message is risky. The device further includes: The comparison module is used to periodically compare the first fingerprint set and the second fingerprint set, wherein the second fingerprint set includes fingerprint samples of non-target types; The deletion module is used to delete the overlapping fingerprint samples from the first fingerprint set if there are overlapping fingerprint samples in the first fingerprint set and the second fingerprint set.

7. The apparatus according to claim 6, characterized in that, The string acquisition module includes: The first deletion unit is used to delete meaningless characters in the first message; A padding unit is used to fill the deletion position with a target symbol to obtain multiple first strings, with each pair of first strings separated by the target symbol. The second deletion unit is used to delete the target string from the plurality of first strings. The target string is a string in which the number of characters between two target symbols does not meet the character count threshold, thereby obtaining a plurality of second strings.

8. The apparatus according to claim 7, characterized in that, The first deletion unit is used for at least one of the following: Delete the symbols in the first message; Delete characters in the first message that do not belong to the target language, where the target language is the language to which the first message belongs.

9. The apparatus according to any one of claims 6 to 8, characterized in that, The matching result meeting the target condition means that: The number of successfully matched reference strings is greater than or equal to the target number; The proportion of the number of successfully matched reference strings to the total number of reference strings is greater than or equal to the target proportion.

10. The apparatus according to claim 8, characterized in that, The device further includes: A sample message acquisition module is used to acquire the sample message of the message template; The deletion module is used to delete meaningless characters in the sample message, fill the deletion position with the target symbol, and obtain multiple first sample strings, with each pair of first sample strings separated by the target symbol. The deletion module is further configured to delete the target sample string from the plurality of first sample strings, wherein the target sample string is a string in which the number of characters between two target symbols does not meet the character count threshold, thereby obtaining a plurality of second sample strings; The reference string acquisition module is used to acquire the multiple reference strings from the multiple second sample strings.

11. A computer device, characterized in that, The computer device includes a processor and a memory, the memory being used to store at least one piece of program code, the at least one piece of program code being loaded by the processor and executed according to any one of claims 1 to 5.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store at least one piece of program code, which is used to execute the message recognition method according to any one of claims 1 to 5.

13. A computer program product comprising computer program code stored in a computer-readable storage medium, wherein a processor of a computer device reads the computer program code from the computer-readable storage medium and executes the computer program code, causing the computer device to perform the message recognition method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Filtering method and device for notification message

    CN106446149A

  • Text information processing method and device

    CN107229638A