Short message sending method, system, equipment and medium

Through the weight adjustment strategy of multi-channel and multi-account, the problem of insufficient SMS service reliability and international number support in traditional SaaS systems is solved, and the SMS sending with high availability and high reach rate is achieved, which enhances the stability of the system and global Expand capability.

CN119211855APending Publication Date: 2024-12-27BEIJING RENKE INTERACTIVE NETWORK TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411341491.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2024-12-27

Smart Images

  • Figure CN119211855A_ABST
    Figure CN119211855A_ABST
Patent Text Reader

Abstract

The invention provides a short message sending method, a short message sending system, short message sending equipment and a medium. The method comprises the following steps: pre-configuring a plurality of channels for sending short messages, wherein each channel is configured with a plurality of short message accounts with weights; selecting one channel from a plurality of channels according to the sending number, and selecting the short message account with the highest weight from a plurality of corresponding short message accounts to send a short message; if the sending fails, selecting the short message account with the highest weight from the rest of the short message accounts in the plurality of corresponding short message accounts to send the short message and reducing the weight of the short message account which fails to send the short message until the sending is successful or the sending of the plurality of corresponding short message accounts fails; and if the corresponding short message accounts fail to be sent, storing the short message sending data. Through multi-channel and multi-account configuration and a weight adjustment strategy, high availability and high reach rate of short message sending are ensured, a compensation mechanism is provided when short message sending fails, and the fault-tolerant capability and stability of the system are enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of SMS communication, and in particular to a method, system, device and medium for sending SMS. Background Art

[0002] In the SaaS (Software as a Service) model, Short Message Service (SMS) is essential for providing key functions such as authentication, information notification, and message reminders. However, traditional SaaS system SMS services usually rely on a single SMS service provider, which limits the reliability and flexibility of the system. When the SMS service provider encounters service interruptions or performance issues, it may cause SMS sending failures for the entire SaaS system, affecting user experience and business continuity.

[0003] In addition, with the development of global business, SaaS systems need to support mobile phone numbers in different regions at home and abroad, including international numbers. Existing SMS service solutions often lack support for international numbers, limiting the global expansion capabilities of SaaS systems. Summary of the invention

[0004] In view of the above defects or shortcomings of the prior art, the present invention provides a method, system, device and medium for sending SMS, which ensures high availability and high reach rate of SMS sending through multi-channel, multi-account configuration and weight adjustment strategy, and provides a compensation mechanism when SMS sending fails, thereby enhancing the fault tolerance and stability of the system.

[0005] Specifically, the present invention is achieved through the following technical solutions: In a first aspect, the present invention provides a method for sending text messages, comprising: pre-configuring multiple channels for sending text messages, wherein each channel is configured with multiple text message accounts with weights; selecting a channel from the multiple channels according to a sending number and selecting a text message account with the highest weight from the corresponding multiple text message accounts for text message sending; if the sending fails, selecting the text message account with the highest weight among the remaining text message accounts in the corresponding multiple text message accounts for text message sending and reducing the weight of the text message account that failed to send the text message until the sending is successful or the corresponding multiple text message accounts all fail to send; if the corresponding multiple text message accounts all fail to send, storing the text message sending data.

[0006] Furthermore, if the corresponding multiple SMS accounts all fail to send, the SMS sending data is stored, and it also includes: selecting the SMS account with the highest weight among the corresponding multiple SMS accounts for resending at predetermined intervals, and sending channel abnormality information if the resending reaches a threshold number of times.

[0007] Furthermore, the method also includes: after sending the channel abnormality information, manually selecting a channel and a short message account for compensation sending.

[0008] Furthermore, the multiple channels include: domestic channels, international channels and custom channels.

[0009] Furthermore, reducing the weight of the SMS account to which the SMS message sending fails also includes: sending SMS account abnormality information to the SMS account to which the SMS message sending fails.

[0010] Furthermore, the SMS sending data includes: SMS sending time, receiving mobile phone number and SMS content.

[0011] Furthermore, each of the multiple SMS accounts has a unique identifier and key.

[0012] In a second aspect, the present invention provides a text message sending system, comprising: a text message channel management module, configured to pre-configure multiple channels for text message sending, wherein each channel is configured with multiple text message accounts with weights; a text message sending module, configured to: select a channel from the multiple channels according to the sending number and select the text message account with the highest weight from the corresponding multiple text message accounts to send the text message; if the sending fails, select the text message account with the highest weight among the remaining text message accounts in the corresponding multiple text message accounts to send the text message and reduce the weight of the text message account that failed to send the text message until the sending is successful or the corresponding multiple text message accounts all fail to send; a text message sending compensation module, configured to: if the corresponding multiple text message accounts all fail to send, store the text message sending data, and select the text message account with the highest weight among the corresponding multiple text message accounts for resending at predetermined intervals, and send channel abnormality information if the resending reaches a threshold number of times; after sending the channel abnormality information, manually select the channel and text message account for compensation sending.

[0013] In a third aspect, the present invention provides a text message sending device, comprising: a memory and a processor, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the text message sending method described in the first aspect.

[0014] In a fourth aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for sending short messages described in the first aspect is implemented.

[0015] The present invention provides a method, system, device and medium for sending short messages. By pre-configuring multiple short message channels and multiple short message accounts with weights corresponding to each channel, the weight of the corresponding short message account is automatically reduced and other short message accounts are tried when the short message sending fails. Moreover, the short message sending compensation mechanism can be started when all short message accounts fail to send, thereby ensuring the high availability and high reach rate of short message sending and enhancing the fault tolerance and stability of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0017] Figure 1 is a flowchart of a method for sending a text message according to an embodiment of the present invention; Figure 2 is a configuration diagram of a short message channel according to an embodiment of the present invention; Figure 3 is a schematic diagram of a system for sending short messages according to an embodiment of the present invention. DETAILED DESCRIPTION

[0018] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0019] Figure 1 is a flowchart of a method for sending a text message according to an embodiment of the present invention. Figure 2 is a configuration diagram of a short message channel according to an embodiment of the present invention.

[0020] Reference Figure 1 and Figure 2Before sending SMS, it is necessary to pre-configure multiple channels for sending SMS, each of which is configured with multiple SMS accounts with weights (step S101). SMS channels can include domestic channels, international channels, and custom channels. SMS channels include SMS manufacturers, and you can choose several mainstream ones, including Chuanglan, Mandao, Tencent Cloud, Alibaba Cloud, Huawei Cloud, twillio, etc., and also support self-expansion integration. The SMS account is an API account in the SMS interface integration. Each account has a unique identifier and key. The SMS manufacturer and the SMS account are in a one-to-many relationship, that is, multiple SMS accounts of the same manufacturer can be configured. The account weight is a default weight value for each SMS account, and the default value is 100.

[0021] Furthermore, when sending a text message, a channel can be selected from the multiple channels according to the sending number and the text message account with the highest weight can be selected from the corresponding multiple text message accounts to send the text message (step S102). For example, a domestic channel or an international channel can be selected accordingly according to whether the sending number is a domestic number or an international number, that is, the corresponding text message manufacturer can be selected. After the channel is selected, the account with the highest weight can be preferentially selected from the multiple text message accounts of the channel to send text messages. If the text message account fails to send, it means that there may be some problems with the current account or channel, and the weight of this account will be automatically reduced.

[0022] Furthermore, if the sending fails, the SMS account with the highest weight among the remaining SMS accounts in the corresponding multiple SMS accounts is selected to send the SMS and the weight of the SMS account that failed to send the SMS is reduced until the sending is successful or the corresponding multiple SMS accounts all fail to send (step S103). For example, if the selected SMS account fails to send, it means that there may be a certain problem with the current account, and the weight of this account will be automatically reduced and the SMS account abnormal information will be sent for the SMS account that failed to send the SMS. When all SMS accounts corresponding to the channel fail to send, it means that there is a problem with the channel. At this time, the channel abnormal information can be sent according to the retry result of sending, which will be described in detail below.

[0023] Furthermore, if the corresponding multiple SMS accounts all fail to send, the SMS sending data is stored (step S104). For example, the SMS sending data may include the SMS sending time, the receiving mobile phone number and the SMS content, etc., which are used for data input of SMS compensation.

[0024] In another embodiment of the present invention, after the corresponding multiple SMS accounts have failed to send and the SMS sending data has been stored, the SMS account with the highest weight among the corresponding multiple SMS accounts can be selected at predetermined intervals for resending, and if the number of resending reaches a threshold, a channel abnormality message is sent. After sending the channel abnormality message, the channel and SMS account can be manually selected for compensation sending. Specifically, when a SMS fails to be sent, the system will automatically select a high-weighted SMS account for resending, for example, every 10 seconds. If the sending is successful, it will be deleted from the failure record; if the sending fails, it will retry to send three times every 10 seconds; if the sending still fails after retrying, an enterprise micro-alarm message will be issued, and manual intervention will be performed. After manually analyzing the cause of the failure, a suitable SMS channel and SMS account can be manually selected for compensation sending.

[0025] From the above, it can be seen that the SMS sending method provided by the present invention can pre-configure multiple SMS channels and multiple SMS accounts with weights corresponding to each channel, automatically reduce the weight of the corresponding SMS account and try other SMS accounts when SMS sending fails, and can start the SMS sending compensation mechanism when all SMS accounts fail to send, thereby ensuring high availability and high reach rate of SMS sending and enhancing the fault tolerance and stability of the system.

[0026] Figure 3 Schematic diagram of a text message sending system according to an embodiment of the present invention. Figure 3 The SMS sending system may include: an SMS channel management module 201, which may be configured to pre-configure multiple channels for SMS sending, wherein each channel is configured with multiple SMS accounts with weights; an SMS sending module 202, which may be configured to: select a channel from the multiple channels according to the sending number and select the SMS account with the highest weight from the corresponding multiple SMS accounts to send the SMS; if the sending fails, select the SMS account with the highest weight among the remaining SMS accounts in the corresponding multiple SMS accounts to send the SMS and reduce the weight of the SMS account that failed to send the SMS until the sending is successful or the corresponding multiple SMS accounts all fail to send; an SMS sending compensation module 203, which may be configured to: if the corresponding multiple SMS accounts all fail to send, store the SMS sending data, and select the SMS account with the highest weight among the corresponding multiple SMS accounts for resending at predetermined intervals, and send channel abnormality information if the resending reaches a threshold number of times; after sending the channel abnormality information, manually select the channel and SMS account for compensation sending.

[0027] The SMS sending system provided by the present invention can pre-configure multiple SMS channels and multiple SMS accounts with weights corresponding to each channel, automatically reduce the weight of the corresponding SMS account and try other SMS accounts when SMS sending fails, and can start the SMS sending compensation mechanism when all SMS accounts fail to send, thereby ensuring high availability and high reach rate of SMS sending and enhancing the fault tolerance and stability of the system.

[0028] In another embodiment of the present invention, a text message sending device is provided, which includes: a memory and a processor, wherein at least one instruction is stored in the memory, and the at least one instruction is loaded and executed by the processor to implement the text message sending method as described above.

[0029] In yet another embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the method for sending short messages as described above can be implemented.

[0030] In summary, the text message sending method, system, device and medium provided by the present invention can pre-configure multiple text message channels and multiple text message accounts with weights corresponding to each channel, automatically reduce the weight of the corresponding text message account and try other text message accounts when the text message sending fails, and can start the text message sending compensation mechanism when all text message accounts fail to send, thereby ensuring the high availability and high reach rate of text message sending and enhancing the fault tolerance and stability of the system.

[0031] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program code.

[0032] In addition, in the present invention, the description with reference to the terms "embodiment", "present embodiment", "another embodiment", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.

[0033] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for sending a text message, characterized in that: include: Pre-configure multiple channels for SMS sending, where each channel is configured with multiple SMS accounts with weights; Selecting a channel from the multiple channels according to the sending number and selecting the SMS account with the highest weight from the corresponding multiple SMS accounts to send the SMS; If the sending fails, select the SMS account with the highest weight among the remaining SMS accounts in the corresponding multiple SMS accounts to send the SMS and reduce the weight of the SMS account that failed to send the SMS, until the sending is successful or the corresponding multiple SMS accounts all fail to send the SMS; If the corresponding multiple SMS accounts all fail to send, the SMS sending data is stored.

2. The method for sending a short message according to claim 1, characterized in that: If the corresponding multiple SMS accounts all fail to send, the SMS sending data is stored, and the method also includes: selecting the SMS account with the highest weight among the corresponding multiple SMS accounts for resending at predetermined intervals, and sending channel abnormality information if the resending times reach a threshold.

3. The method for sending a short message according to claim 2, characterized in that: include: After sending the channel exception information, manually select the channel and SMS account to send compensation.

4. The method for sending a short message according to claim 1, characterized in that: The multiple channels include: domestic channels, international channels and custom channels.

5. The method for sending a short message according to claim 1, characterized in that: Reducing the weight of the SMS account to which the SMS message sending fails also includes: sending SMS account abnormality information for the SMS account to which the SMS message sending fails.

6. The method for sending a short message according to claim 1, characterized in that: The SMS sending data includes: SMS sending time, receiving mobile phone number and SMS content.

7. The method for sending a short message according to any one of claims 1 to 6, characterized in that: Each of the multiple SMS accounts has a unique identifier and a key.

8. A short message sending system, characterized in that: include: The SMS channel management module is configured to pre-configure multiple channels for SMS sending, wherein each channel is configured with multiple SMS accounts with weights; The SMS sending module is configured to: select a channel from the multiple channels according to the sending number and select the SMS account with the highest weight from the corresponding multiple SMS accounts to send the SMS; If the sending fails, select the SMS account with the highest weight among the remaining SMS accounts in the corresponding multiple SMS accounts to send the SMS and reduce the weight of the SMS account that failed to send the SMS, until the sending is successful or the corresponding multiple SMS accounts all fail to send the SMS; The SMS sending compensation module is configured to: if the corresponding multiple SMS accounts all fail to send, store the SMS sending data, and select the SMS account with the highest weight among the corresponding multiple SMS accounts for resending at a predetermined time, and send channel abnormality information if the resending reaches a threshold number of times; After sending the channel exception information, manually select the channel and SMS account to send compensation.

9. A short message sending device, characterized in that: include: A memory and a processor, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the SMS sending method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for sending a short message according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Service processing method and device, equipment, storage medium and product

    CN119967367A

  • A service processing method, apparatus, device, storage medium, and product

    CN119967367B