Short message distribution method, short message distribution system and server
By adopting multiple SMS sending engines distributed in the SMS sending system, the problem of inefficiency and high pressure of network equipment caused by the dependence of a single network device in the SMS sending system is solved, and high performance and high reliability SMS sending is achieved.
Patent Information
- Application Number
- CN202411954836.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-04-18
AI Technical Summary
In the prior art, the SMS gateway function relies on a single network device, resulting in low efficiency and high processing pressure of network equipment.
Multiple SMS sending engines deployed in a distributed manner receive SMS sending requests through the main sending engine, and select the target SMS sending engine from multiple SMS sending engines in turn, and send the requested content to the corresponding SMS gateway server.
It effectively alleviates the pressure on network devices, reduces the possibility of the processing pressure of SMS sending requests being concentrated on the same target SMS sending engine, and improves the high performance and high reliability of SMS sending.
Smart Images

Figure CN119854741A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of text messages, and in particular to a text message distribution method, a text message distribution system, and a server. Background Art
[0002] In recent years, remote office scenarios have become the focus of construction in medium and large enterprises. In order to improve the security of remote access, SMS verification is usually used to confirm whether the remote access device is legal.
[0003] In the related art, a network device can support SMS gateways of multiple protocol types to connect to different types of SMS gateway servers, such as CMPP (China Mobile Point-to-Point Protocol), SGIP (China United Telecom Short Message Gateway System Interface Protocol), ACC (a protocol in telecommunications SMS gateway communication) and other SMS gateway servers. When the network device processes a text message sending request, it will fill in the request message according to the corresponding SMS gateway type and corresponding configuration, and then connect with the corresponding type of SMS gateway server to communicate. However, such an implementation makes the entire SMS gateway function dependent on a single network device, and sending requests can usually only be processed sequentially, which is inefficient.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.
[0006] The embodiments of the present application provide a text message distribution method, a text message distribution system, and a server to improve the high performance and high reliability of text message sending.
[0007] An embodiment of the present application provides a text message distribution method, which is applied to multiple text message sending engines that are deployed in a distributed manner, and the method includes: a main sending engine among the multiple text message sending engines receives at least one text message sending request sent by a network device; the request content in each of the text message sending requests includes a text message to be distributed, a text message receiving number, and a text message gateway type; the main sending engine selects, for each of the text message sending requests, a target text message sending engine from the multiple text message sending engines in turn for processing the text message sending request, and sends the request content in the text message sending request to the target text message sending engine; wherein the target text message sending engine is used to send the text message to be distributed and the text message receiving number in the request content to a text message gateway server corresponding to the text message gateway type.
[0008] In the above implementation, by setting up a distributed SMS sending engine independent of the network device, the network device only needs to send at least one SMS sending request to the main sending engine in the distributed SMS sending engine to process the SMS sending request, without the need for the network device to sequentially process multiple SMS sending requests and interact with the corresponding SMS gateway server, which can effectively relieve the pressure on the network device. At the same time, the main sending engine sequentially selects a target SMS sending engine from multiple SMS sending engines for each SMS sending request, which can reduce the possibility of concentrating the processing pressure of different SMS sending requests on the same target SMS sending engine, which is conducive to achieving high performance and high reliability of SMS sending.
[0009] In some embodiments, the main sending engine selects a target SMS sending engine from the multiple SMS sending engines in turn for each SMS sending request, including: determining the current resource utilization of the main sending engine each time the main sending engine processes one SMS sending request; when the current resource utilization of the main sending engine is not higher than a preset threshold, selecting the main sending engine as the target SMS sending engine; when the current resource utilization of the main sending engine is higher than the preset threshold, selecting the slave sending engine with the best operating status from the multiple SMS sending engines as the target SMS sending engine.
[0010] In the above implementation, considering that when the current resource utilization of the main sending engine is not higher than the preset threshold, the operating state of the main sending engine is better, the main sending engine is used as the target SMS sending engine at this time. The main sending engine does not need to interact with other SMS sending engines, which can effectively alleviate the pressure on network equipment and facilitate improving the efficiency of SMS sending.
[0011] In some embodiments, the main sending engine selects a target SMS sending engine from the multiple SMS sending engines in turn for each SMS sending request, including:
[0012] Each time the main sending engine sends a text message sending request, a slave sending engine with a normal link among the multiple text message sending engines is used as a standby engine;
[0013] When there is one slave sending engine with the smallest number of connections among the candidate engines, the slave sending engine with the smallest number of connections is determined as the target SMS sending engine; the number of connections of each SMS sending engine is the number of connections established between the SMS sending engine and other devices in the network;
[0014] When there are multiple slave sending engines with the smallest number of connections in the alternative engines, the target SMS sending engine is selected from the slave sending engines with the smallest number of connections based on the packet loss rate and / or local properties of each slave sending engine with the smallest number of connections; the local properties include: one or more of: memory size, number of CPU cores, operating frequency, continuous operating time and network delay.
[0015] In the above implementation, it is considered that the reliability of the SMS sending engine may decrease as the number of connections increases. Selecting the slave sending engine with the smallest number of connections can improve the reliability of the SMS distribution system. At the same time, considering that the packet loss rate and / or local attributes can reflect the performance of each SMS sending engine, the target SMS sending engine is selected according to the packet loss rate and / or local attributes of each slave sending engine, so as to facilitate the selection of a slave sending engine with better performance as the target SMS sending engine, so as to improve the high performance and high reliability of SMS sending.
[0016] In some embodiments, the SMS distribution method further includes: the master sending engine obtains a general attribute configuration; and sends the general attribute configuration to each slave sending engine in the multiple SMS sending engines to trigger each of the slave sending engines to configure according to the general attribute configuration.
[0017] In the related art, the general attribute configuration is usually manually performed on each SMS sending engine in turn, which is inefficient and prone to errors. In the above implementation, the master sending engine pushes the general attribute configuration to the slave sending engine, and the slave sending engine performs the general attribute configuration by itself, which can improve the efficiency of the general attribute configuration of the SMS sending engine and is not prone to errors.
[0018] In some embodiments, the method further includes: the master sending engine receives upgrade information and uses the upgrade information for upgrading; if the upgrade of the master sending engine is successful, the master sending engine sends the upgrade information to each slave sending engine, triggering each slave sending engine to upgrade.
[0019] In the above implementation, there is no need to upgrade the network equipment, only the main sending engine needs to be upgraded, and the upgrade of the remaining slave sending engines depends on the main sending engine, so that the upgrade of the slave sending engine does not require human participation, which can reduce the cost of upgrading the SMS sending engine and improve the efficiency of upgrading the SMS sending engine.
[0020] In some embodiments, the method also includes: for each slave sending engine, when the slave sending engine is upgraded successfully, the master sending engine sends a service port switching instruction to the slave sending engine, wherein the service port switching instruction is used to instruct the slave sending engine to switch the service port used for communicating with the SMS gateway server from the first service port used before the upgrade to the second service port.
[0021] In the above implementation, by setting the first SMS receiving port and the second SMS receiving port, the first service port can be used for upgrading and the second service port can be used for communication during the upgrading process of the slave sending engine. After switching the first service port to the second service port, the upgrade of the slave sending engine can be completed, so that the slave distribution engine can maintain uninterrupted business during the upgrading process.
[0022] In some embodiments, the method also includes: obtaining, by the first SMS sending engine, local attributes of each of the SMS sending engines; wherein the local attributes include: priority; the first SMS sending engine is any one of the multiple SMS sending engines; the first SMS sending engine selects a main sending engine from the multiple SMS sending engines according to the priority; other SMS sending engines except the main sending engine are slave sending engines; when the first SMS sending engine is selected as the main sending engine, the first SMS sending engine sends notification information to the network device, wherein the notification information is used to indicate that the first SMS sending engine communicates with the network device as the main sending engine.
[0023] Considering that the set priority can reflect the performance of the SMS sending engine to a certain extent, in the above implementation, the main sending engine is selected according to the priority, and a main sending engine with better performance can be obtained. By managing the slave sending engine with better performance, high performance and high reliability of SMS sending can be achieved.
[0024] In some embodiments, the local attributes also include: one or more of memory size, number of CPU cores, operating frequency, continuous operating time and network delay; the first SMS sending engine selects a main sending engine from the multiple SMS sending engines according to the priority, including: when there is one SMS sending engine with the highest priority, using the SMS sending engine with the highest priority as the main sending engine; when there are multiple SMS sending engines with the highest priority, selecting a main sending engine from the multiple SMS sending engines according to the CPU utilization of each SMS sending engine and / or the local attributes.
[0025] In the above implementation, considering that the CPU utilization and / or local properties can reflect the performance of each SMS sending engine, the main sending engine is selected according to the CPU utilization and / or local properties of each SMS sending engine, so as to facilitate the selection of the main sending engine with better performance to manage the slave sending engine, so as to improve the high performance and high reliability of SMS sending.
[0026] In some embodiments, the method further includes: receiving password authentication information of the user, and verifying whether the password authentication information is correct; and sending a text message sending request to the main sending engine if the password authentication information is correct.
[0027] In the above implementation, by pre-verifying the user's password authentication information, it is possible to avoid a user who is not the account owner from requesting a text message, thereby reducing the text message sending pressure of the text message distribution system.
[0028] An embodiment of the present application provides a text message distribution method, which is applied to a network device, and the method includes: sending at least one text message sending request to a main sending engine among multiple text message sending engines that are deployed in a distributed manner; wherein the request content in each of the text message sending requests includes a text message to be distributed, a text message receiving number, and a text message gateway type; the main sending engine is used to select a target text message sending engine for processing the text message sending request from the multiple text message sending engines in turn for each of the text message sending requests; the target text message sending engine is used to send the text message to be distributed and the text message receiving number in the text message sending request to a text message gateway server corresponding to the text message gateway type.
[0029] In the above implementation, by setting up a distributed SMS sending engine independent of the network device, the network device only needs to send at least one SMS sending request to the main sending engine in the distributed SMS sending engine to process the SMS sending request, without the need for the network device to process multiple SMS sending requests in sequence and interact with the corresponding SMS gateway server, which can effectively relieve the pressure on the network device. At the same time, the main sending engine selects a target SMS sending engine from multiple SMS sending engines in sequence for each SMS sending request, which can reduce the possibility of concentrating the processing pressure of different SMS sending requests on the same target SMS sending engine, which is conducive to achieving high performance and high reliability of SMS sending.
[0030] In some embodiments, the method further includes: after successfully sending the SMS sending request to the main sending engine, not waiting to receive the SMS sending result from the SMS gateway server.
[0031] In the above implementation, after the network device successfully sends the SMS sending request to the main sending engine, there is no need to wait for the SMS sending result received from the SMS gateway server, which can reduce the interaction between the network device and the SMS gateway server and reduce the pressure on the network device.
[0032] An embodiment of the present application provides a text message distribution system, including: a network device and multiple text message distribution engines deployed in a distributed manner, wherein: the network device is used to: send at least one text message sending request to a main sending engine among the multiple text message sending engines; the request content in each of the text message sending requests includes a text message to be distributed, a text message receiving number, and a text message gateway type; the main sending engine is used to: receive at least one text message sending request sent by the network device; for each of the text message sending requests, select a target text message sending engine for processing the text message sending request from the multiple text message sending engines in turn, and send the request content in the text message sending request to the target text message sending engine; wherein the target text message sending engine is used to send the text message to be distributed and the text message receiving number in the request content to a text message gateway server corresponding to the text message gateway type.
[0033] In the above implementation, by setting up a network device and a server independent of the network device that includes multiple SMS distribution engines that are deployed in a distributed manner, the network device only needs to send at least one SMS sending request to the main sending engine in the distributed SMS sending engine to process the SMS sending request, without the need for the network device to sequentially process multiple SMS sending requests and interact with the corresponding SMS gateway server, which can effectively relieve the pressure on the network device. At the same time, the main sending engine sequentially selects a target SMS sending engine from multiple SMS sending engines for each SMS sending request, which can reduce the possibility of concentrating the processing pressure of different SMS sending requests on the same target SMS sending engine, which is conducive to achieving high performance and high reliability of SMS sending.
[0034] In some embodiments, each of the SMS sending engines is also used to send device information; receive and store device information of other engines; if the received device information shows that the SMS sending engine is the main sending engine, switch the device status to the slave sending engine; the device information includes: whether the SMS sending engine that sends the device information is the main sending engine; the other engines are the SMS sending engines other than the SMS sending engine that sends the device information.
[0035] In the above implementation, the SMS sending engines share information with each other, and when there is a master sending engine, the device state is automatically switched to the slave sending engine. The user does not need to set the device state of the SMS sending engine, which can save labor costs.
[0036] In some embodiments, each of the SMS sending engines is further configured to delete the stored device information of the other engine if the device information of the other engine is not received within a preset time period.
[0037] In the above implementation, by deleting the device information of other engines that have not received device information for a long time, the interference of the possible faulty SMS sending engine on the SMS distribution system can be reduced, thereby ensuring the stable operation of the SMS distribution system.
[0038] The above general description and the following description are exemplary and explanatory only and are not intended to limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] One or more embodiments are exemplarily described by corresponding drawings, and these exemplary descriptions and drawings do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings are considered similar elements, and the drawings do not constitute a scale limitation, and wherein:
[0040] Figure 1 A schematic diagram of the communication process of a network device SMS gateway function;
[0041] Figure 2 It is a schematic diagram of a text message distribution method of a text message distribution system provided in an embodiment of the present application;
[0042] Figure 3 is a schematic diagram of a text message distribution method of another text message distribution system provided in an embodiment of the present application;
[0043] Figure 4 It is a schematic diagram of a working method of SMS distribution provided in an embodiment of the present application.
[0044] Reference numerals:
[0045] 1: Network equipment; 2: SMS sending engine; 3: SMS gateway server; 4: Server; 5: Client. DETAILED DESCRIPTION
[0046] In order to be able to understand the features and technical contents of the embodiments of the present application in more detail, the implementation of the embodiments of the present application is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present application. In the following technical description, for the convenience of explanation, a full understanding of the disclosed embodiments is provided through multiple details. However, one or more embodiments can still be implemented without these details. In other cases, to simplify the drawings, well-known structures and devices can be simplified for display.
[0047] The terms "first", "second", etc. in the specification and claims of the embodiments of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the embodiments of the present application described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.
[0048] Unless otherwise stated, the term "plurality" means two or more.
[0049] The term "correspondence" may refer to an association relationship or a binding relationship. The correspondence between A and B means that there is an association relationship or a binding relationship between A and B.
[0050] Figure 1 FIG. 1 shows a schematic diagram of the communication between a short message gateway service and a short message gateway server in a single network device. Figure 1As shown, a short message sending engine (SMS agent) 2 is set in the network device 1. The short message sending engine 2 identifies different types of short message gateways to connect to different types of short message gateway servers 3, so that a single network device 1 can support short message gateways of multiple protocol types and connect to different types of short message gateway servers 3. When the network device 1 processes a short message sending request, it will fill in the request message according to the corresponding short message gateway type and corresponding configuration, and then connect to the short message gateway server for communication. Such an implementation makes the entire short message gateway function dependent on a single network device, and short message sending requests can usually only be processed sequentially, which is inefficient.
[0051] An embodiment of the present application provides a high-performance distributed SMS gateway sending engine device, in which the network device and the SMS sending engine are separated, and multiple SMS sending engines are deployed in a distributed manner. Different SMS contents can be distributed to different SMS agents, and the SMS agent communicates with the corresponding SMS gateway server. In this way, by setting up a distributed SMS sending engine independent of the network device, it is helpful to alleviate the processing pressure of the network device and achieve high performance and high reliability of SMS sending.
[0052] In this application, the SMS sending engine is called SMS (Short Message Service) agent, which is responsible for sending SMS requests to the SMS gateway server. The SMS sending engine is deployed on a PC (personal computer) or server outside the network device. The main sending engine is called master SMS agent, which is an SMS agent that communicates with the network device, and is used to receive SMS related information such as the SMS to be distributed, the SMS receiving number and the SMS gateway type sent by the network device, and then distribute the SMS related information to other SMS agents. The SMS gateway module in the network device is called SMS client, which is mainly used to receive SMS sending requests triggered by other modules in the network device. SSLVPN: A remote access VPN technology, in which the client establishes an SSL (a standard security technology for protecting information security on the network) encrypted channel with the server for data transmission. AAA is the abbreviation of authentication, authorization and accounting. It is a security management mechanism for access control in network security, providing three security services: authentication, authorization and accounting.
[0053] Embodiment 1
[0054] The present application embodiment provides a method for distributing short messages. Figure 2 As shown, Figure 2This is a flow chart of a method for distributing short messages provided in an embodiment of the present application. The method is applied to multiple short message sending engines using distributed deployment. The method may include:
[0055] Step S101, a main sending engine among multiple SMS sending engines receives at least one SMS sending request sent by a network device; the request content in each SMS sending request includes a SMS to be distributed, a SMS receiving number and a SMS gateway type.
[0056] In some embodiments, the network device may be an embedded network device. For example, the network device includes but is not limited to: a router, a switch, a network firewall, an IPS (Intrusion Prevention System), a WAF (Website Application Level Intrusion Prevention System), and the like.
[0057] In some embodiments, multiple SMS sending engines using distributed deployment may be deployed on a server, which may be an independent server or a server cluster consisting of multiple servers.
[0058] In some embodiments, after the main sending engine receives a text message sending request sent by a network device, it can also store the correspondence between the text messages to be distributed, the text message receiving number and the text message gateway type in the text message sending request into the information database according to the receiving time or processing priority of the text message sending request.
[0059] Exemplarily, Table 1 is an example table of an information database. As shown in Table 1, the information database stores the correspondence between the SMS messages to be distributed, the SMS receiving numbers and the SMS gateway types. The earlier the SMS sending request is received or the higher the processing priority, the earlier the ID of the SMS sending request is.
[0060] Table 1:
[0061]
[0062] Step S102: For each SMS sending request, the main sending engine sequentially selects a target SMS sending engine for processing the SMS sending request from a plurality of SMS sending engines, and sends the request content in the SMS sending request to the target SMS sending engine.
[0063] The target SMS sending engine is used to send the SMS to be distributed and the SMS receiving number in the request content to the SMS gateway server corresponding to the SMS gateway type.
[0064] In some embodiments, in step S102, the main sending engine selects a target SMS sending engine from multiple SMS sending engines in turn for each SMS sending request, which may include the following steps:
[0065] Step 101, when the main sending engine processes each SMS sending request, the current resource utilization rate of the main sending engine is determined;
[0066] Exemplarily, the current resource utilization of the main sending engine may be the CPU utilization of the main sending engine.
[0067] Step 102, when the current resource utilization rate of the main sending engine is not higher than a preset threshold, selecting the main sending engine as the target SMS sending engine;
[0068] For example, the preset threshold can be set according to the experience of the engineer. For example, the current resource utilization of the main sending engine is the CPU utilization. The preset threshold can be set to 30%, that is, when the CPU utilization of the main sending engine is not higher than 30%, the main sending engine is selected as the target SMS sending engine.
[0069] Step 103: When the current resource utilization rate of the main sending engine is higher than a preset threshold, a slave sending engine with the best operating status is selected from the multiple SMS sending engines as a target SMS sending engine.
[0070] Exemplarily, the operating status of the SMS sending engine in step 103 can be comprehensively considered based on the packet loss rate and / or local attributes. For example, the operating status of the SMS sending engine can be characterized by the first performance score described below, wherein the higher the first performance score, the better the operating status of the SMS sending engine.
[0071] In some embodiments, in step S102, the main sending engine selects a target SMS sending engine from multiple SMS sending engines in turn for each SMS sending request, which may include the following steps:
[0072] Step 201, when the main sending engine sends a text message sending request, a slave sending engine with a normal link among the multiple text message sending engines is used as a standby engine;
[0073] Step 202: when there is one slave sending engine with the smallest number of connections among the candidate engines, the slave sending engine with the smallest number of connections is determined as the target SMS sending engine; the number of connections of each SMS sending engine is the number of connections established between the SMS sending engine and other devices in the network;
[0074] Step 203, when there are multiple slave sending engines with the smallest number of connections in the alternative engines, select the target SMS sending engine from the slave sending engines with the smallest number of connections based on the packet loss rate and / or local attributes of each slave sending engine with the smallest number of connections; the local attributes include: one or more of: memory size, number of CPU cores, operating frequency, continuous operating time and network delay.
[0075] In some examples, the implementation process of step 103 in the aforementioned embodiment may include steps 201 to 203 .
[0076] In an optional manner of the above embodiment, screening the slave sending engines with normal links as candidate engines may be: selecting all the slave sending engines with normal links as candidate engines.
[0077] In another optional manner of the above embodiment, screening the slave sending engines with normal links as the candidate engines can be: screening the slave sending engines with normal links as the candidate engines; screening a preset number of candidate engines as the candidate engines. Wherein, the preset number is less than the total number of the candidate engines. In this way, since the main sending engine only needs to select one slave sending engine as the target SMS sending engine, by selecting the target SMS sending engine only from a part of the slave sending engines with normal links, the amount of calculation of the main sending engine can be reduced, and the pressure on the main sending engine can be alleviated.
[0078] In an optional manner of the above embodiment, step 203 may include: when there are multiple slave sending engines with the smallest number of connections in the alternative engines, for each slave sending engine with the smallest number of connections, obtaining a first performance score corresponding to the slave sending engine based on the packet loss rate and / or local properties of the slave sending engine; and selecting a target SMS sending engine from the alternative engines based on the first performance score corresponding to each slave sending engine with the smallest number of connections.
[0079] In some examples, based on the packet loss rate and local attributes of the slave sending engine, obtaining the first performance score corresponding to the slave sending engine can be: obtaining the first static weight corresponding to each attribute in the local attributes of the slave sending engine with the smallest number of connections; calculating the formula score1 = ∑(A(n)*SW(n)*(1-D)), where score1 is the first performance score; A(n) is the data of the nth attribute in the local attributes of the slave sending engine with the smallest number of connections; SW(n) is the first static weight corresponding to the nth attribute in the local attributes of the slave sending engine with the smallest number of connections; D is the packet loss rate of the slave sending engine with the smallest number of connections; * is multiplication.
[0080] The first static weight corresponding to the local attribute of the slave sending engine with the smallest number of connections can be obtained by searching the first static weight corresponding to the local attribute in a preset first weight data table. The first weight data table stores the correspondence between the local attribute and the first static weight.
[0081] It is worth noting that when the local attributes include multiple attributes, it is necessary to determine the corresponding first static weight for each attribute. For example, the local attributes include: memory size and number of CPU cores. The first static weight corresponding to the memory size and the first static weight corresponding to the number of CPU cores are searched through the first weight data table. The local attributes include: network delay and memory size. The first static weight corresponding to the network delay and the first static weight corresponding to the memory size are searched through the first weight data table.
[0082] In another optional manner of the above embodiment, a first performance score corresponding to the slave sending engine is obtained based on the packet loss rate and local properties of the slave sending engine: for each slave sending engine with the smallest number of connections: the local properties of the slave sending engine and the packet loss rate of the slave sending engine are input into a preset first score determination model to obtain the first performance score of the slave sending engine.
[0083] In the above optional manner, the first score determination model can be obtained by the following method: inputting the first training data with the first performance score label into the preset first training model for training to obtain the first score determination model. The first training data includes the sample local attributes of the sample sending engine and the sample packet loss rate of the sample sending engine.
[0084] Among them, the first training model can be a neural network model.
[0085] In another optional manner of the above embodiment, obtaining a first performance score corresponding to the slave sending engine according to the local attribute of the slave sending engine includes: for each slave sending engine with the smallest number of connections: searching a preset first relationship table for the first performance score corresponding to the local attribute of the slave sending engine. The preset first relationship table stores the correspondence between different local attributes and performance scores.
[0086] In another optional manner of the above embodiment, obtaining a first performance score corresponding to the slave sending engine according to the packet loss rate of the slave sending engine includes: for each slave sending engine with the smallest number of connections: searching a preset second relationship table for the first performance score corresponding to the packet loss rate of the slave sending engine. The preset second relationship table stores a correspondence between the packet loss rate and the performance score.
[0087] In an optional manner of the above embodiment, the target SMS sending engine is selected from the candidate engines according to the first performance score corresponding to each slave sending engine with the smallest number of connections. The method may be: if there is only one candidate engine with the highest first performance score, the candidate engine is used as the target SMS sending engine. If there are multiple candidate engines with the highest first performance scores, the SMS sending engine with the smallest IP address (Internet Protocol address) among the candidate engines with the highest first performance score is selected as the target SMS sending engine, or the SMS sending engine with the lowest CPU utilization rate among the candidate engines with the highest first performance score is selected as the target SMS sending engine.
[0088] Exemplarily, after receiving a message from a network device, the master SMS agent stores the received message in an information database. The master SMS agent queries the first data from the information database, i.e., the data with the most ID (identification number), selects the candidate engines based on whether the link of the SMS sending engine recorded in the preset sending table is normal, and selects an alternative engine as the target SMS sending engine based on the number of connections corresponding to the alternative engines. After the target SMS sending engine obtains the SMS to be distributed, the SMS receiving number, and the SMS gateway type from the master SMS agent, it notifies the SMS gateway server of the corresponding SMS gateway type to send the SMS to be distributed to the SMS receiving number. Among them, Table 2 is an example table of the sending table. As shown in Table 2, Table 2 records the IP address (Internet Protocol address) and link status of the SMS sending engine.
[0089] Table 2:
[0090] ip address Is the link normal? 192.168.1.10 √ 192.168.1.20 √ 192.168.1.30 √ 192.168.1.40 ×
[0091] In some embodiments, the SMS distribution method further includes: the master sending engine obtains the general attribute configuration; and sends the general attribute configuration to each slave sending engine in the plurality of SMS sending engines to trigger each slave sending engine to configure according to the general attribute configuration.
[0092] In the above embodiment, after each slave sending engine is triggered to configure according to the common attribute configuration, the method further includes: receiving the configuration results returned by each slave sending engine. The configuration results include: whether the configuration is successful. The slave sending engines whose configuration results are unsuccessful are deleted from the preset sending table.
[0093] Exemplarily, after the master SMS agent has configured all SMS gateway instances, it generates corresponding general attribute configurations (global configurations), and sends the general attribute configurations to the SMS agents in the sending table by querying the IP addresses of the SMS agents that already exist in the sending table. After receiving the general attribute configurations, the SMS agent automatically performs attribute configurations. After the configuration is completed, the SMS agent informs the master SMS agent whether the configuration is successfully sent. For SMS agents that fail to send, the master SMS agent deletes them from the sending table. Among them, the sending table may record SMS agents other than the master SMS agent. In this way, because each SMS agent can communicate with the SMS gateway server, the SMS agent needs to configure the corresponding SMS gateway instance, and each SMS gateway instance needs to configure multiple fields. If the instances are manually configured one by one on each SMS agent, the efficiency is low and error-prone. By only configuring on the master SMS agent, and the master SMS agent pushes the general attribute configuration to other SMS agents, the efficiency of configuring each SMS agent can be improved, and it is not easy to make mistakes.
[0094] In some embodiments, the SMS distribution method also includes: the main sending engine receives the upgrade information and uses the upgrade information to upgrade; when the main sending engine is successfully upgraded, the main sending engine sends the upgrade information to each slave sending engine, triggering each slave sending engine to upgrade.
[0095] In some embodiments, each SMS sending engine is provided with a first service port and a second service port. The SMS distribution method further includes: for each slave sending engine, when the slave sending engine is successfully upgraded, the master sending engine sends a service port switching instruction to the slave sending engine. The service port switching instruction is used to instruct the slave sending engine to switch the service port used for communicating with the SMS gateway server from the first service port used before the upgrade to the second service port.
[0096] Exemplarily, three ports are deployed on each SMS agent, one of which is used as a control port to issue control commands. Control commands include, for example, switching service ports, upgrading images (software image upgrades), and modifying configurations. The remaining two ports are used as service ports for communication. Under normal circumstances, it is assumed that port A of the SMS agent is used as a control port, port B of the SMS agent and port C of the SMS agent are used as service ports; the SMS agent uses port B to communicate with the SMS gateway server, and the other port C does not work at this time. After the SMS agent upgrades the image, the master SMS agent issues a command to switch service ports through port A. When the SMS agent receives the command to switch service ports, it stops the instance of sending SMS messages through port B, switches to port C for instance processing and SMS sending services. In this way, because there are many types of SMS gateways, in the prior art, if there is a new SMS gateway requirement, the system image needs to be updated. The implementation method of the present application does not require upgrading network equipment. Only the master SMS agent is upgraded in image, and then the remaining SMS agents are upgraded through the master SMS agent, so that there is no need for human participation in the image upgrade process of other SMS agents, which can reduce labor costs.
[0097] In some embodiments, in combination Figure 3 As shown, the SMS distribution method may further include the following steps:
[0098] Step S201: The first SMS sending engine obtains local attributes of each SMS sending engine.
[0099] The local attributes include: priority. The first SMS sending engine is any one of the multiple SMS sending engines.
[0100] It is understandable that the local attributes of the SMS sending engine are determined by the local configuration of the SMS sending engine. Each SMS sending engine can send the local attributes to the first SMS sending engine so that the first SMS sending engine obtains the local attributes of each SMS sending engine.
[0101] Step S202: the first SMS sending engine selects a main sending engine from among the SMS sending engines according to the priority.
[0102] Among them, the SMS sending engines other than the main sending engine are slave sending engines, and the main sending engine is used to manage the slave sending engines.
[0103] Step S203, when the first SMS sending engine is selected as the main sending engine, the first SMS sending engine sends notification information to the network device; wherein the notification information is used to instruct the first SMS sending engine to communicate with the network device as the main sending engine.
[0104] In some embodiments, the local attributes also include: one or more of memory size, number of CPU cores, operating frequency, continuous operating time and network latency; step S202 may include: when there is one SMS sending engine with the highest priority, using the SMS sending engine with the highest priority as the main sending engine; when there are multiple SMS sending engines with the highest priority, selecting the main sending engine from the multiple SMS sending engines based on the CPU utilization and / or local attributes of each SMS sending engine.
[0105] In an optional manner of the above embodiment, a main sending engine is selected from multiple SMS sending engines based on the CPU utilization and / or local properties of each SMS sending engine, which can be: determining a second performance score of each SMS sending engine based on the CPU utilization and / or the local properties of the SMS sending engine; and selecting the main sending engine from each SMS sending engine based on the second performance score.
[0106] In an optional manner of the above embodiment, determining the second performance score of each SMS sending engine based on the CPU utilization and the local attributes of the SMS sending engine can be: obtaining the second static weight corresponding to the local attribute; calculating score2=∑(B(n)*VW(n)*(1-T)), wherein score2 is the second performance score; B(n) is the data of the nth attribute in the local attributes of the SMS sending engine; VW(n) is the second static weight corresponding to the nth attribute in the local attributes of the SMS sending engine; and T is the CPU utilization of the SMS sending engine.
[0107] It is understandable that the attribute category of the local attribute of the SMS sending engine obtained by the first SMS sending engine may be different from the attribute category of the local attribute of the alternative engine obtained by the main sending engine. For example, the local attribute of the SMS sending engine includes: operating frequency and continuous operation time. The local attribute of the alternative engine includes: memory size and continuous operation time.
[0108] The second static weight corresponding to the local attribute of the SMS sending engine can be obtained by searching the second static weight corresponding to the local attribute of the SMS sending engine in a preset second weight data table. The second weight data table stores the correspondence between the local attribute of the SMS sending engine and the second static weight.
[0109] In another optional manner of the above embodiment, determining the second performance score of each SMS sending engine based on the CPU utilization and the local properties of the SMS sending engine can be: for each SMS sending engine: inputting the local properties of the SMS sending engine and the CPU utilization of the SMS sending engine into a preset second score determination model to obtain the second performance score of the SMS sending engine.
[0110] In the above optional manner, the second score determination model can be obtained by the following method: inputting the second training data with the second performance score label into the preset second training model for training to obtain the second score determination model. The second training data includes the sample local attributes of the sample SMS sending engine and the CPU utilization of the sample SMS sending engine.
[0111] The second training model may be a neural network model.
[0112] In an optional manner of the above embodiment, determining the second performance score of each SMS sending engine according to the CPU utilization may be: for each SMS sending engine: searching a preset third relationship table for the second performance score corresponding to the CPU utilization of the SMS sending engine. The preset third relationship table stores the correspondence between the CPU utilization of the SMS sending engine and the second performance score.
[0113] In an optional manner of the above embodiment, determining the second performance score of each SMS sending engine according to the local attribute of the SMS sending engine may be: for each SMS sending engine: searching the preset fourth relationship table for the second performance score corresponding to the local attribute of the SMS sending engine. The preset fourth relationship table stores the correspondence between the local attribute of the SMS sending engine and the second performance score.
[0114] In some embodiments, when the SMS sending engine serving as the main sending engine is disconnected from the network, the process of selecting the main sending engine is retriggered, that is, steps S201 to S203 are executed.
[0115] In some embodiments, the above method further comprises:
[0116] When the priority of the local attribute in the configuration file of any SMS sending engine is modified to the minimum value in the current network, the SMS sending engine participates in preemption to become the main sending engine after a preset period of time, which can improve the stability of the system. Here, the smaller the priority value of the local attribute of the SMS sending engine, the higher the priority of the SMS sending engine.
[0117] In summary, the solution provided by the embodiments of the present application has at least the following beneficial effects:
[0118] 1. Distributed deployment of multiple SMS agents, sending multiple SMS contents to different SMS agents, and communicating with the SMS gateway server is conducive to improving performance;
[0119] 2. The application of the master SMS agent selection algorithm can dynamically select the best agent in the network as the master to ensure the efficiency and stability of SMS sending;
[0120] 3. Through the automatic discovery mechanism, the master SMS agent can automatically negotiate with other SMS agents in the network;
[0121] 4. Except for the master SMS agent, the global configuration of other SMS agents is pushed by the master, and the configuration is simple;
[0122] 5. The SMS agent deploys two SMS sending ports to ensure uninterrupted business while the image is upgraded.
[0123] Embodiment 2
[0124] The present invention provides a method for distributing short messages, which is applied to a network device and includes the following steps:
[0125] S301: Send at least one SMS sending request to a main sending engine among multiple SMS sending engines that adopt distributed deployment.
[0126] Among them, the request content in each SMS sending request includes the SMS to be distributed, the SMS receiving number and the SMS gateway type; the main sending engine is used to select a target SMS sending engine for processing the SMS sending request from multiple SMS sending engines in turn for each SMS sending request; the target SMS sending engine is used to send the SMS to be distributed and the SMS receiving number in the SMS sending request to the SMS gateway server corresponding to the SMS gateway type.
[0127] In some embodiments, the network device may be an embedded network device. For example, the network device includes but is not limited to: a router, a switch, a network firewall, an IPS (Intrusion Prevention System), a WAF (Website Application Level Intrusion Prevention System), and the like.
[0128] In some embodiments, multiple SMS sending engines using distributed deployment may be deployed on a server, which may be an independent server or a server cluster consisting of multiple servers.
[0129] The implementation process of the above step S301 can refer to the relevant description content of step S101 in the above embodiment and embodiment 1, and will not be repeated here.
[0130] In this embodiment, by setting a distributed SMS sending engine independent of the network device, the network device only needs to send at least one SMS sending request to the main sending engine in the distributed SMS sending engine to process the SMS sending request, without the need for the network device to sequentially process multiple SMS sending requests and interact with the corresponding SMS gateway server, which can effectively relieve the pressure on the network device. At the same time, the main sending engine sequentially selects a target SMS sending engine from multiple SMS sending engines for each SMS sending request, which can reduce the possibility of concentrating the processing pressure of different SMS sending requests on the same target SMS sending engine, which is conducive to achieving high performance and high reliability of SMS sending.
[0131] In some embodiments, the method further includes: after successfully sending the SMS sending request to the main sending engine, not waiting to receive the SMS sending result from the SMS gateway server.
[0132] Accordingly, the SMS sending result returned by the SMS gateway server received by the target SMS sending engine only needs to be notified to the main sending engine, without the need for the network device to keep waiting for the request sending result. This implementation can close the connection in time, save resources, and improve performance. When the SMS fails to be sent, the main sending engine can display the SMS failure information to the user, so that the user can troubleshoot the SMS sending failure problem in the main sending engine and locate it.
[0133] In the above implementation, after the network device successfully sends the SMS sending request to the main sending engine, there is no need to wait for the SMS sending result received from the SMS gateway server, which can reduce the interaction between the network device and the SMS gateway server and reduce the pressure on the network device.
[0134] In some embodiments, the SMS distribution method further includes: receiving password authentication information of the user, and verifying whether the password authentication information is correct; and sending an SMS sending request to the main sending engine when the password authentication information is correct.
[0135] Exemplarily, when the password authentication information is correct, the SMS to be distributed, the SMS receiving number and the SMS gateway type are sent to the main sending engine.
[0136] In the above embodiment, the SMS to be distributed is obtained by: obtaining SMS content; determining an SMS sending template according to the SMS gateway type; assembling the SMS content and the SMS sending template to obtain the SMS to be distributed.
[0137] Determining the SMS sending template according to the SMS gateway type may be to search for the SMS sending template corresponding to the SMS gateway type in a preset template database. The preset template database stores the correspondence between the SMS gateway type and the SMS sending template.
[0138] The assembling of the SMS content and the SMS sending template may be to replace the preset characters in the SMS sending template with the SMS content.
[0139] For example, the SMS gateway type is mobile, and the SMS sending template is, for example, "What is the verification code for this login?" Please use it within ten minutes. The SMS content is, for example, "112233". The SMS sending template and the SMS content are combined to obtain the SMS to be distributed: "What is the verification code for this login? Please use it within ten minutes."
[0140] Embodiment 3
[0141] An embodiment of the present application provides a server, including: multiple SMS distribution engines in a distributed deployment, wherein: a main sending engine among the multiple SMS sending engines receives at least one SMS sending request sent by a network device; the request content in each SMS sending request includes a to-be-distributed SMS, a SMS receiving number, and an SMS gateway type; the main sending engine selects, for each SMS sending request, a target SMS sending engine for processing the SMS sending request from the multiple SMS sending engines in turn, and sends the request content in the SMS sending request to the target SMS sending engine; wherein the target SMS sending engine is used to send the to-be-distributed SMS and the SMS receiving number in the request content to an SMS gateway server corresponding to the SMS gateway type.
[0142] In some embodiments, the main sending engine is used to: determine the current resource utilization of the main sending engine each time a text message sending request is processed; when the current resource utilization of the main sending engine is not higher than a preset threshold, select the main sending engine as the target text message sending engine; when the current resource utilization of the main sending engine is higher than the preset threshold, select the slave sending engine with the best operating status from multiple text message sending engines as the target text message sending engine.
[0143] In some embodiments, the main sending engine is used to: when sending a text message sending request, use a slave sending engine with a normal link among multiple text message sending engines as a backup engine; when there is one slave sending engine with the smallest number of connections among the backup engines, determine the slave sending engine with the smallest number of connections as the target text message sending engine; the number of connections of each text message sending engine is the number of connections established between the text message sending engine and other devices in the network; when there are multiple slave sending engines with the smallest number of connections among the backup engines, select the target text message sending engine from the slave sending engines with the smallest number of connections based on the packet loss rate and / or local properties of each slave sending engine with the smallest number of connections; the local properties include: one or more of memory size, number of CPU cores, operating frequency, continuous operating time and network delay.
[0144] In some embodiments, the master sending engine is used to: obtain a common attribute configuration; and send the common attribute configuration to each slave sending engine in a plurality of SMS sending engines to trigger each slave sending engine to configure according to the common attribute configuration.
[0145] In some embodiments, the master sending engine is used to: receive upgrade information and use the upgrade information for upgrading; when the upgrade of the master sending engine is successful, the master sending engine sends the upgrade information to each slave sending engine, triggering each slave sending engine to upgrade.
[0146] In some embodiments, the master sending engine is used to: for each slave sending engine, when the slave sending engine is successfully upgraded, the master sending engine sends a service port switching instruction to the slave sending engine, wherein the service port switching instruction is used to instruct the slave sending engine to switch the service port used for communicating with the SMS gateway server from the first service port used before the upgrade to the second service port.
[0147] In some embodiments, a first SMS sending engine among multiple SMS sending engines is used to: obtain local properties of each SMS sending engine; wherein the local properties include: priority; the first SMS sending engine is any one of the multiple SMS sending engines; a main sending engine is selected from the multiple SMS sending engines according to the priority; other SMS sending engines except the main sending engine are slave sending engines; when the first SMS sending engine is selected as the main sending engine, a notification message is sent to the network device, wherein the notification message is used to indicate that the first SMS sending engine communicates with the network device as the main sending engine.
[0148] In some embodiments, the local attributes also include: one or more of memory size, number of CPU cores, operating frequency, continuous operating time and network latency; the first SMS sending engine is used to: when there is one SMS sending engine with the highest priority, use the SMS sending engine with the highest priority as the main sending engine; when there are multiple SMS sending engines with the highest priority, select the main sending engine from the multiple SMS sending engines based on the CPU utilization and / or local attributes of each SMS sending engine.
[0149] Embodiment 4
[0150] An embodiment of the present application provides a network device, which sends at least one SMS sending request to a main sending engine among multiple SMS sending engines that are deployed in a distributed manner; wherein the request content in each SMS sending request includes a SMS to be distributed, a SMS receiving number, and an SMS gateway type; the main sending engine is used to select a target SMS sending engine for processing the SMS sending request from multiple SMS sending engines in turn for each SMS sending request; the target SMS sending engine is used to send the SMS to be distributed and the SMS receiving number in the SMS sending request to an SMS gateway server corresponding to the SMS gateway type.
[0151] In some embodiments, the network device is used to: after successfully sending the SMS sending request to the main sending engine, not wait to receive the SMS sending result from the SMS gateway server.
[0152] Embodiment 5
[0153] The present application embodiment provides a short message distribution system. Figure 4 As shown, the SMS distribution system includes: a network device 1 and a server 4, and the server 4 includes a plurality of SMS distribution engines that are deployed in a distributed manner.
[0154] Wherein: the network device is used to: send at least one SMS sending request to a main sending engine among multiple SMS sending engines; the request content in each SMS sending request includes the SMS to be distributed, the SMS receiving number and the SMS gateway type.
[0155] The main sending engine is used to: receive at least one SMS sending request sent by a network device; for each SMS sending request, select a target SMS sending engine for processing the SMS sending request from multiple SMS sending engines in turn, and send the request content in the SMS sending request to the target SMS sending engine; wherein the target SMS sending engine is used to send the SMS to be distributed and the SMS receiving number in the request content to the SMS gateway server 3 corresponding to the SMS gateway type.
[0156] Optionally, the main sending engine is used to: determine the current resource utilization of the main sending engine each time a SMS sending request is processed; when the current resource utilization of the main sending engine is not higher than a preset threshold, select the main sending engine as the target SMS sending engine; when the current resource utilization of the main sending engine is higher than a preset threshold, select the slave sending engine with the best operating status from multiple SMS sending engines as the target SMS sending engine.
[0157] Optionally, the main sending engine is used to: when sending a text message sending request, use a slave sending engine with a normal link among multiple text message sending engines as a backup engine; when there is one slave sending engine with the smallest number of connections among the backup engines, determine the slave sending engine with the smallest number of connections as the target text message sending engine; the number of connections of each text message sending engine is the number of connections established between the text message sending engine and other devices in the network; when there are multiple slave sending engines with the smallest number of connections among the backup engines, select the target text message sending engine from the slave sending engines with the smallest number of connections based on the packet loss rate and / or local properties of each slave sending engine with the smallest number of connections; the local properties include: one or more of memory size, number of CPU cores, operating frequency, continuous operating time and network delay.
[0158] Optionally, the master sending engine is used to: obtain a common attribute configuration; and send the common attribute configuration to each slave sending engine in the multiple SMS sending engines to trigger each slave sending engine to perform configuration according to the common attribute configuration.
[0159] Optionally, the master sending engine is used to: receive upgrade information and use the upgrade information to upgrade; when the upgrade of the master sending engine is successful, the master sending engine sends the upgrade information to each slave sending engine, triggering each slave sending engine to upgrade.
[0160] Optionally, the main sending engine is used to: for each slave sending engine, when the slave sending engine is upgraded successfully, the main sending engine sends a service port switching instruction to the slave sending engine, wherein the service port switching instruction is used to instruct the slave sending engine to switch the service port used for communicating with the SMS gateway server from the first service port used before the upgrade to the second service port.
[0161] Optionally, the first SMS sending engine among multiple SMS sending engines is used to: obtain local attributes of each SMS sending engine; wherein the local attributes include: priority; the first SMS sending engine is any SMS sending engine among the multiple SMS sending engines; a main sending engine is selected from the multiple SMS sending engines according to the priority; other SMS sending engines except the main sending engine are slave sending engines; when the first SMS sending engine is selected as the main sending engine, a notification message is sent to the network device, wherein the notification message is used to indicate that the first SMS sending engine communicates with the network device as the main sending engine.
[0162] Optionally, the local attributes also include: one or more of memory size, number of CPU cores, operating frequency, continuous operating time and network latency; the first SMS sending engine is used to: when there is one SMS sending engine with the highest priority, use the SMS sending engine with the highest priority as the main sending engine; when there are multiple SMS sending engines with the highest priority, select the main sending engine from the multiple SMS sending engines based on the CPU utilization and / or local attributes of each SMS sending engine.
[0163] Optionally, the network device 1 is also used to receive the user's password authentication information and verify whether the password authentication information is correct; if the password authentication information is correct, the SMS to be distributed, the SMS receiving number and the SMS gateway type are sent to the main sending engine.
[0164] The password authentication information may be an account number and a password. The password authentication protocol may be a VPN password authentication or a webauth (an API for authentication on a browser) password authentication.
[0165] In the above embodiment, the network device can form the SMS to be distributed in the following manner: obtain SMS content; determine the SMS sending template according to the SMS gateway type; assemble the SMS content and the SMS sending template to obtain the SMS to be distributed.
[0166] Exemplarily, after the user enters the password authentication information on the VPN (virtual private network) client 5, he clicks to obtain the verification code, and the SMS request is passed to the SSLVPN module of the network device 1. The SSLVPN module of the network device 1 first performs password authentication with the AAA module of the network device 1, and after the authentication is passed, a verification code is randomly generated, and the verification code is combined with the SMS sending template to generate a to-be-distributed SMS, and the network device 1 sends the to-be-distributed SMS to the SMS gateway module (SMS client). After receiving the request, the SMS client of the network device 1 passes it to the main sending engine. After the main sending engine receives the to-be-distributed SMS, it selects a SMS content to be sent from the sending engine, and the sending engine uses the to-be-distributed SMS and the mobile phone number to splice the request message according to the SMS gateway type, and sends the request message to the SMS gateway server 3 corresponding to the SMS gateway type. After receiving the request message, the SMS gateway server 3 sends the to-be-distributed SMS to the user terminal where the mobile phone number is located. The user can use the received to-be-distributed SMS to log in to the VPN.
[0167] Optionally, the network device is used for: after successfully sending the SMS sending request to the main sending engine, not waiting to receive the SMS sending result from the SMS gateway server.
[0168] In some embodiments, the relevant descriptions of the main sending engine, the slave sending engine, and the first SMS sending engine in the multiple SMS distribution engines can refer to the relevant descriptions of the server provided in the aforementioned embodiment 2, which will not be repeated here. In the embodiments provided in the present application, it should be understood that the disclosed devices, systems, and methods can be implemented in other ways. The system embodiments described above are merely schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0169] The embodiments or examples of the present disclosure are not exhaustive, but are only illustrative of some embodiments or examples, and are not intended to be specific limitations on the scope of protection of the present disclosure. In the absence of contradiction, each step in a certain embodiment or example can be implemented as an independent example, and the steps can be combined arbitrarily. For example, the scheme after removing some steps in a certain embodiment or example can also be implemented as an independent example, and the order of the steps in a certain embodiment or example can be arbitrarily exchanged. In addition, the optional methods or optional examples in a certain embodiment or example can be combined arbitrarily; in addition, the various embodiments or examples can be combined arbitrarily, for example, some or all steps of different embodiments or examples can be combined arbitrarily, and a certain embodiment or example can be combined arbitrarily with the optional methods or optional examples of other embodiments or examples.
[0170] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0171] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A method for distributing short messages, characterized in that: The method is applied to multiple SMS sending engines using distributed deployment, and the method includes: The main sending engine among the multiple SMS sending engines receives at least one SMS sending request sent by the network device; the request content in each SMS sending request includes the SMS to be distributed, the SMS receiving number and the SMS gateway type; The main sending engine selects, for each of the SMS sending requests, a target SMS sending engine for processing the SMS sending request from the multiple SMS sending engines in turn, and sends the request content in the SMS sending request to the target SMS sending engine; The target SMS sending engine is used to send the SMS to be distributed and the SMS receiving number in the request content to the SMS gateway server corresponding to the SMS gateway type.
2. The method according to claim 1, characterized in that The main sending engine selects a target SMS sending engine from the multiple SMS sending engines in turn for each SMS sending request, including: Determining the current resource utilization rate of the main sending engine each time the main sending engine processes one of the short message sending requests; When the current resource utilization rate of the main sending engine is not higher than a preset threshold, selecting the main sending engine as the target SMS sending engine; When the current resource utilization rate of the master sending engine is higher than a preset threshold, a slave sending engine with the best operating status is selected from the multiple SMS sending engines as a target SMS sending engine.
3. The method according to claim 1, characterized in that: The main sending engine selects a target SMS sending engine from the multiple SMS sending engines in turn for each SMS sending request, including: Each time the main sending engine sends a text message sending request, a slave sending engine with a normal link among the multiple text message sending engines is used as a standby engine; When there is one slave sending engine with the smallest number of connections among the candidate engines, the slave sending engine with the smallest number of connections is determined as the target SMS sending engine; the number of connections of each SMS sending engine is the number of connections established between the SMS sending engine and other devices in the network; When there are multiple slave sending engines with the smallest number of connections in the alternative engines, the target SMS sending engine is selected from the slave sending engines with the smallest number of connections based on the packet loss rate and / or local properties of each slave sending engine with the smallest number of connections; the local properties include: one or more of: memory size, number of CPU cores, operating frequency, continuous operating time and network delay.
4. The method according to claim 1, characterized in that: The method further comprises: The main sending engine obtains the general attribute configuration; The general attribute configuration is sent to each slave sending engine in the multiple short message sending engines to trigger each slave sending engine to perform configuration according to the general attribute configuration.
5. The method according to claim 1, characterized in that The method further comprises: The main sending engine receives the upgrade information and performs the upgrade using the upgrade information; When the master sending engine is successfully upgraded, the master sending engine sends the upgrade information to each slave sending engine, triggering each slave sending engine to upgrade; Preferably, the method further comprises: For each slave sending engine, when the slave sending engine is upgraded successfully, the master sending engine sends a service port switching instruction to the slave sending engine, wherein the service port switching instruction is used to instruct the slave sending engine to switch the service port used for communicating with the SMS gateway server from the first service port used before the upgrade to the second service port.
6. The method according to claim 1, characterized in that The method further comprises: The first SMS sending engine obtains the local attributes of each of the SMS sending engines; wherein the local attributes include: priority; the first SMS sending engine is any one of the multiple SMS sending engines; The first SMS sending engine selects a main sending engine from the multiple SMS sending engines according to the priority; other SMS sending engines except the main sending engine are slave sending engines; When the first SMS sending engine is selected as the main sending engine, the first SMS sending engine sends notification information to the network device, wherein the notification information is used to instruct the first SMS sending engine to communicate with the network device as the main sending engine.
7. The method according to claim 6, characterized in that The local attributes also include: one or more of memory size, number of CPU cores, operating frequency, continuous operating time and network latency; The first SMS sending engine selects a main sending engine from the multiple SMS sending engines according to the priority, including: When there is one SMS sending engine with the highest priority, use the SMS sending engine with the highest priority as the main sending engine; When there are multiple SMS sending engines with the highest priority, a main SMS sending engine is selected from the multiple SMS sending engines according to the CPU utilization and / or the local attribute of each SMS sending engine.
8. A method for distributing short messages, characterized in that: The method is applied to a network device, and the method comprises: Sending at least one SMS sending request to a main sending engine among multiple SMS sending engines that adopt distributed deployment; wherein the request content in each of the SMS sending requests includes the SMS to be distributed, the SMS receiving number and the SMS gateway type; The main sending engine is used to select a target SMS sending engine for processing the SMS sending request from the multiple SMS sending engines in turn for each SMS sending request; The target SMS sending engine is used to send the SMS to be distributed and the SMS receiving number in the SMS sending request to the SMS gateway server corresponding to the SMS gateway type.
9. The method according to claim 8, characterized in that The method further comprises: After the SMS sending request is successfully sent to the main sending engine, there is no need to wait for receiving the SMS sending result from the SMS gateway server.
10. A server, characterized in that: include: Multiple SMS distribution engines are deployed in a distributed manner, including: The main sending engine among the multiple SMS sending engines receives at least one SMS sending request sent by the network device; the request content in each SMS sending request includes the SMS to be distributed, the SMS receiving number and the SMS gateway type; The main sending engine selects, for each of the SMS sending requests, a target SMS sending engine for processing the SMS sending request from the multiple SMS sending engines in turn, and sends the request content in the SMS sending request to the target SMS sending engine; The target SMS sending engine is used to send the SMS to be distributed and the SMS receiving number in the request content to the SMS gateway server corresponding to the SMS gateway type.
11. A short message distribution system, characterized in that: include: A network device and a server, wherein the server includes a plurality of SMS distribution engines in a distributed deployment, wherein: The network device is used for: Sending at least one SMS sending request to a main sending engine among the multiple SMS sending engines; the request content in each of the SMS sending requests includes the SMS to be distributed, the SMS receiving number and the SMS gateway type; The main sending engine is used for: Receiving at least one SMS sending request sent by the network device; For each of the SMS sending requests, sequentially selecting a target SMS sending engine for processing the SMS sending request from the multiple SMS sending engines, and sending the request content in the SMS sending request to the target SMS sending engine; The target SMS sending engine is used to send the SMS to be distributed and the SMS receiving number in the request content to the SMS gateway server corresponding to the SMS gateway type.