Short message identification method and device, equipment, storage medium and program product

By performing feature extraction and pinyin similarity calculation on the link address text of spam text messages, combined with the feature lexicon and binary tree hash algorithm, the spam text messages can be accurately identified and intercepted, and the problem of low identification efficiency in the existing technology has been solved.

CN118803791APending Publication Date: 2024-10-18LIAONING MOBILE COMM +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410726152.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-05
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

It is difficult to accurately identify and intercept spam text messages with existing technology, especially because spam text messages come in various forms and have no obvious characteristics, resulting in poor identification efficiency. In particular, Universal Link links cannot be recognized by mainstream systems.

Method used

By extracting features from the link address text in the target text message, calculating the pinyin similarity distance between the feature text and the preset feature lexicon, determining the feature words, and searching in the feature lexicon to identify the text message category, combined with the binary tree hash algorithm to improve Query efficiency to achieve accurate identification and interception of spam text messages.

Benefits of technology

It achieves accurate identification and interception of spam text messages, reduces resource consumption, solves the problem of Universal Link link identification, and improves identification accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118803791A_ABST
    Figure CN118803791A_ABST
Patent Text Reader

Abstract

The invention discloses a short message identification method and device, equipment, a storage medium and a program product, and relates to the technical field of communication. The method comprises the steps that feature extraction is carried out on a link address text in a target short message to obtain a feature text, and the feature text is composed of pinyin; the similar distance between the feature text and pinyin of each feature word in a preset first feature word bank is calculated, the first feature word bank comprises pinyin of at least one feature word, and pinyin corresponding to different feature words is different; determining the feature word corresponding to the similarity distance greater than a preset similarity threshold as a target feature word of the target short message; the target feature word is searched in a preset second feature word library, the target short message category of the target short message is recognized, the second feature word library comprises the short message category of at least one feature word, and the short message category is used for indicating that the feature word is a junk short message category or a white list category. According to the embodiment of the invention, the source of the target short message can be accurately known, and then the target short message category of the target short message is identified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of communication technology, and in particular, relates to a text message identification method, device, equipment, storage medium and program product. Background Art

[0002] With the rapid development of mobile communications, the complexity of the Internet environment has made the composition of spam texts complex and diverse, including a large number of illegal jump link addresses, such as shopping websites, software download links, advertising links, etc. These spam text messages have caused great interference to the work and life of mobile phone users. In order to better serve the society, it is necessary to identify and manage spam text messages more accurately. However, the existing spam text messages are in various forms, and it is difficult to identify the source of the text messages. Therefore, it is impossible to identify spam text messages, resulting in poor interception efficiency of spam text messages. Summary of the invention

[0003] The embodiments of the present application provide a text message identification method, apparatus, device, storage medium and program product, which can accurately know the source of the target text message, and then identify the target text message category of the target text message, and finally realize the effective interception of junk text messages.

[0004] In a first aspect, an embodiment of the present application provides a method for identifying a text message, the method comprising:

[0005] Extracting features of the link address text in the target SMS to obtain feature text, wherein the feature text is composed of pinyin;

[0006] Calculating the similarity distance between the feature text and the pinyin of each feature word in a preset first feature word library, wherein the first feature word library includes the pinyin of at least one feature word, and different feature words correspond to different pinyins;

[0007] Determine the feature words corresponding to the similarity distance being greater than a preset similarity threshold as the target feature words of the target short message;

[0008] The target feature word is searched in a preset second feature word library to identify the target SMS category of the target SMS, wherein the second feature word library includes at least one SMS category of the feature word, and the SMS category is used to indicate that the feature word is a spam SMS category or a whitelist category.

[0009] In a second aspect, an embodiment of the present application provides a text message identification device, the device comprising:

[0010] An extraction module is used to extract features from the link address text in the target SMS to obtain feature text, where the feature text is composed of pinyin;

[0011] A calculation module, used for calculating the similarity distance between the feature text and the pinyin of each feature word in a preset first feature word library, wherein the first feature word library includes the pinyin of at least one feature word, and different feature words correspond to different pinyins;

[0012] A first determination module is used to determine the feature words corresponding to the similarity distance being greater than a preset similarity threshold as target feature words of the target short message;

[0013] The identification module is used to search for the target feature word in a preset second feature word library to identify the target SMS category of the target SMS. The second feature word library includes at least one SMS category of the feature word, and the SMS category is used to indicate that the feature word is a spam SMS category or a whitelist category.

[0014] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the text message recognition method as described in any one of the above is implemented.

[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the text message identification method as described in any one of the above is implemented.

[0016] In a fifth aspect, an embodiment of the present application provides a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes any one of the SMS identification methods described above.

[0017] The SMS identification method, device, equipment, storage medium and program product of the embodiment of the present application can extract the features of the link address text in the target SMS to obtain the feature text, which is composed of pinyin; calculate the similarity distance between the feature text and the pinyin of each feature word in the preset first feature word library, the first feature word library includes the pinyin of at least one feature word, and the pinyin corresponding to different feature words is different; determine the feature word corresponding to the similarity distance greater than the preset similarity threshold as the target feature word of the target SMS; search for the target feature word in the preset second feature word library to identify the target SMS category of the target SMS, the second feature word library includes the SMS category of at least one feature word, and the SMS category is used to indicate that the feature word is a spam SMS category or a whitelist category. In this way, the embodiment of the present application can calculate the similarity distance between the feature text of the link address text in the target SMS and the pinyin of each feature word in the first feature word library, and determine the feature word corresponding to the similarity distance greater than the preset similarity threshold as the target feature word of the target SMS, so that the semantics of the link address text in the target SMS can be restored to the target feature word, so as to accurately know the source of the target SMS, and then identify the target SMS category of the target SMS, and finally achieve effective interception of spam SMS. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0019] Figure 1 It is a flowchart of the SMS identification method provided in the embodiment of the present application;

[0020] Figure 2 This is a flow chart of a scenario implementation of the SMS identification method provided in an embodiment of the present application;

[0021] Figure 3 is a structural diagram of a second-order hidden Markov model provided in an embodiment of the present application;

[0022] Figure 4 It is a logic diagram of the semantic restoration module provided in the embodiment of the present application;

[0023] Figure 5 It is a structural schematic diagram of a text message identification device provided in an embodiment of the present application;

[0024] Figure 6 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0025] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.

[0026] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0027] With the rapid development of mobile communications, the complexity of the Internet environment has made the composition of spam texts complex and diverse, including a large number of illegal jump link addresses, such as shopping websites, software download links, advertising links, etc. These spam text messages have caused great interference to the work and life of mobile phone users. In order to better serve the society, it is necessary to identify and manage spam text messages more accurately. The current identification strategies for spam text messages on the market are as follows:

[0028] 1. Use the method of configuring regular expressions to identify jump link addresses. This method requires configuring various feature expressions of jump link addresses in the regular expression for extracting jump link addresses, such as WeChat, VX, QQ, Alipay, etc. According to the feature expression of the jump link address, the category of the jump link address in the text message is determined, and then the jump link address is identified. However, the regular expression required for simply using regular expressions to determine the category of the jump link address will be very redundant. When determining the category, the keywords configured in the regular expression must be queried in the text. If the method of expressing the category in the text is relatively hidden or the regular expression is not equipped with keywords, the category cannot be determined, and spam text messages cannot be intercepted, which has a great impact on the accuracy of jump link address identification.

[0029] 2. Use a combination of machine learning and regular expressions to identify jump link addresses. This method uses machine learning algorithms such as random forests and decision trees to classify the jump link addresses involved in the text. After obtaining the classification results, the jump link addresses are identified using regular expressions. The method of using machine learning to determine the jump link address category and regular expressions to match the jump link address requires training a machine learning model based on samples. The number of samples of different categories of jump link addresses in spam text messages is quite different, which may cause the model to tend to predict categories with higher frequencies and ignore categories with lower frequencies, resulting in a decrease in accuracy. In addition, when the number of samples of certain categories in the training samples is very small or does not exist, the model may not be able to correctly distinguish these categories, which will cause the regular expression to be unable to accurately extract the jump link address.

[0030] Although the above two methods have a certain effect in identifying spam text messages, it is difficult to identify the source of the text messages because spam text messages come in various forms and have no obvious characteristics. Therefore, spam text messages cannot be identified, resulting in poor efficiency in intercepting spam text messages.

[0031] In addition, the difficulty in identifying jump links also makes it more difficult to identify spam messages. There are two main protocols for link jumps: URL Scheme and Universal Link. The formats of URL Scheme and Universal Link are as follows:

[0032] URL Scheme protocol: https: / / [scheme] / [path]? [query]

[0033] Universal Link protocol: [scheme] / [path]? [query]

[0034] URL Scheme is a common protocol for Android and iOS systems, while Universal Link is a special redirect protocol for iOS9 and above. The Universal Link protocol has no http or https protocol header. Currently, mainstream systems cannot recognize Universal Link as a URL, which makes it impossible to identify such spam messages.

[0035] In order to solve the problems of the prior art, the embodiments of the present application provide a text message identification method, device, equipment, storage medium and program product. The text message identification method provided by the embodiments of the present application is first introduced below.

[0036] Figure 1FIG. 1 is a flow chart of a method for identifying short messages provided by an embodiment of the present application. Figure 1 As shown, a method for identifying a text message may include the following steps S101 to S104:

[0037] S101, extracting features from the link address text in the target SMS to obtain feature text, where the feature text is composed of pinyin;

[0038] S102, calculating the similarity distance between the feature text and the pinyin of each feature word in a preset first feature word library, the first feature word library including the pinyin of at least one feature word, and different feature words have different corresponding pinyins;

[0039] S103, determining the feature words corresponding to the similarity distances greater than the preset similarity threshold as the target feature words of the target SMS;

[0040] S104, searching for a target feature word in a preset second feature word library to identify a target SMS category of the target SMS, wherein the second feature word library includes at least one SMS category of a feature word, and the SMS category is used to indicate that the feature word is a spam SMS category or a whitelist category.

[0041] The SMS recognition method of the embodiment of the present application can extract the features of the link address text in the target SMS to obtain the feature text, which is composed of pinyin; calculate the similarity distance between the feature text and the pinyin of each feature word in the preset first feature word library, the first feature word library includes the pinyin of at least one feature word, and the pinyin corresponding to different feature words is different; determine the feature word corresponding to the similarity distance greater than the preset similarity threshold as the target feature word of the target SMS; search for the target feature word in the preset second feature word library to identify the target SMS category of the target SMS, the second feature word library includes the SMS category of at least one feature word, and the SMS category is used to indicate that the feature word is a spam SMS category or a whitelist category. In this way, the embodiment of the present application can calculate the similarity distance between the feature text of the link address text in the target SMS and the pinyin of each feature word in the first feature word library, and determine the feature word corresponding to the similarity distance greater than the preset similarity threshold as the target feature word of the target SMS, so that the semantics of the link address text in the target SMS can be restored to the target feature word, so as to accurately know the source of the target SMS, and then identify the target SMS category of the target SMS, and finally achieve effective interception of spam SMS.

[0042] In S101, the target text may be a text including a link address text. The link address text may be a text of a jump link address, for example, URL Scheme protocol: https: / / [scheme] / [path]?[query], or Universal Link protocol: [scheme] / [path]?[query]. The characteristic text is composed of pinyin, which may be a complete pinyin abbreviation, a partial pinyin abbreviation or a complete pinyin. For example, the abbreviation variants of the word "financial management treasure" may be lcaib, lcb, and licaibao.

[0043] The feature extraction of the link address text in the target SMS to obtain the feature text may be performed, for example, by searching for the target symbol in the link address text of the target SMS; determining the text after the first target symbol in the link address text as redundant text; removing the target symbol and redundant text in the link address text to extract the feature text. Alternatively, the target symbol in the link address text of the target SMS may be searched; determining the text after the first target symbol in the link address text as redundant text; removing the target symbol, redundant text and protocol header text in the link address text to extract the feature text.

[0044] In S102, the first feature word library may include the pinyin of at least one feature word, and different feature words may correspond to different pinyins.

[0045] The above calculation of the similarity distance between the feature text and the pinyin of each feature word in the preset first feature word library can be, for example, calculated according to a similarity distance calculation formula to calculate the similarity distance between the feature text and the pinyin of each feature word in the preset first feature word library. The similarity distance calculation formula is as follows:

[0046]

[0047] Among them, d represents the phonetic distance between word1 and word2, d[i][j] represents the distance between the first i elements of word1 and the first j elements of word2, ω1 and ω2 are the weights of similarity calculation, |word1∩word2| represents the length of the intersection of word1 and word2; the second item of similarity calculation takes into account the situation where all characters are abbreviations, because the abbreviations are partial characters extracted from the original words.

[0048] In S103, the similarity threshold may be a value set according to user needs.

[0049] The above-mentioned feature words corresponding to the similarity distance greater than the preset similarity threshold are determined as the target feature words of the target SMS. For example, when the feature text is "pduoduo", the feature word "Pinduoduo" corresponding to the similarity distance greater than the preset similarity threshold is determined as the target feature word of the target SMS, thereby restoring "pduoduo" to "Pinduoduo".

[0050] In S104, the second feature word library may include at least one SMS category of a feature word. The SMS category may be used to indicate that the feature word is a spam SMS category or a whitelist category, wherein the spam SMS category may include shopping APPs, financial management APPs, short video APPs, etc., and the whitelist category may include government APPs and credit APPs, etc.

[0051] The above-mentioned process of searching for target feature words in a preset second feature vocabulary and identifying the target SMS category of the target SMS can, for example, be based on a binary tree hash algorithm to search for target feature words in a preset second feature vocabulary and identify the target SMS category of the target SMS. Due to the large amount of retrieved data, text queries will often experience downtime, delays, etc. Based on this, a hash algorithm based on a binary tree structure is constructed by utilizing the good performance of hash functions and binary trees in queries to solve the problem of slow retrieval of larger text files, thereby improving search efficiency.

[0052] As an implementation of the present application, in order to accurately determine the to-be-identified SMS as the target SMS and reduce resource consumption, before S101, the method may further include:

[0053] Get the text of the SMS to be identified;

[0054] Searching for a target symbol in the text of the SMS to be identified;

[0055] When the target symbol exists in the text of the to-be-identified text message, the to-be-identified text message is determined as the target text message.

[0056] The above-mentioned target symbol, illustratively, can be a “ / ” symbol. In the embodiment of the present application, the target symbol is not limited to this, and can also be set according to the actual needs of the user, which is not specifically limited here.

[0057] The above-mentioned searching for the target symbol in the text of the SMS to be identified may, for example, be performed by preprocessing the text of the SMS to be identified using a regular expression, using the " / " symbol as a screening condition, and eliminating SMS messages that do not contain links.

[0058] In this embodiment, since the data volume of text messages is extremely large, if each text message is detected, it will cause a huge waste of space and performance. However, if the target text message is identified only by the http or https protocol header, the text messages of the Universal Link protocol will be missed. Therefore, the target text message with a link can be identified by searching for the target symbol in the text message file of the text message to be identified. If the target symbol exists in the text message text of the text message to be identified, it means that there is a link in the text message to be identified. In this way, no matter whether the jump link address in the text message to be identified is the URL Scheme protocol or the Universal Link protocol, the text message to be identified can be accurately determined as the target text message. This not only solves the technical problem that the current mainstream system cannot identify the Universal Link link as a URL, but also can reduce resource consumption in subsequent text message type identification.

[0059] In some embodiments, the above S101 may specifically include:

[0060] Find the target symbol in the link address text of the target SMS;

[0061] The text after the first target symbol in the link address text is determined as redundant text;

[0062] The target symbols and redundant text in the link address text are removed to extract the feature text.

[0063] The above-mentioned searching for the target symbol in the link address text of the target SMS may be, for example, searching for the “ / ” symbol appearing in the link address text of the target SMS using a regular expression.

[0064] In the above, the text after the first target symbol in the link address text is determined as redundant text. For example, "4E3C5D" in "pduoduo / 4E3C5D" may be determined as redundant text.

[0065] The target symbol and redundant text in the link address text are removed to extract the characteristic text. For example, the " / " and "4E3C5D" in "pduoduo / 4E3C5D" may be removed to obtain the characteristic text "pduoduo".

[0066] In this embodiment, the target symbol in the link address text of the target SMS can be searched, and the text after the first target symbol in the link address text can be determined as redundant text. Finally, the target symbol and redundant text in the link address text can be removed to accurately extract the feature text.

[0067] In some embodiments, the link address text may also include a protocol header text;

[0068] The above removes the target symbol and redundant text in the link address text to extract the feature text, which may specifically include:

[0069] The target symbol, redundant text and protocol header text in the link address text are removed to extract the feature text.

[0070] In the case where the link address text is in the URL Scheme protocol, the link address text may include a protocol header text, and the protocol header text may be, for example, an http or https protocol header.

[0071] The target symbol, redundant text and protocol header text in the link address text are removed to extract the characteristic text. For example, " / ", "route" and https: / / in "https: / / pduoduo / route" can be removed to obtain the characteristic text "pduoduo".

[0072] In this embodiment, when the link address text includes a protocol header text, the target symbol, redundant text and protocol header text in the link address text may be removed, thereby accurately extracting the feature text.

[0073] As another implementation of the present application, in order to further accurately identify the target SMS category of the target SMS, before S101, the method may further include:

[0074] Performing semantic segmentation on the text of the target text message to obtain a link address text and at least one Chinese text;

[0075] The above S104 may specifically include:

[0076] The target feature word and at least one Chinese text are searched in a preset second feature word library to identify the target SMS category of the target SMS.

[0077] The above-mentioned search for the target feature word and at least one Chinese text in the preset second feature word library to identify the target SMS category of the target SMS may, for example, be the SMS category corresponding to the target feature word or any Chinese text in the preset second feature word library. If only one of the SMS categories of the target feature word and at least one Chinese text is a spam SMS category, the target SMS category is determined to be a spam SMS category. If all of the SMS categories of the target feature word and at least one Chinese text are whitelist categories, the target SMS category is determined to be a whitelist category.

[0078] The above-mentioned semantic segmentation of the target SMS text to obtain the link address text and at least one Chinese text can be exemplarily performed by a semantic word segmentation method based on a second-order hidden Markov model to semantically segment the target SMS text to obtain the link address text and at least one Chinese text.

[0079] In this embodiment, by semantically segmenting the target SMS text to obtain the link address text and at least one Chinese text, and searching for the target feature words and at least one Chinese text in a preset second feature word library, the target SMS category of the target SMS is further accurately identified.

[0080] As another implementation of the present application, in order to improve the accuracy of identifying the category of the short message, the above method may further include:

[0081] If the target feature word and at least one Chinese text are not found in the second feature word library, the target SMS is released;

[0082] Receive a text message category of a target feature word and a text message category of at least one Chinese text input by a user;

[0083] The short message category of the target feature word and the short message category of at least one Chinese text are added to the second feature word library.

[0084] In this embodiment, when the target feature word and at least one Chinese text are not searched in the second feature word library, the target SMS is released, and then the SMS category of the target feature word and at least one Chinese text input by the user are received and added to the second feature word library to update the second feature word library, ensure the validity of the second feature word library, and thus improve the accuracy of identifying SMS categories.

[0085] As another implementation of the present application, in order to reduce the interference of spam text messages to users, after the above S104, the above method further includes:

[0086] When the target SMS category indicates that the target characteristic word is a spam SMS category, the target SMS is intercepted;

[0087] When the target SMS category indicates that the target feature word is a whitelist category, the target SMS is released.

[0088] In this embodiment, when the target SMS category indicates that the target feature word is a spam SMS category, the target SMS is intercepted, which can reduce the interference of spam SMS to users. When the target SMS category indicates that the target feature word is a whitelist category, the target SMS is released, which can effectively ensure the normal life of the user.

[0089] In order to facilitate the understanding of the SMS identification method in the embodiment of the present application, the actual application process of this SMS identification method is described as follows:

[0090] like Figure 2 As shown, the embodiment of the present application provides a method for SMS recognition, firstly, the input SMS data (equivalent to the above-mentioned SMS text) is preprocessed to remove SMS that do not contain links (equivalent to the above-mentioned jump link address). Then the SMS text is processed using a semantic word segmentation module based on a second-order hidden Markov model to obtain a link address text separated from the Chinese text and the link address. The feature text obtained after feature extraction of the link address text is semantically restored by calling the semantic restoration module, and finally the restored feature words (i.e., the above-mentioned target feature words) and the Chinese text obtained by semantic segmentation are compared with the feature word library (i.e., the above-mentioned second feature word library). If it contains feature words, the type of word library to which it belongs is determined. If the feature words belong to the spam SMS type, it is determined to be a spam SMS. If it belongs to the whitelist type, the SMS is released. If it does not contain feature words, it is manually sampled, new feature words are found and stored in the feature word library, and finally the SMS recognition result is output.

[0091] 1. SMS data preprocessing

[0092] Since the amount of SMS data is extremely large, if every SMS is detected, it will cause a huge waste of space and performance. In order to reduce resource consumption, the SMS data needs to be preprocessed first. For a SMS text to be detected (i.e. the SMS text to be identified above), use regular expressions to preprocess the SMS text, use the " / " symbol (equivalent to the above target symbol) as the screening condition, eliminate SMS without links, and output SMS with links (equivalent to the above target SMS) as the input for the next step.

[0093] 2. Text URL feature extraction

[0094] With respect to the characteristic words contained in the SMS text, the embodiment of the present application adopts a semantic word segmentation method based on a second-order hidden Markov model to segment the SMS text.

[0095] The structure diagram of the second-order hidden Markov model is as follows Figure 3 As shown in Figure 1, given the test set text observation sequence, the Viterbi algorithm is used to solve the optimal state path for each text. Calculate the state S at time t j , state S at time t-1 i The state transition path x1,x2,x3,…,x i In the above example, a text observation sequence o1, o2, o3, ..., o t The maximum probability of:

[0096] δ i (i,j)=max P(x1,x2,x3,…,x t-2 ,x t-1 =S i ,x i =S j ,o1,o2,o3,…,o i ∣λ)

[0097] Assume that at time t the state S j , state S at time t-1 i Among all state transition paths, the t-2th node of the path with the maximum transition probability is denoted as ψ i (i,j). Solve for the optimal state path The process is:

[0098] (i) Initialize δ2(i,j) = π i a ij b i (o1)b ij (o z ),1≤i,j≤N,ψ2(i,j)=0,1≤i,j≤N;

[0099] (ii) Recursive δ i+1 (j,k)=max i≤k≤k [δ i (i,j)·a ijk ] jk (o i+1 ),2≤t≤T-

[0100]

[0101] The segmentation effect of the second-order hidden Markov model is shown in Table 1:

[0102] Table 1

[0103] Word segmentation method Word segmentation results First-order HMM Red envelope rain is coming! Click 4pn.cn now! Second-order HMM Red envelope rain is coming! Click 4pn.cn now! Manual word segmentation Red envelope rain is coming! Click 4pn.cn now! First-order HMM If you need money urgently, please click here: https: / / kuaizhuanq / login.com Second-order HMM If you need money urgently, please click here: https: / / kuaizhuanq / login.com Manual word segmentation If you need money urgently, please click here: https: / / kuaizhuanq / login.com

[0104] After semantic segmentation of SMS messages containing links, the obtained Chinese text and links are processed separately. To address the problem that the Univeral Link jump protocol does not contain the http protocol header, first use regular expressions to find the first " / " symbol in the link, remove the redundant part after the " / " and the initial http protocol header, and only retain the required characteristic protocol header. For example, "https: / / pduoduo / route" and "pduoduo / 4E3C5D" are extracted as "pduoduo".

[0105] To solve the three cases where all the feature protocol headers are abbreviations, some are abbreviations, and all are in pinyin, the embodiment of the present application designs a semantic reduction module to perform semantic reduction on the feature characters in the link. For example, "pduoduo" is reduced to "拼多多" (Pinduoduo), and then the reduced feature word is compared with the feature database. According to the comparison result, it is determined whether it is a spam jump text message. The logic of the semantic reduction module is as Figure 4 shown:

[0106] The embodiment of the present application proposes a Chinese fuzzy matching method based on the edit distance of pinyin abbreviations. First, the characters are semantically segmented, then the redundant parts before and after the link protocol header are removed using regular expressions, and then the similarity distance between these feature words containing pinyin abbreviations and the pinyin of each word in the feature word library is calculated. When the similarity is greater than the set similarity threshold, it can be inferred that the jump link address is a feature word, and the Chinese abbreviations in the original sentence can be replaced to complete the subsequent comparison with the feature word library.

[0107] The feature texts with pinyin abbreviations are divided into three cases: some are abbreviations, all are abbreviations, and all are composed of pinyin. For example, the abbreviated variant words of the word "理财宝" (wealth management treasure) can be lcaib, lcb, licaibao. Considering that the lengths of most variant words are 2 and 3, only the cases where the continuous pinyin string and zero to two nearby Chinese characters are considered. The similarity distance calculation formula is as follows:

[0108]

[0109] Among them, d represents the pinyin distance between word1 and word2, d[i][j] represents the distance between the first i elements of word1 and the first j elements of word2, ω1 and ω2 are the weights for similarity calculation, |word1∩word2| represents the length of the intersection of word1 and word2; the second term in the similarity calculation considers the case where all characters are abbreviations, because for abbreviated words, they are partial characters extracted from the original words. Therefore, the relationship between the same characters and the pinyin length in the two words is also an important factor affecting the detection.

[0110] After calculating the similarity distance, the words with similarity greater than the set threshold are used to replace the original text to complete the subsequent comparison with the feature word library.

[0111] 3. Comparison with the feature word library

[0112] (1) Establishment of the feature word library:

[0113] In order to achieve feature word library matching, it is necessary to establish an initial word library. The embodiment of the present application uses the massive push links released by major platforms as the initial data, divides the word library into spam SMS categories and whitelist categories, and establishes an initial Chinese word library through manual labeling. Among them, the spam SMS categories include shopping apps, financial apps, short video apps, etc., and the whitelist categories include government apps and credit apps, etc. By classifying the word library, the possibility of false interception is reduced, and accurate control of spam SMS is achieved.

[0114] (2) Feature word comparison

[0115] In order to improve the comparison speed, the embodiment of the present application uses a method for retrieval based on a binary tree hash algorithm. When the amount of data to be retrieved is large, text queries often experience downtime, delays, etc. Based on this, a hash algorithm based on a binary tree structure is constructed by utilizing the good performance of hash functions and binary trees in queries to solve the problem of slow retrieval of large text files.

[0116] Based on the matching results, the text messages that belong to the spam category are intercepted, and the text messages that do not match the keywords and whitelist categories are released, thus achieving efficient control over redirected spam text messages.

[0117] (3) Feature word library maintenance

[0118] Redirected SMS has the characteristics of fast changing form and diversified features, which requires constant updating and maintenance of the protocol library. The embodiment of the present application manually checks SMS messages that do not match feature words, adds newly appeared feature words to the feature word library, and realizes real-time update of the feature word library.

[0119] The embodiment of the present application fills the gap in the current industry field of redirected spam SMS identification, and realizes efficient and accurate identification of spam SMS by extracting hidden semantic information in the redirected link and comparing it with the feature word library. In addition, the embodiment of the present application establishes a maintainable and easily expandable feature word library, which solves the problem that the link protocol headers in spam SMS are difficult to identify due to the variety of forms.

[0120] Based on the SMS identification method provided in the above embodiment, the present application also provides a specific implementation of the SMS identification device. It can be understood that the relevant descriptions in the following device embodiments can refer to the above method embodiments, and for the sake of brevity, they will not be repeated. Please refer to the following embodiments.

[0121] See also Figure 5 , is a structural diagram of a text message identification device 500 provided in an embodiment of the present application, which may include: an extraction module 501, a calculation module 502, a first determination module 503 and an identification module 504.

[0122] Extraction module 501, used for extracting features from the link address text in the target SMS to obtain feature text, where the feature text is composed of pinyin;

[0123] A calculation module 502 is used to calculate the similarity distance between the feature text and the pinyin of each feature word in a preset first feature word library, wherein the first feature word library includes the pinyin of at least one feature word, and different feature words correspond to different pinyins;

[0124] The first determination module 503 is used to determine the feature words corresponding to the similarity distances greater than the preset similarity threshold as the target feature words of the target short message;

[0125] The identification module 504 is used to search for the target feature word in the preset second feature word library to identify the target SMS category of the target SMS. The second feature word library includes at least one SMS category of the feature word, and the SMS category is used to indicate that the feature word is a spam SMS category or a whitelist category.

[0126] The SMS recognition device of the embodiment of the present application can extract the features of the link address text in the target SMS to obtain the feature text, which is composed of pinyin; calculate the similarity distance between the feature text and the pinyin of each feature word in the preset first feature word library, the first feature word library includes the pinyin of at least one feature word, and the pinyin corresponding to different feature words is different; determine the feature word corresponding to the similarity distance greater than the preset similarity threshold as the target feature word of the target SMS; search for the target feature word in the preset second feature word library to identify the target SMS category of the target SMS, the second feature word library includes the SMS category of at least one feature word, and the SMS category is used to indicate that the feature word is a spam SMS category or a whitelist category. In this way, the embodiment of the present application can calculate the similarity distance between the feature text of the link address text in the target SMS and the pinyin of each feature word in the first feature word library, and determine the feature word corresponding to the similarity distance greater than the preset similarity threshold as the target feature word of the target SMS, so that the semantics of the link address text in the target SMS can be restored to the target feature word, so as to accurately know the source of the target SMS, and then identify the target SMS category of the target SMS, and finally achieve effective interception of spam SMS.

[0127] As an implementation of the present application, in order to accurately determine the short message to be identified as the target short message and reduce resource consumption, the above-mentioned device 500 may further include:

[0128] An acquisition module, used to acquire the text of the SMS to be identified;

[0129] A search module, used to search for a target symbol in the text of a message to be identified;

[0130] The second determination module is used to determine the SMS to be identified as a target SMS when the target symbol exists in the SMS text of the SMS to be identified.

[0131] In some embodiments, the extraction module 501 may specifically include:

[0132] A search unit, used for searching for a target symbol in a link address text of a target SMS;

[0133] A determination unit, used for determining the text after the first target symbol in the link address text as redundant text;

[0134] The extraction unit is used to remove the target symbol and redundant text in the link address text to extract the feature text.

[0135] In some embodiments, the link address text may also include a protocol header text;

[0136] The above extraction unit can also be used to remove the target symbol, redundant text and protocol header text in the link address text to extract the feature text.

[0137] As another implementation of the present application, in order to further accurately identify the target SMS category of the target SMS, the above-mentioned device 500 may further include:

[0138] A segmentation module, used for performing semantic segmentation on the text of the target text message to obtain a link address text and at least one Chinese text;

[0139] The identification module 504 is further configured to search for a target feature word and at least one Chinese text in a preset second feature word library to identify a target SMS category of the target SMS.

[0140] As another implementation of the present application, in order to improve the accuracy of identifying the category of a text message, the apparatus 500 may further include:

[0141] A first processing module, configured to release the target SMS if the target feature word and at least one Chinese text are not found in the second feature word library;

[0142] A receiving module, used for receiving a text message category of a target feature word and a text message category of at least one Chinese text input by a user;

[0143] The adding module is used to add the SMS category of the target feature word and the SMS category of at least one Chinese text to the second feature word library.

[0144] As another implementation of the present application, in order to reduce the interference of spam text messages to users, the above-mentioned device 500 may also include:

[0145] The second processing module is used to intercept the target SMS when the target SMS category indicates that the target characteristic word is a spam SMS category;

[0146] The third processing module is used to release the target SMS when the target SMS category indicates that the target feature word is a whitelist category.

[0147] Figure 6 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown.

[0148] The electronic device may include a processor 601 and a memory 602 storing computer program instructions.

[0149] Specifically, the processor 601 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0150] The memory 602 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 602 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 602 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 602 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 602 is a non-volatile solid-state memory.

[0151] In certain embodiments, the memory 602 may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.

[0152] The processor 601 implements any one of the SMS identification methods in the above embodiments by reading and executing the computer program instructions stored in the memory 602 .

[0153] In one example, the electronic device may further include a communication interface 603 and a bus 610. Figure 6 As shown, the processor 601, the memory 602, and the communication interface 603 are connected via a bus 610 and communicate with each other.

[0154] The communication interface 603 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.

[0155] Bus 610 includes hardware, software or both, and the parts of electronic equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 610 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.

[0156] The electronic device can execute the SMS recognition method in the embodiment of the present application, thereby realizing the combination Figure 1 and Figure 5 Described is a method and device for identifying short messages.

[0157] In addition, in combination with the SMS identification method in the above embodiments, the present application embodiment can provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any SMS identification method in the above embodiments is implemented.

[0158] In combination with the SMS identification method in the above embodiments, an embodiment of the present application may provide a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes any one of the SMS identification methods above.

[0159] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.

[0160] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0161] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.

[0162] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0163] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.

Claims

1. A method for identifying short messages, characterized in that: include: Extracting features of the link address text in the target SMS to obtain feature text, wherein the feature text is composed of pinyin; Calculating the similarity distance between the feature text and the pinyin of each feature word in a preset first feature word library, wherein the first feature word library includes the pinyin of at least one feature word, and different feature words correspond to different pinyins; Determine the feature words corresponding to the similarity distance being greater than a preset similarity threshold as the target feature words of the target short message; The target feature word is searched in a preset second feature word library to identify the target SMS category of the target SMS, wherein the second feature word library includes at least one SMS category of the feature word, and the SMS category is used to indicate that the feature word is a spam SMS category or a whitelist category.

2. The method according to claim 1, characterized in that Before extracting features from the link address text in the target short message to obtain feature text, the method further includes: Get the text of the SMS to be identified; Searching for a target symbol in the text of the short message to be identified; When the target symbol exists in the text of the to-be-identified text message, the to-be-identified text message is determined as the target text message.

3. The method according to claim 2, characterized in that The feature extraction of the link address text in the target SMS to obtain the feature text includes: Searching for the target symbol in the link address text of the target SMS; Determining the text after the first target symbol in the link address text as redundant text; The target symbol and the redundant text in the link address text are removed to extract the feature text.

4. The method according to claim 3, characterized in that The link address text includes a protocol header text; The step of removing the target symbol and the redundant text from the link address text to extract the feature text includes: The target symbol, the redundant text and the protocol header text in the link address text are removed to extract the feature text.

5. The method according to claim 1, characterized in that Before extracting features from the link address text in the target short message to obtain feature text, the method further includes: Performing semantic segmentation on the text of the target text message to obtain the link address text and at least one Chinese text; The step of searching for the target feature word in a preset second feature word library to identify the target SMS category of the target SMS includes: The target feature word and the at least one Chinese text are searched in a preset second feature word library to identify the target SMS category of the target SMS.

6. The method according to claim 5, characterized in that The method further comprises: If the target feature word and the at least one Chinese text are not found in the second feature word library, releasing the target SMS; receiving a text message category of the target feature word and a text message category of the at least one Chinese text input by a user; The short message category of the target feature word and the short message category of the at least one Chinese text are added to the second feature word library.

7. The method according to claim 1, characterized in that After searching the target feature word in the preset second feature word library and identifying the target SMS category of the target SMS, the method further includes: When the target SMS category indicates that the target characteristic word is a junk SMS category, intercepting the target SMS; When the target SMS category indicates that the target feature word is in the whitelist category, the target SMS is released.

8. A text message recognition device, characterized in that: The device comprises: An extraction module is used to extract features from the link address text in the target SMS to obtain feature text, where the feature text is composed of pinyin; A calculation module, used for calculating the similarity distance between the feature text and the pinyin of each feature word in a preset first feature word library, wherein the first feature word library includes the pinyin of at least one feature word, and different feature words correspond to different pinyins; A first determination module is used to determine the feature words corresponding to the similarity distance being greater than a preset similarity threshold as target feature words of the target short message; The identification module is used to search for the target feature word in a preset second feature word library to identify the target SMS category of the target SMS. The second feature word library includes at least one SMS category of the feature word, and the SMS category is used to indicate that the feature word is a spam SMS category or a whitelist category.

9. An electronic device, characterized in that: The device comprises: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the text message identification method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the text message identification method according to any one of claims 1 to 7 is implemented.

11. A computer program product, characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the text message identification method as described in any one of claims 1 to 7.