Disclosure of Invention
The invention provides a method and a system for monitoring short message sending abnormity, aiming at the technical problem that the number of short messages sent by a specific service line cannot be monitored in time and early warning is carried out in the prior art.
A method for monitoring short message sending abnormity, the method comprises:
respectively allocating unique service line access identification for each service line;
counting the number of short messages sent by each service line according to the service line access identification;
and judging whether the number of the short messages sent by each service line exceeds a preset amount.
Furthermore, the short message sent by each service line contains the service line access identifier allocated to it.
Further, for the service line with the number of the sent short messages exceeding the preset amount, the short messages are stopped being sent.
Further, whether the number of the short messages sent by each service line exceeds a preset amount is judged based on one or more of the following judgment rules:
judging a first rule: comparing the number of the short messages sent by each service line with a first early warning threshold value;
and a second judgment rule: comparing the number of short messages sent by each service line in the current period with the number of short messages sent by one historical period in the historical period of each service line;
judging a rule III: and comparing the difference value between the number of the short messages sent by each service line in the current period and the number of the short messages sent by one historical period in the historical period of each service line with a second early warning threshold value.
Further, the first warning threshold and/or the second warning threshold may be adjustable.
Further, the number of short messages sent by each service line is counted in a certain counting period and/or the number of short messages sent by each service line in a certain time period is counted.
A system for monitoring short message delivery anomalies, the system comprising:
the counting module counts the number of the short messages sent by each service line according to the service line access identification;
and the early warning module is used for judging whether the number of the short messages sent by each service line exceeds a preset amount.
Further, the system further comprises:
and the processing module stops sending the short messages of the service lines with the number of the sent short messages exceeding a preset amount.
Furthermore, the short message sent by each service line contains the service line access identifier allocated to it.
Further, the early warning module judges whether the number of short messages sent by each service line exceeds an early warning value based on one or more of the following judgment rules:
judging a rule I: comparing the number of the short messages sent by each service line with a first early warning threshold value;
and a second judgment rule: comparing the number of short messages sent by each service line in the current period with the number of short messages sent by one historical period in the historical period of each service line;
judging a rule III: and comparing the difference value between the number of the short messages sent by each service line in the current period and the number of the short messages sent by one historical period in the historical period of each service line with a second early warning threshold value.
Further, the statistical module is used for counting the number of the short messages sent by each service line according to a certain statistical period and/or counting the number of the short messages sent by each service line within a certain time period.
A system for monitoring short message sending exceptions, the system comprising at least one processor and at least one memory; the memory stores a computer program for performing any of the methods described above, and the processor invokes the computer program in the memory to perform any of the methods described above.
The technical scheme of the invention can be applied to medium and large-sized companies, which have more service lines for sending short messages and can also be applied to companies with single service line. The method aims to help various companies to discover the possible short message over-sending behavior as early as possible by using a technical means, and avoid generating unnecessary part of short message cost; and the abnormal service lines can be identified to carry out targeted early warning, so that the product can be fed back more quickly, and the product experience is improved. The invention can monitor and early warn the excessive sending of the short message in real time, and quickly position and inform the service line generating abnormal behavior to follow up the processing.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention. It is to be understood that the embodiments described are only a few embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 shows a basic flow chart according to an embodiment of the present invention, as shown in the figure: firstly, respectively allocating a unique service line access identifier, access token, to each service line; secondly, counting the number of short messages sent by each service line according to the access identification, access token, of the service line; and finally, judging whether the number of the short messages sent by each service line exceeds a preset amount. The number of short messages sent by each service line may be counted at a certain counting period and/or the number of short messages sent by each service line within a certain time period, and whether the number of short messages sent by each service line exceeds a predetermined amount may be determined based on a plurality of determination rules.
The following describes an embodiment of the present invention with reference to fig. 2. Fig. 2 is a schematic flow chart illustrating monitoring of short message sending anomalies according to an embodiment of the present invention.
Each service line requests access to the short message service party by making a request to the short message service party. It should be noted that the short message in the present invention includes, but is not limited to, a short message, an instant messaging message (e.g., a WeChat message, a QQ message, etc.), a mail message, and the like.
Without loss of generality, the embodiment of the invention is exemplified by taking two service lines as an example, but is not limited to only two production lines.
Illustratively, the first service line and the second service line respectively make requests to a short message service side. After receiving the requests of the two service lines, the short message service side allocates the technical documents related to the short message to the first service line and the second service line respectively, and allocates a unique service line access identifier, accesstken, to each service line. And assigning a unique service line access identifier, accesstken 1, to the first service line and assigning a unique service line access identifier, accesstken 2, to the second service line without loss of generality.
The technical document comprises a detailed interface document for calling and sending the short message; the service line access identification, accessToken, is an identification distributed to each service line in the company by a short message service provider, and one service line corresponds to a unique access identification; the service line is a product for specifically sending short messages, such as a registration login verification code; the short message service side only provides a common interface in the company and is not responsible for specific sending operation.
After receiving the technical document related to the short message and the service line access identifier AccessToken provided by the short message service party for the first service line and the second service line, respectively calling the server of the short message service party to send the short message to a short message sending module maintained by the short message service party, wherein the short message contains a mobile phone number and short message content. The short message sent by the first service line also carries a first service line access identifier, accessToken1, allocated by the short message service party, and the short message sent by the second service line also carries a second service line access identifier, accessToken2, allocated by the short message service party.
After receiving the short message of the first service line and/or the second service line, the short message service side forwards the short message to a short message sending module, and sends the short message through the short message sending module. And the short message sending module sends the short message of the first service line and/or the short message of the second service line to a receiving party in a synchronous mode or an asynchronous mode.
And the short message service side performs statistical monitoring on the number of the short messages sent by each service line in the process of sending the short messages of the first service line and the second service line. Specifically, the short message service side calls a statistical module thereof to count the number of short messages sent by each service line within a certain statistical time.
Exemplarily, the statistical module distinguishes the short messages sent by different service lines according to the access identifier, accessToken, in the short message. Identifying the short message containing the first service line access identification, accesstken 1, as the short message sent by the first service line, identifying the short message containing the second service line access identification, accesstken 2, as the short message sent by the second service line, and respectively counting the number N1 of the short messages sent by the first service line and the number N2 of the short messages sent by the second service line.
Optionally, for the statistics of the number of the sent short messages, the number of the short messages including the first service line access identifier, accesstken 1, and the number of the short messages including the second service line access identifier, accesstken 2, may be calculated respectively, or the number of the first service line access identifier, accesstken 1, and the number of the second service line access identifier, accesstken 2, may be directly counted to obtain the number of the short messages sent by the first service line N1, and the number of the short messages sent by the second service line N2.
The statistical time may be several minutes, hours or days. The setting of the statistical time can be flexibly set or adjusted according to the actual situation.
For the statistics of the number of short messages, the statistical module may perform continuous statistics, for example, after the statistics of the number of short messages in 10 minutes is completed, the statistics of the number of short messages in 10 minutes is performed again, and thus the statistics is performed continuously; or periodically counting at a certain counting period, for example, the counting period is set to half an hour, and the counting time is ten minutes, then the counting module counts the number of short messages sent in 10 minutes every half an hour.
The statistical period may be several minutes, hours or days. The setting of the statistical period can be flexibly set or adjusted according to the actual situation.
And the counting module sends the counted number N1 of the short messages of the first service line and the number N2 of the short messages of the second service line to the early warning module. The early warning module can set an individual judgment rule for each service line to perform early warning, or set a unified judgment rule for all service lines to perform early warning, so as to judge whether the number of short messages sent by each service line exceeds a predetermined amount.
Optionally, the judgment rule may perform warning by setting a warning threshold:
the early warning module can be provided with an early warning threshold value, and can set a uniform short message sending quantity early warning threshold value M aiming at all service lines. In this case, after receiving the number N1 of short messages of the first service line, the early warning module compares the number N1 of short messages with the early warning threshold M of number of short messages, and if the number N1 of short messages exceeds the early warning threshold M of number of short messages, sends, to the short message service party, alarm message information that the number of short messages sent by the first service line exceeds a predetermined number, where the alarm message information includes a first service line identifier, accesstken 1, so as to definitely indicate that the number of short messages sent by the first service line is excessive, and may include information such as the number of short messages sent by the first service line.
An early warning threshold may also be set separately for each service line, for example, the short message quantity early warning threshold M1 of the first service line is set, and the short message quantity early warning threshold M2 of the second service line is set. In this case, the early warning module compares the number N1 of the received short messages of the first service line with the early warning threshold M1 of the number of the received short messages set for the first service line, and sends the notification information that the number of the short messages sent by the first service line exceeds the early warning number to the short message service party if the number N1 of the received short messages exceeds the early warning threshold M1 of the number of the received short messages.
After the early warning module judges that the quantity of the short messages sent by the first service line exceeds an early warning threshold value, sending alarm message information to the short message service side so as to inform the short message service side that the quantity of the short messages sent by the first service line exceeds the early warning value. Similarly, the alarm message information contains a first service line identifier, accessToken1, to specify that the alarm message is an alarm message for the first service line, and may also contain contents such as the number of short messages sent by the first service line.
The early warning module can also directly send an alarm message to the sending module so as to inform the sending module that the quantity of the short messages sent by the related service lines at present exceeds an early warning value.
The early warning mode for the second service line and other service lines is the same as that for the first service line, and is not described herein again.
Optionally, the judgment rule may also perform early warning by comparing the current statistic with the historical statistic.
The early warning module compares the number of the short messages of each service line received from the counting module with the number of the short messages received before, i.e. the number of the short messages received in history, to determine whether the number of the short messages is excessive.
After receiving the number of short messages sent in the ith cycle of the first production line, the early warning module compares the number of the short messages in the ith cycle with the number of the short messages sent in the 1 st cycle, or compares the number of the short messages sent in the cycle before the ith cycle. And after the quantity of the short messages sent in the ith cycle exceeds the quantity of the short messages sent in the 1 st cycle or exceeds a certain quantity delta, or exceeds the quantity of the short messages sent in a certain cycle before the ith cycle or exceeds a certain quantity delta, sending alarm message information to the short message service party so as to inform the short message service party that the quantity of the short messages sent by the first service line exceeds an early warning value. The early warning module can also directly send an alarm message to the sending module so as to inform the sending module that the quantity of the short messages sent by the related service lines at present exceeds an early warning value.
When i =1, the warning may be performed by, for example, comparing with a warning threshold value set in advance.
The early warning mode for the second service line and other service lines is the same as that for the first service line, and is not described herein again.
And for the certain amount of delta, flexibly adjusting according to actual conditions.
The early warning module can flexibly set the sending time, cycle and the like of the early warning information, for example, the early warning information is not sent within a period of time, the early warning information is sent once for a long time, and the early warning information is sent at a certain specific time.
After receiving the alarm message information, the short message service side can determine which service line sends a short message with a quantity exceeding an early warning value according to the received alarm message information. For example, after receiving the alarm message of the first service line, the short message service side identifies that the short message sent by the first service line exceeds the early warning threshold value based on the first service line identifier AccessToken1 in the alarm message. The short message service side can control the sending module to stop sending the short message of the service line exceeding the early warning value, namely, control the sending module to stop sending the short message of the first service line.
The short message termination transmission for the second service line and other service lines is the same as the control for the first service line, and is not described herein again.
The embodiment of the invention also provides a system for monitoring the short message sending abnormity correspondingly. As shown in fig. 3, the system for monitoring short message transmission abnormality includes a statistics module, an early warning module, a processing module, and the like, wherein the statistics module counts the number of short messages transmitted by each service line according to the service line access identifier, the early warning module receives the number of short messages transmitted by each service line counted by the statistics module and determines whether the number of short messages transmitted by each service line exceeds a predetermined amount, and generates an early warning message for the service line exceeding the predetermined amount, the processing module receives the early warning message transmitted by the early warning module, determines the service line with the number of short messages exceeding the predetermined amount according to the early warning message, and stops transmitting the short message.
The method of the invention can be realized by a computer or an embedded program controlled system. Correspondingly, another system for monitoring short message sending exception is provided in the embodiment of the present invention, as shown in fig. 4, the system for monitoring short message sending exception includes at least one processor and at least one memory; the memory stores a computer program that performs the above method, and the processor calls the computer program in the memory to perform the above method.
Further, the memory may be communicatively coupled to the one or more processors and may have stored therein instructions executable by the one or more processors to cause the one or more processors to perform the method of the present invention.
All of the modules, processes of the present invention may be processed by one or more processors in a system. The processor may be any programmable microprocessor, microcomputer or multiple processor chip or chips that can be configured by software instructions (applications) to perform a variety of functions, including the functions of the various embodiments described herein. The processor may include internal memory sufficient to store the application software instructions, which may be volatile or non-volatile memory (e.g., flash memory) or a mixture of both. For the purposes of this description, a general reference to memory refers to all memory accessible by the processor, including internal memory, removable memory plugged into the apparatus, and memory within the processor itself.
By the technical scheme of the embodiment of the invention, the number of the short messages sent by each service line can be accurately counted automatically and early warning is carried out. Meanwhile, the short message sending quantity of each service line is monitored, so that when the short message sending quantity is far beyond the normal visit quantity due to the fact that illegal personnel maliciously control the short message sending, the malicious behavior can be found in time and processed in time, the malicious attack behavior can be effectively prevented, problems can be found actively when the system is attacked, and the possibility that the system is attacked further continuously is reduced.
It is not necessary that each step in the present invention is closely connected, and unless otherwise stated, it is not excluded that there are other steps between the two steps, and it is within the scope of the present invention as long as the object of the present invention is achieved. The claimed system may be comprised of a single device, a plurality of devices, a single element, or a plurality of elements. The devices and systems are not necessarily connected to each other by wire or directly, and an indirect connection or a wireless connection is within the scope of the present invention as long as the object of the present invention can be achieved.
In the present invention, the functions described may be implemented in hardware, software, firmware, or any combination thereof. If implemented in hardware, the functionality may be implemented within circuitry that may be suitable for use in processing circuitry in a system. The steps of a method or algorithm disclosed herein may be embodied in a processor-executable software module executed, which may reside on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a computer. By way of example, and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
Although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.