WO2016090764A1 - 一种短信发送方法、装置和计算机存储介质 - Google Patents

一种短信发送方法、装置和计算机存储介质 Download PDF

Info

Publication number
WO2016090764A1
WO2016090764A1 PCT/CN2015/074968 CN2015074968W WO2016090764A1 WO 2016090764 A1 WO2016090764 A1 WO 2016090764A1 CN 2015074968 W CN2015074968 W CN 2015074968W WO 2016090764 A1 WO2016090764 A1 WO 2016090764A1
Authority
WO
WIPO (PCT)
Prior art keywords
smsc
service
index
message
service type
Prior art date
Application number
PCT/CN2015/074968
Other languages
English (en)
French (fr)
Inventor
胡丽蓉
钱建阳
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2016090764A1 publication Critical patent/WO2016090764A1/zh

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]

Definitions

  • the present invention relates to the field of mobile communications, and in particular, to a method, an apparatus, and a computer storage medium for sending short messages.
  • SMS services have been widely used. Its services cover various information services, as well as subscription and on-demand services based on short message platforms, covering information publishing, personal information management, transactions, entertainment, and industrial applications. And six categories of services related to location. With the increase in the number of services, the volume of user traffic has grown rapidly. Especially in New Year's Eve, Christmas and other holiday, the traffic volume of SMS has increased rapidly, and the gateway device of a single node is far from being able to bear heavy load. At present, some operators have adopted SMSC (Short Message Service Center) or SMS gateway device to implement SMS load sharing. However, how to effectively utilize the processing power of each node and improve the overall service processing capability is still an important task.
  • SMSC Short Message Service Center
  • the prior art discloses a solution for distributing short messages according to the proportional value of processing power of each node.
  • the main processing flow of the solution includes: first summing the ratios of service processing capabilities of each node. After obtaining the cardinality, the semaphore value is used to modulate the obtained base number, and then the node is determined according to the scale value.
  • SMS has a certain loss rate.
  • the ratio of the processing capacity of the device is difficult to be clearly quantified. It is difficult to ensure that a device does not run overloaded according to the estimated distribution ratio of the processing capacity of the device, especially when processing a large amount of short message service, if a certain device has If you are in an overloaded state but still receive SMS messages, it will inevitably lead to the loss of some SMS messages.
  • embodiments of the present invention are expected to provide a short message sending method, apparatus, and computer storage medium.
  • An embodiment of the present invention provides a method for sending a short message, where the method includes:
  • the protocol stack processing device obtains, according to the service type of the service message sent by the service subsystem, the SMS service center SMSC index list that matches the service type; the service message includes: a service type identifier and a short message content;
  • the SMSC index list is polled, and when it is determined that the SMSC corresponding to the polled SMSC index meets the preset short message sending condition, the service message is sent to the SMSC.
  • the protocol stack processing device obtains the SMSC index list that matches the service type according to the service type of the service message sent by the service subsystem, including:
  • the protocol stack processing device parses the service message to obtain a service type identifier, and uses the service type identifier as a keyword to search the local memory for the SMSC index list that matches the service identifier.
  • the SMSC index list matching the service identifier is not found in the local memory, the method further includes:
  • the protocol stack processing device uses the service type identifier as a keyword to search for an SMSC index that has a mapping relationship with the service type identifier in a configuration relationship table between the service type identifier of the local database and the SMSC index;
  • the method before the protocol stack processing device determines whether the link of the SMSC is in an active state, the method further includes:
  • the protocol stack processing device manages the link state of the SMSC in the following manner:
  • the service message status is detected. If the SMSC responds to the service message timeout or fails to respond, the preset abnormality counter is incremented by one;
  • the link corresponding to the SMSC is deactivated, a timer is set, and when the set timer reaches the second preset time, the SMSC is activated. If the count time of the abnormal counter reaches the first preset time, but the abnormal count value does not reach the preset number of times, the count value of the abnormal counter is cleared to zero, and the service status detection of the next cycle is performed again; The count value does not reach the preset number of times, and the count time of the abnormal counter does not reach the first preset time, and the status of the service message is continuously detected.
  • the method further includes: when the SMSC index list is polled, and the SMSC that satisfies the preset short message sending condition is not found, an error response message is returned to the service subsystem to indicate the reason why the current short message cannot be sent.
  • the embodiment of the present invention provides a short message sending device, where the device includes: a short message service center SMSC index list obtaining module, a processing module, and a service message sending module;
  • the SMSC index list obtaining module is configured to obtain an SMSC index list that matches the service type according to the service type of the service message sent by the service subsystem; the service message includes: a service type identifier and a short message content;
  • the processing module is configured to poll the SMSC index list, and trigger a service message sending module when determining that the SMSC corresponding to the polled SMSC index meets the preset short message sending condition;
  • the service message sending module is configured to send a service message to the SMSC when triggered by the processing module.
  • the SMSC index list obtaining module obtains an SMSC index list that matches the service type of the service message in the following manner:
  • the SMSC index list obtaining module parses the service message to obtain a service type identifier, and uses the service type identifier as a keyword to search the local memory for the SMSC index list that matches the service identifier.
  • the SMSC index list obtaining module is further configured to: when the SMSC index list matching the service identifier is not found in the local memory, generate the SMSC index list by:
  • the SMSC index list obtaining module searches the SMSC index of the service type identifier and the service type identifier in the configuration relationship table of the service type identifier of the local database and the SMSC index as the key;
  • SMSC index
  • the processing module determines that the polled SMSC satisfies the preset short message sending condition by:
  • the device further includes a link state management module, configured to manage the link state of the SMSC in the following manner before the processing module determines whether the link of the SMSC is in an active state:
  • the service message status is detected. If the SMSC responds to the service message timeout or fails to respond, the preset abnormality counter is incremented by one;
  • the link corresponding to the SMSC is deactivated, a timer is set, and when the set timer reaches the second preset time, the SMSC is activated. If the count time of the abnormal counter reaches the first preset time, but the abnormal count value does not reach the preset number of times, the count value of the abnormal counter is cleared to zero, and the service status detection of the next cycle is performed again; The count value does not reach the preset number of times, and the count time of the abnormal counter does not reach the first preset time, and the status of the service message is continuously detected.
  • the device further includes: a response module, configured to: when the processing module polls the SMSC index list, and fails to find the SMSC that satisfies the preset short message sending condition, return an error response message to the service subsystem to indicate the current The reason why the text message cannot be sent.
  • a response module configured to: when the processing module polls the SMSC index list, and fails to find the SMSC that satisfies the preset short message sending condition, return an error response message to the service subsystem to indicate the current The reason why the text message cannot be sent.
  • the embodiment of the present invention further provides a computer storage medium, where the storage medium includes a set of computer executable instructions, and the instructions are used to execute the short message sending method according to the embodiment of the present invention.
  • the protocol stack processing device obtains an SMSC index list matching the service type according to the service type of the service message sent by the received service subsystem;
  • the service message includes: a service type identifier and a short message content; and the polling the SMSC index list, and when determining that the SMSC corresponding to the polled SMSC index meets the preset short message sending condition, sending the service message to the SMSC.
  • the protocol stack processing device can select the transmittable SMSC according to the service type of the service message, and determine whether the SMSC satisfies the short message sending condition in the selected SMSC, and only when the short message sending condition is met, The service message is sent to the corresponding SMSC.
  • the service message is divided by the service type, and only the SMSC that matches the service type is polled to select the SMSC that satisfies the short message sending condition to send the short message.
  • the SMSC can perform reasonable load sharing on the short message service, and when the SMSC is sent by using the SMS sending mode with the protection mechanism, the probability of successful sending of the short message is greatly increased; in addition, the SMSC selected when the short message is sent has Stronger regularity, therefore, in the event of a fault, the fault can be quickly located.
  • FIG. 1 is a flowchart of a method for sending a short message according to an embodiment of the present invention
  • FIG. 2 is a flowchart of a method for generating an SMSC index list matching a service type identifier according to an embodiment of the present invention
  • FIG. 3 is a first mapping diagram of a service type identifier and an SMSC index according to an embodiment of the present invention
  • FIG. 4 is a second mapping diagram between a service type identifier and an SMSC index according to an embodiment of the present invention
  • FIG. 5 is a schematic structural diagram of a system for implementing short message sending according to an embodiment of the present invention.
  • FIG. 6 is a flowchart of managing link state of an SMSC according to an embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of a short message sending apparatus according to an embodiment of the present invention.
  • FIG. 8 is a flowchart 1 of an example of sending a short message according to an embodiment of the present invention.
  • FIG. 9 is a second flowchart of an example of sending a short message according to an embodiment of the present invention.
  • the protocol stack processing device obtains an SMSC index list that matches the service type according to the service type of the service message sent by the service subsystem.
  • the service message includes at least: a service type identifier and a short message content. And polling the SMSC index list, and when determining that the SMSC corresponding to the polled SMSC index meets the preset short message sending condition, sending the service message to the SMSC.
  • a first embodiment of the present invention provides a method for sending a short message. As shown in FIG. 1 , the method includes the following steps:
  • Step 101 The protocol stack processing device obtains an SMSC index list that matches the service type according to the service type of the service message sent by the received service subsystem.
  • the service message includes: a service type identifier, a short message content, and a destination terminal number.
  • the service subsystem identifies the service type of the service message by using the service type identifier in the service message, that is, the service subsystem distinguishes different service types by using the service type identifier carried in the service message; thus, the protocol stack processing
  • the device obtains the SMSC index list that matches the service type according to the service type of the service message sent by the service subsystem, and the method includes: the protocol stack processing device parses the service message to obtain a service type identifier;
  • the type identifier is used as a key to search the local memory for the SMSC index list that matches the service identifier; when the matching SMSC index list is found, the process directly proceeds to step 102 to continue; when the service type is not found
  • the following processing flow is continued to generate a list of SMSC indexes matching the service type identifier, and the flowchart thereof is as shown in FIG. 2:
  • Step S201 The protocol stack processing device uses the service type identifier as a keyword to search for an SMSC index that is in a mapping relationship with the service type identifier in a service type identifier of the local database and a configuration relationship table of the SMSC index.
  • the service type identifier and the SMSC may be a one-to-one mapping, a one-to-many mapping, a many-to-one mapping, or a many-to-many mapping, and therefore, the configuration relationship table is found.
  • the SMSC index can be one or more.
  • FIG. 3 is a first schematic diagram showing a mapping relationship between a service type identifier and an SMSC index according to an embodiment of the present invention.
  • a mapping relationship allocation process is described.
  • the processing capabilities of SMSC1 and SMSC2 are strong.
  • the traffic of the service type is USSD and AA is large. Therefore, the USSD and AA services can be allocated to the SMSC1 and the ASM service according to the relationship of Figure 3.
  • a mapping relationship is established between SMSC2, and other services with smaller traffic, including: BB, CC, and DD, are mapped to SMSC3.
  • the index identification numbers 0, 1, and 2 respectively represent SMSC1, SMSC2, and SMSC3, and five service type identifiers are stored in the configuration relationship table of the service type identifier and the SMSC index stored in the local database, and each service type identifier and the SMSC exist.
  • the corresponding relationship shown in FIG. 3 is: USSD (0, 1), AA (0, 1), BB (2), CC (2), DD (2), that is, USSD and SMSC 1 and SMSC
  • AA corresponds to SMSC 1 and SMSC 2
  • BB, CC and DD both correspond to SMSC 3.
  • FIG. 4 is a second diagram showing the mapping relationship between the service type identifier and the SMSC index according to the embodiment of the present invention, and the assignment of the mapping relationship is described as an example, as shown in FIG. 4:
  • the index identification numbers 0, 1, and 2 respectively represent the SMSC1, the SMSC2, and the SMSC3, and the three types of service type identifiers are stored in the local SMSC index table, and each service type identifier has a corresponding relationship with the SMSC, as shown in FIG.
  • the corresponding relationship is: USSD (0, 1), AA (0, 1, 2), BB (1, 2), that is, USSD corresponds to SMSC 1 and SMSC 2, and AA corresponds to SMSC 1, SMSC 2, and SMSC 3.
  • BB corresponds to SMSC 2 and SMSC 3.
  • mapping needs to be performed according to actual conditions.
  • a slight change can be made to make all kinds of services correspond to SMSC 1, SMSC 2 and SMSC 3, so that the load sharing effect can be achieved, but there is no isolation between services. .
  • Step S202 Generate, according to the discovered SMSC index that has a mapping relationship with the service type identifier, generate an SMSC index list that matches the service type.
  • Step S203 Save the generated SMSC index list in the local memory, and go to step 102 to poll the generated SMSC index list.
  • Step 102 Poll the SMSC index list, and when it is determined that the polled SMSC satisfies the preset short message sending condition, send the service message to the SMSC.
  • the system structure for implementing short message transmission is shown in FIG. 5.
  • the service subsystem is connected to the protocol stack processing device, and the protocol stack processing device is respectively connected to multiple SMSCs to implement short message transmission;
  • protocol stack processing device may be located in the service subsystem when actually implemented.
  • the initial value of the polling index may be determined according to actual needs, that is, from which SMSC index is selected to start polling; for example, the following three may be adopted. Method to select the initial value of the index entry:
  • Method 1 Take the number of index entries in the SMSC index list as the base number, use the value of the base terminal number of the current service message to modulate the cardinality as the index initial value, and search the SMSC index list for the corresponding SMSC index; for example , you can select the last three digits of the destination terminal number or the last four digits, etc.;
  • Method 2 Take the next index of the SMSC index corresponding to the success of the service type message as the initial value of the index entry; if it is the first time to poll the SMSC index list of the service type, that is, the first time to generate the generated SMSC When indexing the list, taking the first SMSC index in the SMSC index list as the initial value of the index entry;
  • Method 3 randomly select an SMSC index in the SMSC index list as the initial value of the index.
  • the method 1 is exemplified below with reference to FIG. 4:
  • the mapping relationship is AA(0, 1, 2).
  • the last 4 digits of the destination terminal number in the service message are taken, assuming the last 4 digits are 6911, and because of the index list. It includes 3 elements. Therefore, the modulo base is 3, and the result after modulo the 6911 to 3 is 2, then 2 is selected as the initial value of the polling index, and index 2 corresponds to SMSC 3.
  • the following method may be used to determine whether the SMSC satisfies the preset short message sending condition:
  • the number of words of the short message content included in the service message may be more. According to the requirement of the number of related words, it is required to be split into multiple short messages for sending; if the number of words of the short message content meets the requirements of the number of related words, no splitting is needed. .
  • the number of short messages supported by the SMSC is represented by the size of the sliding window of the SMSC. Therefore, in actual operation, the number of split short messages can be summed with the number of short messages that have been sent to the corresponding SMSC and are waiting to be processed. And comparing whether the added result is less than or equal to the sliding window size of the corresponding SMSC, if less than or equal to the size of the sliding window, further confirming the corresponding SMSC Whether the link is in an active state; if it is larger than the sliding window size, it is determined that the SMSC does not satisfy the short message sending condition.
  • the protocol stack processing device records the number of these short messages as the number of short messages that have been sent to the SMSC and is waiting for processing, and the SMSC processes the corresponding short message (ie, after the SMS message is sent to the corresponding SMSC).
  • the response message is returned to the protocol stack processing device.
  • the protocol stack processing device updates the local recorded number of short messages that have been sent to the SMSC and are waiting to be processed, that is, the response will be received. The number of short messages of the message is subtracted from the number of short messages recorded above.
  • the method further includes: the protocol stack processing device manages a link state of the SMSC, where the link state includes: an activated state and a deactivated state, and the activated state is in a chain The path is available. In the deactivated state, the link is unavailable.
  • the link state of the SMSC can be managed in the following manner. The flowchart is as shown in Figure 6.
  • S601 Detect a service message status after sending a service message to the SMSC.
  • S602 Determine whether the status of the service message is a response timeout or a response failure.
  • step S603 If yes, go to step S603; if no, go to step S601 to continue detecting the status of the service message, that is, re-execute the service message status detection of the next cycle;
  • S604 Determine whether the abnormal count value reaches the preset number of times X times;
  • S605 Deactivate the link corresponding to the SMSC, and set a timer.
  • step S606 determining whether the timer reaches the second preset time Z minutes; if yes, proceeding to step S607; if not, maintaining the current state to continue timing and continuing to determine;
  • S607 The link is activated, and the link recovery of the SMSC is available.
  • step S608 determining whether the abnormal counter counting time reaches the first preset time; if yes, go to step S609; if not, go directly to step S601 to continue the service message detection;
  • Step S609 Clear the count value of the abnormality counter to zero, and return to step S601 to perform the service message detection again after clearing.
  • the values of X, Y and Z can be configured according to actual needs.
  • Y can be set between 5 minutes and 10 minutes;
  • X can be set between 20 times and 100 times.
  • X can be set.
  • the value of Z can be set between 3 minutes and 5 minutes; in addition, the default detection function is not enabled when the values of X, Y and Z are 0.
  • SMSC that satisfies the preset short message sending condition is not found after performing the polling on the SMSC index list, an error response message is returned to the service subsystem to indicate the reason why the current short message cannot be sent; or a timer may be set.
  • the service sub- The system returns an error response message to indicate the reason why the current short message cannot be sent; the reason why the current short message cannot be sent includes: the link is abnormal, the SMSC is overloaded (ie, the SMSC sending window is full), and the like.
  • the SMSC parses the service message, generates a short message according to the short message content, and sends the generated short message to the destination terminal number.
  • the third embodiment of the present invention provides a short message sending apparatus, which is applied to a protocol stack processing device.
  • the apparatus includes: an SMSC index list obtaining module 71, a processing module 72, and a service message sending module 73; ,
  • the SMSC index list obtaining module 71 is configured to obtain an SMSC index list that matches the service type according to the service type of the service message sent by the service subsystem; the service message at least includes: a service type identifier and a short message content;
  • the processing module 72 is configured to poll the SMSC index list, and when it is determined that the SMSC corresponding to the polled SMSC index meets the preset short message sending condition, the service message sending module 73 is triggered;
  • the service message sending module 73 is configured to send a service message to the SMSC when triggered by the processing module 72.
  • the SMSC index list obtaining module 71 obtains an SMSC index list that matches the service type of the service message by:
  • the SMSC index list obtaining module 71 parses the service message to obtain a service type identifier, and uses the service type identifier as a keyword to search the local memory for the SMSC index list that matches the service identifier.
  • the SMSC index list obtaining module 71 is further configured to generate an SMSC index list by using the following steps when the SMSC index list matching the service identifier is not found:
  • the SMSC index list obtaining module 71 uses the service type identifier as a key, and searches for an SMSC index that has a mapping relationship with the service type identifier in the service type identifier of the local database and the configuration relationship table of the SMSC index;
  • SMSC index
  • the processing module 72 determines that the polled SMSC satisfies the preset short message sending condition by:
  • the device further includes a link state management module 74 configured to manage the link state of the SMSC in the following manner before the processing module 72 determines whether the link of the SMSC is in an active state:
  • the service message status is detected. If the SMSC responds to the service message timeout or fails to respond, the preset abnormality counter is incremented by one;
  • the link corresponding to the SMSC is deactivated, a timer is set, and when the set timer reaches the second preset time, the SMSC is activated. If the count time of the abnormal counter reaches the first preset time, but the abnormal count value does not reach the preset number of times, the count value of the abnormal counter is cleared to zero, and the service status detection of the next cycle is performed again; The count value does not reach the preset number of times, and the count time of the abnormal counter does not reach the first preset time, and the status of the service message is continuously detected.
  • the device further includes: a response module 75, configured to: after the processing module 72 polls the SMSC index list, and fails to find the SMSC that meets the preset short message sending condition, return an error response message to the service subsystem to indicate that the current short message cannot be
  • the reason for the transmission may be that after one polling, or after the NMSC does not find the SMSC that satisfies the preset short message sending condition, an error response message is returned to the service subsystem.
  • the example includes the following steps:
  • Step 801 Receive a service message and extract a service type identifier.
  • Step 802 traverse the local memory area service type identifier array, and search for the SMSC index list List corresponding to the service type identifier. If the search is found, the process directly proceeds to step S804, otherwise, the process proceeds to step S803.
  • the foregoing SMSC index list is based on the preset service type identifier and the configuration of the SMSC.
  • Step 803 Create an SMSC index list and append to the existing list
  • Step 804 Polling the SMSC index list
  • an index initial value is selected in the SMSC index list, and polling is started from the SMSC index corresponding to the initial value, and an SMSC index is polled and the SMSC index is indexed.
  • the next SMSC index is sequentially polled;
  • Step 805 Determine whether the sum of the current short message number N and the number of short messages waiting for the SMSC response is smaller than the sending window size of the SMSC;
  • the current short message number refers to the number of short messages included in the current service message; the number of short messages waiting for the SMSC response refers to: a message that has been sent to the currently polled SMSC and is waiting for the SMSC response. Number; in this step, if the result of the determination is yes, then proceeds to step 806 to continue processing, otherwise, proceeds to step 808;
  • Step 806 Determine whether the currently polled SMSC link is in an active state, and if yes, go to step 807, otherwise go to step 808;
  • Step 807 Send N short messages in the service message to the SMSC, and increase the short message counter waiting for the SMSC response by N;
  • the SMSC index corresponding to the current service type needs to be recorded, so that the index initial value is selected for the next message polling of the service message type (assuming that the initial value is selected in the above manner);
  • Step 808 It is determined whether the number of polling times reaches the total number of elements in the SMSC index list List. If the round-up step 804 is not reached, the next SMSC index is polled; otherwise, the process proceeds to step 809;
  • Step 809 Record the reason why the short message is sent and end the process.
  • the example includes the following steps:
  • Step 901 Receive a service message and extract a service type identifier.
  • Step 902 traversing the local memory area service type identifier array, looking up the SMSC index list List corresponding to the service type identifier, if found, then directly proceeds to step 904, otherwise proceeds to step 903;
  • the foregoing SMSC index list is an index table established in a memory area according to a preset service type identifier and a configuration relationship table of the SMSC;
  • Step 903 Create an SMSC index list and append to the existing list
  • Step 904 Polling the SMSC index list
  • an index initial value is selected in the SMSC index list, and polling is started from the SMSC index corresponding to the initial value, and an SMSC index is polled and the SMSC index is indexed.
  • the next SMSC index is sequentially polled;
  • Step 905 Determine whether the sum of the current short message number N and the number of short messages waiting for the SMSC response is smaller than the sending window size of the SMSC;
  • the current short message number refers to the number of short messages included in the current service message; the number of short messages waiting for the SMSC response refers to: a message that has been sent to the currently polled SMSC and is waiting for the SMSC response. Number; in this step, if the result of the determination is yes, then proceeds to step 906 to continue processing, otherwise, proceeds to step 908;
  • Step 906 Determine whether the currently polled SMSC link is in an active state, and if yes, go to step 907, otherwise go to step 908;
  • Step 907 Send N short messages in the service message to the SMSC, and increase the short message counter waiting for the SMSC response by N;
  • the SMSC index corresponding to the current service type needs to be recorded, so that the index initial value is selected for the next message polling of the service message type (assuming that the initial value is selected in the above manner);
  • Step 908 Determine whether the number of polling times reaches the total number of elements in the SMSC index list List, if not reached the transfer step 904 continues to poll the next SMSC index; otherwise, proceeds to step 909;
  • Step 909 traverse the counter count value plus one
  • the traversal counter is used to count the number of times that all elements in the SMSC are traversed, that is, when polling all the elements in the SMSC, the value of the traversal counter is incremented by one;
  • Step 910 Determine whether the traversal counter reaches a certain threshold
  • the threshold of the traversal counter can be set according to actual needs; when the traversal counter reaches a certain threshold, go to step 911; when the traversal counter does not reach a certain threshold, go to step 912;
  • Step 911 Record the reason for the failure of sending the short message
  • Step 912 setting a timer
  • Step 913 Determine whether the timer expires; and when the timer expires, re-pollize the SMSC index list; when the timer does not time out, return to continue counting, and re- poll the SMSC when the timer expires.
  • the foregoing SMSC index list obtaining module 71, the processing module 72, the service message sending module 73, the link state management module 74, and the response module 75 may be processed by a central processing unit (CPU, Central Processing) in the protocol stack processing device. Unit), Microprocessor Unit (MPU), Digital Signal Processor (DSP) or Field-Programmable Gate Array (FPGA).
  • CPU Central Processing
  • MPU Microprocessor Unit
  • DSP Digital Signal Processor
  • FPGA Field-Programmable Gate Array
  • the embodiment of the present invention further provides a computer storage medium, where the storage medium includes a set of computer executable instructions, and the instructions are used to execute the short message sending method according to the embodiment of the present invention.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Telephonic Communication Services (AREA)

Abstract

本发明公开了一种短信发送方法,协议栈处理设备根据接收到的业务子系统发送的业务消息的业务类型获得与所述业务类型相匹配的SMSC索引列表;所述业务消息包括:业务类型标识和短信内容;轮询所述SMSC索引列表,当确定被轮询到的SMSC索引对应的SMSC满足预设短信发送条件时,将所述业务消息发送至所述SMSC。本发明同时还公开了一种短信发送装置和计算机存储介质。

Description

一种短信发送方法、装置和计算机存储介质 技术领域
本发明涉及移动通信领域,特别涉及一种短信发送方法、装置和计算机存储介质。
背景技术
随着移动终端的普及,短信业务得到了广泛应用,其业务涵盖各种资讯类服务、以及基于短消息平台的订阅与点播业务,其内容涵盖信息发布、个人信息管理、交易、娱乐、行业应用以及与位置相关的六大类服务。随着业务种类的增多,用户业务量迅速的增长,尤其在除夕、圣诞等节假日短信业务流量急增,单一节点的网关设备已经远不能承担重负荷。目前一些运营商已采用多节点短信服务中心(SMSC,Short Message Service Center)或短信网关设备实现短信负荷分担,但如何有效发挥各节点处理能力,提升整体业务处理能力,仍是一重要任务。
为解决短信负荷分担问题,现有技术中公开了根据各节点处理能力的比例值按比例进行短信分发的方案,该方案的主要处理流程包括:先将各节点的业务处理能力的比例值求和得到基数,再用短信特征值对求得的基数取模后根据比例值确定短信发往哪一个节点。
上述方案存在以下不足:
1)短信收发有一定丢失率。首先,设备的处理能力比例值是很难明确定量的,按照估算的设备处理能力比例值分发很难保证某个设备不出现过负荷运行,尤其是在处理海量短信业务时,若某个设备已处于过负荷运行状态却仍然不停地收到短信,必然会导致部分短信丢失;此外,缺乏负荷分担保护机制,在设备即将或已经过负荷时,应该将消息分发至其它节点 设备。
2)出现故障时无法快速定位具体业务,定位具体故障原因。由于是简单地按比例取模分发,各种业务发往的目的短信中心具有随机性,在发生故障后很难第一时间定位出具体业务。
发明内容
为了解决现有存在的技术问题,本发明实施例期望提供一种短信发送方法、装置和计算机存储介质。
本发明实施例提供了一种短信发送方法,所述方法包括:
协议栈处理设备根据接收到的业务子系统发送的业务消息的业务类型获得与所述业务类型相匹配的短信服务中心SMSC索引列表;所述业务消息包括:业务类型标识和短信内容;
轮询所述SMSC索引列表,当确定被轮询到的SMSC索引对应的SMSC满足预设短信发送条件时,将所述业务消息发送至所述SMSC。
上述方案中,协议栈处理设备根据接收到的业务子系统发送的业务消息的业务类型获得与所述业务类型相匹配的SMSC索引列表,包括:
协议栈处理设备对所述业务消息进行解析获得业务类型标识,将所述业务类型标识作为关键字在本地内存中查找与所述业务标识相匹配的SMSC索引列表。
上述方案中,当将所述业务类型标识作为关键字在本地内存中没有查找到与所述业务标识相匹配的SMSC索引列表时,所述方法还包括:
协议栈处理设备将所述业务类型标识作为关键字在本地数据库的业务类型标识与SMSC索引的配置关系表中查找与所述业务类型标识存在映射关系的SMSC索引;
根据查找到的与所述业务类型标识存在映射关系的SMSC索引,生成与所述业务类型相匹配的SMSC索引列表;
将生成的SMSC索引列表保存于本地内存中。
上述方案中,通过以下方式确定被轮询到的SMSC满足预设短信发送条件:
判断当前业务消息拆分后的短信数与已发送至所述轮询到的SMSC、且等待处理的短信数之和是否小于等于相应SMSC所支持的短信数;如果小于等于,则判断所述SMSC的链路是否处于激活状态,如果是,则确认SMSC满足预设短信发送条件。
上述方案中,所述协议栈处理设备判断所述SMSC的链路是否处于激活状态之前,所述方法还包括:
协议栈处理设备通过以下方式对SMSC的链路状态进行管理:
每次发送业务消息至SMSC后,检测业务消息状态,如果所述SMSC对业务消息响应超时或响应失败,则使预设的异常计数器加1;
若异常计数值在第一预设时间内达到预设次数,则去激活此SMSC对应的链路,设置定时器,并在所设置的定时器达到第二预设时间时,激活所述SMSC对应的链路;若异常计数器的计数时间到达第一预设时间、但异常计数值未达到预设次数时,将异常计数器的计数值清零,并重新进行下一周期业务消息状态检测;若异常计数值未达到预设次数、且异常计数器的计数时间未到达第一预设时间,继续检测业务消息状态。
上述方案中,所述方法还包括:当轮询完所述SMSC索引列表,没有找到满足预设短信发送条件的SMSC时,向业务子系统返回错误响应消息以指示当前短信不能发送的原因。
本发明实施例提供了一种短信发送装置,所述装置包括:短信服务中心SMSC索引列表获取模块、处理模块及业务消息发送模块;其中,
所述SMSC索引列表获取模块,配置为根据接收到的业务子系统发送的业务消息的业务类型获得与所述业务类型相匹配的SMSC索引列表;所述业务消息包括:业务类型标识和短信内容;
所述处理模块,配置为轮询所述SMSC索引列表,并在确定被轮询到的SMSC索引对应的SMSC满足预设短信发送条件时,触发业务消息发送模块;
所述业务消息发送模块,配置为被处理模块触发时,将业务消息发送给所述SMSC。
上述方案中,所述SMSC索引列表获取模块通过以下方式获取与所述业务消息的业务类型相匹配的SMSC索引列表:
SMSC索引列表获取模块对所述业务消息进行解析获得业务类型标识,将所述业务类型标识作为关键字在本地内存中查找与所述业务标识相匹配的SMSC索引列表。
上述方案中,所述SMSC索引列表获取模块,还配置为在本地内存中没有查找到与所述业务标识相匹配的SMSC索引列表时,通过以下方式生成SMSC索引列表:
SMSC索引列表获取模块将所述业务类型标识作为关键字在本地数据库的业务类型标识与SMSC索引的配置关系表中查找与所述业务类型标识存在映射关系的SMSC索引;
根据查找到的与所述业务类型标识存在映射关系的SMSC索引,生成与所述业务类型相匹配的SMSC索引列表;所述SMSC索引列表中包括查找到的所有与所述业务类型标识存在映射关系的SMSC索引;
将生成的SMSC索引列表保存于本地内存中。
上述方案中,所述处理模块通过以下方式确定被轮询到的SMSC满足预设短信发送条件:
判断所述业务消息拆分后的短信数与已发送至所述轮询到的SMSC、且等待处理的短信数之和是否小于等于相应SMSC所支持的短信数;如果小于等于,则判断所述SMSC的链路是否处于激活状态,如果是,则确认SMSC满足预设短信发送条件。
上述方案中,所述装置还包括链路状态管理模块,配置为在处理模块判断SMSC的链路是否处于激活状态之前,通过以下方式对SMSC的链路状态进行管理:
每次发送业务消息至SMSC后,检测业务消息状态,如果所述SMSC对业务消息响应超时或响应失败,则使预设的异常计数器加1;
若异常计数值在第一预设时间内达到预设次数,则去激活此SMSC对应的链路,设置定时器,并在所设置的定时器达到第二预设时间时,激活所述SMSC对应的链路;若异常计数器的计数时间到达第一预设时间、但异常计数值未达到预设次数时,将异常计数器的计数值清零,并重新进行下一周期业务消息状态检测;若异常计数值未达到预设次数、且异常计数器的计数时间未到达第一预设时间,继续检测业务消息状态。
上述方案中,所述装置还包括:响应模块,配置为在处理模块轮询完所述SMSC索引列表,没有找到满足预设短信发送条件的SMSC时,向业务子系统返回错误响应消息以指示当前短信不能发送的原因。
本发明实施例还提供了一种计算机存储介质,所述存储介质包括一组计算机可执行指令,所述指令用于执行本发明实施例所述的短信发送方法。
本发明实施例所提供的一种短信发送方法、装置和计算机存储介质,协议栈处理设备根据接收到的业务子系统发送的业务消息的业务类型获得与所述业务类型相匹配的SMSC索引列表;所述业务消息包括:业务类型标识和短信内容;轮询所述SMSC索引列表,当确定被轮询到的SMSC索引对应的SMSC满足预设短信发送条件时,将所述业务消息发送至所述SMSC。如此,协议栈处理设备可以根据业务消息的业务类型为业务消息选择可发送的SMSC,并在选择出的SMSC中对SMSC是否满足短信发送条件进行判断,并只在满足短信发送条件时,才将业务消息发送到相应的SMSC,因此,以业务类型对业务消息进行划分,仅在与所述业务类型相匹配的SMSC中进行轮询从而选取满足短信发送条件的SMSC进行短信发送, 可以使SMSC对短信业务进行合理的负荷分担,且通过这种有保护机制的短信发送方式选择SMSC进行短信发送时,短信发送成功的概率也大大增加;另外,由于短信发送时所选取的SMSC具有更强的规律性,因此,出现故障时,也可以进行故障的快速定位。
附图说明
图1为本发明实施例提供的短信发送方法流程图;
图2为本发明实施例提供的生成与业务类型标识相匹配的SMSC索引列表的方法流程图;
图3为本发明实施例提供的业务类型标识与SMSC索引之间映射关系图一;
图4为本发明实施例提供的业务类型标识与SMSC索引之间映射关系图二;
图5为本发明实施例提供的用于实现短信发送的系统结构;
图6为本发明实施例提供的对SMSC的链路状态进行管理的流程图;
图7为本发明实施例提供的短信发送装置的基本结构图;
图8为本发明实施例提供的短信发送方法示例流程图一;
图9为本发明实施例提供的短信发送方法示例流程图二。
具体实施方式
本发明实施例中,协议栈处理设备根据接收到的业务子系统发送的业务消息的业务类型获得与所述业务类型相匹配的SMSC索引列表;所述业务消息至少包括:业务类型标识和短信内容;轮询所述SMSC索引列表,当确定被轮询到的SMSC索引对应的SMSC满足预设短信发送条件时,将所述业务消息发送至所述SMSC。
下面通过附图及具体实施例对本发明做进一步的详细说明。
实施例一
本发明实施例一提供了一种短信发送方法,如图1所示,该方法包括以下步骤:
步骤101:协议栈处理设备根据接收到的业务子系统发送的业务消息的业务类型获得与所述业务类型相匹配的SMSC索引列表;
所述业务消息包括:业务类型标识、短信内容和目的终端号码。
业务子系统通过业务消息中的业务类型标识对所述业务消息的业务类型进行标识,也就是说,业务子系统通过业务消息中携带的业务类型标识来区分不同的业务类型;因而,协议栈处理设备根据接收到的业务子系统发送的业务消息的业务类型获得与所述业务类型相匹配的SMSC索引列表,包括:协议栈处理设备对所述业务消息进行解析获得业务类型标识;将所述业务类型标识作为关键字在本地内存中查找与所述业务标识相匹配的SMSC索引列表;当查找到相匹配的SMSC索引列表时,直接转至步骤102继续执行;当没有查找到与所述业务类型标识相匹配的SMSC索引列表时,继续执行以下处理流程以生成与业务类型标识相匹配的SMSC索引列表,其流程图如图2所示:
步骤S201:协议栈处理设备将所述业务类型标识作为关键字在本地数据库中的业务类型标识与SMSC索引的配置关系表中查找与所述业务类型标识存在映射关系的SMSC索引;
需要说明的是,由于实际应用中,所述业务类型标识与SMSC可以为一对一映射、一对多映射、多对一映射或者多对多映射,因此,在所述配置关系表中查找到的SMSC索引可以为一个或多个。
图3是根据本发明实施例的业务类型标识与SMSC索引之间映射关系图一,以此作为一个例子来描述映射关系的分配过程,如图3所示,SMSC1、SMSC2的处理能力较强,而业务类型标识为USSD、AA的业务流量较大,因此,可以按照图3的关系分配,将USSD和AA业务分别与SMSC1和 SMSC2之间建立映射关系,而其它流量较小的业务,包括:BB、CC、DD均与SMSC3建立映射关系。
以索引标识号0、1、2分别代表SMSC1、SMSC2、SMSC3,存储于本地数据库的业务类型标识与SMSC索引的配置关系表里会保存5种业务类型标识,每种业务类型标识与SMSC存在一个对应关系,图3中示出的对应关系有:USSD(0,1)、AA(0,1)、BB(2)、CC(2)、DD(2),即,USSD与SMSC 1和SMSC 2对应,AA与SMSC 1和SMSC 2对应,BB、CC和DD均与SMSC 3对应。
图4是根据本发明实施例的业务类型标识与SMSC索引之间映射关系图二,以此为例描述映射关系的分配,如图4所示:
假如3个SMSC处理能力相当,业务类型为AA的流量较大,可以分配所有的SMSC给它,即,将AA与所有SMSC对应,剩下业务类型标识USSD和BB可以轮询两个短信中心;
以索引标识号0、1、2分别代表SMSC1、SMSC2、SMSC3,存储于本地的SMSC索引表里会保存3种业务类型标识,每种业务类型标识与SMSC存在一个对应关系,图4中示出的对应关系有:USSD(0,1),AA(0,1,2),BB(1,2),即,USSD与SMSC 1和SMSC 2对应、AA与SMSC 1、SMSC 2和SMSC 3对应,BB与SMSC 2和SMSC 3对应。
在实际应用中,由于不同种类业务需要的流量大小与SMSC的处理能力各不相同,需要根据实际情况做映射关系。极端情况下,举个例子,如图4所示稍作变化,可以使所有种类业务都与SMSC 1、SMSC 2与SMSC 3对应,这样,也可以达到负荷分担效果,只是业务之间没有进行隔离。
步骤S202:根据查找到的与所述业务类型标识存在映射关系的SMSC索引,生成与所述业务类型相匹配的SMSC索引列表;
步骤S203:将生成的SMSC索引列表保存于本地内存中,并转至步骤102,轮询所述生成的SMSC索引列表。
步骤102:轮询所述SMSC索引列表,当确定被轮询到的SMSC满足预设短信发送条件时,将所述业务消息发送至所述SMSC。
用于实现短信发送的系统结构如图5所示,从图5可知,业务子系统与协议栈处理设备相连,协议栈处理设备分别与多个SMSC相连,实现短信的发送;
另外,本领域技术人员应该理解的是所述协议栈处理设备在实际实现时,可以位于业务子系统内。
这一步骤中,初次轮询所述SMSC索引列表时,可以根据实际需要基于多种方式确定轮询的索引初始值,即选择从哪一个SMSC索引开始轮询;示例性的,可以采用以下三种方法选定索引条目的初始值:
方法一:取SMSC索引列表里的索引条目个数作为基数,用当前业务消息的目终端号码的尾数对基数取模后的值作为索引初始值,到SMSC索引列表中查找对应的SMSC索引;例如,可以选择目的终端号码的末尾三位数或末尾四位数等等;
方法二:取上一次该业务类型消息发送成功对应的SMSC索引的下一个索引作为索引条目的初始值;如果是第一次轮询该业务类型的SMSC索引列表,即,第一次创建生成SMSC索引列表时,则取SMSC索引列表中第一个SMSC索引作为索引条目的初始值;
方法三:随机选择SMSC索引列表中的某个SMSC索引作为索引初始值。
当确定索引初始值之后,轮询该索引初始值对应的SMSC,判断所述SMSC是否满足短信发送条件;如果不满足则继续轮询所述索引初始值的下一个索引,并判断相应的SMSC是否满足短信发送条件;依次类推,直到遍历完SMSC索引列表中的所有SMSC索引,如果仍没有找到满足短信发送条件的SMSC,则直接向业务子系统返回错误信息,以指示短信发送不成功;或者,执行以下处理步骤:
设置定时器,并在定时器超时时,轮询SMSC索引列表中的SMSC,直到找到满足短信发送条件SMSC;如何仍没有找到,重复执行该步骤;
通常在执行以上步骤轮询所述SMSC索引列表特定次数后,还没有找到满足短信发送条件的SMSC时,向业务子系统返回错误信息,以指示短信发送不成功;其中,所述特定次数可以根据实际需要进行设置。
下面结合图4对该方法一进行举例说明:
对于业务类型标识为AA的业务,其映射关系为AA(0,1,2),根据方法一,取业务消息中目的终端号码末尾4位数字,假设末尾4位为6911,又由于索引列表中包括3个元素,因此,取模基数为3,用6911对3取模后的结果为2,则选定2为轮询索引的初始值,索引2对应的是SMSC 3。
针对每一次轮询到的SMSC索引,需要判断相应的SMSC是否满足预设短信发送条件,可以通过以下方法判断SMSC是否满足预设短信发送条件:
判断当前业务消息拆分后的短信数与已发送至相应SMSC、且等待处理的短信数之和是否小于等于相应SMSC所支持的短信数;如果大于,则确定相应SMSC不满足预设短信发送条件;如果小于等于,则进一步确认相应SMSC的链路是否处于激活状态,如果是,则确认SMSC满足预设短信发送条件,将业务消息发送至相应SMSC,并结束当前短信发送流程,如果否,则确认SMSC不满足预设短信发送条件。需要说明的是,业务消息中包含的短信内容字数可能较多,根据相关字数要求需要被拆分为多条短信进行发送;如果所述短信内容的字数符合相关字数要求,则不需要进行拆分。
所述SMSC所支持的短信数通过SMSC的滑动窗口大小进行表征,因此,在实际操作中,可以将拆分后的短信数与已发送至相应SMSC、且等待处理的短信数相加求和,并比较相加后的结果是否小于等于相应SMSC的滑动窗口大小,若小于等于所述滑动窗口大小,则进一步确认相应SMSC 的链路是否处于激活状态;若大于所述滑动窗口大小,则确定所述SMSC不满足短信发送条件。
在这一步骤之前,协议栈处理设备每次向相应SMSC发送短信后,会将这些短信的个数记录为已发送给SMSC、且等待处理的短信个数,同时当SMSC处理完相应短信(即,将短信发送给特定终端)时,会向协议栈处理设备返回响应消息,此时,协议栈处理设备更新本地记录的已发送给SMSC、且等待处理的短信个数,即,将收到响应消息的短信个数从上述记录的短信个数中减去。
在确认相应SMSC的链路是否处于激活状态之前,所述方法还包括:协议栈处理设备对SMSC的链路状态进行管理,所述链路状态包括:激活状态和去激活状态,激活状态下链路可用,去激活状态下表示链路不可用;可以通过以下方式对SMSC的链路状态进行管理,其流程图如图6所示:
S601:每次发送业务消息至SMSC后,检测业务消息状态;
S602:判断业务消息状态是否为响应超时或响应失败;
即,检测SMSC是否对业务消息响应超时或响应失败;
如果是,则转至步骤S603;如果否,则转至步骤S601继续检测业务消息状态,即,重新进行下一周期的业务消息状态检测;
S603:使预设的异常计数器加1;
S604:判断异常计数值是否达到预设次数X次;
若是,则转到S605;否则,转到S608;
S605:去激活此SMSC对应的链路,并设置定时器;
S606:判断定时器是否到达第二预设时间Z分钟;如果是,则转至步骤S607;如果否,则维持当前状态继续计时并继续判断;
S607:使链路处于激活状态,该SMSC的链路恢复可用;
S608:判断异常计数器计数时间是否到达第一预设时间;如果是,则转至步骤S609;如果否则直接转至步骤S601继续进行业务消息检测;
步骤S609:将异常计数器的计数值清零,并在清零后直接返回步骤S601重新进行业务消息检测。
以上步骤中,X、Y及Z的值可以根据实际需要进行配置,例如,Y可以设置在5分钟到10分钟之间;X可以设置在20次至100次之间,优选的,可以将X设置在20次至30次之间;Z的取值可以设置在3分钟至5分钟之间;另外,默认当X、Y及Z的值为0时不启用该异常检测功能。
当确认当前轮询的SMSC不满足预设短信发送条件时,继续轮询所述SMSC索引列表中的下一个SMSC索引,并判断下一个SMSC是否满足短信发送条件,如果是,则将业务消息发送至相应SMSC;如果否,则继续轮询SMSC索引列表中下一个SMSC,直到被轮询到的SMSC满足短信发送条件,将业务消息发送至相应SMSC并结束当前短信发送流程;
如果对所述SMSC索引列表进行一次轮询后,没有找到满足预设短信发送条件的SMSC时,向业务子系统返回错误响应消息以指示当前短信不能发送的原因;或者,也可以设置定时器,并在定时器超时时,重新轮询,并在总共进行特定次数(例如三次,该值实际应用中可以根据需要设置)轮询后仍没有找到满足预设短信发送条件的SMSC时,向业务子系统返回错误响应消息以指示当前短信不能发送的原因;所述当前短信不能发送的原因,包括:链路异常、SMSC负荷过重(即,SMSC发送窗口均满)等等。
在这一步骤中,将业务消息发送至相应的SMSC之后,SMSC对所述业务消息进行解析,根据短信内容生成短信,并将生成的短信发送至目的终端号码。
实施例三
本发明实施例三提供了一种短信发送装置,应用于协议栈处理设备中,如图7所示,所述装置包括:SMSC索引列表获取模块71、处理模块72及业务消息发送模块73;其中,
所述SMSC索引列表获取模块71,配置为根据接收到的业务子系统发送的业务消息的业务类型获得与所述业务类型相匹配的SMSC索引列表;所述业务消息至少包括:业务类型标识和短信内容;
所述处理模块72,配置为轮询所述SMSC索引列表,并在确定被轮询到的SMSC索引对应的SMSC满足预设短信发送条件时,触发业务消息发送模块73;
所述业务消息发送模块73,配置为被处理模块72触发时,将业务消息发送给所述SMSC。
所述SMSC索引列表获取模块71通过以下方式获取与所述业务消息的业务类型相匹配的SMSC索引列表:
SMSC索引列表获取模块71对所述业务消息进行解析获得业务类型标识;将所述业务类型标识作为关键字在本地内存中查找与所述业务标识相匹配的SMSC索引列表。
所述SMSC索引列表获取模块71,还配置为在没有查找到与所述业务标识相匹配的SMSC索引列表时,通过以下步骤生成SMSC索引列表:
SMSC索引列表获取模块71将所述业务类型标识作为关键字,在本地数据库的业务类型标识与SMSC索引的配置关系表中查找与所述业务类型标识存在映射关系的SMSC索引;
根据查找到的与所述业务类型标识存在映射关系的SMSC索引,生成与所述业务类型相匹配的SMSC索引列表;所述SMSC索引列表中包括查找到的所有与所述业务类型标识存在映射关系的SMSC索引;
将生成的SMSC索引列表保存于本地内存。
所述处理模块72通过以下方式确定被轮询到的SMSC满足预设短信发送条件:
判断所述业务消息拆分后的短信数与已发送至所述轮询到的SMSC、且等待处理的短信数之和是否小于等于相应SMSC所支持的短信数;如果 小于等于,进一步判断所述SMSC的链路是否处于激活状态,如果是,则确认SMSC满足预设短信发送条件。
所述装置还包括链路状态管理模块74,配置为在处理模块72判断SMSC的链路是否处于激活状态之前,通过以下方式对SMSC的链路状态进行管理:
每次发送业务消息至SMSC后,检测业务消息状态,如果所述SMSC对业务消息响应超时或响应失败,则使预设的异常计数器加1;
若异常计数值在第一预设时间内达到预设次数,则去激活此SMSC对应的链路,设置定时器,并在所设置的定时器达到第二预设时间时,激活所述SMSC对应的链路;若异常计数器的计数时间到达第一预设时间、但异常计数值未达到预设次数时,将异常计数器的计数值清零,并重新进行下一周期业务消息状态检测;若异常计数值未达到预设次数、且异常计数器的计数时间未到达第一预设时间,继续检测业务消息状态。
所述装置还包括:响应模块75,配置为在处理模块72轮询完所述SMSC索引列表,没有找到满足预设短信发送条件的SMSC时,向业务子系统返回错误响应消息以指示当前短信不能发送的原因;可以是在1次轮询之后,也可以是在N次轮询之后没有找到满足预设短信发送条件的SMSC时,向业务子系统返回错误响应消息。
下面通过两个具体示例,对本发明实施例所述方法作以下详细介绍;
示例一
如图8所示,该示例包括以下步骤:
步骤801:接收业务消息并提取业务类型标识;
步骤802:遍历本地内存区业务类型标识数组,查找该业务类型标识对应的SMSC索引列表List,如果查找到则直接进入S804步骤,否则进入S803步骤;
上述SMSC索引列表是根据预先设置的业务类型标识与SMSC的配置 关系表在内存区建立的索引表;
步骤803:创建SMSC索引列表并追加至已有列表;
在本地预先设置的业务类型标识与SMSC的配置关系表里搜索所述业务标识类型对应的SMSC并创建该业务类型标识对应的索引列表,追加至本地内存区已有列表;
步骤804:轮询所述SMSC索引列表;
如果是初次轮询当前SMSC索引列表,则在所述SMSC索引列表里选定一个索引初始值,并从该初始值对应的SMSC索引开始轮询,并在轮询完一个SMSC索引且该SMSC索引对应的SMSC不满足短信发送条件时,顺序轮询下一个SMSC索引;
步骤805:判断当前短消息数N与等待SMSC响应的短消息数之和是否小于SMSC的发送窗口大小;
其中,所述当前短消息数是指当前业务消息中包含的短消息数;所述等待SMSC响应的短消息数是指:已发送至当前轮询到的SMSC且在等待所述SMSC响应的消息数;这一步骤中,如果判断结果为是,则转入步骤806继续处理,否则,转入步骤808;
步骤806:判断当前所轮询的SMSC的链路是否处于激活状态,若是,则转入步骤807,否则转入步骤808;
步骤807:将业务消息中的N条短消息发送至SMSC,并将等待该SMSC响应的短信计数器增加N;
在该步骤中,还需要记录当前业务类型对应的SMSC索引,以便用于下一次该业务消息类型的消息轮询时选取索引初始值(假设按上述方式二选初始值);
步骤808:判断轮询次数是否达到SMSC索引列表List里元素总数,若未达到转入步骤804继续轮询下一个SMSC索引;否则,转入步骤809;
步骤809:记录短信发送失败原因并结束流程。
示例二
如图9所示,该示例包括以下步骤:
步骤901:接收业务消息并提取业务类型标识;
步骤902:遍历本地内存区业务类型标识数组,查找该业务类型标识对应的SMSC索引列表List,如果查找到则直接进入步骤904,否则进入步骤903;
上述SMSC索引列表是根据预先设置的业务类型标识与SMSC的配置关系表在内存区建立的索引表;
步骤903:创建SMSC索引列表并追加至已有列表;
在本地预先设置的业务类型标识与SMSC的配置关系表里搜索所述业务标识类型对应的SMSC并创建该业务类型标识对应的索引列表,追加至本地内存区已有列表;
步骤904:轮询所述SMSC索引列表;
如果是初次轮询当前SMSC索引列表,则在所述SMSC索引列表里选定一个索引初始值,并从该初始值对应的SMSC索引开始轮询,并在轮询完一个SMSC索引且该SMSC索引对应的SMSC不满足短信发送条件时,顺序轮询下一个SMSC索引;
步骤905:判断当前短消息数N与等待SMSC响应的短消息数之和是否小于SMSC的发送窗口大小;
其中,所述当前短消息数是指当前业务消息中包含的短消息数;所述等待SMSC响应的短消息数是指:已发送至当前轮询到的SMSC且在等待所述SMSC响应的消息数;这一步骤中,如果判断结果为是,则转入步骤906继续处理,否则,转入步骤908;
步骤906:判断当前所轮询的SMSC的链路是否处于激活状态,若是,则转入步骤907,否则转入步骤908;
步骤907:将业务消息中的N条短消息发送至SMSC,并将等待该SMSC响应的短信计数器增加N;
在该步骤中,还需要记录当前业务类型对应的SMSC索引,以便用于下一次该业务消息类型的消息轮询时选取索引初始值(假设按上述方式二选初始值);
步骤908:判断轮询次数是否达到SMSC索引列表List里元素总数,若未达到转入步骤904继续轮询下一个SMSC索引;否则,转入步骤909;
步骤909:遍历计数器计数值加1;
遍历计数器是用于统计遍历完SMSC中所有元素的次数,即,对SMSC中所有元素轮询完时,将遍历计数器的数值加1;
步骤910:判断遍历计数器是否达到特定阈值;
在这一步骤之前,可以根据实际需要设置遍历计数器的阈值;当遍历计数器达到特定阈值时,转步骤911;当遍历计数器未达到特定阈值时,转步骤912;
步骤911:记录短信发送失败原因;
步骤912:设置定时器;
步骤913:判断定时器是否超时;并在定时器超时时,重新轮询所述SMSC索引列表;定时器未超时时返回继续计时,并在定时器超时时重新轮询所述SMSC。
在具体实施过程中,上述SMSC索引列表获取模块71、处理模块72、业务消息发送模块73、链路状态管理模块74和响应模块75可以由协议栈处理设备内的中央处理器(CPU,Central Processing Unit)、微处理器(MPU,Micro Processing Unit)、数字信号处理器(DSP,Digital Signal Processor)或可编程逻辑阵列(FPGA,Field-Programmable Gate Array)来实现。
本发明实施例还提供了一种计算机存储介质,所述存储介质包括一组计算机可执行指令,所述指令用于执行本发明实施例所述的短信发送方法。
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。

Claims (13)

  1. 一种短信发送方法,所述方法包括:
    协议栈处理设备根据接收到的业务子系统发送的业务消息的业务类型获得与所述业务类型相匹配的短信服务中心SMSC索引列表;所述业务消息包括:业务类型标识和短信内容;
    轮询所述SMSC索引列表,当确定被轮询到的SMSC索引对应的SMSC满足预设短信发送条件时,将所述业务消息发送至所述SMSC。
  2. 根据权利要求1所述的方法,其中,协议栈处理设备根据接收到的业务子系统发送的业务消息的业务类型获得与所述业务类型相匹配的SMSC索引列表,包括:
    协议栈处理设备对所述业务消息进行解析获得业务类型标识,将所述业务类型标识作为关键字在本地内存中查找与所述业务标识相匹配的SMSC索引列表。
  3. 根据权利要求2所述的方法,其中,当将所述业务类型标识作为关键字在本地内存中没有查找到与所述业务标识相匹配的SMSC索引列表时,所述方法还包括:
    协议栈处理设备将所述业务类型标识作为关键字在本地数据库的业务类型标识与SMSC索引的配置关系表中查找与所述业务类型标识存在映射关系的SMSC索引;
    根据查找到的与所述业务类型标识存在映射关系的SMSC索引,生成与所述业务类型相匹配的SMSC索引列表;
    将生成的SMSC索引列表保存于本地内存中。
  4. 根据权利要求1、2或3所述的方法,其中,通过以下方式确定被轮询到的SMSC满足预设短信发送条件:
    判断当前业务消息拆分后的短信数与已发送至所述轮询到的SMSC、 且等待处理的短信数之和是否小于等于相应SMSC所支持的短信数;如果小于等于,则判断所述SMSC的链路是否处于激活状态,如果是,则确认SMSC满足预设短信发送条件。
  5. 根据权利要求4所述的方法,其中,所述协议栈处理设备判断所述SMSC的链路是否处于激活状态之前,所述方法还包括:
    协议栈处理设备通过以下方式对SMSC的链路状态进行管理:
    每次发送业务消息至SMSC后,检测业务消息状态,如果所述SMSC对业务消息响应超时或响应失败,则使预设的异常计数器加1;
    若异常计数值在第一预设时间内达到预设次数,则去激活此SMSC对应的链路,设置定时器,并在所设置的定时器达到第二预设时间时,激活所述SMSC对应的链路;若异常计数器的计数时间到达第一预设时间、但异常计数值未达到预设次数时,将异常计数器的计数值清零,并重新进行下一周期业务消息状态检测;若异常计数值未达到预设次数、且异常计数器的计数时间未到达第一预设时间,继续检测业务消息状态。
  6. 根据权利要求1、2或3所述的方法,其中,所述方法还包括:当轮询完所述SMSC索引列表,没有找到满足预设短信发送条件的SMSC时,向业务子系统返回错误响应消息以指示当前短信不能发送的原因。
  7. 一种短信发送装置,所述装置包括:短信服务中心SMSC索引列表获取模块、处理模块及业务消息发送模块;其中,
    所述SMSC索引列表获取模块,配置为根据接收到的业务子系统发送的业务消息的业务类型获得与所述业务类型相匹配的SMSC索引列表;所述业务消息包括:业务类型标识和短信内容;
    所述处理模块,配置为轮询所述SMSC索引列表,并在确定被轮询到的SMSC索引对应的SMSC满足预设短信发送条件时,触发业务消息发送模块;
    所述业务消息发送模块,配置为被处理模块触发时,将业务消息发 送给所述SMSC。
  8. 根据权利要求7所述的装置,其中,所述SMSC索引列表获取模块通过以下方式获取与所述业务消息的业务类型相匹配的SMSC索引列表:
    SMSC索引列表获取模块对所述业务消息进行解析获得业务类型标识,将所述业务类型标识作为关键字在本地内存中查找与所述业务标识相匹配的SMSC索引列表。
  9. 根据权利要求8所述的装置,其中,所述SMSC索引列表获取模块,还配置为在本地内存中没有查找到与所述业务标识相匹配的SMSC索引列表时,通过以下方式生成SMSC索引列表:
    SMSC索引列表获取模块将所述业务类型标识作为关键字在本地数据库的业务类型标识与SMSC索引的配置关系表中查找与所述业务类型标识存在映射关系的SMSC索引;
    根据查找到的与所述业务类型标识存在映射关系的SMSC索引,生成与所述业务类型相匹配的SMSC索引列表;所述SMSC索引列表中包括查找到的所有与所述业务类型标识存在映射关系的SMSC索引;
    将生成的SMSC索引列表保存于本地内存中。
  10. 根据权利要求7、8或9所述的装置,其中,所述处理模块通过以下方式确定被轮询到的SMSC满足预设短信发送条件:
    判断所述业务消息拆分后的短信数与已发送至所述轮询到的SMSC、且等待处理的短信数之和是否小于等于相应SMSC所支持的短信数;如果小于等于,则判断所述SMSC的链路是否处于激活状态,如果是,则确认SMSC满足预设短信发送条件。
  11. 根据权利要求10所述的装置,其中,所述装置还包括链路状态管理模块,配置为在处理模块判断SMSC的链路是否处于激活状态之前,通过以下方式对SMSC的链路状态进行管理:
    每次发送业务消息至SMSC后,检测业务消息状态,如果所述SMSC对业务消息响应超时或响应失败,则使预设的异常计数器加1;
    若异常计数值在第一预设时间内达到预设次数,则去激活此SMSC对应的链路,设置定时器,并在所设置的定时器达到第二预设时间时,激活所述SMSC对应的链路;若异常计数器的计数时间到达第一预设时间、但异常计数值未达到预设次数时,将异常计数器的计数值清零,并重新进行下一周期业务消息状态检测;若异常计数值未达到预设次数、且异常计数器的计数时间未到达第一预设时间,继续检测业务消息状态。
  12. 根据权利要求7、8或9所述的装置,其中,所述装置还包括:响应模块,配置为在处理模块轮询完所述SMSC索引列表,没有找到满足预设短信发送条件的SMSC时,向业务子系统返回错误响应消息以指示当前短信不能发送的原因。
  13. 一种计算机存储介质,所述存储介质包括一组计算机可执行指令,所述指令用于执行权利要求1-6任一项所述的短信发送方法。
PCT/CN2015/074968 2014-12-12 2015-03-24 一种短信发送方法、装置和计算机存储介质 WO2016090764A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410767851.9 2014-12-12
CN201410767851.9A CN105744494A (zh) 2014-12-12 2014-12-12 一种短信发送方法和装置

Publications (1)

Publication Number Publication Date
WO2016090764A1 true WO2016090764A1 (zh) 2016-06-16

Family

ID=56106538

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/074968 WO2016090764A1 (zh) 2014-12-12 2015-03-24 一种短信发送方法、装置和计算机存储介质

Country Status (2)

Country Link
CN (1) CN105744494A (zh)
WO (1) WO2016090764A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111210045A (zh) * 2018-11-22 2020-05-29 中国移动通信集团湖南有限公司 一种停机指令发送优化方法
CN113747378A (zh) * 2020-05-29 2021-12-03 中国移动通信有限公司研究院 短信传输方法、装置及网络设备

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109699047B (zh) * 2017-10-20 2022-04-26 中国移动通信集团浙江有限公司 一种短信交互平台实现方法及装置
CN110072199B (zh) * 2018-01-23 2023-01-20 优信拍(北京)信息科技有限公司 一种监控短消息发送异常的方法及系统
CN111356092B (zh) * 2018-12-24 2022-08-02 中兴通讯股份有限公司 投递域的查询方法及装置、短消息的投递方法及装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1262849A (zh) * 1997-06-03 2000-08-09 诺基亚网络有限公司 为短消息选择路由
KR20010035726A (ko) * 1999-10-01 2001-05-07 서평원 이동 통신망을 이용한 이 메일 송수신 방법
CN1905698A (zh) * 2006-08-02 2007-01-31 侯万春 实现短消息补充业务的系统和方法
CN101116067A (zh) * 2005-03-02 2008-01-30 思科技术公司 用于在短消息业务(sms)环境中提供代理的系统和方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1262849A (zh) * 1997-06-03 2000-08-09 诺基亚网络有限公司 为短消息选择路由
KR20010035726A (ko) * 1999-10-01 2001-05-07 서평원 이동 통신망을 이용한 이 메일 송수신 방법
CN101116067A (zh) * 2005-03-02 2008-01-30 思科技术公司 用于在短消息业务(sms)环境中提供代理的系统和方法
CN1905698A (zh) * 2006-08-02 2007-01-31 侯万春 实现短消息补充业务的系统和方法

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111210045A (zh) * 2018-11-22 2020-05-29 中国移动通信集团湖南有限公司 一种停机指令发送优化方法
CN111210045B (zh) * 2018-11-22 2023-07-04 中国移动通信集团湖南有限公司 一种停机指令发送优化方法
CN113747378A (zh) * 2020-05-29 2021-12-03 中国移动通信有限公司研究院 短信传输方法、装置及网络设备

Also Published As

Publication number Publication date
CN105744494A (zh) 2016-07-06

Similar Documents

Publication Publication Date Title
WO2016090764A1 (zh) 一种短信发送方法、装置和计算机存储介质
US10680874B2 (en) Network service fault handling method, service management system, and system management module
JP6055009B2 (ja) パケット処理方法、装置及びシステム
CN107864063B (zh) 一种异常监控方法、装置及电子设备
US9930632B2 (en) M2M application remote registration method, device, system and storage medium
WO2016127884A1 (zh) 消息推送方法及装置
CN107579854B (zh) 一种集群告警方法、装置、设备和计算机可读存储介质
US20160344582A1 (en) Call home cluster
CN107181628B (zh) 双向无线通信方法、装置和终端
US11979761B2 (en) Method and apparatus for detecting time series data
WO2013167092A2 (zh) 一种终端外设的远程管理方法、装置和系统
CN112311674B (zh) 报文发送方法、装置及存储介质
WO2017045433A1 (zh) 站点间通信状态检测方法及装置、存储介质
US10219133B2 (en) Notification message transmission method and device, and computer storage medium
AU2014237655A1 (en) Accessing multiple Converged Infrastructure systems
KR20210008525A (ko) 가입 서버, 가입 단말기, 정보 가입 방법, 및 시스템
US10511682B2 (en) Group resource updating processing methods, devices and system, and CSEs
US9164820B1 (en) System and method for correcting scrambled messages
US9264338B1 (en) Detecting upset conditions in application instances
US20180219971A1 (en) Service Processing Method and Device
CN106130874B (zh) 融合多通信方式的企业一体化信息处理方法
CN104022917A (zh) 云桥监控方法
WO2021164236A1 (zh) 报文的处理方法及装置
CN114338794A (zh) 一种服务消息的推送方法、装置、电子设备及存储介质
WO2016074455A1 (zh) 组资源更新处理方法、装置、系统及cse

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15867325

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15867325

Country of ref document: EP

Kind code of ref document: A1