Abnormal short message determination method and device, equipment and computer storage medium

By segmenting and encoding the target text message, it can quickly determine whether it is abnormal, which solves the problem of low detection efficiency caused by the large number of samples in the existing technology, and realizes a method of timely determination of abnormal text messages.

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

Patent Information

Application Number
CN202311520199.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-15
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

When the existing technology detects and filters abnormal text messages, due to the large number of samples in the sample database, it takes a long time to confirm the abnormal text messages, the efficiency is low, and it is difficult to determine whether the text messages are abnormal in a timely manner.

Method used

By segmenting the target text message, extracting the fingerprint vector, randomly generating the mapping vector, calculating the encoding vector, comparing it with the encoding vector of the abnormal sample class, and judging whether it is the same to determine the abnormality.

Benefits of technology

It improves the efficiency of determining abnormal text messages, can quickly and timely determine whether text messages are abnormal, and avoids the inefficiency of calculating similarities one by one.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118798191A_ABST
    Figure CN118798191A_ABST
Patent Text Reader

Abstract

The invention discloses an abnormal short message determination method and device, equipment and a computer storage medium. The method comprises the following steps: acquiring a target short message; performing word segmentation on the target short message to obtain at least one target word and an index ID thereof; inputting the index ID of the at least one target word into a text fingerprint extractor, performing feature extraction on the index ID, and determining a fingerprint vector of the target short message; according to the dimension of the fingerprint vector of the target short message and a preset dimension, randomly generating a mapping vector of the target dimension; determining a coding vector of the target short message according to the product of the fingerprint vector of the target short message and the mapping vector and preset function relation information; and comparing the coding vector of the target short message with the coding vectors of the plurality of abnormal sample classes, and determining that the target short message is abnormal under the condition that the coding vector of the target short message is the same as the coding vector of the target abnormal sample class. Whether the target short message is abnormal is rapidly determined, the efficiency of determining the abnormal short message is improved, and whether the short message is abnormal can be determined in time.
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 method, device, equipment and computer storage medium for determining abnormal text messages. Background Art

[0002] With the rapid development of Internet communication technology, industry messaging services have become increasingly popular, and the amount of SMS messages sent by industry messaging services has increased dramatically. SMS messages for industry messaging services include verification codes, e-commerce logistics, member notifications, payment reminders, etc., which have become an indispensable part of the Internet. However, in the open industry SMS service, there are some inevitable security issues.

[0003] At present, since the text messages sent by industry ports have certain templates, the differences between similar text messages often exist in the differences in keywords related to user information. Therefore, for the detection and filtering of abnormal text messages, we can establish an abnormal text message sample database and determine the abnormal text messages based on the similarity of the text message content. The similarity is usually determined based on the edit distance between the target text message and the samples in the sample database. However, the number of samples in the sample database is large, and it takes a long time to confirm abnormal text messages, which is inefficient, making it difficult to determine whether the text message is abnormal in a timely manner. Summary of the invention

[0004] The embodiments of the present application provide a method, apparatus, device and computer storage medium for determining abnormal text messages, which can quickly determine whether a target text message is abnormal, improve the efficiency of determining abnormal text messages, and thus can promptly determine whether a text message is abnormal.

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

[0006] Get the target SMS;

[0007] Segmenting the target short message to obtain at least one target word and at least one index ID of the target word, wherein the index ID of the at least one target word is determined according to a segmentation table, and the segmentation table includes relationship information between the word and the index ID;

[0008] Inputting the index ID of at least one target word into a text fingerprint extractor, performing feature extraction on the index ID of at least one target word, and determining a fingerprint vector of the target text message;

[0009] According to the dimension of the fingerprint vector of the target SMS and the preset dimension, a mapping vector of the target dimension is randomly generated, and the mapping vector obeys a normal distribution;

[0010] Determine the encoding vector of the target SMS according to the product of the fingerprint vector of the target SMS and the mapping vector, and the preset functional relationship information;

[0011] The encoding vector of the target text message is compared with the encoding vectors of multiple abnormal sample classes, and when the encoding vector of the target text message is the same as the encoding vector of the target abnormal sample class, it is determined that the target text message is abnormal.

[0012] In a possible implementation, comparing the encoding vector of the target SMS with the encoding vectors of multiple abnormal sample classes, and determining that the target SMS is abnormal when the encoding vector of the target SMS is the same as the encoding vector of the target abnormal sample class, includes:

[0013] When the encoding vector of the target SMS is the same as the encoding vector of the target abnormal sample class, the edit distance between the target SMS and the SMS in the target abnormal sample class is calculated;

[0014] When all edit distances are smaller than a preset threshold, the target text message is determined to be abnormal.

[0015] In a possible implementation, when all edit distances are less than a preset threshold, before determining that the target text message is abnormal, the method further includes:

[0016] Calculate the average of the edit distances;

[0017] When all edit distances are less than the preset threshold, the target SMS is determined to be abnormal, including:

[0018] When the average value is less than the preset threshold, the target SMS is determined to be abnormal.

[0019] In a possible embodiment, it also includes:

[0020] When the average value is not less than the preset threshold, it is determined that the target SMS is normal.

[0021] In a possible implementation, before obtaining the target SMS, the method further includes:

[0022] Obtaining a first sample and a second sample, wherein the first sample includes normal text messages, and the second sample includes abnormal text messages;

[0023] Perform word segmentation on the first sample and the second sample to obtain a word segmentation table, where the word segmentation table includes at least one word and at least one index ID of the word;

[0024] The index ID of at least one word is input into an initial text fingerprint extractor, the initial text fingerprint extractor is trained using the index ID of at least one word, feature extraction is performed on the index ID of at least one word, fingerprint vectors of a first sample and a second sample are determined, and a text fingerprint extractor is obtained.

[0025] In a possible implementation, before comparing the encoding vector of the target SMS with the encoding vectors of multiple abnormal sample classes, the method further includes:

[0026] According to the dimension of the fingerprint vector of the second sample and the preset dimension, randomly generate a sample mapping vector of the target dimension, and the sample mapping vector obeys a normal distribution;

[0027] Determine a sample encoding vector of the second sample according to the product of the fingerprint vector of the second sample and the sample mapping vector, and preset functional relationship information;

[0028] The second samples with the same sample encoding vector are divided into the same category to obtain multiple abnormal sample classes.

[0029] In a possible implementation, the encoding vector includes a plurality of first target values; determining the encoding vector of the target SMS according to the product of the fingerprint vector of the target SMS and the mapping vector, and the preset functional relationship information, includes:

[0030] Calculate the product of each second target value in the fingerprint vector of the target SMS and the corresponding third target value in the mapping vector to obtain a plurality of first target values;

[0031] When the first target value is not less than the preset value, the first target value is determined to be the first coding value. When the first target value is less than the preset value, the first target value is determined to be the second coding value to obtain the coding vector of the target SMS.

[0032] In a second aspect, an embodiment of the present application provides a device for determining an abnormal text message, including:

[0033] The acquisition module is used to obtain the target SMS;

[0034] A word segmentation module, used to segment the target short message to obtain at least one target word and at least one index ID of the target word, wherein the index ID of the at least one target word is determined according to a word segmentation table, and the word segmentation table includes relationship information between the word and the index ID;

[0035] A determination module, used to input the index ID of at least one target word into a text fingerprint extractor, perform feature extraction on the index ID of at least one target word, and determine the fingerprint vector of the target SMS;

[0036] A generation module, used for randomly generating a mapping vector of a target dimension according to the dimension of the fingerprint vector of the target SMS and a preset dimension, wherein the mapping vector obeys a normal distribution;

[0037] The determination module is further used to determine the encoding vector of the target SMS according to the product of the fingerprint vector of the target SMS and the mapping vector, and the preset functional relationship information;

[0038] The determination module is also used to compare the encoding vector of the target SMS with the encoding vectors of multiple abnormal sample classes, and determine that the target SMS is abnormal when the encoding vector of the target SMS is the same as the encoding vector of the target abnormal sample class.

[0039] In a third aspect, an embodiment of the present application provides an electronic device, the device comprising:

[0040] a processor and a memory storing computer program instructions;

[0041] When the processor executes the computer program instructions, it implements any one of the above methods for determining abnormal text messages.

[0042] In a fourth aspect, an embodiment of the present application provides a computer storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, any of the above-mentioned methods for determining abnormal text messages is implemented.

[0043] In a fifth aspect, an embodiment of the present application provides 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 is enabled to execute any of the above-mentioned methods for determining abnormal text messages.

[0044] The method, device, equipment and computer storage medium for determining abnormal text messages in the embodiments of the present application include: obtaining a target text message; performing word segmentation on the target text message to obtain at least one target word and at least one index ID of the target word, wherein the index ID of the at least one target word is determined according to a word segmentation table, and the word segmentation table includes relationship information between the word and the index ID; inputting the index ID of the at least one target word into a text fingerprint extractor, performing feature extraction on the index ID of the at least one target word, and determining a fingerprint vector of the target text message; randomly generating a mapping vector of the target dimension according to the dimension of the fingerprint vector of the target text message and a preset dimension, wherein the mapping vector obeys a normal distribution; determining an encoding vector of the target text message according to the product of the fingerprint vector of the target text message and the mapping vector, and preset function relationship information; comparing the encoding vector of the target text message with the encoding vectors of multiple abnormal sample classes, and determining that the target text message is abnormal when the encoding vector of the target text message is the same as the encoding vector of the target abnormal sample class. In this way, the target SMS is segmented, the index ID of at least one target word in the target SMS is determined, and the fingerprint vector of the target SMS is determined by the index ID; and the encoding vector of the target SMS is determined based on the fingerprint vector and the randomly generated mapping vector, and whether the target SMS is abnormal is determined by comparing the encoding vector of the target SMS with the encoding vectors of multiple abnormal sample classes. It is not necessary to calculate the similarity between the target SMS and the sample one by one, and only needs to compare whether the encoding vector of the target SMS is the same as the encoding vector of the sample to confirm whether the target SMS is abnormal. Even if the sample size in the sample database is large, it is possible to quickly determine whether the target SMS is abnormal, which improves the efficiency of determining abnormal SMS, and thus can promptly determine whether the SMS is abnormal. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] 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.

[0046] Figure 1 It is a flowchart of a method for determining abnormal text messages provided by an embodiment of the present application;

[0047] Figure 2 is a flowchart of a method for determining abnormal text messages provided by another embodiment of the present application;

[0048] Figure 3 It is a flowchart of a method for determining abnormal text messages provided by another embodiment of the present application;

[0049] Figure 4 It is a structural schematic diagram of a device for determining abnormal text messages provided in yet another embodiment of the present application;

[0050] Figure 5 It is a structural diagram of an electronic device provided in yet another embodiment of the present application. DETAILED DESCRIPTION

[0051] 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.

[0052] 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.

[0053] With the rapid development of Internet communication technology, industry messaging services have become increasingly popular, and the amount of SMS messages sent by industry messaging services has increased dramatically. SMS messages for industry messaging services include verification codes, e-commerce logistics, member notifications, payment reminders, etc., which have become an indispensable part of the Internet. However, in the open industry SMS service, there are some inevitable security issues.

[0054] At present, since the text messages sent by industry ports have certain templates, the differences between similar text messages often exist in the differences in keywords related to user information. Therefore, for the detection and filtering of abnormal text messages, we can establish an abnormal text message sample database and determine the abnormal text messages based on the similarity of the text message content. The similarity is usually determined based on the edit distance between the target text message and the samples in the sample database. However, the number of samples in the sample database is large, and it takes a long time to confirm abnormal text messages, which is inefficient, making it difficult to determine whether the text message is abnormal in a timely manner.

[0055] In order to solve the problems of the prior art, the embodiments of the present application provide a method, device, equipment and computer storage medium for determining abnormal text messages. The method for determining abnormal text messages provided by the embodiments of the present application is first introduced below.

[0056] Figure 1 A flow chart of a method for determining abnormal text messages provided in one embodiment of the present application is shown.

[0057] like Figure 1 As shown, the method for determining abnormal text messages provided in the embodiment of the present application includes the following steps.

[0058] S110, obtaining a target text message.

[0059] Here, the target text message may be a text message to be determined to be normal or abnormal.

[0060] S120, segment the target short message to obtain at least one target word and at least one index ID of the target word, wherein the index ID of the at least one target word is determined according to a segmentation table, and the segmentation table includes relationship information between the word and the index ID.

[0061] In some embodiments, the target SMS can be segmented using a preset segmentation algorithm to obtain at least one target word and at least one index ID of the target word. For example, the preset segmentation algorithm can be a jieba segmentation algorithm. Each word in the segmentation table has its corresponding index ID.

[0062] S130: Input the index ID of at least one target word into a text fingerprint extractor, perform feature extraction on the index ID of at least one target word, and determine a fingerprint vector of the target SMS.

[0063] In some embodiments, the text fingerprint extractor is pre-trained, and the text fingerprint extractor includes an encoding module and a decoding module. The encoding module is used to extract and encode the index ID of at least one target word, and the decoding module is used to decode the encoded target code to obtain the fingerprint vector of the target text message. Here, the encoding and decoding methods are not specifically limited.

[0064] As an example, Figure 2 As shown, the target SMS is segmented to obtain at least one target word index ID, which is then subjected to feature extraction and encoding by the encoding module and then decoded to obtain the fingerprint vector of the target SMS.

[0065] In some embodiments, the input of the text fingerprint extractor is the index ID sequence of all words obtained after the text in the target SMS is segmented, and the output is a fingerprint vector that can represent the semantics and content of the text. The text fingerprint extractor can use the transformer architecture in deep learning, and its results have higher accuracy and interpretability than the traditional RNN network. The transformer architecture includes two parts: a decoding module and an encoding module.

[0066] S140. Randomly generate a mapping vector of a target dimension according to the dimension of the fingerprint vector of the target SMS and a preset dimension, wherein the mapping vector obeys a normal distribution.

[0067] In some embodiments, the fingerprint vector of the target text message is mapped to a new low-dimensional space by dimensionality reduction. According to the dimension of the fingerprint vector of the target text message and the preset dimension, a mapping vector of the target dimension is randomly generated. The mapping vector is composed of f vectors with a normal distribution of mean 0, standard deviation 1 and k*1 dimensions, forming a k*f dimensional mapping vector. Here, the preset dimension is f, which is set in advance. The dimension of the fingerprint vector of the target text message is 1*k, and here, the dimension of the fingerprint vector of the target text message is set in advance.

[0068] S150, determining the encoding vector of the target text message according to the product of the fingerprint vector of the target text message and the mapping vector, and preset functional relationship information.

[0069] In some embodiments, the product of the fingerprint vector and the mapping vector of the target text message can be regarded as the product of two matrices, wherein the fingerprint vector is 1*k-dimensional and the mapping vector is k*f-dimensional, and the product of the fingerprint vector and the mapping vector of the target text message is 1*f-dimensional. The 1*f-dimensional product vector is converted according to the preset functional relationship information to determine the encoding vector of the target text message.

[0070] S160: Compare the coding vector of the target text message with the coding vectors of multiple abnormal sample classes, and determine that the target text message is abnormal when the coding vector of the target text message and the coding vector of the target abnormal sample class are the same.

[0071] In some embodiments, the encoding vector of the target abnormal sample class may be any one of the encoding vectors of multiple abnormal sample classes.

[0072] In this way, the target SMS is segmented, the index ID of at least one target word in the target SMS is determined, and the fingerprint vector of the target SMS is determined by the index ID; and the encoding vector of the target SMS is determined based on the fingerprint vector and the randomly generated mapping vector, and whether the target SMS is abnormal is determined by comparing the encoding vector of the target SMS with the encoding vectors of multiple abnormal sample classes. It is not necessary to calculate the similarity between the target SMS and the sample one by one, and it is only necessary to compare whether the encoding vector of the target SMS is the same as the encoding vector of the sample to confirm whether the target SMS is abnormal. Even if the sample size in the sample database is large, it is possible to quickly determine whether the target SMS is abnormal, which improves the efficiency of determining abnormal SMS, and thus can promptly determine whether the SMS is abnormal.

[0073] Based on this, in some embodiments, the above S160 may include:

[0074] When the encoding vector of the target SMS is the same as the encoding vector of the target abnormal sample class, the edit distance between the target SMS and the SMS in the target abnormal sample class is calculated;

[0075] When all edit distances are smaller than a preset threshold, the target text message is determined to be abnormal.

[0076] In some embodiments, in the application scenario of abnormal SMS filtering, the determination of whether a SMS is illegal should be as cautious as possible, and the edit distance algorithm is further used to confirm whether the content of the target SMS is sufficiently similar to the SMS in the abnormal sample class. When the encoding vector of the target SMS is the same as the encoding vector of the target abnormal sample class, the edit distance between the target SMS and each SMS in the target abnormal sample class is calculated. When all the edit distances are less than the preset threshold, the target SMS is determined to be abnormal.

[0077] In some embodiments, each edit distance is compared with a preset threshold, and when all edit distances are less than the preset threshold, the target text message is determined to be abnormal. The smaller the edit distance, the more similar the target text message is to the text messages in the target abnormal sample class. The full name of the edit distance algorithm is the Levenshtein distance algorithm. The Levenshtein distance algorithm is a quantitative measurement method for the degree of difference between two strings. The difference value of the two strings is determined by counting the at least number of times it takes to transform one character into another. The processing includes addition, modification, and deletion at the word and letter level. After obtaining the difference value, the difference value is normalized according to the maximum length of the two strings to obtain the similarity of the two strings.

[0078] In this way, the edit distance between the target SMS and the SMS in the target abnormal sample class is further calculated, thereby improving the accuracy of determining the abnormal SMS.

[0079] Based on this, in some embodiments, when all edit distances are less than a preset threshold, before determining that the target text message is abnormal, the method may further include:

[0080] Calculate the average of the edit distances;

[0081] When all edit distances are less than the preset threshold, the target SMS is determined to be abnormal, including:

[0082] When the average value is less than the preset threshold, the target SMS is determined to be abnormal.

[0083] In this way, there is no need to compare the edit distances one by one. Whether the target SMS is abnormal can be determined by comparing the average value of the edit distances with a preset threshold. This improves the efficiency of determining abnormal SMS while improving accuracy.

[0084] Based on this, in some embodiments, the method may further include:

[0085] When the average value is not less than the preset threshold, it is determined that the target SMS is normal.

[0086] In some embodiments, when the average value is not less than a preset threshold, it indicates that the target SMS is not similar enough to the SMS in the target abnormal sample class, and the similarity is small, and the target SMS is determined to be normal.

[0087] In this way, when the average value of the edit distance is small, it is considered that the target SMS has a small similarity with the SMS in the target abnormal sample class, and the target SMS can be determined to be normal.

[0088] Based on this, in some embodiments, before the above S110, the method may further include:

[0089] Obtaining a first sample and a second sample, wherein the first sample includes normal text messages, and the second sample includes abnormal text messages;

[0090] Perform word segmentation on the first sample and the second sample to obtain a word segmentation table, where the word segmentation table includes at least one word and at least one index ID of the word;

[0091] The index ID of at least one word is input into an initial text fingerprint extractor, the initial text fingerprint extractor is trained using the index ID of at least one word, feature extraction is performed on the index ID of at least one word, fingerprint vectors of a first sample and a second sample are determined, and a text fingerprint extractor is obtained.

[0092] In some embodiments, a word segmentation table is constructed based on a large number of first samples and second samples, and the word segmentation table includes at least one word and at least one index ID of the word. The first sample includes a first label, and the first label indicates that the first sample is a normal text message. The second sample includes a second label, and the second label indicates that the second sample is an abnormal text message. The fingerprint vector can represent the semantics of the text, and the distance between the fingerprints of similar texts in the vector space is also relatively close.

[0093] In this way, the first sample and the second sample can be used to train a text fingerprint extractor, and through the trained text fingerprint extractor, no matter whether the target text message is normal or abnormal, the fingerprint vector of the target text message can be determined.

[0094] Based on this, in some embodiments, before the above S160, the method may further include:

[0095] According to the dimension of the fingerprint vector of the second sample and the preset dimension, randomly generate a sample mapping vector of the target dimension, and the sample mapping vector obeys a normal distribution;

[0096] Determine a sample encoding vector of the second sample according to the product of the fingerprint vector of the second sample and the sample mapping vector, and preset functional relationship information;

[0097] The second samples with the same sample encoding vector are divided into the same category to obtain multiple abnormal sample classes.

[0098] In some embodiments, the fingerprint vector of the second sample is mapped to a new low-dimensional space by dimensionality reduction. According to the dimension of the fingerprint vector of the second sample and the preset dimension, a sample mapping vector of the target dimension is randomly generated. Each sample mapping vector is composed of f vectors with a normal distribution of mean 0, standard deviation 1 and k*1 dimensions, forming a sample mapping vector of k*f dimensions. Here, the preset dimension is f, which is set in advance. The dimension of the fingerprint vector of the second sample is 1*k, and here, the dimension of the fingerprint vector of the second sample is set in advance.

[0099] In some embodiments, the product of the fingerprint vector of the second sample and the mapping vector can be regarded as the product of two matrices, wherein the fingerprint vector of the second sample is 1*k dimensional, and the sample mapping vector is k*f dimensional, then the product of the fingerprint vector of the second sample and the mapping vector is 1*f dimensional. The 1*f dimensional product vector is converted according to the preset functional relationship information to determine the encoding vector of the second sample.

[0100] In some embodiments, second samples with the same sample encoding vector are considered to be similar with a high probability, and are put into the same bucket and classified into the same category, thereby obtaining multiple abnormal sample classes.

[0101] In this way, the sample encoding vector determined by the product of the fingerprint vector obtained by the text fingerprint extractor and the randomly generated sample mapping vector based on all the abnormal SMS samples is used as the encoding vector of the abnormal sample; for a new SMS, its fingerprint vector is also extracted to determine its encoding vector. A similar match is performed in the encoding vector of the abnormal sample. If it is the same as the encoding vector of the abnormal sample, the SMS can be considered to be an abnormal SMS, thereby achieving the determination of the abnormal SMS.

[0102] Based on this, in some embodiments, the above S150 may specifically include:

[0103] Calculate the product of each second target value in the fingerprint vector of the target SMS and the corresponding third target value in the mapping vector to obtain a plurality of first target values;

[0104] When the first target value is not less than the preset value, the first target value is determined to be the first coding value. When the first target value is less than the preset value, the first target value is determined to be the second coding value to obtain the coding vector of the target SMS.

[0105] As an example, let x represent the fingerprint vector of the target SMS, whose dimension is 1*k. Randomly generate a vector v with a mean of 0, a standard deviation of 1, and a k*1 dimension with normal distribution. v is a k*1 dimensional vector in the mapping vector (k*f dimension). The first target value is calculated by the following formula (1):

[0106] p(x)=sgn(x·v) (1)

[0107] Wherein, sgn(x·v) represents the preset relationship function information, and the preset relationship function information satisfies the following formula (2):

[0108]

[0109] Among them, when the first target value is not less than 0, the first target value is determined to be a first coding value, and the first coding is 1; when the first target value is less than 0, the first target value is determined to be a second coding value, and the second coding is 0.

[0110] The mapping vector V is composed of f vectors v with a normal distribution of 0, a standard deviation of 1, and k*1 dimensions, forming a k*f dimensional vector. The product of each second target value in the fingerprint vector of the target SMS and the corresponding third target value in the mapping vector is calculated to obtain multiple first target values. When the first target value is not less than the preset value, the first target value is determined to be the first encoding value. When the first target value is less than the preset value, the first target value is determined to be the second encoding value, and the encoding vector of the target SMS is obtained. The calculation process is shown in formula (3), which is as follows:

[0111] p(x)=sgn(x·V)=y,y∈1×f (3)

[0112] Here, y represents a coding vector, which is an f-dimensional coding vector composed of 0-1. Combining formula (1) and formula (2), the first code or the second code corresponding to each first target value is determined by the preset relationship function information, and the coding vector of the target SMS can be determined. For example, the coding vector is 0110001.

[0113] In this way, the encoding vector can be determined by the preset value, and then it can be determined whether the target text message is abnormal, thereby improving the efficiency of determination.

[0114] In the embodiment provided in the present application, at the geometric level, it is equivalent to randomly generating f hyperplanes, each of which divides the k-dimensional vector space into two. The fingerprint vector x is 1 above this hyperplane and 0 below it. Then the obtained f 0s or 1s are combined to obtain the hyperplane code (coding vector) y of the fingerprint vector x. The hyperplane code y is the mapping of the fingerprint vector x in the f-dimensional space, and similar fingerprint vectors should have the same coding vector. Therefore, fingerprint vectors with the same coding vector are considered to be similar with a high probability and are placed in the same bucket, so that the abnormal samples are divided into two f When judging the target SMS, the encoding vector of the target SMS is first calculated, and then similar fingerprint vectors can be further searched in the same bucket as the encoding vector of the target SMS. This directly removes most of the dissimilar features, thereby greatly reducing the time spent on retrieval.

[0115] In some embodiments, f is a preset dimension, which is set in advance. The value of f will affect the computational complexity of the encoding vector and the number of buckets of abnormal samples. Generally speaking, the larger the sample size in the abnormal sample, the higher the value of f should be. According to the sample size, the value range of f can be selected in 4-20. When there are many abnormal samples. When f<<n, it is obvious that the computational complexity of the encoding vector is much lower than the cosine similarity, and only one small matrix multiplication and a simple nonlinear transformation need to be calculated.

[0116] In the embodiments provided in this application, Figure 3 As shown, it is divided into offline training part and online matching part.

[0117] In the offline training part, we first build a vocabulary based on large-scale SMS samples (including normal and abnormal samples); then we train and generate a text fingerprint extractor based on a deep neural network to convert the text in the SMS samples into fingerprint vectors. Then we use the fingerprint vectors of all abnormal SMS samples extracted by this text fingerprint extractor to encode the fingerprint vectors of all abnormal SMS samples to determine the encoding vector. And based on the encoding vector, we store all fingerprint vectors in buckets as the encoding vectors of the abnormal sample class.

[0118] In the online matching part, for a target SMS, first use the fingerprint extractor to obtain its fingerprint vector, and then calculate its encoding vector. Compare the encoding vector of the abnormal sample class with it, and take out all abnormal SMS in the bucket with the same encoding vector as the target SMS. These abnormal SMS are likely to be similar to the target SMS. Finally, calculate the edit distance between the target SMS and the extracted SMS, and further confirm whether the target SMS is the same as or similar enough to the abnormal sample according to the set threshold, that is, determine whether the target SMS is abnormal or normal. If a sufficiently similar abnormal sample is matched, the target SMS is determined to be abnormal. Then it needs to be processed according to the business, so as to achieve the filtering of abnormal SMS content.

[0119] In the embodiment provided in the present application, a text fingerprint extractor based on a deep neural network is generated by training, a fingerprint vector of a fixed length that can characterize the semantic content of the text is extracted, and an abnormal sample class is constructed based on the encoding vector of the fingerprint vector. The determination of the encoding vector can be achieved by matrix multiplication, which is faster and easier than the edit distance, and the GPU parallel computing can be used to further accelerate the calculation process. The abnormal samples are divided into several buckets, and the samples in the same bucket are considered to be similar with a high probability, and the samples in different buckets are considered to be dissimilar. In similarity retrieval, it is first determined which bucket the target SMS should belong to, and then further determined in the corresponding bucket whether it is the same as or similar enough to the abnormal sample in the bucket. It can avoid the similarity calculation of a large number of samples that are significantly different from the target SMS, thereby greatly saving the time required for similar retrieval, and can cope with the increasing amount of messages.

[0120] Based on the method for determining abnormal text messages provided in the above embodiments, the present application also provides a specific implementation of a device for determining abnormal text messages. Please refer to the following embodiments.

[0121] See also Figure 4 The abnormal text message determination device 400 provided in the embodiment of the present application includes:

[0122] The acquisition module 410 is used to acquire the target SMS;

[0123] A word segmentation module 420 is used to segment the target short message to obtain at least one target word and at least one index ID of the target word, wherein the index ID of the at least one target word is determined according to a word segmentation table, and the word segmentation table includes relationship information between the word and the index ID;

[0124] A determination module 430, configured to input the index ID of at least one target word into a text fingerprint extractor, perform feature extraction on the index ID of at least one target word, and determine a fingerprint vector of a target SMS;

[0125] A generating module 440, configured to randomly generate a mapping vector of a target dimension according to the dimension of the fingerprint vector of the target SMS and a preset dimension, wherein the mapping vector obeys a normal distribution;

[0126] The determination module 430 is further used to determine the encoding vector of the target SMS according to the product of the fingerprint vector of the target SMS and the mapping vector, and the preset functional relationship information;

[0127] The determination module 430 is further used to compare the coding vector of the target SMS with the coding vectors of multiple abnormal sample classes, and determine that the target SMS is abnormal when the coding vector of the target SMS is the same as the coding vector of the target abnormal sample class.

[0128] Based on this, in some embodiments, the determination module 430 may also be used to:

[0129] When the encoding vector of the target SMS is the same as the encoding vector of the target abnormal sample class, the edit distance between the target SMS and the SMS in the target abnormal sample class is calculated;

[0130] When all edit distances are smaller than a preset threshold, the target text message is determined to be abnormal.

[0131] Based on this, in some embodiments, the apparatus 400 may further include:

[0132] A calculation module, used for calculating the average value of the edit distance before determining that the target SMS message is abnormal when all the edit distances are less than a preset threshold;

[0133] The determination module 430 may also be used to:

[0134] When the average value is less than the preset threshold, the target SMS is determined to be abnormal.

[0135] Based on this, in some embodiments, the apparatus 400 may further include:

[0136] The determination module 430 is further configured to determine that the target SMS is normal when the average value is not less than a preset threshold.

[0137] Based on this, in some embodiments, the apparatus 400 may further include:

[0138] The acquisition module 410 is further used to acquire a first sample and a second sample before acquiring the target SMS, wherein the first sample includes a normal SMS and the second sample includes an abnormal SMS;

[0139] The word segmentation module 420 is further used to perform word segmentation on the first sample and the second sample to obtain a word segmentation table, where the word segmentation table includes at least one word and at least one word index ID;

[0140] The determination module 430 is also used to input the index ID of at least one word into the initial text fingerprint extractor, train the initial text fingerprint extractor using the index ID of at least one word, perform feature extraction on the index ID of at least one word, determine the fingerprint vectors of the first sample and the second sample, and obtain the text fingerprint extractor.

[0141] Based on this, in some embodiments, the apparatus 400 may further include:

[0142] The generating module 440 is further used to randomly generate a sample mapping vector of the target dimension according to the dimension of the fingerprint vector of the second sample and the preset dimension before comparing the encoding vector of the target SMS with the encoding vectors of the multiple abnormal sample classes, wherein the sample mapping vector obeys a normal distribution;

[0143] The determination module 430 is further configured to determine the sample encoding vector of the second sample according to the product of the fingerprint vector of the second sample and the sample mapping vector, and the preset functional relationship information;

[0144] The division module is used to divide the second samples with the same sample encoding vector into the same category to obtain multiple abnormal sample classes.

[0145] Based on this, in some embodiments, the determination module 430 may also be used to:

[0146] Calculate the product of each second target value in the fingerprint vector of the target SMS and the corresponding third target value in the mapping vector to obtain a plurality of first target values;

[0147] When the first target value is not less than the preset value, the first target value is determined to be the first coding value. When the first target value is less than the preset value, the first target value is determined to be the second coding value to obtain the coding vector of the target SMS.

[0148] The various modules of the device for determining abnormal text messages provided in the embodiment of the present application can implement the functions of the various steps of the method for determining abnormal text messages provided above and achieve the corresponding technical effects, which will not be repeated here for the sake of brevity.

[0149] Based on the same inventive concept, an embodiment of the present application also provides an electronic device.

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

[0151] The electronic device may include a processor 501 and a memory 502 storing computer program instructions.

[0152] Specifically, the processor 501 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.

[0153] The memory 502 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 502 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 502 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 502 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 502 is a non-volatile solid-state memory.

[0154] The memory 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. Therefore, generally, 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 one aspect of the present disclosure.

[0155] The processor 501 implements any one of the methods for determining abnormal text messages in the above embodiments by reading and executing computer program instructions stored in the memory 502 .

[0156] In one example, the electronic device may further include a communication interface 503 and a bus 510. Figure 5 As shown, the processor 501, the memory 502, and the communication interface 503 are connected via a bus 510 and communicate with each other.

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

[0158] The bus 510 includes hardware, software or both, coupling the components of the electronic device to each other. For example, but not limitation, the bus may include an accelerated graphics port (Accelerated Graphics Port, AGP) or other graphics bus, an enhanced industry standard architecture (Extended Industry Standard Architecture, EISA) bus, a front side bus (Front Side Bus, FSB), a hypertransport (Hyper Transport, HT) interconnection, an industry standard architecture (Industry Standard Architecture, ISA) bus, an infinite bandwidth interconnection, a low pin count (Linear Predictive Coding, LPC) bus, a memory bus, a micro channel architecture (MicroChannel Architecture, MCA) bus, a peripheral component interconnect (Peripheral Component Interconnect, PCI) bus, a PCI-Express (Peripheral Component Interconnect-X, PCI-X) bus, a serial advanced technology attachment (Serial Advanced Technology Attachment, SATA) bus, a video electronics standard association local (VESA Local Bus, VLB) bus or other suitable bus or a combination of two or more of these. Where appropriate, the bus 510 may include one or more buses. Although the embodiments of the present application describe and illustrate a specific bus, the present application considers any suitable bus or interconnection. The electronic device can execute the method for determining abnormal text messages in the embodiments of the present invention, thereby implementing the above-mentioned method for determining abnormal text messages.

[0159] In addition, in combination with the method for determining abnormal text messages in the above embodiments, the embodiments of the present application may provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the methods for determining abnormal text messages in the above embodiments is implemented.

[0160] The present application also provides 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 each process of implementing any one of the above-mentioned abnormal text message determination method embodiments.

[0161] 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.

[0162] The functional blocks shown in the structural block diagram described above 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 (Application Specific Integrated Circuit, ASIC), appropriate firmware, plug-in, function card, etc. When implemented in software, the elements of the present application are programs or code segments 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 communication link by a data signal carried in a carrier. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, read-only memory (Read-Only Memory, ROM), flash memory, erasable read-only memory (Erasable ReadOnly Memory, EROM), floppy disks, compact disc read-only memory (Compact Disc Read-Only Memory, CD-ROM), optical discs, hard disks, optical fiber media, radio frequency (Radio Frequency, RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0163] 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.

[0164] 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.

[0165] The above are only specific implementation methods 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 determining abnormal short messages, characterized in that: include: Get the target SMS; Segmenting the target short message to obtain at least one target word and an index ID of the at least one target word, wherein the index ID of the at least one target word is determined according to a segmentation table, and the segmentation table includes relationship information between words and index IDs; Inputting the index ID of the at least one target word into a text fingerprint extractor, performing feature extraction on the index ID of the at least one target word, and determining a fingerprint vector of the target text message; According to the dimension of the fingerprint vector of the target SMS and the preset dimension, a mapping vector of the target dimension is randomly generated, and the mapping vector obeys a normal distribution; Determine the encoding vector of the target text message according to the product of the fingerprint vector of the target text message and the mapping vector, and preset functional relationship information; The encoding vector of the target text message is compared with the encoding vectors of multiple abnormal sample classes, and when the encoding vector of the target text message and the encoding vector of the target abnormal sample class are the same, it is determined that the target text message is abnormal.

2. The method for determining abnormal text messages according to claim 1, characterized in that: The comparing the coding vector of the target text message with the coding vectors of the plurality of abnormal sample classes, and determining that the target text message is abnormal when the coding vector of the target text message and the coding vector of the target abnormal sample class are the same, includes: When the encoding vector of the target text message is the same as the encoding vector of the target abnormal sample class, calculating the edit distance between the target text message and the text messages in the target abnormal sample class; When all the edit distances are smaller than a preset threshold, it is determined that the target short message is abnormal.

3. The method for determining abnormal text messages according to claim 2, characterized in that: When all the edit distances are less than a preset threshold, before determining that the target short message is abnormal, the method further includes: Calculating an average value of the edit distance; When all the edit distances are less than a preset threshold, determining that the target short message is abnormal includes: When the average value is less than a preset threshold, it is determined that the target text message is abnormal.

4. The method for determining abnormal text messages according to claim 3, characterized in that: Also includes: When the average value is not less than a preset threshold, it is determined that the target short message is normal.

5. The method for determining abnormal text messages according to claim 1, characterized in that: Before obtaining the target SMS, the method further includes: Obtaining a first sample and a second sample, wherein the first sample includes normal text messages, and the second sample includes abnormal text messages; Performing word segmentation on the first sample and the second sample to obtain the word segmentation table, wherein the word segmentation table includes at least one word and an index ID of the at least one word; The index ID of the at least one word is input into an initial text fingerprint extractor, the initial text fingerprint extractor is trained using the index ID of the at least one word, feature extraction is performed on the index ID of the at least one word, fingerprint vectors of the first sample and the second sample are determined, and the text fingerprint extractor is obtained.

6. The method for determining abnormal text messages according to claim 5, characterized in that: Before comparing the encoding vector of the target SMS with the encoding vectors of multiple abnormal sample classes, the method further includes: According to the dimension of the fingerprint vector of the second sample and the preset dimension, randomly generating a sample mapping vector of the target dimension, wherein the sample mapping vector obeys a normal distribution; Determining a sample encoding vector of the second sample according to a product of the fingerprint vector of the second sample and the sample mapping vector, and the preset functional relationship information; The second samples with the same sample encoding vector are divided into the same category to obtain multiple abnormal sample categories.

7. The method for determining abnormal text messages according to any one of claims 1 to 6, characterized in that: The encoding vector includes a plurality of first target values; the determining the encoding vector of the target short message according to the product of the fingerprint vector of the target short message and the mapping vector, and the preset functional relationship information, includes: Calculate the product of each second target value in the fingerprint vector of the target short message and the corresponding third target value in the mapping vector to obtain a plurality of first target values; When the first target value is not less than a preset value, the first target value is determined to be a first coding value; when the first target value is less than a preset value, the first target value is determined to be a second coding value, and the coding vector of the target SMS is obtained.

8. A device for determining abnormal short messages, characterized in that: include: The acquisition module is used to obtain the target SMS; A word segmentation module, used to segment the target short message to obtain at least one target word and an index ID of the at least one target word, wherein the index ID of the at least one target word is determined according to a word segmentation table, and the word segmentation table includes relationship information between words and index IDs; A determination module, configured to input the index ID of the at least one target word into a text fingerprint extractor, perform feature extraction on the index ID of the at least one target word, and determine a fingerprint vector of the target SMS; A generating module, used for randomly generating a mapping vector of a target dimension according to the dimension of the fingerprint vector of the target SMS and a preset dimension, wherein the mapping vector obeys a normal distribution; The determination module is further used to determine the encoding vector of the target SMS according to the product of the fingerprint vector of the target SMS and the mapping vector, and the preset functional relationship information; The determination module is further used to compare the encoding vector of the target SMS with the encoding vectors of multiple abnormal sample classes, and determine that the target SMS is abnormal when the encoding vector of the target SMS is the same as the encoding vector of the target abnormal sample class.

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 method for determining an abnormal text message as described in any one of claims 1-6 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 method for determining an abnormal text message according to any one of claims 1 to 6 is implemented.