CN113382372B - Short message management and control method and device - Google Patents

Short message management and control method and device Download PDF

Info

Publication number
CN113382372B
CN113382372B CN202010162813.6A CN202010162813A CN113382372B CN 113382372 B CN113382372 B CN 113382372B CN 202010162813 A CN202010162813 A CN 202010162813A CN 113382372 B CN113382372 B CN 113382372B
Authority
CN
China
Prior art keywords
short message
time period
receiving
message receiving
sub
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010162813.6A
Other languages
Chinese (zh)
Other versions
CN113382372A (en
Inventor
王浩
张鸷
李晓静
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Group Liaoning Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Group Liaoning Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile Group Liaoning Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202010162813.6A priority Critical patent/CN113382372B/en
Publication of CN113382372A publication Critical patent/CN113382372A/en
Application granted granted Critical
Publication of CN113382372B publication Critical patent/CN113382372B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/12Messaging; Mailboxes; Announcements
    • H04W4/14Short messaging services, e.g. short message services [SMS] or unstructured supplementary service data [USSD]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The embodiment of the invention relates to the technical field of communication, and discloses a short message control method and a device, wherein the method comprises the following steps: receiving a short message sent by a gateway; counting the short message receiving quantity of the called number corresponding to the short message in a preset time period; if the short message receiving amount exceeds a threshold value, sending alarm information to a corresponding terminal user to prompt that the risk of short message bombing exists at present; and if receiving an interception starting instruction of the terminal user, sending the current cached short message based on a preset white list. By the method, before the short message is sent to the terminal user, the short message receiving amount of the called number in the preset time period is automatically counted, if the short message receiving amount exceeds the threshold value, alarm information is sent to the terminal user to prompt that the current risk of short message bombing is possible, the corresponding short message is intercepted when the interception indication of the user is obtained, the management and control efficiency is high, and the actual demand of the user is met.

Description

Short message management and control method and device
Technical Field
The embodiment of the invention relates to the technical field of communication, in particular to a short message management and control method and a short message management and control device.
Background
With the development of mobile internet, a mobile phone number is used as an important identity of a user, and plays an important role in the fields of network application, identity authentication and the like. In particular, in the field of authentication, the frequency of use has far exceeded the document ID such as an identification card, a passport number, and the like. However, with the increasing importance of mobile phone numbers and short messages, the harassment means for users are also changing, wherein the short messages are bombed by using the verification codes, which seriously affects the normal life of users and becomes a social problem. This brings inconvenience to the user and also challenges to information security management and control.
In the prior art, a short message bomb management and control method is that each user can configure a specific strategy according to the own requirements, for example, a user-defined white list strategy, and when bombed by a short message, a caller stops issuing the short message which is not in the white list, so that the effect of short message filtering is achieved. The calling white list is defined by the user through short messages or apps and the like. However, in this way, a user usually wants to start the monitoring function of the short message bomb only when the user is bombed by the short message bomb, and at this time, the mobile phone of the user may be in a stuck or down state, and the short message bomb monitoring cannot be started by means of short messages, manual customer service, apps and the like, so that the management and control method is lagged, and a white list is edited manually by the user, so that a number setting error or incomplete list may occur, some important short messages may be blocked by mistake, and the like, which cannot meet the actual requirements of the user, and the management and control efficiency is not high.
Disclosure of Invention
In view of the foregoing problems, embodiments of the present invention provide a method and an apparatus for managing and controlling a short message, which overcome the foregoing problems or at least partially solve the foregoing problems.
According to an aspect of an embodiment of the present invention, a method for managing and controlling short messages is provided, the method including: receiving a short message sent by a gateway; counting the short message receiving quantity of the called number corresponding to the short message in a preset time period; if the short message receiving amount exceeds a threshold value, sending alarm information to a corresponding terminal user to prompt that the risk of short message bombing exists at present; and if receiving an interception starting instruction of the terminal user, sending the currently cached short message based on a preset white list.
In an optional manner, before receiving the short message sent by the gateway, the method further includes: and constructing a data structure to record the short message receiving amount, wherein the data structure comprises two self-balancing binary search trees, one self-balancing binary search tree is a counting tree, and the other self-balancing binary search tree is a timing tree.
In an optional manner, the counting a short message receiving amount of a called number corresponding to the short message in a preset time period includes: updating the two self-balancing binary search trees based on the received short message; and counting the short message receiving amount of the called number in the preset time period based on the two updated self-balancing binary search trees.
In an optional manner, the preset time period includes a plurality of consecutive sub-time periods, the receiving time point of the short message intersects with the last time period of the preset time period, and the count tree includes: counting node, count group, counting node carries the called number, count group includes: the short message receiving amount of the sub-time period and the receiving time point of the last short message in the preset time period; the timing tree includes: a timing node and a timing array, wherein the timing node carries the called number and a receiving time point of the last short message in the preset time period, the lengths of any two sub-time periods are equal, and the updating of the two self-balancing binary search trees based on the received short messages comprises the following steps: analyzing whether the called number exists in the counting tree or not; if the short message exists, updating the node corresponding to the called number based on the currently received short message; and if not, establishing a corresponding node and inserting the node into the self-balancing binary search tree.
In an optional manner, the updating the node corresponding to the called number based on the currently received short message includes: judging whether the receiving time point of the last short message of the called number and the receiving time point of the current short message are in the same sub-time period; if yes, adding 1 to the short message receiving quantity of the sub-time period, and updating a corresponding timing node based on the receiving time point of the current short message; if not, the short message receiving amount of the sub-time period is changed into 1, and the corresponding timing node is updated based on the receiving time point of the current short message.
In an optional manner, the preset time period includes a first time period, a second time period, and a third time period, where the first time period, the second time period, and the third time period all use a receiving time point of the short message as an end point, the first time period is shorter than the second time period, the second time period is shorter than the third time period, the first time period is equal to the sub-time periods, the third time period is equal to the sum of the sub-time periods, and the statistics on the short message receiving amount of the called number in the preset time period based on the updated self-balancing binary search tree includes: acquiring the short message receiving quantity of the sub-time period of the short message, and taking the short message receiving quantity as the short message receiving quantity of the first time period; counting the short message receiving amount of the second time period based on a preset formula; and summing the short message receiving quantity of each sub-time period to obtain the short message receiving quantity of the third time period.
In an optional manner, after counting the short message receiving amount of the called number corresponding to the short message in a preset time period, the method further includes: judging whether the short message receiving amount of the first time period is greater than or equal to a first threshold value; if the short message receiving amount in the first time period is larger than or equal to the first threshold, turning to a step of sending alarm information to a corresponding terminal user to prompt that the risk of short message bombing exists currently; if the short message receiving amount in the first time period is smaller than the first threshold, judging whether the short message receiving amount in the second time period is larger than or equal to a second threshold; if the short message receiving amount in the second time period is larger than or equal to the second threshold value, turning to a step of sending alarm information to a corresponding terminal user to prompt that the risk of short message bombing currently exists; if the short message receiving amount in the second time period is smaller than the second threshold, judging whether the short message receiving amount in the third time period is larger than or equal to a third threshold; and if the short message receiving amount in the third time period is larger than or equal to the third threshold, turning to a step of sending alarm information to a corresponding terminal user to prompt that the risk of short message bombing exists currently, wherein the first threshold is smaller than the second threshold, and the second threshold is smaller than the third threshold.
In an optional manner, the counting, based on the updated self-balancing binary search tree, a short message reception amount of the called number in the preset time period includes: acquiring the short message receiving quantity of each sub-time period of a preset time period; summing the acquired short message receiving quantity of each sub-time period to obtain the short message receiving quantity of the preset time period; after counting the short message receiving quantity of the called number corresponding to the short message in a preset time period, the method further comprises the following steps: judging whether the short message receiving amount in a preset time period is greater than or equal to an alarm threshold value or not; and if the short message receiving amount in the preset time period is larger than or equal to an alarm threshold, sending alarm information to a corresponding terminal user to prompt that the risk of short message bombing exists currently.
According to another aspect of the embodiments of the present invention, a short message management and control apparatus is provided, including: the receiving module is used for receiving the short message sent by the gateway; the counting module is used for counting the short message receiving quantity of the called number corresponding to the short message in a preset time period, wherein the preset time period takes the receiving time point of the short message as an end point; the prompting module is used for sending alarm information to a corresponding terminal user to prompt that the risk of short message bombing exists currently if the short message receiving amount exceeds a threshold value; and the control module is used for sending the currently cached short message based on a preset white list if the starting interception instruction of the terminal user is received.
According to another aspect of the embodiments of the present invention, there is provided an apparatus, including: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the steps of the short message management and control method.
According to another aspect of the embodiment of the present invention, a computer storage medium is provided, where at least one executable instruction is stored in the storage medium, and the executable instruction causes the processor to execute the steps of the short message management and control method.
In the embodiment of the invention, before the short message is sent to the terminal user, the short message receiving amount of the called number in the preset time period is automatically counted, if the short message receiving amount exceeds the threshold value, an alarm message is sent to the terminal user to prompt that the current risk of short message bombing is possible, and the corresponding short message is intercepted when the interception indication of the user is obtained, so that the management and control efficiency is high, and the actual requirement of the user is met.
The foregoing description is only an overview of the technical solutions of the embodiments of the present invention, and the embodiments of the present invention can be implemented according to the content of the description in order to make the technical means of the embodiments of the present invention more clearly understood, and the detailed description of the present invention is provided below in order to make the foregoing and other objects, features, and advantages of the embodiments of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a schematic flow chart illustrating a short message management and control method according to a first embodiment of the present invention;
fig. 2 is a schematic flowchart illustrating a specific flow of step S2 of the short message management and control method according to the first embodiment of the present invention;
fig. 3 is a schematic structural diagram of a short message management and control apparatus according to a second embodiment of the present invention;
fig. 4 shows a schematic structural diagram of an apparatus according to a fourth embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
Fig. 1 is a schematic flowchart illustrating a short message management and control method according to a first embodiment of the present invention. As shown in fig. 1, the method for managing and controlling short messages includes:
step S1, receiving a short message sent by a gateway;
specifically, receiving a short message sent by a gateway, and recording a receiving time point;
step S2, counting the short message receiving quantity of the called number corresponding to the short message in a preset time period;
specifically, according to the called number corresponding to the short message, the short message receiving amount of the called number in a preset time period before the current time point is counted. The preset time period refers to a time period calculated before the current time point is taken as an end point, and the preset time period may be 1 minute, 2 minutes, 3 minutes, 5 minutes, and the like, and may be set according to actual situations, which is not limited herein.
Step S3, if the short message receiving quantity exceeds the threshold value, sending alarm information to the corresponding terminal user to prompt that the risk of short message bombing exists currently;
specifically, if the counted short message receiving amount exceeds the threshold, sending alarm information to the corresponding terminal user, that is, sending alarm information to the user terminal user of the called number, so as to prompt the risk that a short message may be bombed currently, and inquiring whether the terminal user intercepts the short message. After receiving the alarm information, the terminal user can feed back the information according to the actual situation, if the user considers that the interception is not necessary, the terminal user feeds back the information of no, and if the user considers that the interception is necessary, the terminal user feeds back the information of yes. It should be noted that after the alarm information is sent, a period of time (for example, 30 seconds) needs to be waited, if no feedback of the terminal user is received after waiting for the period of time, the interception is abandoned by the terminal user by default, and the threshold value is related to the preset time period, if the preset time period is 3 minutes, the corresponding threshold values are 40, if the preset time period is 1 minute, the corresponding threshold values are 20, and if the preset time period is 5 minutes, the corresponding threshold values are 60. It should be noted that, if the short message receiving amount exceeds the threshold, which indicates that the problem of short message bombing may occur, the short message caching function is automatically started to cache the received short message until the feedback of the user is received.
Step S4, if an interception starting instruction of a terminal user is received, sending a current cached short message based on a preset white list;
specifically, if an interception start instruction of the terminal user is received, the short message cached currently can be issued based on a preset white list, that is, matching screening is performed according to the white list and the short message cached currently, the cached short message matched with the number in the white list is issued to the terminal user, and the short message unmatched with the number in the white list is not sent to the terminal user.
In an implementation manner of this embodiment, if a non-start interception instruction of a terminal user is received, which indicates that short messages do not need to be intercepted, the currently cached short messages are sent to the terminal user.
In this embodiment, before sending the short message to the terminal user, the short message receiving amount of the called number in a preset time period is automatically counted, if the short message receiving amount exceeds a threshold, an alarm message is sent to the terminal user to prompt that the terminal user is at a risk of short message bombing currently, and the corresponding short message is intercepted when an interception instruction of the user is obtained, so that the management and control efficiency is high, and the actual requirement of the user is met.
In an implementation manner of this embodiment, before the step S1, the method further includes:
constructing a data structure to record the short message receiving amount;
specifically, a data structure is first constructed for recording the short message receiving amount, the data structure includes two self-balancing binary search trees (AVLs), which are a count tree and a timing tree, respectively, and the count tree and the timing tree are correspondingly configured as if the information of a called number in the count tree and the information in the timing tree are at the same height, and for example, the count information of the called number is stored in the count tree and the timing information is stored in the timing tree. The data structure stores the short message information of a plurality of called numbers, and the short message management and control mode of each called number adopts the execution mode of the steps.
The count tree includes: counting node, counting group, this counting node carries called number, and regards this called number as KEY, and this counting group includes: the received amount of the short message in each sub-period of the preset time period and the received time point of the last short message in the preset time period, for example, 5 minutes is used as the preset time period, that is, the received amount of the short message is periodically recorded in a time length of 5 minutes, and the count group records the received amount of the short message in each minute of the 5 minutes and the received time point of the last short message in the 5 minutes. And in the next 5 minutes, recording the short message receiving amount of the called number in each minute in the next 5 minutes and the receiving time point of the last short message again.
The timing tree includes: the timing node carries a called number and a receiving time point of the last short message in a preset time period, and the value of the timing array is null. For example, the timing node of the called number takes the called number and the receiving time point of the last short message in a preset time period as KEY, and the VALUE of the timing array (VALUE) is null.
In a preferable aspect of this embodiment, the method further includes:
and if the difference value between the current time point and the receiving time point of the last short message is greater than a preset time value, deleting nodes corresponding to the called number in the timing tree and the counting tree.
Specifically, if the difference between the current time point and the time point of receiving the last short message is greater than a preset time value, the node corresponding to the called number in the timing tree and the counting tree is deleted, where the preset time value may be set according to an actual situation, for example, 5 minutes, or another value, which is not limited herein. If the short message is not received within 5 minutes, the corresponding node is required to be deleted, and then when the short message is retransmitted, the node is reestablished and counting is carried out again.
In a preferable solution of this embodiment, as shown in fig. 2, the step S2 specifically includes:
step S21, updating two self-balancing binary search trees based on the received short message;
specifically, the two self-balancing binary search trees are updated according to the receiving time point of the short message.
Step S22, counting the short message receiving quantity of the called number in the preset time period based on the two updated self-balancing binary search trees;
specifically, the short message receiving amount of the called number in the preset time period is counted according to the updated self-balancing binary search tree, and for example, the short message receiving amount of the called number in the preset time period is counted according to the information recorded by the self-balancing binary search tree.
In a preferable scheme of this embodiment, the step S21 specifically includes:
analyzing whether the called number exists in a counting tree or not;
specifically, since the count tree includes: count node, count group, count node carries called number, count group includes: if the counting node takes the called number as the KEY, the counting node only needs to search the counting tree to know whether the called number exists in the counting tree, and if the called number has a short message record, the counting node directly searches the counting tree to know whether the called number exists in the data structure, so that the processing efficiency can be improved.
The timing node carries the called number and the receiving time point of the last short message in the preset time period, the value of the timing array is null, and the lengths of any two sub-time periods are equal. For example, if the preset time period is 5 minutes, the sub-time period is 1 minute, and the time length of 5 minutes has 5 sub-time periods, that is, each 5 minutes is cycled, each minute corresponds to one sub-time period, the count group includes short message reception amount records of 5 sub-time periods, for example, the current time is 12 o ' clock 45 minutes 30 seconds, the preset time period before the time refers to a time period between 12 o ' clock 41 and 12 o ' clock 45 minutes, and the 5 sub-time periods are respectively: 12 o 'clock 41 min 0 sec to 12 o' clock 41 min 59 sec, 12 o 'clock 42 min 0 sec to 12 o' clock 42 min 59 sec, 12 o 'clock 43 min 0 sec to 12 o' clock 43 min 59 sec, 12 o 'clock 44 min 0 sec to 12 o' clock 44 min 59 sec, 12 o 'clock 45 min 0 sec to 12 o' clock 45 min 59 sec, and 12 o 'clock 46 min 0 sec to 12 o' clock 46 min 59 sec to the first sub-period of the next cycle (i.e., a sub-period of the next 5 minutes). It should be noted that the length of the preset time period is an integral multiple of the sub-time period.
If the called number exists in the counting tree, updating a node corresponding to the called number based on the currently received short message;
specifically, if the called number exists in the count tree, it indicates that the short message record information of the called number already exists, and updates the corresponding node based on the currently received short message, so as to update the data such as the receiving time point and the short message receiving amount of the last short message of the called number.
If the called number does not exist in the counting tree, establishing a corresponding node and inserting the node into the self-balancing binary search tree;
specifically, if the called number does not exist in the count tree, a node of the called number needs to be established and inserted into the self-balancing binary search tree, for example, a count node and a timing node are established, the called number is used as a KEY suggestion count node, and the called number and the time point of receiving the short message are used as KEYs and inserted into the timing tree. So as to directly record when the short message sent to the called number is obtained again in the following.
In a preferred embodiment of this embodiment, the process of updating the node corresponding to the called number based on the currently received short message may include:
judging whether the receiving time point of the last short message of the called number and the receiving time point of the current short message are in the same sub-time period;
specifically, it is first to determine whether the receiving time point of the short message and the receiving time point of the previous short message are in the same sub-time period, for example, if the receiving time point of the current short message is 12 points, 30 minutes and 5 seconds, and the receiving time point of the previous short message is 12 points, 29 minutes and 55 seconds, the current short message and the previous short message belong to different sub-time periods; and if the receiving time point of the current short message is 12 o 'clock 29 min 5 s and the receiving time point of the last short message is 12 o' clock 29 min 55 s, it indicates that the two short messages belong to the same sub-time period.
If the two are in the same time period, the operation of adding 1 to the short message receiving amount of the sub-time period is executed, and the corresponding timing node is updated based on the receiving time point of the current short message;
specifically, if the number of the called number is in the same sub-time period, the operation of adding 1 is performed in the short message receiving amount of the sub-time period, for example, the number of the called number currently recorded in the sub-time period is 12, after the short message is received, the short message receiving amount of the sub-time period is 12+1, the data is updated to the count tree, and the receiving time point corresponding to the node of the timing tree is changed to the receiving time point of the current short message. For example, if the first time period is 1 minute and the preset time period is 5 minutes, 5 sub-time periods are included, and 5 integer elements are respectively included, and are respectively numbered as 0, 1, 2, 3, and 4. Firstly, determining a sub-time period of the short message, wherein the receiving time point of the short message is 12 to 11 minutes, and according to a first formula: and idx is the number of minutes of the current short message receiving time point, which is 5%, that is, the remainder is taken from 5 according to the number of minutes (for example, 11) corresponding to the receiving point to obtain 1, and if the sub-time period of the short message is the integer element No. 1, the short message receiving amount corresponding to the integer element is increased by 1.
If the two are not in the same sub-time period, the short message receiving amount of the sub-time period is modified to 1, and the corresponding timing node is updated based on the receiving time point of the current short message;
specifically, if the two messages are not in the same sub-time period, it is indicated that the sub-time period corresponding to the current message needs to be cleared, that is, the message record of the sub-time period is cleared, the currently received message is used as the first received message again (that is, the message receiving amount of the sub-time period is modified to 1), the called number and the receiving time point of the message are used as KEYs, a new timing node is inserted, and the receiving time point of the last message of the count tree is updated, that is, the receiving time point of the current message is updated to the count tree.
In a preferable aspect of this embodiment, the preset time period may include: the short message receiving method comprises a first time period, a second time period and a third time period, wherein the length of the first time period is smaller than that of the second time period, the length of the second time period is smaller than that of the third time period, the length of the first time period is equal to that of the sub-time periods, the third time period is equal to the sum of the sub-time periods, the first time period, the second time period and the third time period all take the receiving time point of the short message as an end point, for example, the first time period is 1 minute, the second time period is 3 minutes, and the third time period is 5 minutes, namely, within 1 minute, within 3 minutes and within 5 minutes before the receiving time point of the current short message.
Further, the step S22 specifically includes:
acquiring the short message receiving quantity of the sub-time period of the short message, and taking the short message receiving quantity as the short message receiving quantity of the first time period;
specifically, the short message receiving amount of the short message in the sub-time period is firstly obtained and used as the short message receiving amount of the first time period, that is, the sub-time period where the short message is located is determined based on the receiving time point of the short message, then the short message receiving amount of the sub-time period is calculated and used as the short message receiving amount of the first time period, at this time, the short message receiving amount of the sub-time period is the short message receiving amount of the first time period, if the receiving time point of the short message is 12: 11 min, it is determined that the short message is located in the number 1 integer element according to the first formula, and the short message receiving amount of the number 1 integer element is the short message receiving amount of the first time period.
Counting the short message receiving amount of the second time period based on a preset formula;
specifically, the first time period has the same length as the sub-time periods, the second time period is an integral multiple of the first time period, and the preset formula is as follows: jidxn + Jidx (n-1) +, + Jidx (n-k), wherein Jidxn is the short message receiving amount of the sub-time period where the short message is located, Jidx (n-1) is the short message receiving amount of the last sub-time period of the sub-time period where the short message is located, and Jidx (n-k) is the short message receiving amount of the last k sub-time periods of the sub-time period where the short message is located, wherein the time length of the second time period is k times of the time length of the first time period, wherein n and k are natural numbers larger than 1, and n is larger than or equal to k. And obtaining the short message receiving quantity of the second time period according to the preset formula.
Summing the short message receiving quantity of each sub-time period to obtain the short message receiving quantity of a third time period;
specifically, since the third time period is equal to the preset time period, that is, the third time period includes all sub-time periods of the preset time period, the short message receiving amount of each sub-time period may be summed to be the short message receiving amount of the third time period.
In a further preferable solution of this embodiment, after step S2, the method further includes:
judging whether the short message receiving amount in the first time period is greater than or equal to a first threshold value;
specifically, it is first determined whether the short message reception amount in the first time period is greater than or equal to a first threshold, and if it is determined that the short message reception amount in the first time period is greater than or equal to the first threshold, the process goes to step S3;
if the short message receiving amount in the first time period is judged to be less than the first threshold, further judging whether the short message receiving amount in the second time period is greater than or equal to a second threshold; if the short message receiving amount in the second time period is greater than or equal to the second threshold, go to step S3;
if the short message receiving amount in the second time period is smaller than the second threshold, further determining whether the short message receiving amount in the third time period is greater than or equal to a third threshold, if the short message receiving amount in the third time period is greater than or equal to the third threshold, turning to step S3, and if the short message receiving amount in the third time period is smaller than the third threshold, directly issuing a short message to the called number.
It should be noted that the first threshold, the second threshold, and the third threshold may be set according to actual situations, but are not limited thereto, and the first threshold < the second threshold < the third threshold, but the sizes of the first threshold, the second threshold, and the third threshold are related to the length of the corresponding time period, for example, when the first time period is 1 minute, the number of the first threshold is 20, when the second time period is 3 minutes, the number of the second threshold is 40, and when the third time period is 5 minutes, the number of the third threshold is 60.
In a variation of this embodiment, the specific process of counting the short message receiving amount of the called number in the preset time period based on the updated self-balancing binary search tree is as follows:
acquiring the short message receiving amount of each sub-time period of a preset time period;
and summing the acquired short message receiving quantity of each sub-time period to obtain the short message receiving quantity of the preset time period.
Specifically, the preset time period includes a plurality of sub time periods, and the short message receiving amount of each sub time period is recorded in the count tree, and the short message receiving amount of each sub time period is directly obtained from the count tree, and then the short message receiving amount of the preset time period is obtained by summing, where the preset time period may be set according to actual situations, for example, 3 minutes, 5 minutes, or other numerical values, which is not limited herein.
In a further preferable embodiment of this embodiment, after step S2, the method further includes:
judging whether the short message receiving quantity in a preset time period is greater than or equal to an alarm threshold value or not;
specifically, after the short message receiving amount in the preset time period is obtained, whether the short message receiving amount is greater than or equal to the alarm threshold value or not is judged, if the short message receiving amount is greater than or equal to the alarm threshold value, the step is switched to step S3, and if the short message receiving amount is less than the alarm threshold value, a short message is directly sent to the called number, or a next short message is waited for until the short message receiving amount reaches the alarm threshold value. The alarm threshold may be set according to actual conditions, and is not limited herein.
For ease of understanding, the specific implementation is described below as an example:
the method comprises the steps of presetting a mechanism and a data structure, setting 5 minutes as a preset time period, namely taking 5 minutes as a period, wherein the data structure comprises a timing tree and a counting tree, the counting tree comprises a counting node and a counting array, the counting array comprises 5 integer elements which are respectively 0, 1, 2, 3 and 4, one integer element corresponds to one sub-time interval (namely one integer element corresponds to one minute time), each integer element carries a short message receiving quantity corresponding to one minute time (the value of the integer element is the short message receiving quantity), and also carries a receiving time point of the last short message, the counting node carries a called number, the timing tree comprises a timing node and a timing array, the timing node carries the receiving time points of the called number and the last short message, and the timing array is an empty value.
When a short message is received, a current sub-period is determined based on a receiving time point of the short message, that is, the current time is 12 points, 11 minutes and 50 seconds, for example, according to a first formula: determining that the current short message is in the integer element with the label of 1 when idx is 5 minutes of the receiving time point of the current short message, and then obtaining the receiving time point of the previous short message (namely the last short message before the current short message), for example, if the receiving time point of the previous short message is 12 points, 11 minutes and 5 seconds, it indicates that the current short message and the previous short message are in the same sub-time period (namely in the same integer element), an operation of adding 1 to the receiving amount of the short message of the integer element is required, and at this time, the current short message is the last short message, and the receiving time point of the last short message of the counting node and the timing node is updated. If the receiving time point of the last short message is 12 points, 10 minutes and 59 seconds, the current short message and the last short message do not belong to the same sub-time period, the shaping element corresponding to the current short message needs to be cleared, the short message receiving quantity corresponding to the current shaping element is changed to 1, and the receiving time point of the current short message is taken as the receiving time point of the last short message to be updated to the counting node and the timing node.
After updating the counting tree and the timing tree, counting the short message receiving amount in a preset time period, such as counting the short message receiving amount in 1 minute, 3 minutes and 5 minutes, for example: assuming that the current time is 11 o 'clock, 12 o' clock and 13 s, the current short message receiving amount is counted in the 2 nd (12 o 'clock and 5 o' clock, respectively), the receiving amount 11 o 'clock and 11 o' clock in the previous minute is accumulated in the 1 st element, the receiving amount 11 o 'clock and 10 o' clock is accumulated in the 0 th shaping element, the short message receiving amount 11 o 'clock 09 o' clock is accumulated in the 4 th shaping element, the short message receiving amount 11 o 'clock and 08 o' clock is accumulated in the 3 rd shaping element, and the short message receiving amount of the last three minutes is the count of the current element 2+ the count of the element 1 + the count of the element 0. The obtaining processes are respectively as follows:
the short message receiving quantity in the first 1 minute is the idx integral value of the array;
the short message receiving amount in the first 3 minutes is the value of the idx integer + the value of the (idx + 4)% 5 integer + the value of the (idx + 3)% 5 integer in the array,
the short message receiving amount in the first 5 minutes is the sum of 5 integer element values;
based on the above, the short message receiving amounts of 1 minute, 3 minutes and 5 minutes are respectively calculated, if one of the short message receiving amounts exceeds the corresponding threshold, alarm information is sent to the corresponding terminal user to prompt that the risk of short message bombing currently exists, a caching function is started, the subsequently received short messages are cached, the indication of the user is waited, if the starting interception indication of the user is received, the currently cached short messages are sent out based on a preset white list, and if the indication of the user is not received or the non-starting interception indication of the user is received, the cached short messages are directly sent out.
In the embodiment, the received short messages are monitored in real time, when the short message receiving amount exceeds the threshold value, an alarm prompt is automatically sent to the user, corresponding operation is executed according to the feedback of the user, the management and control efficiency can be improved, and the actual requirements of the user are met;
secondly, the short messages are recorded based on the self-balancing binary search tree, so that the short message counting efficiency and accuracy can be improved, and the scientificity of short message management and control is improved.
Moreover, the short message receiving quantity control in a plurality of time periods is set, so that the effectiveness of control can be improved.
Fig. 3 shows a schematic structural diagram of a short message management and control apparatus according to a second embodiment of the present invention. The device includes: receiving module 31, statistics module 32 connected with receiving module 31, suggestion module 33 connected with statistics module 32, control module 34 connected with suggestion module 33, wherein:
the receiving module 31 is configured to receive a short message sent by a gateway;
specifically, receiving a short message sent by a gateway, and recording a receiving time point;
the statistical module 32 is used for counting the short message receiving quantity of the called number corresponding to the short message in a preset time period;
specifically, according to the called number corresponding to the short message, the short message receiving amount of the called number in a preset time period before the current time point is counted. The preset time period refers to a period of time calculated before the current time point is used as an end point, and the preset time period may be 1 minute, 2 minutes, 3 minutes, 5 minutes, and the like, and may be set according to actual conditions, which is not limited herein.
The prompting module 33 is configured to send alarm information to a corresponding terminal user to prompt that a risk of short message bombing currently exists if the short message receiving amount exceeds a threshold;
specifically, if the counted short message receiving amount exceeds the threshold, sending alarm information to the corresponding terminal user, that is, sending alarm information to the user terminal user of the called number to prompt that the risk of short message bombing may occur at present, and inquiring whether the terminal user intercepts the short message. After receiving the alarm information, the terminal user can feed back according to the actual situation, if the user considers that the interception is not necessary, the terminal user feeds back no information, and if the user considers that the interception is necessary, the terminal user feeds back the information. It should be noted that after the alarm information is sent, a period of time (for example, 30 seconds) needs to be waited, if no feedback of the end user is received after waiting for the period of time, the end user is determined to give up interception by default, the threshold is related to the preset period of time, if the preset period of time is 3 minutes, the corresponding threshold is 40, if the preset period of time is 1 minute, the corresponding threshold is 20, and if the preset period of time is 5 minutes, the corresponding threshold is 60. It should be noted that, if the short message receiving amount exceeds the threshold, the received short message starts to be cached until the feedback of the user is received.
The control module 34 is configured to send a currently cached short message based on a preset white list if an interception start instruction of a terminal user is received;
specifically, when receiving an interception start instruction of the terminal user, the current cached short message may be issued based on a preset white list, that is, the matching screening is performed according to the white list and the current cached short message, the cached short message matching the number in the white list is issued to the terminal user, and the short message not matching the number in the white list is not sent to the terminal user.
In an implementation manner of this embodiment, if a non-start interception instruction of a terminal user is received, which indicates that short messages do not need to be intercepted, the currently cached short messages are sent to the terminal user.
In the embodiment, before the short message is sent to the terminal user, the short message receiving amount of the called number in a preset time period is automatically counted, if the short message receiving amount exceeds a threshold value, alarm information is sent to the terminal user to prompt that the current risk of short message bombing is possible, and the corresponding short message is intercepted when the interception indication of the user is obtained, so that the management and control efficiency is high, and the actual requirement of the user is met.
In one implementation of this embodiment, the apparatus further comprises: a building module connected to both the receiving module 31 and the counting module 32, wherein:
the building module is used for building a data structure to record the short message receiving amount;
specifically, a data structure is first constructed for recording the short message receiving amount, the data structure includes two self-balancing binary search trees (AVLs), which are a count tree and a timing tree, respectively, and the count tree and the timing tree are set correspondingly, as if the information of a called number in the count tree is at the same height as the information in the timing tree, and for example, the count information of the called number is stored in the count tree and the timing information is stored in the timing tree. The data structure stores the short message information of a plurality of called numbers, and the short message control mode of each called number adopts the execution mode of the steps.
The count tree includes: counting node, counting group, this counting node carries called number, and regards this called number as KEY, and this counting group includes: the short message receiving amount of each sub-period of the preset period and the receiving time point of the last short message in the preset period, for example, 5 minutes is used as the preset period, that is, the short message receiving amount is periodically recorded in the time length of 5 minutes, and the counting group records the short message receiving amount of each minute in the 5 minutes and the receiving time point of the last short message in the 5 minutes. And in the next 5 minutes, recording the short message receiving amount of the called number in each minute in the next 5 minutes and the receiving time point of the last short message again.
The timing tree includes: the timing node carries a called number and a receiving time point of the last short message in a preset time period, and the value of the timing array is null. For example, the timing node of the called number takes the called number and the receiving time point of the last short message in a preset time period as KEY, and the VALUE of the timing array (VALUE) is null.
In a preferred aspect of this embodiment, the control module 34 is further configured to:
and if the difference value between the current time point and the receiving time point of the last short message is greater than a preset time value, deleting the nodes corresponding to the called number in the timing tree and the counting tree.
Specifically, if the difference between the current time point and the time point of receiving the last short message is greater than a preset time value, the node corresponding to the called number in the timing tree and the counting tree is deleted, where the preset time value may be set according to an actual situation, for example, 5 minutes, or another value, which is not limited herein. If no short message is received within 5 minutes, the corresponding node needs to be deleted, and then when the short message is retransmitted, the node is reestablished and counting is carried out again.
In a preferred embodiment of this embodiment, the statistical module 32 specifically includes: update unit and statistical unit who is connected with it, wherein:
the updating unit is used for updating two self-balancing binary search trees based on the received short message;
specifically, the two self-balancing binary search trees are updated according to the receiving time point of the short message.
The statistical unit is used for counting the short message receiving amount of the called number in a preset time period based on the updated two self-balancing binary search trees;
specifically, the short message receiving amount of the called number in the preset time period is counted according to the updated self-balancing binary search tree, and the short message receiving amount of the called number in the preset time period is counted according to the information recorded by the self-balancing binary search tree.
In a preferred embodiment of this embodiment, the updating unit is specifically configured to:
analyzing whether the called number exists in a counting tree or not;
specifically, since the count tree includes: count node, count group, count node carries called number, count group includes: if the counting node takes the called number as the KEY, the counting node only needs to search the counting tree to know whether the called number exists in the counting tree, and if the called number has a short message record, the counting node directly searches the counting tree to know whether the called number exists in the data structure, so that the processing efficiency can be improved.
The timing node carries the called number and the receiving time point of the last short message in the preset time period, the value of the timing array is null, and the lengths of any two sub-time periods are equal. For example, if the preset time period is 5 minutes, the sub-time period is 1 minute, and the time length of 5 minutes has 5 sub-time periods, that is, the cycle is performed once every 5 minutes, each minute corresponds to one sub-time period, the count group includes records of short message receiving amount of 5 sub-time periods, for example, the current time is 12 o ' clock, 45 o ' clock and 30 seconds, then the preset time period before the time refers to a time period between 12 o ' clock 41 and 12 o ' clock 45 o ' clock, and the 5 sub-time periods are respectively: 12 points 41 minutes 0 second to 12 points 41 minutes 59 seconds, 12 points 42 minutes 0 second to 12 points 42 minutes 59 seconds, 12 points 43 minutes 0 second to 12 points 43 minutes 59 seconds, 12 points 44 minutes 0 second to 12 points 44 minutes 59 seconds, 12 points 45 minutes 0 second to 12 points 45 minutes 59 seconds, and 12 points 46 minutes 0 second to 12 points 46 minutes 59 seconds to the first sub-period of the next cycle (i.e., a sub-period of the next 5 minutes). It should be noted that the length of the preset time period is an integer multiple of the sub-time period.
If the called number exists in the count tree, updating a node corresponding to the called number based on the currently received short message;
specifically, if the called number exists in the count tree, it indicates that the short message record information of the called number already exists, and updates the corresponding node based on the currently received short message, so as to update the data such as the receiving time point and the short message receiving amount of the last short message of the called number.
If the called number does not exist in the counting tree, establishing a corresponding node and inserting the node into the self-balancing binary search tree;
specifically, if the called number does not exist in the count tree, a node of the called number needs to be established and inserted into the self-balancing binary search tree, for example, a count node and a timing node are established, the called number is used as a KEY suggestion count node, and the called number and the time point of receiving the short message are used as KEYs and inserted into the timing tree. So as to directly record when the short message sent to the called number is obtained again in the following.
In a preferred embodiment of this embodiment, the process of updating the node corresponding to the called number based on the currently received short message may include:
judging whether the receiving time point of the last short message of the called number and the receiving time point of the current short message are in the same sub-time period;
specifically, it is first to determine whether the receiving time point of the short message and the receiving time point of the previous short message are in the same sub-time period, for example, if the receiving time point of the current short message is 12 points, 30 minutes and 5 seconds, and the receiving time point of the previous short message is 12 points, 29 minutes and 55 seconds, the current short message and the previous short message belong to different sub-time periods; when the receiving time point of the current short message is 12 points, 29 minutes and 5 seconds, and the receiving time point of the last short message is 12 points, 29 minutes and 55 seconds, the two short messages belong to the same sub-time period.
If the two are in the same time period, the operation of adding 1 to the short message receiving amount of the sub-time period is executed, and the corresponding timing node is updated based on the receiving time point of the current short message;
specifically, if the number of the called number is in the same sub-time period, the operation of adding 1 is performed in the short message receiving amount of the sub-time period, for example, the short message receiving amount of the currently recorded called number in the sub-time period is 12, after the short message is received, the short message receiving amount of the sub-time period is 12+1, the data is updated to the count tree, and the receiving time point corresponding to the node of the timing tree is changed to the receiving time point of the current short message. For example, if the first time period is 1 minute and the preset time period is 5 minutes, 5 sub-time periods are included, each including 5 integer elements, which are respectively labeled as 0, 1, 2, 3, and 4. Firstly, determining a sub-time period of the short message, wherein the receiving time point of the short message is 12 to 11 minutes, and according to a first formula: and idx is the number of minutes of the current short message receiving time point, which is 5%, that is, the remainder is taken from 5 according to the number of minutes (for example, 11) corresponding to the receiving point to obtain 1, and if the sub-time period of the short message is the integer element No. 1, the short message receiving amount corresponding to the integer element is increased by 1.
If the two are not in the same sub-time period, the short message receiving amount of the sub-time period is modified to 1, and a corresponding timing node is updated based on the receiving time point of the current short message;
specifically, if the two messages are not in the same sub-time period, it is indicated that the sub-time period corresponding to the current short message needs to be cleared, that is, the short message record of the sub-time period is cleared, the currently received short message is used as the first received short message again (that is, the short message receiving amount of the sub-time period is modified to 1), the called number and the receiving time point of the short message are used as KEYs, a new timing node is inserted, and the receiving time point of the last short message of the count tree is updated, that is, the receiving time point of the current short message is updated to the count tree.
In a preferable aspect of this embodiment, the preset time period may include: the short message receiving time point is used as an end point of the first time period, for example, the first time period is 1 minute, the second time period is 3 minutes, and the third time period is 5 minutes, that is, within 1 minute, within 3 minutes, and within 5 minutes before the receiving time point of the current short message.
Further, the statistical unit is specifically configured to:
acquiring the short message receiving quantity of the sub-time period in which the short message is positioned, and taking the short message receiving quantity as the short message receiving quantity of the first time period;
specifically, the short message receiving amount of the short message in the sub-time period is firstly obtained and used as the short message receiving amount of the first time period, that is, the sub-time period where the short message is located is determined based on the receiving time point of the short message, then the short message receiving amount of the sub-time period is calculated and used as the short message receiving amount of the first time period, at this time, the short message receiving amount of the sub-time period is the short message receiving amount of the first time period, if the receiving time point of the short message is 12: 11 min, it is determined that the short message is located in the number 1 integer element according to the first formula, and the short message receiving amount of the number 1 integer element is the short message receiving amount of the first time period.
Counting the short message receiving amount of the second time period based on a preset formula;
specifically, the first time period has the same length as the sub-time periods, the second time period is an integral multiple of the first time period, and the preset formula is as follows: jidxn + Jidx (n-1) +, + Jidx (n-k), wherein Jidxn is the short message receiving quantity of the sub-time period where the short message is located, the short message receiving quantity of the previous sub-time period where the Jidx (n-1) short message is located, and the short message receiving quantity of the previous k sub-time periods where the Jidx (n-k) short message is located, wherein the time length of the second time period is k times of the time length of the first time period, n and k are natural numbers larger than 1, and n is larger than or equal to k. And obtaining the short message receiving quantity of the second time period according to the preset formula.
Summing the short message receiving quantity of each sub-time period to obtain the short message receiving quantity of a third time period;
specifically, since the third time period is equal to the preset time period, that is, the third time period includes all sub-time periods of the preset time period, the short message receiving amount of each sub-time period may be summed to be the short message receiving amount of the third time period.
In a further preferred aspect of this embodiment, the apparatus further includes: a judging module connected with the statistical module 32, wherein:
the judging module is used for judging whether the short message receiving quantity in the first time period is greater than or equal to a first threshold value;
specifically, it is first determined whether the short message receiving amount in the first time period is greater than or equal to a first threshold, and if it is determined that the short message receiving amount in the first time period is greater than or equal to the first threshold, the short message receiving amount in the second time period is further determined whether the short message receiving amount in the second time period is greater than or equal to a second threshold, and if it is greater than or equal to the second threshold, the short message receiving amount in the third time period is further determined whether the short message receiving amount in the third time period is greater than or equal to a third threshold, the short message receiving amount in the third time period is fed back to the prompting module 33, and if the short message receiving amount in the third time period is less than the third threshold, the short message is directly sent to the called number.
It should be noted that the first threshold, the second threshold, and the third threshold may be set according to actual circumstances, and are not limited herein, but the first threshold < the second threshold < the third threshold, but the sizes of the first threshold, the second threshold, and the third threshold are related to the length of the corresponding time period, for example, when the first time period is 1 minute, the first threshold is 20, when the second time period is 3 minutes, the second threshold is 40, and when the third time period is 5 minutes, the third threshold is 60.
In a variation of this embodiment, the statistical unit is specifically configured to:
acquiring the short message receiving quantity of each sub-time period of a preset time period;
and summing the obtained short message receiving quantity of each sub-time period to obtain the short message receiving quantity of the preset time period.
Specifically, the preset time period includes a plurality of sub time periods, and the short message receiving amount of each sub time period is recorded in the counting tree, the short message receiving amount of each sub time period is directly obtained from the counting tree, and then the short message receiving amount of the preset time period is obtained by summing up, where the preset time period may be set according to actual situations, for example, 3 minutes, 5 minutes, or other values, which is not limited herein.
In a further preferred aspect of this embodiment, the determining module is further configured to:
judging whether the short message receiving amount in a preset time period is greater than or equal to an alarm threshold value or not;
specifically, after the short message receiving amount in the preset time period is obtained, whether the short message receiving amount is greater than or equal to the alarm threshold value or not is judged, if the short message receiving amount is greater than or equal to the alarm threshold value, the step is switched to step S3, and if the short message receiving amount is less than the alarm threshold value, a short message is directly sent to the called number, or a next short message is waited for until the short message receiving amount reaches the alarm threshold value. The alarm threshold may be set according to actual conditions, and is not limited herein.
For the convenience of understanding, the specific implementation process is described as an example below:
the method comprises the steps of presetting a mechanism and a data structure, setting 5 minutes as a preset time period, namely taking 5 minutes as a period, wherein the data structure comprises a timing tree and a counting tree, the counting tree comprises a counting node and a counting array, the counting array comprises 5 integer elements which are respectively 0, 1, 2, 3 and 4, one integer element corresponds to one sub-time interval (namely one integer element corresponds to one minute time), each integer element carries a short message receiving quantity corresponding to one minute time (the value of the integer element is the short message receiving quantity), and also carries a receiving time point of the last short message, the counting node carries a called number, the timing tree comprises a timing node and a timing array, the timing node carries the receiving time points of the called number and the last short message, and the timing array is an empty value.
When a short message is received, first, a current sub-period, i.e. an integer element, is determined based on a receiving time point of the short message, for example, the current time is 12 points, 11 minutes and 50 seconds, according to a first formula: determining that the current short message is in the integer element with the label of 1 when idx is 5 minutes of the receiving time point of the current short message, and then obtaining the receiving time point of the previous short message (namely the last short message before the current short message), for example, if the receiving time point of the previous short message is 12 points, 11 minutes and 5 seconds, it indicates that the current short message and the previous short message are in the same sub-time period (namely in the same integer element), an operation of adding 1 to the receiving amount of the short message of the integer element is required, and at this time, the current short message is the last short message, and the receiving time point of the last short message of the counting node and the timing node is updated. And if the receiving time point of the last short message is 12 points, 10 minutes and 59 seconds, indicating that the current short message and the last short message do not belong to the same sub-time period, indicating that the integer element corresponding to the current short message needs to be cleared, changing the short message receiving quantity corresponding to the current integer element into 1, and updating the counting node and the timing node by taking the receiving time point of the current short message as the receiving time point of the last short message.
After updating the count tree and the timing tree, the short message receiving amount in a preset time period is counted, such as the short message receiving amounts in 1 minute, 3 minutes and 5 minutes are counted respectively, for example: assuming that the current time is 11 o 'clock, 12 o' clock and 13 s, the current short message receiving amount is counted in the 2 nd (12 o 'clock and 5 o' clock, respectively), the receiving amount 11 o 'clock and 11 o' clock in the previous minute is accumulated in the 1 st element, the receiving amount 11 o 'clock and 10 o' clock is accumulated in the 0 th shaping element, the short message receiving amount 11 o 'clock 09 o' clock is accumulated in the 4 th shaping element, the short message receiving amount 11 o 'clock and 08 o' clock is accumulated in the 3 rd shaping element, and the short message receiving amount of the last three minutes is the count of the current element 2+ the count of the element 1 + the count of the element 0. The obtaining processes are respectively as follows:
the short message receiving quantity in the first 1 minute is the idx integer value of the array;
the short message receiving amount in the first 3 minutes is the value of the idx integer + the value of the (idx + 4)% 5 integer + the value of the (idx + 3)% 5 integer in the array,
the short message receiving amount in the first 5 minutes is the sum of 5 integer element values;
based on the above, the short message receiving amounts of 1 minute, 3 minutes and 5 minutes are respectively calculated, if one of the short message receiving amounts exceeds the corresponding threshold, alarm information is sent to the corresponding terminal user to prompt that the risk of short message bombing currently exists, a caching function is started, the subsequently received short messages are cached, the indication of the user is waited, if the starting interception indication of the user is received, the currently cached short messages are sent out based on a preset white list, and if the indication of the user is not received or the non-starting interception indication of the user is received, the cached short messages are directly sent out.
In this embodiment, the apparatus is applied to an interactive system, and the interactive system includes: the mobile phone terminal comprises a mobile phone terminal, a terminal supporting module, a short message control device, a short message gateway and an SP port, wherein the SP port sends a short message to the short message gateway, the short message gateway sends the short message to the short message control device, the short message control device controls the received short message, if the short message receiving quantity in a preset time period exceeds a threshold value, alarm information is sent through the terminal supporting module, the terminal supporting module sends the alarm information to the mobile phone terminal (namely a terminal user), if the mobile phone terminal feeds back an indication, the alarm information is sent to the short message control device through the terminal supporting module, and the short message control device executes the next operation based on the fed-back indication.
In a preferred embodiment of this embodiment, the mobile phone terminal uploads the service customization through the terminal support module, the terminal support module synchronizes the service customization to the short message control device, and the short message control device adds a corresponding service to the number of the mobile phone terminal and then feeds back the customization result through the terminal support module. In addition, the user can set a white list through the mobile phone terminal and synchronize the white list to the short message control device through the terminal supporting module, and the short message control device feeds back an updating result to the mobile phone terminal through the terminal supporting module after updating the white list.
In the embodiment, the received short messages are monitored in real time, when the short message receiving amount exceeds the threshold value, an alarm prompt is automatically sent to the user, corresponding operation is executed according to the feedback of the user, the management and control efficiency can be improved, and the actual requirements of the user are met;
and secondly, recording the short message based on the self-balancing binary search tree, so that the statistical efficiency and accuracy of the short message can be improved, and the scientificity of short message management and control is improved.
Moreover, the short message receiving quantity control in a plurality of time periods is set, so that the effectiveness of control can be improved.
The third embodiment of the present invention also provides a computer storage medium including a computer program stored on the computer storage medium, the computer program including program instructions that, when executed by a computer, cause the computer to perform the method of suppressing the EPC tidal effect of the first embodiment described above.
The executable instructions may be specifically configured to cause the processor to:
receiving a short message sent by a gateway;
counting the short message receiving quantity of the called number corresponding to the short message in a preset time period;
if the short message receiving amount exceeds a threshold value, sending alarm information to a corresponding terminal user to prompt that the risk of short message bombing exists at present;
and if receiving an interception starting instruction of the terminal user, sending the current cached short message based on a preset white list.
In an alternative form, the executable instructions cause the processor to:
and constructing a data structure to record the short message receiving amount, wherein the data structure comprises two self-balancing binary search trees, one self-balancing binary search tree is a counting tree, and the other self-balancing binary search tree is a timing tree.
In an alternative, the executable instructions cause the processor to:
updating the two self-balancing binary search trees based on the received short message;
and counting the short message receiving amount of the called number in the preset time period based on the two updated self-balancing binary search trees.
In an optional manner, the preset time period includes a plurality of consecutive sub-time periods, the receiving time point of the short message intersects with a last time period of the preset time period, and the count tree includes: count node, count group, count node carries called number, count group includes: the short message receiving amount of the sub-time period and the receiving time point of the last short message in the preset time period; the timing tree includes: a timing node and a timing array, wherein the timing node carries the called number and the receiving time point of the last short message in the preset time period, the lengths of any two sub-time periods are equal, and the processor is enabled to execute the following operations by the executable instruction:
analyzing whether the called number exists in the counting tree or not;
if yes, updating a node corresponding to the called number based on the currently received short message;
and if not, establishing a corresponding node and inserting the node into the self-balancing binary search tree.
In an alternative form, the executable instructions cause the processor to:
judging whether the receiving time point of the last short message of the called number and the receiving time point of the current short message are in the same sub-time period or not;
if yes, adding 1 to the short message receiving quantity of the sub-time period, and updating a corresponding timing node based on the receiving time point of the current short message;
if not, the short message receiving amount of the sub-time period is changed into 1, and the corresponding timing node is updated based on the receiving time point of the current short message.
In an optional manner, the preset time period includes a first time period, a second time period, and a third time period, the first time period, the second time period, and the third time period all use a receiving time point of the short message as an end point, the first time period is shorter than the second time period, the second time period is shorter than the third time period, the first time period is equal to the sub-time periods, and the third time period is equal to a sum of the sub-time periods, where the executable instructions cause the processor to perform the following operations:
acquiring the short message receiving quantity of the sub-time period of the short message, and taking the short message receiving quantity as the short message receiving quantity of the first time period;
counting the short message receiving amount of the second time period based on a preset formula;
and summing the short message receiving quantity of each sub-time period to obtain the short message receiving quantity of the third time period.
In one option, the executable instructions cause the processor to:
judging whether the short message receiving amount of the first time period is greater than or equal to a first threshold value;
if the short message receiving amount in the first time period is larger than or equal to the first threshold, turning to a step of sending alarm information to a corresponding terminal user to prompt that the risk of short message bombing exists currently;
if the short message receiving amount in the first time period is smaller than the first threshold, judging whether the short message receiving amount in the second time period is larger than or equal to a second threshold;
if the short message receiving amount in the second time period is larger than or equal to the second threshold value, turning to a step of sending alarm information to a corresponding terminal user to prompt that the risk of short message bombing currently exists;
if the short message receiving amount in the second time period is smaller than the second threshold, judging whether the short message receiving amount in the third time period is larger than or equal to a third threshold;
if the short message receiving amount in the third time period is larger than or equal to the third threshold, sending alarm information to a corresponding terminal user to prompt that the risk of short message bombing currently exists, wherein the first threshold is smaller than the second threshold, and the second threshold is smaller than the third threshold.
In an alternative, the executable instructions cause the processor to:
acquiring the short message receiving amount of each sub-time period of a preset time period;
summing the obtained short message receiving quantity of each sub-time period to obtain the short message receiving quantity of the preset time period;
the executable instructions cause the processor to:
judging whether the short message receiving quantity in a preset time period is greater than or equal to an alarm threshold value or not;
and if the short message receiving amount in the preset time period is greater than or equal to an alarm threshold, sending alarm information to a corresponding terminal user to prompt that the risk of short message bombing exists currently.
In the embodiment, the received short messages are monitored in real time, when the short message receiving amount exceeds the threshold value, an alarm prompt is automatically sent to the user, corresponding operation is executed according to feedback of the user, the management and control efficiency can be improved, and the actual requirements of the user are met.
Fig. 4 is a schematic structural diagram of a device according to a fourth embodiment of the present invention, and the specific embodiment of the present invention does not limit the specific implementation of the device.
As shown in fig. 4, the apparatus may include: a processor (processor)402, a communication Interface 404, a memory 406, and a communication bus 408.
Wherein: the processor 402, communication interface 404, and memory 406 communicate with each other via a communication bus 408. A communication interface 404 for communicating with network elements of other devices, such as clients or other servers. The processor 402 is configured to execute the program 410, and may specifically execute the relevant steps of the short message management and control method in the first embodiment.
In particular, program 410 may include program code comprising computer operating instructions.
The processor 402 may be a central processing unit CPU or an application Specific Integrated circuit asic or one or more Integrated circuits configured to implement embodiments of the present invention. The device includes one or more processors, which may be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
And a memory 406 for storing a program 410. Memory 406 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 410 may be specifically configured to cause the processor 402 to perform the following operations:
receiving a short message sent by a gateway;
counting the short message receiving quantity of the called number corresponding to the short message in a preset time period;
if the short message receiving amount exceeds a threshold value, sending alarm information to a corresponding terminal user to prompt that the risk of short message bombing exists at present;
and if receiving an interception starting instruction of the terminal user, sending the currently cached short message based on a preset white list.
In an alternative, the program 410 causes the processor 402 to:
and constructing a data structure to record the short message receiving amount, wherein the data structure comprises two self-balancing binary search trees, one self-balancing binary search tree is a counting tree, and the other self-balancing binary search tree is a timing tree.
In an alternative, the program 410 causes the processor 402 to:
updating the two self-balancing binary search trees based on the received short message;
and counting the short message receiving amount of the called number in the preset time period based on the two updated self-balancing binary search trees.
In an optional manner, the preset time period includes a plurality of consecutive sub-time periods, the receiving time point of the short message intersects with a last time period of the preset time period, and the count tree includes: counting node, count group, counting node carries the called number, count group includes: the short message receiving amount of the sub-time period and the receiving time point of the last short message in the preset time period; the timing tree includes: a timing node and a timing array, wherein the timing node carries the called number and a receiving time point of the last short message in the preset time period, and the lengths of any two sub-time periods are equal, and the program 410 enables the processor 402 to execute the following operations:
analyzing whether the called number exists in the counting tree;
if the short message exists, updating the node corresponding to the called number based on the currently received short message;
and if not, establishing a corresponding node and inserting the node into the self-balancing binary search tree.
In an alternative, the program 410 causes the processor 402 to:
judging whether the receiving time point of the last short message of the called number and the receiving time point of the current short message are in the same sub-time period;
if yes, adding 1 to the short message receiving quantity of the sub-time period, and updating a corresponding timing node based on the receiving time point of the current short message;
if not, the short message receiving amount of the sub-time period is changed into 1, and the corresponding timing node is updated based on the receiving time point of the current short message.
In an optional manner, the preset time period includes a first time period, a second time period, and a third time period, the first time period, the second time period, and the third time period all use a receiving time point of the short message as an end point, the first time period is shorter than the second time period, the second time period is shorter than the third time period, the first time period is equal to the sub-time periods, and the third time period is equal to a sum of the sub-time periods, where the program 410 causes the processor 402 to perform the following operations:
acquiring the short message receiving quantity of the sub-time period of the short message, and taking the short message receiving quantity as the short message receiving quantity of the first time period;
counting the short message receiving amount of the second time period based on a preset formula;
and summing the short message receiving quantity of each sub-time period to obtain the short message receiving quantity of the third time period.
In an alternative, the program 410 causes the processor 402 to:
judging whether the short message receiving amount of the first time period is greater than or equal to a first threshold value;
if the short message receiving amount in the first time period is larger than or equal to the first threshold, turning to a step of sending alarm information to a corresponding terminal user to prompt that the risk of short message bombing currently exists;
if the short message receiving amount in the first time period is smaller than the first threshold, judging whether the short message receiving amount in the second time period is larger than or equal to a second threshold;
if the short message receiving amount in the second time period is larger than or equal to the second threshold, turning to a step of sending alarm information to a corresponding terminal user to prompt that the risk of short message bombing exists currently;
if the short message receiving amount in the second time period is smaller than the second threshold, judging whether the short message receiving amount in the third time period is larger than or equal to a third threshold;
if the short message receiving amount in the third time period is larger than or equal to the third threshold, sending alarm information to a corresponding terminal user to prompt that the risk of short message bombing currently exists, wherein the first threshold is smaller than the second threshold, and the second threshold is smaller than the third threshold.
In an alternative, the program 410 causes the processor 402 to:
acquiring the short message receiving amount of each sub-time period of a preset time period;
summing the obtained short message receiving quantity of each sub-time period to obtain the short message receiving quantity of the preset time period;
the program 410 causes the processor 402 to perform the following operations:
judging whether the short message receiving amount in a preset time period is greater than or equal to an alarm threshold value or not;
and if the short message receiving amount in the preset time period is greater than or equal to an alarm threshold, executing an operation of sending alarm information to a corresponding terminal user to prompt that the risk of short message bombing exists currently.
In the embodiment of the invention, the received short messages are monitored in real time, when the short message receiving amount exceeds the threshold value, an alarm prompt is automatically sent to the user, and corresponding operation is executed according to the feedback of the user, so that the control efficiency can be improved and the actual requirements of the user are met;
secondly, the short messages are recorded based on the self-balancing binary search tree, so that the short message counting efficiency and accuracy can be improved, and the scientificity of short message management and control is improved.
Moreover, the short message receiving amount control of a plurality of time periods is set, so that the effectiveness of control can be improved.
The algorithms or displays presented herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. In addition, embodiments of the present invention are not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the embodiments of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be construed to reflect the intent: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components in the embodiments may be combined into one module or unit or component, and furthermore, may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names. The steps in the above embodiments should not be construed as limiting the order of execution unless specified otherwise.

Claims (9)

1. A short message management and control method is characterized by comprising the following steps:
constructing a data structure to record short message receiving amount, wherein the data structure comprises two self-balancing binary search trees, one self-balancing binary search tree is a counting tree, and the other self-balancing binary search tree is a timing tree;
receiving a short message sent by a gateway;
counting the short message receiving quantity of the called number corresponding to the short message in a preset time period;
if the short message receiving quantity exceeds a threshold value, sending alarm information to a corresponding terminal user to prompt that the risk of short message bombing exists currently;
and if receiving an interception starting instruction of the terminal user, sending the current cached short message based on a preset white list.
2. The method of claim 1, wherein the counting the short message receiving amount of the called number corresponding to the short message in a preset time period comprises:
updating the two self-balancing binary search trees based on the received short message;
and counting the short message receiving amount of the called number in the preset time period based on the two updated self-balancing binary search trees.
3. The method of claim 2, wherein the predetermined time period comprises a plurality of consecutive sub-time periods, the receiving time point of the short message intersects with the last time period of the predetermined time period, and the count tree comprises: counting node, count group, counting node carries the called number, count group includes: the short message receiving amount of the sub-time period and the receiving time point of the last short message in the preset time period; the timing tree includes: the method comprises a timing node and a timing array, wherein the timing node carries the called number and the receiving time point of the last short message in the preset time period, the lengths of any two sub-time periods are equal, and the updating of the two self-balancing binary search trees based on the received short messages comprises the following steps:
analyzing whether the called number exists in the counting tree;
if the short message exists, updating the node corresponding to the called number based on the currently received short message;
if not, establishing a corresponding node and inserting the node into the self-balancing binary search tree.
4. The method of claim 3, wherein the updating the node corresponding to the called number based on the currently received short message comprises:
judging whether the receiving time point of the last short message of the called number and the receiving time point of the current short message are in the same sub-time period;
if the judgment result is yes, adding 1 to the short message receiving quantity of the sub-time period, and updating a corresponding timing node based on the receiving time point of the current short message;
if not, the short message receiving quantity of the sub-time period is modified to be 1, and the corresponding timing node is updated based on the receiving time point of the current short message.
5. The method of claim 4, wherein the preset time period comprises a first time period, a second time period and a third time period, the first time period, the second time period and the third time period all end at a receiving time point of the short message, the first time period is shorter than the second time period, the second time period is shorter than the third time period, the first time period is equal to the sub-time period, the third time period is equal to the sum of the sub-time periods, and the counting the short message receiving amount of the called number in the preset time period based on the updated self-balanced binary search tree comprises:
acquiring the short message receiving quantity of the sub-time period of the short message, and taking the short message receiving quantity as the short message receiving quantity of the first time period;
counting the short message receiving amount of the second time period based on a preset formula;
and summing the short message receiving quantity of each sub-time period to obtain the short message receiving quantity of the third time period.
6. The method of claim 5, wherein after counting the received amount of the short message in a preset time period of the called number corresponding to the short message, the method further comprises:
judging whether the short message receiving amount of the first time period is greater than or equal to a first threshold value;
if the short message receiving amount in the first time period is larger than or equal to the first threshold, turning to a step of sending alarm information to a corresponding terminal user to prompt that the risk of short message bombing exists currently;
if the short message receiving amount in the first time period is smaller than the first threshold, judging whether the short message receiving amount in the second time period is larger than or equal to a second threshold;
if the short message receiving amount in the second time period is larger than or equal to the second threshold value, turning to a step of sending alarm information to a corresponding terminal user to prompt that the risk of short message bombing currently exists;
if the short message receiving amount in the second time period is smaller than the second threshold, judging whether the short message receiving amount in the third time period is larger than or equal to a third threshold;
if the short message receiving amount in the third time period is larger than or equal to the third threshold, sending alarm information to a corresponding terminal user to prompt that the risk of short message bombing currently exists, wherein the first threshold is smaller than the second threshold, and the second threshold is smaller than the third threshold.
7. The method of claim 4, wherein the counting the short message receiving amount of the called number in the preset time period based on the updated self-balanced binary search tree comprises:
acquiring the short message receiving quantity of each sub-time period of a preset time period;
summing the acquired short message receiving quantity of each sub-time period to obtain the short message receiving quantity of the preset time period;
after counting the short message receiving quantity of the called number corresponding to the short message in a preset time period, the method further comprises the following steps:
judging whether the short message receiving quantity in a preset time period is greater than or equal to an alarm threshold value or not;
and if the short message receiving amount in the preset time period is larger than or equal to an alarm threshold, sending alarm information to a corresponding terminal user to prompt that the risk of short message bombing exists currently.
8. A short message management and control device is characterized by comprising:
the receiving module is used for receiving the short message sent by the gateway;
the counting module is used for counting the short message receiving quantity of the called number corresponding to the short message in a preset time period, wherein the preset time period takes the receiving time point of the short message as an end point;
the prompting module is used for sending alarm information to a corresponding terminal user to prompt that the risk of short message bombing exists currently if the short message receiving amount exceeds a threshold value;
and the control module is used for sending the current cached short message based on a preset white list if the starting interception instruction of the terminal user is received.
9. A computer device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface are communicated with each other through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the short message management and control method according to any one of claims 1-7.
CN202010162813.6A 2020-03-10 2020-03-10 Short message management and control method and device Active CN113382372B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010162813.6A CN113382372B (en) 2020-03-10 2020-03-10 Short message management and control method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010162813.6A CN113382372B (en) 2020-03-10 2020-03-10 Short message management and control method and device

Publications (2)

Publication Number Publication Date
CN113382372A CN113382372A (en) 2021-09-10
CN113382372B true CN113382372B (en) 2022-07-26

Family

ID=77568909

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010162813.6A Active CN113382372B (en) 2020-03-10 2020-03-10 Short message management and control method and device

Country Status (1)

Country Link
CN (1) CN113382372B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104702487A (en) * 2013-12-04 2015-06-10 北京千橡网景科技发展有限公司 Mail sending method and device

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7145875B2 (en) * 2001-03-05 2006-12-05 Tekelec Methods and systems for preventing short message service (SMS) message flooding
CN100542190C (en) * 2005-01-11 2009-09-16 康佳集团股份有限公司 A kind of portable terminal short message explosive protection system and method
BRPI0619984A2 (en) * 2005-12-14 2011-10-25 Tekelec Us computer program methods, systems, and products to detect and reduce fraudulent messaging traffic from messaging services
CN101790142B (en) * 2010-03-11 2012-11-14 上海粱江通信***股份有限公司 Method and system for identifying spam message sources by combining message contents and transmission frequency
CN102572747B (en) * 2010-12-28 2015-05-27 ***通信集团吉林有限公司 Method and system for monitoring junk short message
CN103209397B (en) * 2012-01-16 2016-12-14 阿里巴巴集团控股有限公司 Short message sending, the control method of reception and server thereof and terminal
CN102833713A (en) * 2012-08-31 2012-12-19 中国联合网络通信集团有限公司 Method and device for distinguishing spam message
CN104244206B (en) * 2013-06-20 2016-10-05 腾讯科技(深圳)有限公司 A kind of SMS processing method, device and terminal unit
CN103369486A (en) * 2013-08-01 2013-10-23 上海粱江通信***股份有限公司 System and method for preventing fraud SMS (Short message Service) message
US9237426B2 (en) * 2014-03-25 2016-01-12 Location Labs, Inc. Device messaging attack detection and control system and method
EP3515020A3 (en) * 2018-01-18 2019-10-23 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. Method, apparatus, electronic message server and computer program for processing a plurality of electronic messages

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104702487A (en) * 2013-12-04 2015-06-10 北京千橡网景科技发展有限公司 Mail sending method and device

Also Published As

Publication number Publication date
CN113382372A (en) 2021-09-10

Similar Documents

Publication Publication Date Title
CN107332876B (en) Method and device for synchronizing block chain state
US9219808B2 (en) Contact information synchronization system and method
CN106993048B (en) Determine method and device, information recommendation method and the device of recommendation information
CN110502318A (en) Event-handling method, event processing server, storage medium and device
CN109788027A (en) Method of data synchronization, device, server and computer storage medium
CN106101220A (en) Information synchronization method and device, synchronizing information processing system
CN110245145A (en) Structure synchronization method and apparatus of the relevant database to Hadoop database
CN110659971B (en) Transaction data processing method and device
CN104135571A (en) Method of setting heartbeat timer, terminal and server
CN109842621A (en) A kind of method and terminal reducing token storage quantity
CN104717120A (en) Method and device for determining time for sending information
CN115023919B (en) Firewall rule updating method and device, server and storage medium
CN115955332A (en) Abnormal traffic filtering method and device for authentication system and electronic equipment
WO2014128064A1 (en) A time and attendance processing system
CN114238703A (en) Event flow arrangement method, device and application
CN113382372B (en) Short message management and control method and device
CN114328638A (en) Service message pushing system based on database polling
CN114928610A (en) Data update notification method, data processing method, device, equipment and medium
CN112749190B (en) Data query method and device, computing equipment and computer storage medium
CN111427708A (en) Message consumption method and device, computer equipment and storage medium
CN102053917A (en) Smart card capable of reducing memory footprint and instruction processing method thereof
RU2010131947A (en) IMPROVED PRESENCE CONTROL SERVER SYSTEM
CN116132528B (en) Flight management message pushing method and device and electronic equipment
CN114385267B (en) Data pushing method for cash transaction service
CN114666779B (en) Device connection method, device, computer device, and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant