CN114401258A - Short message sending method, device, electronic device and storage medium - Google Patents

Short message sending method, device, electronic device and storage medium Download PDF

Info

Publication number
CN114401258A
CN114401258A CN202111579453.0A CN202111579453A CN114401258A CN 114401258 A CN114401258 A CN 114401258A CN 202111579453 A CN202111579453 A CN 202111579453A CN 114401258 A CN114401258 A CN 114401258A
Authority
CN
China
Prior art keywords
short message
sending
target
message sending
target short
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.)
Withdrawn
Application number
CN202111579453.0A
Other languages
Chinese (zh)
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.)
DBAPPSecurity Co Ltd
Original Assignee
DBAPPSecurity 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 DBAPPSecurity Co Ltd filed Critical DBAPPSecurity Co Ltd
Priority to CN202111579453.0A priority Critical patent/CN114401258A/en
Publication of CN114401258A publication Critical patent/CN114401258A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • 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)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application relates to a short message sending method, a short message sending device, an electronic device and a storage medium, wherein the short message sending method comprises the following steps: acquiring a target short message sent by a situation awareness system; caching the target short message to a redis server; and selecting one from a plurality of short message gateways to send the target short message in the redis server until the target short message is successfully sent. By the method and the device, the problem that the short message sending function facing different gateways influences the realization of the service function of the situation awareness system in the prior art is solved, the service function decoupling of the short message sending function and the situation awareness system is realized, and the technical effect that the service function is not influenced when the situation awareness system pushes the short messages of different gateways is achieved.

Description

Short message sending method, device, electronic device and storage medium
Technical Field
The present application relates to the field of information technology, and in particular, to a short message sending method, device, electronic device, and storage medium.
Background
Situation awareness is an ability to dynamically and integrally know about security risks based on environment, and is a way to improve discovery, identification, understanding, analysis and corresponding handling ability of security threats from a global perspective based on security big data. The situation awareness system has the continuous monitoring capability of network space safety, can timely discover various attack threats and anomalies, has the capability of threat investigation analysis and visualization, and can quickly judge the influence range, attack path, purpose and means related to threats, thereby supporting effective safety decision and response, and establishing a safety early warning mechanism to perfect the levels of risk control, emergency response and overall safety protection.
The existing situation awareness system needs to inform each process in the situation awareness network to the relevant processor through a short message. However, when the situation awareness system is deployed, independent situation awareness platforms are provided in different regions, and are limited by the influence of regional differences, and different platforms have different short message gateways.
Aiming at the problem that the service function realization of the situation awareness system is influenced by the short message sending function facing different gateways in the related art, no effective solution is provided at present.
Disclosure of Invention
The embodiment provides a short message sending method, a short message sending device, an electronic device and a storage medium, so as to solve the problem that the short message sending function facing different gateways affects the realization of the service function of a situation awareness system in the related art.
In a first aspect, in this embodiment, a short message sending method is provided, where the method includes:
acquiring a target short message sent by a situation awareness system;
caching the target short message to a redis server;
and selecting one from a plurality of short message gateways to send the target short message in the redis server until the target short message is successfully sent.
In one embodiment, the acquiring the target short message sent by the situational awareness system includes: and asynchronously acquiring the target short message sent by the situation awareness system.
In one embodiment, the selecting one of the plurality of short message gateways to send the target short message in the redis server includes: routing the short message gateway and determining a target short message sending interface; and calling the target short message sending interface to send the target short message and acquiring a short message sending result.
In one embodiment, the target short message sending interface at least comprises an http interface and a webservices interface.
In one embodiment, the obtaining of the short message sending result includes: and if the short message transmission fails, carrying out routing selection on the short message gateway again, selecting the short message transmission interfaces corresponding to other short message gateways as the target short message transmission interfaces, and transmitting the target short message.
In one embodiment, the obtaining of the short message sending result further includes: and if the short message sending fails, counting the sending failure times of the target short message, if the sending failure times of the target short message exceeds a preset threshold value, storing the target short message to a retry queue, and sending other short messages in the redis server.
In a second aspect, a short message sending apparatus is provided in this embodiment, the apparatus includes:
the acquisition module is used for acquiring a target short message sent by the situation awareness system;
the storage module is used for caching the target short message to a redis server;
and the sending module is used for selecting one from a plurality of short message gateways to send the target short message in the redis server until the target short message is successfully sent.
In one embodiment, the redis server comprises a main server and at least one standby server, wherein the main server and the standby server are in heartbeat connection;
and if the connection between the main server and the standby servers is abnormal, selecting one of the standby servers as the main server.
In a third aspect, in this embodiment, an electronic device is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the electronic device implements the short message sending method according to the first aspect.
In a fourth aspect, a storage medium is provided in the present embodiment, and a computer program is stored thereon, and when executed by a processor, the computer program implements the short message sending method according to the first aspect.
Compared with the related art, the short message sending method, the short message sending device, the electronic device and the storage medium provided by the embodiment obtain the target short message sent by the situation awareness system; caching the target short message to a redis server; the method and the device have the advantages that one target short message in the redis server is selected from the multiple short message gateways and sent until the target short message is successfully sent, the problem that the short message sending function facing different gateways influences the realization of the service function of the situation awareness system in the prior art is solved, the service function decoupling of the short message sending function and the situation awareness system is realized, and the technical effect that the service function is not influenced when the situation awareness system pushes the short messages of different gateways is achieved.
The details of one or more embodiments of the application are set forth in the accompanying drawings and the description below to provide a more thorough understanding of the application.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a block diagram of a hardware structure of a terminal for transmitting a short message according to an embodiment of the present application;
fig. 2 is a flowchart of a short message sending method according to an embodiment of the present application;
fig. 3 is a block diagram of a short message sending apparatus according to an embodiment of the present application;
FIG. 4 is a schematic diagram of another short message sending apparatus according to an embodiment of the present application;
fig. 5 is a flowchart of another short message sending method according to an embodiment of the present application.
Detailed Description
For a clearer understanding of the objects, aspects and advantages of the present application, reference is made to the following description and accompanying drawings.
Unless defined otherwise, technical or scientific terms used herein shall have the same general meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The use of the terms "a" and "an" and "the" and similar referents in the context of this application do not denote a limitation of quantity, either in the singular or the plural. The terms "comprises," "comprising," "has," "having," and any variations thereof, as referred to in this application, are intended to cover non-exclusive inclusions; for example, a process, method, and system, article, or apparatus that comprises a list of steps or modules (elements) is not limited to the listed steps or modules, but may include other steps or modules (elements) not listed or inherent to such process, method, article, or apparatus. Reference throughout this application to "connected," "coupled," and the like is not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. Reference to "a plurality" in this application means two or more. "and/or" describes an association relationship of associated objects, meaning that three relationships may exist, for example, "A and/or B" may mean: a exists alone, A and B exist simultaneously, and B exists alone. In general, the character "/" indicates a relationship in which the objects associated before and after are an "or". The terms "first," "second," "third," and the like in this application are used for distinguishing between similar items and not necessarily for describing a particular sequential or chronological order.
The method embodiments provided in the present embodiment may be executed in a terminal, a computer, or a similar computing device. For example, the present invention is executed on a terminal, and fig. 1 is a block diagram of a hardware structure of a terminal for sending a short message according to an embodiment of the present invention. As shown in fig. 1, the terminal may include one or more processors 102 (only one shown in fig. 1) and a memory 104 for storing data, wherein the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA. The terminal may also include a transmission device 106 for communication functions and an input-output device 108. It will be understood by those of ordinary skill in the art that the structure shown in fig. 1 is merely an illustration and is not intended to limit the structure of the terminal described above. For example, the terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store a computer program, for example, a software program and a module of application software, such as a computer program corresponding to the short message sending method in the present embodiment, and the processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, so as to implement the method described above. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used to receive or transmit data via a network. The network described above includes a wireless network provided by a communication provider of the terminal. In one example, the transmission device 106 includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
With the development of science and technology, networks have been deepened into various industries and mass lives, but with the continuous expansion of network scale, various attacks are more and more, and the traditional network security cannot meet the current network security requirements, so that the perception of network security situation is generated accordingly.
The network security situation awareness system is usually a system integrating a plurality of data information systems such as antivirus software, a firewall, an intrusion monitoring system, a security auditing system and the like, and integrating the systems to evaluate the current whole network condition and predict the future change trend. The network security situation awareness system is mainly divided into four parts: data acquisition, feature extraction, situation assessment and safety early warning. Data acquisition is to extract data of the current whole network state, and the data includes a plurality of data such as a website security log, a vulnerability database, a malicious code database and the like, and is comprehensively arranged. After a large amount of data is collected, useful data is extracted from the data to perform corresponding preprocessing work, and data preparation is performed for the next work. Data acquisition and feature extraction are the bottommost layer of the whole network security situation perception system and belong to data preparation work. The situation evaluation is mainly to perform data fusion processing on the association time and perform association identification from multiple aspects such as time, space, protocols and the like. In short, the risk assessment and the risk level judgment are carried out on the current time by combining data information. After a large number of network states are extracted through the above steps, the system can evaluate and predict the current network state and the future network state according to the specified standard, and further give corresponding analysis reports and safety state early warning processing. The network security situation awareness system simply judges and warns the current network and the possible threats which will appear in the future by collecting and sorting data, gives an analysis report and helps enterprises to make measures of network security.
The situation awareness system needs to notify each process in the situation awareness network to the relevant processor through a short message. However, when the situation awareness system is deployed, independent situation awareness platforms are provided in different regions, and are limited by the influence of regional differences, different platforms have different short message gateways, and when the existing situation awareness system pushes a short message, two implementation manners generally exist in order to adapt to different short message gateways. The first implementation is to directly call the code for sending the short message in the service function of the situation awareness system. However, this method has a problem that, in order to adapt to different short message gateways, a manufacturer needs to modify a service logic code, and if short message transmission fails, a service function is blocked, resulting in poor user experience. Another way to implement this is to temporarily store the message through the message queue middleware, which may have the following problems: and other message middleware such as kafka, rabbitmq, rocktmq and activitymq which are all disk access-based middleware and have low read-write performance, high time delay, high maintenance cost and poor stability. Therefore, it is a technical problem to be solved urgently at present to improve the short message sending capability of the situation awareness system.
In this embodiment, a short message sending method is provided, and fig. 2 is a flowchart of a short message sending method according to an embodiment of the present application, and as shown in fig. 2, the flowchart includes the following steps:
step S201, a target short message sent by the situation awareness system is obtained.
Specifically, in the time notification and hidden danger notification service function, the situation awareness system needs to notify the next process handler of notification handling through a short message. And acquiring the target short message to be pushed through the service function of the situation awareness system.
Step S202, caching the target short message to a redis server.
Specifically, a target mobile phone number and short message content of a target short message to be sent are stored through a redis queue. The redis is a cache server based on a memory, supports a queue list type data storage structure, sends short message sending request content to the redis queue, can realize asynchronous decoupling of short message efficient storage and short message sending, and simultaneously supports a persistence function without data loss.
Step S203, selecting one from a plurality of short message gateways to send the target short message in the redis server until the target short message is successfully sent.
Specifically, the mobile phone number and the short message content of the short message receiver can be obtained by polling the short message sending content in the queue of the redis in a multithread mode, the short message is automatically routed to a specific gateway, the short message gateway is called to send the short message, and if the sending fails, the gateway is automatically switched until the sending succeeds.
Through the steps, the short message sending method sends the short message to be sent by the situation awareness system to the redis server for storage, and only needs to acquire the content of the short message from the redis server when the short message is sent, so that the decoupling of the short message sending function and the service function of the situation awareness system is realized, no matter what type of gateway the short message to be sent needs to be sent through, the core logic code of the service function does not need to be modified, and the code compiling difficulty is reduced. Meanwhile, the short message is stored in the redis server, and compared with the prior art that a middleware information sending method based on disk access is adopted, the short message reading and writing speed is improved, and the short message sending efficiency and the server maintenance cost are improved.
In one embodiment, the acquiring the target short message sent by the situational awareness system includes: and asynchronously acquiring the target short message sent by the situation awareness system.
Specifically, asynchronous acquisition is a concept as opposed to synchronous acquisition. Synchronous acquisition means that when a method is called, a calling party waits for the method to return a result and can continue to execute the method later. Asynchronous means that the caller does not get the result immediately, but the caller can continue to perform subsequent operations after the call is issued. Asynchronous calls have many advantages, for example, an asynchronous flow can immediately return preliminary results to the caller. Asynchronous flows may delay the final result data to the caller, during which more additional work may be done, such as result logging, etc. In the execution process of the asynchronous flow, resources such as occupied threads and the like can be released, blocking is avoided, thread processing is obtained again after results are generated, the asynchronous flow can return a result set uniformly after the results called for many times are obtained, and response efficiency is improved. According to the method and the device for acquiring the short message, the target short message sent by the situation awareness system is acquired in an asynchronous mode, the short message receiving efficiency can be improved, the short message generated in the situation awareness system can be acquired in time, and meanwhile, the method and the device are suitable for the large-data-volume working mode of the situation awareness system. The time delay of sending the short message is reduced, and the flow processing efficiency is improved.
In one embodiment, the selecting one of the plurality of short message gateways to send the target short message in the redis server includes: routing the short message gateway and determining a target short message sending interface; and calling the target short message sending interface to send the target short message and acquiring a short message sending result.
Specifically, routing selection is carried out according to the information content of the target short message and the mobile phone number of the target short message receiver, a short message gateway corresponding to the mobile phone number is selected, a short message sending interface corresponding to the short message gateway is called, the target short message is sent to the target short message receiver through the short message sending interface, and a short message sending result is obtained. The short message sending result comprises the success of short message sending and the failure of short message sending. The sending condition of the current target short message can be determined according to the short message sending result.
In one embodiment, the target short message sending interface at least comprises an http interface and a webservices interface.
In one embodiment, the obtaining of the short message sending result includes: and if the short message transmission fails, carrying out routing selection on the short message gateway again, selecting the short message transmission interfaces corresponding to other short message gateways as the target short message transmission interfaces, and transmitting the target short message.
Specifically, a plurality of short message gateways are arranged, and each time one short message gateway is selected to send a target short message and a short message sending result is obtained. If the short message is successfully sent, stopping selecting the short message gateway; if the short message is failed to be sent, other gateways are selected to send the target short message until the short message is successfully sent. Preferably, the gateways can be prioritized according to the content of the short message and/or the number of the short message recipient, and the gateway is selected according to the priority to send the target short message.
In one embodiment, the obtaining of the short message sending result further includes: and if the short message sending fails, counting the sending failure times of the target short message, if the sending failure times of the target short message exceeds a preset threshold value, storing the target short message to a retry queue, and sending other short messages in the redis server.
Specifically, two redis queues can be set for sending short messages, the first redis queue is used for receiving target short messages sent by the situation awareness system and sending the target short messages through the gateway, and the redis queue can be used as a normal sending queue; when the number of times of transmission failure of a certain short message in the normal transmission queue is excessive, the short message is put into a second redis queue, the second redis queue is used as a retry queue, and the gateway is reselected in the retry queue to try to transmit the target short message. Meanwhile, the normal sending queue sends the next target short message. And the normal sending queue and the retry queue select a gateway in parallel to send the short message without mutual interference. In order to determine whether the number of current short message sending failures is large, a preset threshold value can be configured, and if the number of current short message sending failures exceeds the preset threshold value, the number of short message sending failures is considered to be large, and the short message sending failures are required to be put into a retry queue. By the short message sending method in the embodiment of the application, the short message sending efficiency of the redis queue can be improved, the phenomenon that the redis queue is blocked because one or more short message sending failure times are large is avoided, and the short message sending efficiency is reduced.
It should be noted that the steps illustrated in the above-described flow diagrams or in the flow diagrams of the figures may be performed in a computer system, such as a set of computer-executable instructions, and that, although a logical order is illustrated in the flow diagrams, in some cases, the steps illustrated or described may be performed in an order different than here.
In this embodiment, a short message sending apparatus is further provided, and the apparatus is used to implement the foregoing embodiments and preferred embodiments, and the description of the apparatus is omitted for brevity. The terms "module," "unit," "subunit," and the like as used below may implement a combination of software and/or hardware for a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 3 is a block diagram of a short message sending apparatus according to an embodiment of the present application, and as shown in fig. 3, the apparatus includes:
the acquisition module 10 is used for acquiring a target short message sent by the situation awareness system;
the storage module 20 is configured to cache the target short message to a redis server;
the sending module 30 is configured to select one of the multiple short message gateways to send the target short message in the redis server until the target short message is successfully sent.
The obtaining module 10 is further configured to asynchronously obtain the target short message sent by the situation awareness system.
The sending module 30 is further configured to perform routing selection on the short message gateway and determine a target short message sending interface; and calling the target short message sending interface to send the target short message and acquiring a short message sending result.
The sending module 30 is further configured to call a target short message sending interface, where the target short message sending interface at least includes an http interface and a webservices interface.
The sending module 30 is further configured to reselect the routing for the short message gateway if the short message sending fails, select a short message sending interface corresponding to another short message gateway as the target short message sending interface, and send the target short message.
The sending module 30 is further configured to count the number of times of the target short message sending failure if the short message sending failure occurs, store the target short message to a retry queue if the number of times of the target short message sending failure exceeds a preset threshold, and send other short messages in the redis server.
In one embodiment, the redis server comprises a main server and at least one standby server, wherein the main server and the standby server are in heartbeat connection; and if the connection between the main server and the standby servers is abnormal, selecting one of the standby servers as the main server.
Specifically, a master-slave switching mechanism is introduced for the redis server to ensure high availability of the redis server. The main/standby switching mechanism includes connection, synchronization and switching. The connection means that the redis standby server is connected according to the IP and the socket of the redis main server port. The synchronization is realized by a special processor of the redis standby server, and the switching means that the two servers have heartbeat connection, namely the standby server continuously pings the main server, namely the main server is subjected to ping detection. ping commands are commonly used to test networks by sending test packets to a specified network address, detecting whether the network address is responsive, and counting response times as a check of network availability. Once the main server is abnormal, the connection is disconnected, and the rest standby servers reselect the main server.
The embodiment of the application provides another short message sending device. Fig. 4 is a schematic view of another short message sending apparatus according to an embodiment of the present application, and as shown in fig. 4, the short message sending apparatus includes a situation awareness early warning notification platform, a redis server, a short message handler module, and a short message gateway access system, which are connected in sequence, where:
when the network security situation awareness system realizes the event notification and hidden danger notification service functions, the situation awareness notification early warning platform generates an event notification short message and a hidden danger notification short message based on service logic and is used for notifying a next process handler to perform service processing.
The redis server is a cache server based on a memory, supports a queue list type data storage structure, and can realize asynchronous decoupling of efficient short message storage and short message sending by the situation awareness system to send the short message sending request content to the redis queue. In addition, the short message is stored in the redis server, and a persistence function is supported, so that data cannot be lost. Preferably, one main server and a plurality of standby servers may be set through the main/standby switching mechanism.
The short message processor module comprises a plurality of short message processors, can acquire the mobile phone number and the content of the short message by polling the short message sending content in the queue of redis in a multithread manner, automatically routes the short message to a specific short message gateway, calls the short message gateway to send the short message, and can realize automatic switching of the gateway if the short message is failed to be sent. Preferably, if the retry fails after a plurality of retries, the content of the short message is stored in the retry queue and is retransmitted through the retry processor.
The short message gateway access module is a platform system for providing third-party dynamic data exchange through an interface, the short message platform is seamlessly connected with various software systems, for example, the short message gateway access module is connected with a short message center of a third party through a dream network platform and transmits and receives the short message in real time, and a quick short message bidirectional or unidirectional channel is established for various systems or software, so that a mobile phone user can conveniently perform bidirectional communication with a mobile data Service Provider (SP) in a short message mode and receive information services provided by the mobile data Service Provider (SP). At present, the situation awareness system mainly focuses on the application of short message gateways, such as the interface docking of third-party short message gateways, such as the blue-eye, the voice communication, the hundred million, the Tencent, the China Mobile cloud (MAS), and the like, so as to realize the function of sending short messages according to mobile phone numbers.
The embodiment also provides a short message sending method which is applied to the short message sending device in the embodiment of the application. Fig. 5 is a flowchart of another short message sending method according to an embodiment of the present application, and as shown in fig. 5, the flowchart includes the following steps:
step S501, a notification service function module of the situation awareness system asynchronously sends a short message to a redis queue.
Specifically, when the short message is stored in the redis queue, a specific short message gateway for sending the short message does not need to be considered, and the short message sending and the short message gateway are decoupled. Due to the adoption of asynchronous processing, the response time of a front-end request is shortened, and the response speed is improved.
Step S502, the short message processor module subscribes the short message sending message stored in the redis queue and reads the short message content from the redis queue.
Step S503, the short message processor selects the route of the short message gateway, polls each short message gateway to send the short message, and finishes polling as long as 1 short message gateway is successfully sent.
Step S504, call the concrete short message gateway, send the short message, carry on the butt joint to the interface of every short message gateway and realize, such as http, webservices interface, deliver the content of the short message to the short message gateway provider, send the short message to the correspondent mobile phone number by the short message gateway.
And step S505, returning the sending result, processing according to the returned result of the short message gateway, and automatically trying other available short message gateways if the short message gateway fails.
Step S506, if the short message fails to be sent for multiple times, the short message is sent to a retry queue. Wherein, the maximum retry number can be configured according to actual needs.
And step S507, reading the short messages in the queue through the short message retry processor, and sending the short messages again according to the steps of the step S504 and the step S505.
Through the steps, the short message sending method of the embodiment of the application puts the short message sending task into the redis server for asynchronous processing. Because the short message task is stored based on the redis memory, the method has the advantages of high read-write performance and low time delay, and can realize the accumulation and persistence of the short message task. The unified short message sending processor is used for processing different types of short messages, and the unification of the short message sending process and the independence of the service function of the situation awareness system and the short message gateway are realized. In addition, the slave node is responsible for reading through the load reading and writing of the master node, and the concurrency of the server is improved. The master-standby switching mechanism among the redis servers can avoid the unavailability of service caused by single-point failure, and the high availability of the master-standby switching mechanism is the basis for sentinel mechanism and cluster realization. And the retry queue is isolated from the normal short message queue, and the retry short message has no influence on the normal short message.
The short message sending method can realize the short message butt-joint function of situation awareness report early warning in different areas, does not need to develop repeated codes, and reduces labor cost. Based on a redis memory level queue, the real-time performance is high, based on a persistence mechanism, the data safety and reliability are guaranteed, and based on the main-standby switching, the unavailability of service caused by a single-point fault can be avoided.
The above modules may be functional modules or program modules, and may be implemented by software or hardware. For a module implemented by hardware, the modules may be located in the same processor; or the modules can be respectively positioned in different processors in any combination.
There is also provided in this embodiment an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
and S1, acquiring the target short message sent by the situation awareness system.
And S2, caching the target short message to a redis server.
S3, selecting one from multiple short message gateways to send the target short message in the redis server until the target short message is successfully sent.
It should be noted that, for specific examples in this embodiment, reference may be made to the examples described in the foregoing embodiments and optional implementations, and details are not described again in this embodiment.
In addition, in combination with the short message sending method provided in the foregoing embodiment, a storage medium may also be provided in this embodiment. The storage medium having stored thereon a computer program; the computer program, when executed by a processor, implements any of the methods of sending short messages in the above embodiments.
It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to be limiting. All other embodiments, which can be derived by a person skilled in the art from the examples provided herein without any inventive step, shall fall within the scope of protection of the present application.
It is obvious that the drawings are only examples or embodiments of the present application, and it is obvious to those skilled in the art that the present application can be applied to other similar cases according to the drawings without creative efforts. Moreover, it should be appreciated that in the development of any such actual implementation, as in any engineering or design project, numerous implementation-specific decisions must be made to achieve the developers' specific goals, such as compliance with system-related and business-related constraints, which may vary from one implementation to another.
The term "embodiment" is used herein to mean that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is to be expressly or implicitly understood by one of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the patent protection. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims (10)

1. A short message sending method is characterized by comprising the following steps:
acquiring a target short message sent by a situation awareness system;
caching the target short message to a redis server;
and selecting one from a plurality of short message gateways to send the target short message in the redis server until the target short message is successfully sent.
2. The short message sending method according to claim 1, wherein the acquiring the target short message sent by the situational awareness system comprises:
and asynchronously acquiring the target short message sent by the situation awareness system.
3. The method for sending short messages according to claim 1, wherein the selecting one of the plurality of short message gateways to send the target short message in the redis server comprises:
routing the short message gateway and determining a target short message sending interface;
and calling the target short message sending interface to send the target short message and acquiring a short message sending result.
4. The method for sending short messages according to claim 1, wherein the target short message sending interface at least comprises an http interface and a webservices interface.
5. The short message sending method of claim 3, wherein the step of obtaining the short message sending result comprises:
and if the short message transmission fails, carrying out routing selection on the short message gateway again, selecting the short message transmission interfaces corresponding to other short message gateways as the target short message transmission interfaces, and transmitting the target short message.
6. The short message sending method of claim 3, further comprising, after obtaining the short message sending result:
and if the short message sending fails, counting the sending failure times of the target short message, if the sending failure times of the target short message exceeds a preset threshold value, storing the target short message to a retry queue, and sending other short messages in the redis server.
7. A short message sending device, characterized in that the device comprises:
the acquisition module is used for acquiring a target short message sent by the situation awareness system;
the storage module is used for caching the target short message to a redis server;
and the sending module is used for selecting one from a plurality of short message gateways to send the target short message in the redis server until the target short message is successfully sent.
8. The short message sending device of claim 7, wherein the redis server comprises a main server and at least one standby server, and the main server and the standby server are configured to have a heartbeat connection;
and if the connection between the main server and the standby servers is abnormal, selecting one of the standby servers as the main server.
9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the computer program to perform the short message sending method according to any one of claims 1 to 6.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
CN202111579453.0A 2021-12-22 2021-12-22 Short message sending method, device, electronic device and storage medium Withdrawn CN114401258A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111579453.0A CN114401258A (en) 2021-12-22 2021-12-22 Short message sending method, device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111579453.0A CN114401258A (en) 2021-12-22 2021-12-22 Short message sending method, device, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN114401258A true CN114401258A (en) 2022-04-26

Family

ID=81226506

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111579453.0A Withdrawn CN114401258A (en) 2021-12-22 2021-12-22 Short message sending method, device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN114401258A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115412865A (en) * 2022-08-11 2022-11-29 北京天融信网络安全技术有限公司 Short message gateway protocol calling method, system, electronic equipment and storage medium
CN115474168A (en) * 2022-09-15 2022-12-13 杭州安恒信息安全技术有限公司 Message unified sending method, device, equipment and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107889069A (en) * 2017-12-28 2018-04-06 广东蜂助手网络技术股份有限公司 A kind of Short Message Service Gateway system of selection, device, server and readable storage medium storing program for executing
CN108834086A (en) * 2018-06-25 2018-11-16 平安科技(深圳)有限公司 Method, apparatus, computer equipment and the storage medium that short message is sent
CN110601952A (en) * 2018-06-12 2019-12-20 北京京东尚科信息技术有限公司 Multi-channel message notification sending method and device
CN111918225A (en) * 2020-09-15 2020-11-10 北京值得买科技股份有限公司 Method for sending short message based on multiple operators

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107889069A (en) * 2017-12-28 2018-04-06 广东蜂助手网络技术股份有限公司 A kind of Short Message Service Gateway system of selection, device, server and readable storage medium storing program for executing
CN110601952A (en) * 2018-06-12 2019-12-20 北京京东尚科信息技术有限公司 Multi-channel message notification sending method and device
CN108834086A (en) * 2018-06-25 2018-11-16 平安科技(深圳)有限公司 Method, apparatus, computer equipment and the storage medium that short message is sent
CN111918225A (en) * 2020-09-15 2020-11-10 北京值得买科技股份有限公司 Method for sending short message based on multiple operators

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115412865A (en) * 2022-08-11 2022-11-29 北京天融信网络安全技术有限公司 Short message gateway protocol calling method, system, electronic equipment and storage medium
CN115412865B (en) * 2022-08-11 2023-11-24 北京天融信网络安全技术有限公司 Short message gateway protocol calling method, system, electronic equipment and storage medium
CN115474168A (en) * 2022-09-15 2022-12-13 杭州安恒信息安全技术有限公司 Message unified sending method, device, equipment and medium

Similar Documents

Publication Publication Date Title
US10917322B2 (en) Network traffic tracking using encapsulation protocol
US8086714B2 (en) Load balancing system
CN107171885B (en) A kind of methods, devices and systems of detection service device operating status
CN114401258A (en) Short message sending method, device, electronic device and storage medium
CN111176803B (en) Service processing method, device, server and storage medium
CN101257388B (en) Lawless exterior joint detecting method, apparatus and system
CN110740072B (en) Fault detection method, device and related equipment
CN106612284B (en) Streaming data transmission method and device
CN110908872B (en) Method and system for detecting server state
CN108400904A (en) A kind of health examination method and device based on micro services framework
CN109714190A (en) A kind of load balancing based on application level and failure transfer system and its method
CN113364852B (en) File transmission method and device and server
CN114338650A (en) File transmission method and device, electronic equipment and readable storage medium
CN111884875A (en) Offline device determination method and device
CN112671813B (en) Server determination method, device, equipment and storage medium
CN108235800B (en) Network fault detection method, control center equipment and computer storage medium
US20120083220A1 (en) Determining the quality of service in a communication terminal device
JP6117345B2 (en) Message system that avoids degradation of processing performance
CN108781215B (en) Network service implementation method, service controller and communication system
CN110233759B (en) Load abnormity warning method and related device
CN106209666B (en) Link multiplexing method and system based on load balancer
CN114356625A (en) Distributed system redundancy diagnosis method, device, electronic device and storage medium
CN114390059A (en) Service processing system and service processing method
CN110324179B (en) Load abnormity warning method and related device
CN109429236A (en) A kind of method for managing resource and device of core net

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
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20220426