Junk message intercepting method and device, electronic equipment and computer readable medium

By using the keywords and hash values ​​of historical spam messages in spam message detection combined with large language model to detect messages to be tested, the problem of low detection accuracy and efficiency in the prior art is solved, and higher accuracy and automation are achieved efficiency.

CN119172754AActive Publication Date: 2024-12-20CHINA TELECOM CORP LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411061418.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-02
Publication Date
2024-12-20
Estimated Expiration
2044-08-02

AI Technical Summary

Technical Problem

In the prior art, the accuracy and efficiency of spam message detection is low, it is difficult to balance false alarms and missed alarms, and requires manual analysis and judgment.

Method used

When receiving the message sending request, the text content in the message to be tested is extracted, and the keywords, hash values ​​and large language models of the historical spam message are detected to determine whether the message to be tested is a spam message, thereby intercepting it.

Benefits of technology

By accurately judging spam messages that have appeared in history and spam messages that have not appeared before, the false alarm and missed rate is reduced, and the accuracy and efficiency of detection are improved without manual assistance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119172754A_ABST
    Figure CN119172754A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a junk message intercepting method and device, electronic equipment and a computer readable medium. The method comprises the following steps: when a message sending request is received, obtaining a to-be-tested message in the message sending request; extracting text content in the to-be-tested message; based on the keyword of the historical spam message, the hash value of the historical spam message and a large language model, detecting the text content to determine whether the to-be-detected message is a spam message; and in response to the fact that the to-be-tested message is the junk message, intercepting the to-be-tested message. According to the embodiment, the spam message detection accuracy and efficiency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a method, device, electronic device, and computer-readable medium for intercepting junk messages. Background Art

[0002] With the rapid development of mobile Internet, the problem of spam messages has become increasingly serious, causing many troubles to users. Therefore, it is necessary to detect and intercept spam messages in a timely manner.

[0003] In the prior art, spam detection technology is mainly divided into two methods: rule-based detection and machine learning-based detection. However, due to the diversity of spam forms and insufficient sample size of spam messages, traditional detection methods are difficult to balance false positives and false negatives, and require further manual analysis and judgment, resulting in low accuracy and efficiency of spam detection. Summary of the invention

[0004] The embodiments of the present application provide a method, an apparatus, an electronic device and a computer-readable medium for intercepting junk messages, so as to solve the technical problem of low accuracy and efficiency of junk message detection in the prior art.

[0005] In a first aspect, an embodiment of the present application provides a spam message interception method, the method comprising: upon receiving a message sending request, obtaining a message to be tested in the message sending request; extracting text content in the message to be tested; based on keywords of historical spam messages, hash values ​​of historical spam messages and a large language model, detecting the text content to determine whether the message to be tested is a spam message; in response to the message to be tested being a spam message, intercepting the message to be tested.

[0006] In a second aspect, an embodiment of the present application provides a spam message interception device, which includes: an acquisition unit, used to acquire a message to be tested in the message sending request when a message sending request is received; an extraction unit, used to extract text content in the message to be tested; a detection unit, used to detect the text content based on keywords of historical spam messages, hash values ​​of historical spam messages and a large language model to determine whether the message to be tested is a spam message; and an interception unit, used to intercept the message to be tested in response to the message to be tested being a spam message.

[0007] In a third aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any embodiment of the first aspect.

[0008] In a fourth aspect, an embodiment of the present application provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any embodiment of the first aspect.

[0009] The junk message interception method, device, electronic device and computer-readable medium provided in the embodiment of the present application, when receiving a message sending request, first extract the text content in the message to be tested in the message sending request, and then detect the text content based on the keywords of the historical junk messages, the hash value of the historical junk messages and the large language model to determine whether the message to be tested is a junk message, so as to intercept the message to be tested if it is a junk message. Because it can accurately determine whether the message to be tested is a historical junk message that has appeared in the past based on the keywords and hash values ​​of the historical junk messages, and can more accurately capture the semantic features of the junk text messages based on the large language model, so that it can accurately determine the junk messages that have never appeared in the past, so the above method can deal with the problem of diversified junk message forms, reduce the false alarm rate and missed alarm rate of junk messages, and improve the accuracy of junk message detection. In addition, the above method can update and supplement samples according to the detection results, so as to deal with the problem of insufficient samples and further improve the accuracy of junk message detection. At the same time, no manual auxiliary analysis is required, which improves the efficiency of junk message detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0011] Figure 1 is a flow chart of an embodiment of the junk message blocking method of the present application;

[0012] Figure 2 It is a schematic diagram of an application scenario of the junk message blocking method of the present application;

[0013] Figure 3 It is a structural diagram of an embodiment of a junk message blocking device of the present application;

[0014] Figure 4 It is a schematic diagram of the structure of an electronic device used to implement an embodiment of the present application. DETAILED DESCRIPTION

[0015] All actions to obtain signals, information or data in this application are carried out in compliance with the relevant data protection laws and policies of the country where they are located, and with the authorization given by the owner of the corresponding device.

[0016] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It should also be noted that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.

[0017] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0018] Please refer to Figure 1 , which shows a process 100 of an embodiment of a spam message interception method according to the present application. The spam message interception method can be applied to various electronic devices with data processing functions. For example, the above electronic devices may include but are not limited to cloud servers, physical servers, etc. The execution subject of the spam message interception method may be a processor in the above electronic devices.

[0019] The junk message interception method comprises the following steps:

[0020] Step 101: upon receiving a message sending request, obtaining a message to be tested in the message sending request.

[0021] In this embodiment, the message sending request may include a message to be tested. The message to be tested may be various types of messages, for example, including but not limited to short messages, multimedia messages, instant messaging messages, and the like.

[0022] In some optional implementations of this embodiment, the above-mentioned spam message interception method can be applied to the first SMS center. The above-mentioned message to be tested is a text message. The above-mentioned message sending request is sent by the sending terminal to the first mobile device switching center via the sending end base station, and is sent by the first mobile device switching center to the first SMS center. Among them, the above-mentioned first SMS center is the SMS center (Short Message Service Center, SMSC) of the first operator where the sending terminal is located. The first mobile device switching center is a mobile device switching center (Mobile Switching Center, MSC) maintained by the first operator where the sending terminal is located. In practice, the SMS center is a network element in a mobile communication network, which is responsible for processing and storing short message service (Short Message Service, SMS) messages. The functions of the SMS center include routing, forwarding, storage and backup of SMS. The mobile device switching center is a key component in a traditional mobile phone network, especially in the second generation and third generation networks. The mobile device switching center is responsible for processing the routing and switching of mobile phone calls to ensure that calls can be connected within the network or across networks.

[0023] On this basis, in some optional implementations of this embodiment, in response to the above-mentioned message to be tested being a normal message, the above-mentioned message sending request is sent to a second SMS center, and the above-mentioned message sending request is sent to a second mobile device exchange center through the above-mentioned second SMS center, and the above-mentioned message to be tested is sent to a receiving terminal via a receiving end base station through the above-mentioned second mobile device exchange center; wherein the above-mentioned second SMS center is the SMS center of the second operator where the above-mentioned receiving terminal is located, and the above-mentioned second mobile device exchange center is a mobile device exchange center maintained by the above-mentioned second operator.

[0024] Step 102: extract text content from the message to be tested.

[0025] In this embodiment, the execution subject may extract the text content in the message to be tested by using a corresponding text extraction technology based on the type of the message to be tested.

[0026] In some optional implementations of the present embodiment, the above-mentioned extracting text content in the message to be tested may specifically include: when the message to be tested contains text, extracting the text; when the message to be tested contains an image, extracting text information from the image by using optical character recognition (OCR) technology; and splicing the text and the text information to generate the text content of the message to be tested.

[0027] When extracting text information from an image by optical character recognition technology, specifically, the image brightness can be first detected, and the dark and light patterns of multiple areas of the image can be detected to determine the character shape. Afterwards, the character shape can be translated into computer text using a character recognition method (such as a European space comparison method, a dynamic program comparison method, a neural network-based character comparison method, etc.). In this way, the text information in the image can be obtained.

[0028] It should be noted that if the above-mentioned message to be tested includes a video, optical character recognition technology can be used to extract text information from each video frame, and the extracted text information can be deduplicated to obtain the text content of the message to be tested.

[0029] By adopting the above method, when the message to be tested has different types of content, the text in each type of content can be completely extracted, thereby obtaining the complete text content in the message to be tested, thereby improving the comprehensiveness and completeness of text content extraction and helping to improve the accuracy of spam message detection.

[0030] Step 103: Based on the keywords of historical spam messages, the hash values ​​of historical spam messages and the large language model, the text content is detected to determine whether the message to be tested is a spam message.

[0031] In this embodiment, historical junk messages may include but are not limited to junk messages detected in a set historical period (e.g., within the last 1 year, within the last 3 years, within the last month) by various means. Historical junk messages may include multiple messages. The content of historical junk messages may include but are not limited to promotional information, sensitive information, etc.

[0032] In this embodiment, for each historical spam message, the execution subject can match the historical spam message with the text content based on the keywords of the historical spam message to obtain a detection result, which can characterize the text matching degree between the text content and the historical spam message. At the same time, the hash value of the historical spam message can be matched with the hash value of the text content to obtain a second detection result, which can characterize the similarity between the text content and the historical spam message. At the same time, the text content can also be input into the large language model to obtain a third detection result output by the large language model. Then, combining the three detection results, it is comprehensively determined whether the message to be tested is a spam message.

[0033] Among them, the above-mentioned hash value can be calculated using a hash algorithm. The above-mentioned large language model (LLM) is a deep learning model trained based on massive text data. It can not only generate natural language text, but also deeply understand the meaning of the text and handle various natural language tasks, such as text summarization, question and answer, translation, etc. In practical applications, the above-mentioned large language model can be trained based on an existing language model, or it can be trained using a self-developed language model, which is not specifically limited here. As an example, the large language model can adopt models such as ChatGPT (Chat Generative Pre-trained Transformer). Compared with traditional classifiers, the use of large prophecy models can improve the ability to understand and generate natural language, thereby improving the accuracy of spam detection.

[0034] In some optional implementations of the present embodiment, the hash values ​​of the above text content and historical spam messages and the similarities determined based on the hash values ​​can be calculated by SSDeep (Similarity Digest Algorithm). SSDeep can be used to compare and identify the similarity of files. Based on the sliding window technology, SSDeep can divide the file into multiple fixed-size blocks, calculate a local hash value for each block, and connect these local hash values ​​to form a global hash value for the file. For each historical spam message, the hash value of the historical spam message is the global hash value calculated by SSDeep for the historical spam message. Unlike traditional hash algorithms, SSDeep can tolerate a certain degree of modification and change in the file, making the detection of spam messages more accurate.

[0035] In some optional implementations of this embodiment, the above step 103 specifically includes the following steps:

[0036] The first step is to generate a regular expression based on the keywords of historical spam messages, and then perform regular matching on the text content based on the regular expression to obtain the regular matching result (which can be recorded as R r ). In actual applications, a regular expression can be generated based on the keywords of each historical spam message. The text content of the message to be tested can be matched based on the regular expressions of each historical spam message. If any regular expression is matched, the regular matching result can be 1; if no regular expression is matched, the regular matching result can be 0.

[0037] The second step is to determine the hash value of the text content. Based on the hash value of the text content and the hash value of the historical spam messages, the maximum similarity between the text content and the historical spam messages is determined (which can be recorded as R s ). In practical applications, the hash value of the text content of the message to be tested can be used to calculate the similarity with the hash value of each historical spam message, so as to select the maximum value of the similarity calculation result as the maximum similarity. In practical applications, the above SSDeep algorithm can be used to calculate the hash value and similarity.

[0038] The third step is to generate model input information based on the text content and the preset scoring rules, and input the model input information into the large language model to obtain the first score of the text content (which can be recorded as R l ).

[0039] As an example, the model input information can be as follows:

[0040] You are now an experienced spam detection expert. Now I will provide you with a message to be tested, and you need to give me a conclusion whether the message to be tested is a spam message. You need to score the content to be tested, ranging from 0-10 points. If it is specifically determined to be a spam message, the score is 10 points, and if it is determined not to be a spam message, it is 0 points. For a non-spam message, the output example is as follows: {"level":0,"description":"Not a spam message, normal message content"}. For a spam message, the output example is as follows: {"level":10,"description":"It is a spam message, and the judgment basis is ${answer}"}. The content of the message to be tested is: ${content}.

[0041] It should be noted that the large language model can be pre-trained based on historical junk messages to learn the characteristics of historical junk messages, so as to accurately determine whether the message to be tested is a junk message.

[0042] The fourth step is to determine whether the message to be tested is a spam message based on the regular matching result, the maximum similarity and the first score.

[0043] Optionally, the following steps may be performed: First, determine the average value of the regular matching result and the maximum similarity (ie, (R r +R s ) / 2); Then, the first score is normalized to obtain the second score (i.e., R l / 10); then, the average value and the second score are weighted and summed to obtain the third score; finally, based on the third score and the preset threshold (which can be recorded as R t ), determine whether the message to be tested is a spam message. The third score calculation formula is as follows:

[0044]

[0045] Wherein, D is a balance parameter, i.e., a weight coefficient, which can be set as needed. As an example, its default value can be set to 0.4.

[0046] The above preset threshold can be set as needed, for example, it can be set to 0.8. t , then the message to be tested can be determined to be a spam message; otherwise, if R≤R t , it can be determined that the above-mentioned message to be tested is a normal message.

[0047] Step 104: In response to the message to be tested being a spam message, the message to be tested is intercepted.

[0048] In this embodiment, in response to the message to be tested being a spam message, the execution subject may intercept the message to be tested, thereby providing a purer communication environment for the user.

[0049] In some optional implementations of this embodiment, after the message to be tested is intercepted, the text content can also be recorded as a historical spam message, and the keywords and hash values ​​of the text content can be stored. Thus, the historical spam messages can be updated in real time, the sample size and effectiveness of the historical spam messages are increased, and thus the effectiveness and accuracy of spam message detection are improved.

[0050] The following describes this solution using a specific application scenario as an example. Figure 2 , the embodiments of the present application can be applied to the SMS sending scenario, the messages of the embodiments of the present application can all be SMS, and the execution subject can be the SMS center (i.e., the first SMS center) of the operator where the sending terminal (i.e., the terminal sending the SMS) is located. First, the sending terminal sends a message sending request to the sending end base station. Then, the sending end base station sends the message sending request to the first mobile device exchange center maintained by the first operator where the sending terminal is located. After that, the first mobile device exchange center forwards the message sending request to the first SMS center of the first operator. The first SMS center first extracts the text content from the SMS in the message sending request, and then detects the text content based on the keywords of the historical spam SMS, the hash value of the historical spam SMS, and the large language model to determine whether the SMS is a spam message. If it is a spam SMS, it is intercepted and its relevant information is recorded. On the contrary, if it is a normal SMS, the message sending request is passed to the second SMS center of the second operator where the receiving terminal (i.e., the terminal receiving the SMS) is located. After receiving the message sending request in the second SMS, the SMS can be sent to the second mobile device exchange center maintained by the second operator, and then the SMS is sent to the receiving terminal via the receiving end base station.

[0051] The method provided by the above embodiment of the present application, when receiving a message sending request, first extracts the text content in the message to be tested in the message sending request, and then detects the text content based on the keywords of historical spam messages, the hash values ​​of historical spam messages and the large language model to determine whether the message to be tested is a spam message, so as to intercept the message to be tested if it is a spam message. Because based on the keywords and hash values ​​of historical spam messages, it is possible to accurately determine whether the message to be tested is a historical spam message that has appeared in the past, and based on the large language model, it is possible to more accurately capture the semantic features of spam text messages, so that spam messages that have never appeared in the past can be accurately determined. Therefore, the above method can cope with the problem of diversified forms of spam messages, reduce the false alarm rate and missed alarm rate of spam messages, and improve the accuracy of spam message detection. In addition, the above method can update and supplement samples according to the detection results, thereby coping with the problem of insufficient samples and further improving the accuracy of spam message detection. At the same time, no manual auxiliary analysis is required, which improves the efficiency of spam message detection.

[0052] Further references Figure 3 As an implementation of the methods shown in the figures, the present application provides an embodiment of a junk message interception device. Figure 1 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0053] like Figure 3 As shown, the spam message interception device 300 of this embodiment includes: an acquisition unit 301, which is used to acquire the message to be tested in the message sending request when receiving the message sending request; an extraction unit 302, which is used to extract the text content in the message to be tested; a detection unit 303, which is used to detect the text content based on the keywords of the historical spam messages, the hash values ​​of the historical spam messages and the large language model to determine whether the message to be tested is a spam message; an interception unit 304, which is used to intercept the message to be tested in response to the message to be tested being a spam message.

[0054] In some optional implementations of this embodiment, the extraction unit 302 is further used to: extract the text when the message to be tested contains text; extract text information from the image by optical character recognition technology when the message to be tested contains an image; and splice the text and the text information to generate the text content of the message to be tested.

[0055] In some optional implementations of this embodiment, the detection unit 303 is further used to: generate a regular expression based on keywords of historical spam messages, perform regular matching on the text content based on the regular expression, and obtain a regular matching result; determine a hash value of the text content, and determine the maximum similarity between the text content and the historical spam messages based on the hash value of the text content and the hash value of the historical spam messages; generate model input information based on the text content and a preset scoring rule, and input the model input information into a large language model to obtain a first score for the text content; and determine whether the message to be tested is a spam message based on the regular matching result, the maximum similarity, and the first score.

[0056] In some optional implementations of this embodiment, the detection unit 303 is further used to: determine the average value of the regular matching result and the maximum similarity; normalize the first score to obtain a second score; perform weighted summation of the average value and the second score to obtain a third score; and determine whether the message to be tested is a spam message based on the third score and a preset threshold.

[0057] In some optional implementations of this embodiment, the device further includes a storage unit, which is used to record the text content as a historical spam message after intercepting the message to be tested, and store keywords and hash values ​​of the text content.

[0058] In some optional implementations of this embodiment, the method is applied to a first SMS center; the message to be tested is a SMS; the message sending request is sent by a sending terminal to a first mobile device exchange center via a sending base station, and is sent by the first mobile device exchange center to the first SMS center; wherein the first SMS center is the SMS center of a first operator where the sending terminal is located, and the first mobile device exchange center is a mobile device exchange center maintained by the first operator.

[0059] In some optional implementations of this embodiment, the device also includes a sending unit, which is used to: in response to the message to be tested being a normal message, send the message sending request to a second SMS center, send the message sending request to a second mobile device exchange center through the second SMS center, and send the message to be tested to a receiving terminal via a receiving end base station through the second mobile device exchange center; wherein the second SMS center is the SMS center of the second operator where the receiving terminal is located, and the second mobile device exchange center is a mobile device exchange center maintained by the second operator.

[0060] The device provided by the embodiment of the present application, when receiving a message sending request, first extracts the text content in the message to be tested in the message sending request, and then detects the text content based on the keywords of historical spam messages, the hash values ​​of historical spam messages and the large language model to determine whether the message to be tested is a spam message, so as to intercept the message to be tested if it is a spam message. Since it can accurately determine whether the message to be tested is a historical spam message that has appeared in the past based on the keywords and hash values ​​of historical spam messages, and can more accurately capture the semantic features of spam text messages based on the large language model, it can accurately determine spam messages that have never appeared in the past. Therefore, the method can cope with the problem of diversified forms of spam messages, reduce the false alarm rate and missed alarm rate of spam messages, and improve the accuracy of spam message detection. In addition, the method can update and supplement samples according to the detection results, thereby coping with the problem of insufficient samples and further improving the accuracy of spam message detection. At the same time, no manual auxiliary analysis is required, which improves the efficiency of spam message detection.

[0061] Reference below Figure 4 , which shows a schematic structural diagram of an electronic device for implementing some embodiments of the present application. Figure 4The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0062] like Figure 4 As shown, the electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the electronic device 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0063] Typically, the following devices may be connected to the I / O interface 405: an input device 406 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 408 including, for example, a disk, a hard disk, etc.; and a communication device 409. The communication device 409 may allow the electronic device 400 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The electronic device 400 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 4 Each block shown in the figure may represent one device, or may represent multiple devices as required.

[0064] In particular, according to some embodiments of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, some embodiments of the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from the network through the communication device 409, or installed from the storage device 408, or installed from the ROM 402. When the computer program is executed by the processing device 401, the above-mentioned functions defined in the method of some embodiments of the present application are executed.

[0065] It should be noted that the computer-readable medium described in some embodiments of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In some embodiments of the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In some embodiments of the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0066] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0067] The computer-readable medium may be included in the electronic device; or it may exist independently without being installed in the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: upon receiving a message sending request, obtains the message to be tested in the message sending request; extracts the text content in the message to be tested; detects the text content based on the keywords of historical spam messages, the hash values ​​of historical spam messages, and the large language model to determine whether the message to be tested is a spam message; and intercepts the message to be tested in response to the message to be tested being a spam message.

[0068] Computer program code for performing the operations of some embodiments of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++; and also conventional procedural programming languages ​​such as "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, or may be connected to an external computer (e.g., through the Internet using an Internet service provider), including a local area network (LAN) or a wide area network (WAN).

[0069] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0070] The units described in some embodiments of the present application may be implemented by software or hardware. The units described may also be set in a processor, for example, it may be described as: a processor includes a first determination unit, a second determination unit, a selection unit, and a third determination unit. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0071] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0072] The above description is only some preferred embodiments of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present application is not limited to the technical solutions formed by the specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above invention concept. For example, the above features are replaced with (but not limited to) the technical features with similar functions disclosed in the embodiments of the present application to form a technical solution.

Claims

1. A method for intercepting junk messages, characterized in that: The method comprises: When receiving a message sending request, obtaining the message to be tested in the message sending request; Extracting text content from the message to be tested; Based on the keywords of historical spam messages, the hash values ​​of historical spam messages and the large language model, the text content is detected to determine whether the message to be tested is a spam message; In response to the message to be tested being a spam message, the message to be tested is intercepted.

2. The method according to claim 1, characterized in that The extracting text content from the message to be tested includes: In the case where the message to be tested contains text, extracting the text; In the case where the message to be tested includes an image, extracting text information from the image by optical character recognition technology; The text and the text information are concatenated to generate the text content of the message to be tested.

3. The method according to claim 1, characterized in that The detecting of the text content based on the keywords of the historical spam messages, the hash values ​​of the historical spam messages and the large language model to determine whether the message to be tested is a spam message includes: Generate a regular expression based on the keywords of the historical spam messages, and perform regular matching on the text content based on the regular expression to obtain a regular matching result; Determine a hash value of the text content, and determine a maximum similarity between the text content and the historical spam messages based on the hash value of the text content and the hash value of the historical spam messages; Generate model input information based on the text content and a preset scoring rule, and input the model input information into a large language model to obtain a first score for the text content; Based on the regular matching result, the maximum similarity and the first score, it is determined whether the message to be tested is a spam message.

4. The method according to claim 3, characterized in that The determining whether the message to be tested is a spam message based on the regular matching result, the maximum similarity and the first score includes: Determine an average value of the regular matching result and the maximum similarity; Normalizing the first score to obtain a second score; Performing a weighted summation on the average value and the second score to obtain a third score; Based on the third score and a preset threshold, it is determined whether the message to be tested is a spam message.

5. The method according to claim 3, characterized in that: After intercepting the message to be tested, the method further includes: The text content is recorded as a historical junk message, and the keywords and hash values ​​of the text content are stored.

6. The method according to any one of claims 1 to 5, characterized in that: The method is applied to a first SMS center; the message to be tested is a SMS; the message sending request is sent by a sending terminal to a first mobile device switching center via a sending end base station, and is sent by the first mobile device switching center to the first SMS center; The first SMS center is a SMS center of a first operator where the sending terminal is located, and the first mobile equipment exchange center is a mobile equipment exchange center maintained by the first operator.

7. The method according to claim 6, characterized in that The method further comprises: In response to the message to be tested being a normal message, sending the message sending request to a second SMS center, sending the message sending request to a second mobile device switching center through the second SMS center, and sending the message to be tested to a receiving terminal via a receiving end base station through the second mobile device switching center; The second SMS center is a SMS center of a second operator where the receiving terminal is located, and the second mobile equipment exchange center is a mobile equipment exchange center maintained by the second operator.

8. A junk message interception device, characterized in that: The device comprises: An acquiring unit, configured to acquire the message to be tested in the message sending request when receiving the message sending request; An extraction unit, used to extract text content from the message to be tested; A detection unit, configured to detect the text content based on keywords of historical spam messages, hash values ​​of historical spam messages, and a large language model to determine whether the message to be tested is a spam message; The interception unit is used for intercepting the message to be tested in response to the message to be tested being a spam message.

9. An electronic device, characterized in that: include: one or more processors; a storage device having one or more programs stored thereon, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

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

Citation Information

Patent Citations

  • Method for recognizing junk short messages, client, cloud server and system

    CN106162584A

  • Network security system and method based on information identification

    CN113887207A

  • Information identification method and device

    CN114282097A

  • Network traffic interception method and device and computer readable storage medium

    CN115994281A

  • Sensitive word auditing method based on large language model, storage medium and electronic equipment

    CN116720515A