CN113794999A - Short message distribution method, device and storage medium - Google Patents

Short message distribution method, device and storage medium Download PDF

Info

Publication number
CN113794999A
CN113794999A CN202110963051.4A CN202110963051A CN113794999A CN 113794999 A CN113794999 A CN 113794999A CN 202110963051 A CN202110963051 A CN 202110963051A CN 113794999 A CN113794999 A CN 113794999A
Authority
CN
China
Prior art keywords
short message
message
service provider
short
sending
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110963051.4A
Other languages
Chinese (zh)
Other versions
CN113794999B (en
Inventor
李铁擎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Dewu Information Technology Co ltd
Original Assignee
Shanghai Dewu Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Dewu Information Technology Co ltd filed Critical Shanghai Dewu Information Technology Co ltd
Priority to CN202110963051.4A priority Critical patent/CN113794999B/en
Publication of CN113794999A publication Critical patent/CN113794999A/en
Application granted granted Critical
Publication of CN113794999B publication Critical patent/CN113794999B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

Abstract

The invention discloses a short message distribution method, a device and a storage medium, wherein the method comprises the following steps: receiving a short message template application message, and generating a short message template identifier after the short message template application message passes the verification; receiving a first short message sending application message, wherein the message comprises a receiver mobile phone number, a short message template identifier, a short message variable parameter and a corresponding parameter value; selecting a short message service provider from the short message service provider list, and constructing a second short message sending application message according to the mobile phone number of the receiving party, the short message content and the short message service provider and sending the second short message sending application message to the message queue; and acquiring a second short message sending application message from the message queue, and calling an interface corresponding to the short message service provider to send the short message content to the mobile phone number of the receiver. The embodiment of the invention solves the problem that a plurality of short message service providers need to be adapted to a plurality of short message service provider interfaces when being called, reduces the complexity of interface butt joint when an application layer sends short messages, and improves the concurrent processing capacity of short message sending.

Description

Short message distribution method, device and storage medium
Technical Field
The invention relates to the technical field of computers, in particular to a short message distribution method, a short message distribution device and a storage medium.
Background
The application of the mobile phone short message is more and more extensive on the internet service, and more companies use the mobile phone short message to perform services such as identifying codes, popularizing, notifying and the like. For convenience of use, the short message is not directly sent by an operator but used by calling an API (application program interface) provided by a short message service provider, so that the short message service access cost is reduced by packaging a third party, and the short message service access cost can be reduced by simultaneously accessing a plurality of service providers and internally bidding. However, the following problems exist when accessing different short message service providers:
1. API interfaces provided by different short message service providers are different, and corresponding access logic needs to be realized for each short message service provider; different business parties lack communication, and the probability of repeated labor is higher.
2. The contents of the short messages sent by the service party are uneven, the short messages have the limitation of word number, and the use cost is increased due to the excessive word number.
3. Aiming at the requirement of sending short messages in a large batch in a short time, the interface of a short message service provider is directly called, and the reliable concurrency amount cannot be ensured.
Disclosure of Invention
The invention mainly aims to provide a short message distribution method, a short message distribution device and a storage medium, and aims to solve the problems that in the prior art, API interfaces provided by different short message service providers are different, and a short message service sender needs to adapt to the API interface provided by each short message service provider, so that the workload of the short message service sender is increased. Meanwhile, when short messages are sent in a large batch in a short time, reliable concurrency cannot be guaranteed by directly calling the short message service provider interface.
In order to achieve the above object, the present invention provides a short message distribution method, which comprises the following steps:
receiving a short message template application message sent by a short message sender, wherein the short message template application message carries short message content and short message variable parameters, auditing the short message content and the short message variable parameters, and generating a short message template identifier after the short message template application message passes the auditing and returning the short message template identifier to the short message sender;
receiving a first short message sending application message sent by the short message sending party, wherein the first short message sending application message comprises a mobile phone number of a receiving party, the short message template identification, the short message variable parameter and a corresponding parameter value;
detecting the first short message sending application message; if the detection fails, discarding the first short message sending application message; if the detection is successful, creating short message content to be sent;
selecting a short message service provider, constructing a second short message sending application message according to the mobile phone number of the receiving party, the short message content and the short message service provider, and sending the second short message sending application message to a message queue;
and acquiring the second short message sending application message from the message queue, analyzing the mobile phone number of the receiving party, the short message content and the short message service provider from the second short message sending application message, and calling an interface corresponding to the short message service provider to send the short message content to the mobile phone number of the receiving party.
Optionally, the short message content and the short message variable parameter are audited, and an artificial auditing mode is adopted for auditing.
Optionally, the detecting the first short message transmission application message includes the following steps:
detecting whether the short message template mark exists or not;
detecting whether the quantity of the short message variable parameters and the quantity of the corresponding parameter values meet the quantity specified by the short message module corresponding to the short message template identification;
and detecting whether the mobile phone number of the receiver is legal or not.
Optionally, the selecting a short message service provider is implemented by the following steps:
selecting one of the SMS service providers with the lowest SMS sending cost or
Selecting one of the SMS service providers with the highest SMS transmission efficiency, or
And randomly selecting one short message service provider.
Optionally, before the interface corresponding to the short message service provider is called to send the short message content to the mobile phone number of the receiving party, the method further includes the following steps:
establishing an adaptation rule for an interface corresponding to each short message service provider;
and calling the adaptation rule to adapt the mobile phone number of the receiving party and the short message content to an interface corresponding to the short message service provider.
Optionally, the method further comprises the steps of:
and calling a short message callback interface provided by the short message service provider, and collecting feedback information sent by the short message service provider to the short message content.
Optionally, the method further comprises the steps of:
and calling a short message uplink interface provided by the short message service provider, and collecting the reply information of the user to the short message content.
In addition, in order to achieve the above object, the present invention further provides a short message distribution apparatus, including:
the template auditing unit is used for receiving a short message template application message sent by a short message sender, carrying short message content and short message variable parameters, and auditing the short message content and the short message variable parameters, and generating a short message template identifier after the short message template application message passes the auditing and returning the short message template identifier to the short message sender;
the short message receiving unit is used for receiving a first short message sending application message sent by the short message sending party, wherein the first short message sending application message comprises a mobile phone number of a receiving party, the short message template identification, the short message variable parameter and a corresponding parameter value;
the short message detection unit is used for detecting the first short message sending application message; if the detection fails, discarding the first short message sending application message; if the detection is successful, creating short message content to be sent;
the short message service provider selection unit is used for selecting a short message service provider and is also used for constructing a second short message sending application message according to the mobile phone number of the receiving party, the short message content and the short message service provider and sending the second short message sending application message to a message queue;
and the short message sending unit is used for acquiring the second short message sending application message from the message queue, analyzing the mobile phone number of the receiving party, the short message content and the short message service provider from the second short message sending application message, and calling an interface corresponding to the short message service provider to send the short message content to the mobile phone number of the receiving party.
In addition, to achieve the above object, the present invention also provides an electronic device, including: the short message distribution system comprises a memory, a processor and a short message distribution program which is stored on the memory and can run on the processor, wherein the short message distribution program is configured to realize the steps of the short message distribution method.
In addition, to achieve the above object, the present invention further provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of the short message distribution method as described above.
The invention solves the problem that a plurality of short message service provider interfaces need to be adapted when a plurality of short message service provider interfaces are called by adapting the plurality of short message service provider interfaces, reduces the complexity of interface butt joint when an application layer sends short messages and improves the concurrent processing capacity of short message sending.
Drawings
Fig. 1 is a schematic flow chart of a short message distribution method provided by the present invention.
Fig. 2 is another schematic flow chart of the short message distribution method provided by the present invention.
Fig. 3 is a schematic flow chart of short message detection provided by the present invention.
Fig. 4 is a schematic flow chart of interface matching of the short message service provider according to the present invention.
Fig. 5 is a block diagram of a short message distribution device provided in the present invention.
Fig. 6 is a schematic structural diagram of an electronic device provided in the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
In order to make the technical problems, technical solutions and advantageous effects to be solved by the present invention clearer and clearer, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in itself. Thus, "module", "component" or "unit" may be used mixedly.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
In one embodiment, as shown in fig. 1, the present invention provides a short message distribution method, including:
step 101, receiving a short message template application message sent by a short message sender, wherein the short message template application message carries short message content and short message variable parameters, auditing the short message content and the short message variable parameters, and generating a short message template identifier after the short message template application message passes the auditing and returning the short message template identifier to the short message sender.
In order to ensure that the content and the word number of the short message sent by the short message sending party are controllable, before the short message is sent, the short message sending party needs to apply for a short message template according to the content of the short message sent.
The short message template is a content template used when a short message sender sends a short message and consists of a pure fixed text or a fixed text plus a variable. After the template is created, only the variables can be changed according to the rules and replaced with the specified content meeting the format requirements.
Before sending a short message, a short message sending party needs to apply for a short message template from a short message service platform. And filling in the short message template type, the short message content and the short message variable parameter in the application. As shown in the following table:
Figure BDA0003222954450000051
the short message variable parameters and the short message content can be submitted to the short message service platform together.
And after receiving the short message template application message sent by the short message sender, the short message service platform verifies the type of the short message template, the content of the short message and the variable parameters of the short message carried in the message, wherein the verification mode adopts a manual mode for verification. And the auditor audits the short message content and the short message variable parameter to check whether the short message content belongs to the content which is allowed to be sent by the short message service platform, wherein the short message variable parameter meets the requirement of the short message service platform. If the audit is not passed, the short message service platform returns an audit failed message to the short message sending party, and the short message sending party carries the failed identification and the reason. The short message sending party can modify the short message template according to reasons and then submit the verification again.
After the verification is passed, the verifier clicks the verification pass on the short message service platform, the short message service platform generates a short message template identifier for the short message template, and then returns the message passing the verification of the short message template to the short message sender, wherein the message template identifier is carried by the message. The short message service platform stores the checked short message template identification and the content of the short message template application message, and the table is as follows:
Figure BDA0003222954450000061
102, receiving a first short message sending application message sent by the short message sending party, wherein the first short message sending application message comprises a mobile phone number of a receiving party, the short message template identification, the short message variable parameter and a corresponding parameter value.
After the short message template application of the short message sending party is passed, when the service needs to send the short message, for example, when the user needs to send the short message verification code to the mobile phone number of the user during registration. The method comprises the steps that a short message verification code is generated by a registration service, then a first short message sending application request message is constructed by using the short message verification code, a mobile phone number (namely a mobile phone number of a receiving party) registered by a user and a short message template identification (verification code), and the short message service platform is requested to send the registration verification code to the mobile phone number of the user. The parameters carried by the first short message sending application message are shown in the following table:
receiver mobile phone number 13800138086
Short message template mark vcode_sms_001
Short message variable parameter ${NUM_6}
Corresponding parameter value 654489
Step 103, detecting the first short message sending application message; if the detection fails, discarding the first short message sending application message; and if the detection is successful, creating the short message content to be sent.
After receiving a first short message sending application message sent by a short message sending party, the short message service platform needs to detect the content carried in the first short message sending application message. The detection flow is shown in fig. 3:
step 201, detecting whether the short message template mark exists.
If the short message template mark carried by the first short message sending application message is empty or the short message template mark cannot find related information in a database of the short message service platform, judging that the short message template mark detection fails, discarding the first short message sending application message and not sending the short message; otherwise, judging that the short message template mark detection is successful, and continuing the subsequent steps.
Step 202, detecting whether the number of the short message variable parameters and the corresponding parameter values meets the number specified by the short message module corresponding to the short message template identification.
The short message service platform detects whether the carried short message variable parameters (such as $ { NUM _6}), the corresponding parameter values (such as 654489) and the number recorded in the short message template identification (such as vocode _ sms _001) are matched. If the matching fails, discarding the first short message sending application message, and not sending the short message; and if the matching is successful, continuing the subsequent steps.
Step 203, detecting whether the mobile phone number of the receiver is legal.
And detecting the mobile phone number of the receiving party, if 13800138086 meets the requirement of Chinese mobile phone number format, whether the mobile phone number belongs to a valid mobile phone number. The method can be deployed in different areas according to the short message service platform, and verification is performed according to mobile phone number formats in different areas. If the mobile phone number fails to be checked, discarding the first short message sending application message and not sending the short message; if the mobile phone number is successfully checked, the content detection of the first short message sending application message is passed.
After the short message service platform passes the detection of the content carried by the first short message sending application message, the short message service platform needs to construct the short message content according to the short message template identifier, the short message variable parameter and the corresponding parameter value carried in the first short message sending application message. Acquiring the content corresponding to the short message template identification by using the short message template identification (such as vocode _ sms _ 001):
Figure BDA0003222954450000071
and then, the short message content in the short message template identification is taken out, and the short message variable parameter is replaced by the corresponding parameter value to obtain the short message content. Such as: your verification code is: 654489(5 minutes active), to keep the account secure, do not provide anyone with this passcode.
And 104, selecting a short message service provider, constructing a second short message sending application message according to the mobile phone number of the receiving party, the short message content and the short message service provider, and sending the second short message sending application message to a message queue.
The short message service platform is in butt joint with a plurality of short message service providers, and the butt-jointed short message service providers are stored in a database or a file. When the short message service platform needs to send a short message, a short message service provider (such as a sms platform) needs to be selected from a database or a file. When selecting the short message service provider, the selection can be carried out according to one of the following modes: selecting a short message service provider with the lowest short message sending cost; selecting a short message service provider with the highest short message sending efficiency; randomly selecting a short message service provider.
Serial number Short message service provider Cost of the short message Efficiency of sending short messages
1 Huacheng short message platform 0.045 element/bar 90%
2 Tencent message short message platform 0.05 yuan/bar 85%
3 Ali short message platform 0.05 yuan/bar 88%
4 Blue short message platform of making a wound 0.065 yuan/bar 82%
5 Chinese short message platform 0.07 yuan/bar 89%
The short message cost and the short message sending efficiency are manually configured when the short message service provider is in butt joint. The sending and type-selecting efficiency of the short message service provider can be updated by the short message service platform according to the feedback information of the short message sent by the short message service provider.
The short message service platform selects a short message service provider with the lowest cost, such as the Huawei short message service platform. And then constructing a second short message sending application message by using the mobile phone number of the receiver, the short message content and the short message service provider.
Figure BDA0003222954450000081
And after constructing a second short message sending application message, the short message service platform sends the second short message sending application message to the message queue. The short message service platform sends the second short message sending application message to the message queue, so as to prevent the service layer from sending a large amount of short messages to the short message service platform in a peak period, and when the short message service platform cannot send the short messages in time through a short message sending function provided by a short message service provider, smooth processing needs to be realized through the message queue.
The message queue can be a self-realized message queue in the short message service platform, such as a first-in first-out message queue; or message queue middleware provided by a third party, such as Kafka, RabbitMQ, RockketMQ and the like.
The message queue has a high data processing throughput, such as ten thousand or one hundred thousand. Therefore, when the service layer sends a large number of short messages at the same time in the service peak period, the message queue can be stored in time. After storing a large number of short messages in the message queue, the short message service platform can gradually acquire a second short message sending application message from the message queue according to the service processing capacity of the short message service platform, and then sends the short messages to the corresponding mobile phone numbers.
And 105, acquiring the second short message sending application message from a message queue, analyzing the mobile phone number of the receiving party, the short message content and the short message service provider from the second short message sending application message, and calling an interface corresponding to the short message service provider to send the short message content to the mobile phone number of the receiving party.
The short message service platform starts a plurality of threads or processes to call an interface provided by a short message service provider to send the short message. Each thread or process acquires the second short message from the message queue (such as RabbitMQ message queue middleware) step by step according to the service processing capacity of the thread or process. Acquiring a second short message sending application message, and taking out the mobile phone number of the receiver, the short message content and the short message service provider from the message, wherein the table is as follows:
Figure BDA0003222954450000091
the short message service platform adapts the mobile phone number of the receiver and the content of the short message to the interface for sending the short message by the short message service provider according to the interface adaptation flow shown in fig. 4. If the API is adapted to the China Mobile short message platform, the API sends the short message.
301, creating an adaptation rule for each interface corresponding to the short message service provider.
The short message service platform adapts the short message sending interface provided by each short message service provider, and adapts the mobile phone number and the short message content of the receiver to the interface provided by the corresponding short message service provider. If the short message platform interface adaptation rule is as follows:
and constructing a corresponding request message according to the Hua-is short message interface type.
Interface types are as follows:
request method POST
Access URI /sms/batchSendSms/v1
Communication protocol HTTPS
Request Headers parameter:
Figure BDA0003222954450000101
request Body parameter description
Figure BDA0003222954450000102
Figure BDA0003222954450000111
The method comprises the steps of carrying out adaptation according to the Huawei short message platform, constructing an adaptation rule, realizing the interior of the short message service platform through a programming language, and providing a function for adapting the mobile phone number and the short message content of a receiver to a short message sending API (application programming interface) of the Huawei short message platform according to a specific programming language (such as java).
The short message service platform provides a java class for each short message service provider, and is used for realizing the adaptation of the mobile phone number and the short message content of the receiver to the short message sending API provided by the short message service provider.
Step 302, calling the adaptation rule, and adapting the mobile phone number of the receiver and the short message content to an interface corresponding to the short message service provider.
And the short message service platform calls the corresponding java class according to the short message service provider information carried in the second short message sending application message. And if the huawei-sms-plat is a short message platform, calling the corresponding huawei-adapt-sms class to realize that the mobile phone number and the short message content of the receiver are adapted to the interface corresponding to the short message service provider. Such as:
Figure BDA0003222954450000112
Figure BDA0003222954450000121
after calling the java class corresponding to the short message service provider, the short message service platform adapts the mobile phone number of the receiver and the content of the short message to a short message sending API interface of the short message service provider, and submits the content of the short message to the short message service provider through the short message sending API interface. And after receiving the short message content through the short message sending API, the short message service provider sends the short message content to the mobile phone number of the receiver. Thereby completing the short message sending process.
The embodiment solves the problem that a plurality of short message service provider interfaces need to be adapted when a plurality of short message service provider interfaces are called by adapting the plurality of short message service provider interfaces, reduces the complexity of interface butt joint when an application layer sends short messages, and improves the concurrent processing capacity of short message sending.
In one embodiment, fig. 2 provides a flowchart of the process of sending feedback and replying to the short message after the step 105 in the embodiment of fig. 1.
And 106, calling a short message callback interface provided by the short message service provider, and collecting feedback information sent by the short message service provider to the short message content.
The short message service platform acquires the corresponding java class according to the short message service provider, and then calls a function of the short message callback interface function provided by the registered short message service provider in the java class. And submitting the receiving address of the short message sending result fed back by the short message service provider to the short message service provider. The short message service platform calls back an address, which is used for receiving a short message status report, such as: http:// my. com/receiveSMSRreport.
After the short message service provider sends the short message, the short message sending state, such as the short message sending success or the sending failure and the failure reason, is sent to the short message service platform through the callback address. The short message service platform receives the feedback information sent by the short message service provider, analyzes the corresponding information and stores the information in a database for a subsequent short message sending party to use.
Step 107, calling a short message uplink interface provided by the short message service provider, and collecting the reply information of the user to the short message content.
When the short message service platform is connected with the short message service provider, an address for receiving the uplink short message notification can be configured, for example: http:// my. com/recvSMS. After receiving the short message belonging to the short message service platform, the short message service provider sends the short message to the short message service platform through the address for receiving the uplink short message notification. The short message service platform receives the uplink short message sent by the short message service provider, analyzes the corresponding information and stores the information in a database for a subsequent short message sending party to use.
In this embodiment, the short message service platform configures a short message callback interface for receiving short message sending feedback information and uplink short message information reported by the short message service platform. The function of the short message service platform is enhanced, so that a short message sending party can know the short message sending state and the reply content of a user to the sent short message in time.
In addition, an embodiment of the present invention further provides a short message distribution apparatus, and with reference to fig. 5, the short message distribution apparatus includes:
the template auditing unit is used for receiving a short message template application message sent by a short message sender, carrying short message content and short message variable parameters, and auditing the short message content and the short message variable parameters, and generating a short message template identifier after the short message template application message passes the auditing and returning the short message template identifier to the short message sender;
the short message receiving unit is used for receiving a first short message sending application message sent by the short message sending party, wherein the first short message sending application message comprises a mobile phone number of a receiving party, the short message template identification, the short message variable parameter and a corresponding parameter value;
the short message detection unit is used for detecting the first short message sending application message; if the detection fails, discarding the first short message sending application message; if the detection is successful, creating short message content to be sent;
the short message service provider selection unit is used for selecting a short message service provider and is also used for constructing a second short message sending application message according to the mobile phone number of the receiving party, the short message content and the short message service provider and sending the second short message sending application message to a message queue;
and the short message sending unit is used for acquiring the second short message sending application message from the message queue, analyzing the mobile phone number of the receiving party, the short message content and the short message service provider from the second short message sending application message, and calling an interface corresponding to the short message service provider to send the short message content to the mobile phone number of the receiving party.
The embodiment solves the problem that a plurality of short message service provider interfaces need to be adapted when a plurality of short message service provider interfaces are called by adapting the plurality of short message service provider interfaces, reduces the complexity of interface butt joint when an application layer sends short messages, and improves the concurrent processing capacity of short message sending.
It should be noted that each unit in the apparatus may be configured to implement each step in the method, and achieve the corresponding technical effect, which is not described herein again.
Referring to fig. 6, fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
As shown in fig. 6, the electronic device may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include standard wired interfaces, wireless interfaces (e.g., WI-FI, 4G, 5G interfaces). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration shown in fig. 6 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 6, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a short message distribution program.
In the electronic apparatus shown in fig. 6, the network interface 1004 is mainly used for data communication with an external network; the user interface 1003 is mainly used for receiving input instructions of a user; the electronic device calls the short message distribution program stored in the memory 1005 through the processor 1001, and performs the following operations:
receiving a short message template application message sent by a short message sender, wherein the short message template application message carries short message content and short message variable parameters, auditing the short message content and the short message variable parameters, and generating a short message template identifier after the short message template application message passes the auditing and returning the short message template identifier to the short message sender;
receiving a first short message sending application message sent by the short message sending party, wherein the first short message sending application message comprises a mobile phone number of a receiving party, the short message template identification, the short message variable parameter and a corresponding parameter value;
detecting the first short message sending application message; if the detection fails, discarding the first short message sending application message; if the detection is successful, creating short message content to be sent;
selecting a short message service provider, constructing a second short message sending application message according to the mobile phone number of the receiving party, the short message content and the short message service provider, and sending the second short message sending application message to a message queue;
and acquiring the second short message sending application message from the message queue, analyzing the mobile phone number of the receiving party, the short message content and the short message service provider from the second short message sending application message, and calling an interface corresponding to the short message service provider to send the short message content to the mobile phone number of the receiving party.
Optionally, the short message content and the short message variable parameter are audited, and an artificial auditing mode is adopted for auditing.
Optionally, the detecting the first short message transmission application message includes the following steps:
detecting whether the short message template mark exists or not;
detecting whether the quantity of the short message variable parameters and the quantity of the corresponding parameter values meet the quantity specified by the short message module corresponding to the short message template identification;
and detecting whether the mobile phone number of the receiver is legal or not.
Optionally, the selecting a short message service provider is implemented by the following steps:
selecting one of the SMS service providers with the lowest SMS sending cost or
Selecting one of the SMS service providers with the highest SMS transmission efficiency, or
And selecting one short message service provider randomly.
Optionally, before the interface corresponding to the short message service provider is called to send the short message content to the mobile phone number of the receiving party, the method further includes the following steps:
establishing an adaptation rule for an interface corresponding to each short message service provider;
and calling the adaptation rule to adapt the mobile phone number of the receiving party and the short message content to an interface corresponding to the short message service provider.
Optionally, the method further comprises the steps of:
and calling a short message callback interface provided by the short message service provider, and collecting feedback information sent by the short message service provider to the short message content.
Optionally, the method further comprises the steps of:
and calling a short message uplink interface provided by the short message service provider, and collecting the reply information of the user to the short message content.
The embodiment solves the problem that a plurality of short message service provider interfaces need to be adapted when a plurality of short message service provider interfaces are called by adapting the plurality of short message service provider interfaces, reduces the complexity of interface butt joint when an application layer sends short messages, and improves the concurrent processing capacity of short message sending.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where a short message distribution program is stored on the computer-readable storage medium, and when executed by a processor, the short message distribution program implements the following operations:
receiving a short message template application message sent by a short message sender, wherein the short message template application message carries short message content and short message variable parameters, auditing the short message content and the short message variable parameters, and generating a short message template identifier after the short message template application message passes the auditing and returning the short message template identifier to the short message sender;
receiving a first short message sending application message sent by the short message sending party, wherein the first short message sending application message comprises a mobile phone number of a receiving party, the short message template identification, the short message variable parameter and a corresponding parameter value;
detecting the first short message sending application message; if the detection fails, discarding the first short message sending application message; if the detection is successful, creating short message content to be sent;
selecting a short message service provider, constructing a second short message sending application message according to the mobile phone number of the receiving party, the short message content and the short message service provider, and sending the second short message sending application message to a message queue;
and acquiring the second short message sending application message from the message queue, analyzing the mobile phone number of the receiving party, the short message content and the short message service provider from the second short message sending application message, and calling an interface corresponding to the short message service provider to send the short message content to the mobile phone number of the receiving party.
Optionally, the short message content and the short message variable parameter are audited, and an artificial auditing mode is adopted for auditing.
Optionally, the detecting the first short message transmission application message includes the following steps:
detecting whether the short message template mark exists or not;
detecting whether the quantity of the short message variable parameters and the quantity of the corresponding parameter values meet the quantity specified by the short message module corresponding to the short message template identification;
and detecting whether the mobile phone number of the receiver is legal or not.
Optionally, the selecting a short message service provider is implemented by the following steps:
selecting one of the SMS service providers with the lowest SMS sending cost or
Selecting one of the SMS service providers with the highest SMS transmission efficiency, or
And selecting one short message service provider randomly.
Optionally, before the interface corresponding to the short message service provider is called to send the short message content to the mobile phone number of the receiving party, the method further includes the following steps:
establishing an adaptation rule for an interface corresponding to each short message service provider;
and calling the adaptation rule to adapt the mobile phone number of the receiving party and the short message content to an interface corresponding to the short message service provider.
Optionally, the method further comprises the steps of:
and calling a short message callback interface provided by the short message service provider, and collecting feedback information sent by the short message service provider to the short message content.
Optionally, the method further comprises the steps of:
and calling a short message uplink interface provided by the short message service provider, and collecting the reply information of the user to the short message content.
The embodiment solves the problem that a plurality of short message service provider interfaces need to be adapted when a plurality of short message service provider interfaces are called by adapting the plurality of short message service provider interfaces, reduces the complexity of interface butt joint when an application layer sends short messages, and improves the concurrent processing capacity of short message sending.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, a controller, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A short message distribution method is characterized by comprising the following steps:
receiving a short message template application message sent by a short message sender, wherein the short message template application message carries short message content and short message variable parameters, auditing the short message content and the short message variable parameters, and generating a short message template identifier after the short message template application message passes the auditing and returning the short message template identifier to the short message sender;
receiving a first short message sending application message sent by the short message sending party, wherein the first short message sending application message comprises a mobile phone number of a receiving party, the short message template identification, the short message variable parameter and a corresponding parameter value;
detecting the first short message sending application message; if the detection fails, discarding the first short message sending application message; if the detection is successful, creating short message content to be sent;
selecting a short message service provider, constructing a second short message sending application message according to the mobile phone number of the receiving party, the short message content and the short message service provider, and sending the second short message sending application message to a message queue;
and acquiring the second short message sending application message from the message queue, analyzing the mobile phone number of the receiving party, the short message content and the short message service provider from the second short message sending application message, and calling an interface corresponding to the short message service provider to send the short message content to the mobile phone number of the receiving party.
2. The method of claim 1, wherein the short message content and the short message variable parameter are audited by a manual audit.
3. The method of claim 1, wherein the detecting the first sms application message comprises:
detecting whether the short message template mark exists or not;
detecting whether the quantity of the short message variable parameters and the quantity of the corresponding parameter values meet the quantity specified by the short message module corresponding to the short message template identification;
and detecting whether the mobile phone number of the receiver is legal or not.
4. The method of claim 1, wherein the selecting a short message service provider is performed by:
selecting one of the SMS service providers with the lowest SMS sending cost or
Selecting one of the SMS service providers with the highest SMS transmission efficiency, or
And randomly selecting one short message service provider.
5. The method of claim 1, wherein before the interface corresponding to the short message service provider is called to send the short message content to the mobile phone number of the receiving party, the method further comprises the following steps:
establishing an adaptation rule for an interface corresponding to each short message service provider;
and calling the adaptation rule to adapt the mobile phone number of the receiving party and the short message content to an interface corresponding to the short message service provider.
6. The method according to claim 1, characterized in that the method further comprises the steps of:
and calling a short message callback interface provided by the short message service provider, and collecting feedback information sent by the short message service provider to the short message content.
7. The method according to claim 1, characterized in that the method further comprises the steps of:
and calling a short message uplink interface provided by the short message service provider, and collecting the reply information of the user to the short message content.
8. A short message distribution device is characterized in that the device comprises:
the template auditing unit is used for receiving a short message template application message sent by a short message sender, carrying short message content and short message variable parameters, and auditing the short message content and the short message variable parameters, and generating a short message template identifier after the short message template application message passes the auditing and returning the short message template identifier to the short message sender;
the short message receiving unit is used for receiving a first short message sending application message sent by the short message sending party, wherein the first short message sending application message comprises a mobile phone number of a receiving party, the short message template identification, the short message variable parameter and a corresponding parameter value;
the short message detection unit is used for detecting the first short message sending application message; if the detection fails, discarding the first short message sending application message; if the detection is successful, creating short message content to be sent;
the short message service provider selection unit is used for selecting a short message service provider and is also used for constructing a second short message sending application message according to the mobile phone number of the receiving party, the short message content and the short message service provider and sending the second short message sending application message to a message queue;
and the short message sending unit is used for acquiring the second short message sending application message from the message queue, analyzing the mobile phone number of the receiving party, the short message content and the short message service provider from the second short message sending application message, and calling an interface corresponding to the short message service provider to send the short message content to the mobile phone number of the receiving party.
9. An electronic device, characterized in that the electronic device comprises: the short message distribution system comprises a memory, a processor and a short message distribution program which is stored on the memory and can run on the processor, wherein the short message distribution program is configured to realize the steps of the short message distribution method according to any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the steps of the short message distribution method according to any one of claims 1 to 7.
CN202110963051.4A 2021-08-20 2021-08-20 Short message distribution method, device and storage medium Active CN113794999B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110963051.4A CN113794999B (en) 2021-08-20 2021-08-20 Short message distribution method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110963051.4A CN113794999B (en) 2021-08-20 2021-08-20 Short message distribution method, device and storage medium

Publications (2)

Publication Number Publication Date
CN113794999A true CN113794999A (en) 2021-12-14
CN113794999B CN113794999B (en) 2022-11-01

Family

ID=78876241

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110963051.4A Active CN113794999B (en) 2021-08-20 2021-08-20 Short message distribution method, device and storage medium

Country Status (1)

Country Link
CN (1) CN113794999B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114979988A (en) * 2022-05-07 2022-08-30 中移互联网有限公司 Method and device for issuing short message, electronic equipment and storage medium
CN115226050A (en) * 2022-06-22 2022-10-21 百果园技术(新加坡)有限公司 Flow distribution method, flow distribution device, flow distribution equipment, storage medium and program product

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110337075A (en) * 2019-06-28 2019-10-15 北京奇才天下科技有限公司 A kind of short message sending method, device and electronic equipment based on APP type of service
CN111885516A (en) * 2020-07-09 2020-11-03 深圳市富之富信息技术有限公司 Multi-channel access short message configuration method and device, computer equipment and storage medium
CN111953776A (en) * 2020-08-12 2020-11-17 江苏云柜网络技术有限公司 Application service message pushing method and device, computer equipment and computer storage medium
CN112073923A (en) * 2020-09-04 2020-12-11 江苏锐创软件技术有限公司 Communication method, device, gateway and readable storage medium compatible with multiple operators
CN112069064A (en) * 2020-08-31 2020-12-11 北京首汽智行科技有限公司 Short message service provider API interface test method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110337075A (en) * 2019-06-28 2019-10-15 北京奇才天下科技有限公司 A kind of short message sending method, device and electronic equipment based on APP type of service
CN111885516A (en) * 2020-07-09 2020-11-03 深圳市富之富信息技术有限公司 Multi-channel access short message configuration method and device, computer equipment and storage medium
CN111953776A (en) * 2020-08-12 2020-11-17 江苏云柜网络技术有限公司 Application service message pushing method and device, computer equipment and computer storage medium
CN112069064A (en) * 2020-08-31 2020-12-11 北京首汽智行科技有限公司 Short message service provider API interface test method
CN112073923A (en) * 2020-09-04 2020-12-11 江苏锐创软件技术有限公司 Communication method, device, gateway and readable storage medium compatible with multiple operators

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114979988A (en) * 2022-05-07 2022-08-30 中移互联网有限公司 Method and device for issuing short message, electronic equipment and storage medium
CN114979988B (en) * 2022-05-07 2023-09-19 中移互联网有限公司 Method and device for issuing short message, electronic equipment and storage medium
CN115226050A (en) * 2022-06-22 2022-10-21 百果园技术(新加坡)有限公司 Flow distribution method, flow distribution device, flow distribution equipment, storage medium and program product
CN115226050B (en) * 2022-06-22 2024-04-19 百果园技术(新加坡)有限公司 Traffic distribution method, traffic distribution device, traffic distribution apparatus, traffic distribution storage medium, and traffic distribution program product

Also Published As

Publication number Publication date
CN113794999B (en) 2022-11-01

Similar Documents

Publication Publication Date Title
CN110347560B (en) Method, device, system, equipment and medium for prompting abnormity of big data product
CN113794999B (en) Short message distribution method, device and storage medium
CN109104360B (en) Mail sending method, mail sending system, computer equipment and storage medium
CN110519154B (en) Data transmission method, device, equipment and computer readable storage medium
CN109688047B (en) Message adaptation method, device and storage medium based on XML
CN114513762B (en) Service processing method, device, electronic equipment and computer readable medium
CN105165035B (en) Have both the multimedia message transmission of text message transmission
CN110909013A (en) Service list generation method, device, equipment and computer readable storage medium
CN103269384A (en) Rich client abnormality processing method, processing device and processing system
CN111475788A (en) Cross-border e-commerce platform account registration method, device, terminal and storage medium
WO2020073538A1 (en) Message sending method, device and system
CN106453582B (en) Asynchronous message pushing method and system
US20080268883A1 (en) Spam short message blocking system using a call back short message and a method thereof
RU2604983C2 (en) Service parsing method flexibly adapted to ims system service tag
CN106412000A (en) Domain name query processing method
US7809809B2 (en) Client provisioning using application characteristics template with flag parameters
CN116308236A (en) Mail processing method, mail processing device, electronic equipment and storage medium
CN110475215B (en) Message editing, transmitting and displaying method, server and terminal thereof
CN113645578B (en) Method and device for preventing repeated sending of information and storage medium
CN114745681B (en) Rich media information display method, rich media information display equipment and computer storage medium
US9160811B2 (en) Client provisioning with enhanced linking
CN114095365B (en) Processing method and device of Internet of things service based on 5G message
CN113239048B (en) Data management method and device, electronic equipment and storage medium
CN114979989A (en) 5G message drop-back method, system and device
CN110493735B (en) Short message processing method and device

Legal Events

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