Short message sending method and device, equipment and storage medium
By using the transmission layer network protocol for handshake and data transmission during the SMS sending process, the problem of low efficiency of TCP transmission protocol is solved, and an efficient and secure SMS sending process is achieved, which improves the user experience.
Patent Information
- Application Number
- CN202510592511.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-08
- Publication Date
- 2025-08-22
AI Technical Summary
The SMS sending process in the prior art relies on the TCP transmission protocol, resulting in low transmission efficiency.
SMS is sent using the transport layer network protocol, including the handshake process between the client and the server, identity authentication, session key encryption, application connection identification management and status report feedback, to improve the efficiency and security of SMS sending.
By optimizing the SMS sending process, the efficiency and reliability of SMS sending are improved, the security of data transmission is ensured, and the client's ability to control the SMS sending process is enhanced, and the user experience is improved.
Smart Images

Figure CN120529264A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of communication technology, and in particular to a method, apparatus, device and storage medium for sending short messages. Background Art
[0002] With the rapid development of the mobile internet, SMS, as a fundamental communication method, remains widely used in various business scenarios. The SMS sending process in related technologies typically relies on the TCP transmission protocol. While TCP (Transmission Control Protocol)-based SMS point-to-point protocols offer some security and transmission reliability, they suffer from low transmission efficiency. Summary of the Invention
[0003] In view of the above problems, embodiments of the present invention provide a method, apparatus, device and storage medium for sending short messages, which are used to solve the problem of low efficiency in sending short messages in related technologies.
[0004] According to one aspect of an embodiment of the present invention, a method for sending text messages is provided, which includes: obtaining a text message sending request initiated by a client based on a transport layer network protocol, the text message sending request including a receiving end corresponding to the text message sending package; sending the text message sending package to the receiving end based on the text message sending request, and obtaining a text message sending result; generating a status report for the text message sending request based on the text message sending result, and feeding it back to the client.
[0005] In an optional implementation, before obtaining the SMS sending request initiated by the client based on the transport layer network protocol, the method further includes:
[0006] Get the first handshake request initiated by the client;
[0007] Performing a first handshake with the client based on the first handshake request, and feeding back the handshake result of the first handshake to the client;
[0008] Receive a connection data packet and a second handshake request sent by the client based on the handshake result of the first handshake;
[0009] A second handshake is performed with the client based on the second handshake request and the connection data packet, and a transmission link is established between the server and the client based on the handshake result of the second handshake.
[0010] In an optional implementation, obtaining a text message sending request initiated by a client based on a transport layer network protocol includes:
[0011] Get the heartbeat packet sent by the client based on the datagram;
[0012] Determine the application connection identifier between the client and the server based on the heartbeat packet;
[0013] Based on the application connection identifier and the transport layer network protocol, obtain the SMS sending request initiated by the client.
[0014] In an optional implementation, obtaining a text message sending request initiated by a client based on an application connection identifier and a transport layer network protocol includes:
[0015] If the client and the server are connected, the SMS sending request initiated by the client is obtained based on the application connection identifier and the transport layer network protocol;
[0016] If the client and the server are in a disconnected state, obtain the third handshake request initiated by the client;
[0017] A third handshake is performed with the client based on the third handshake request, and during the third handshake, a text message sending request initiated by the client is obtained based on the transport layer network protocol.
[0018] In an optional implementation, sending the SMS delivery package to the receiving end based on the SMS sending request, and obtaining the SMS delivery result includes:
[0019] Obtain the status information of the receiving end, including the online status of the receiving end, the network status of the carrier to which the receiving end belongs, and the valid time period for the receiving end to receive text messages;
[0020] Based on the status information and the corresponding SMS downlink channel, the SMS downlink packet is sent to the receiving end;
[0021] The SMS delivery confirmation message or SMS delivery failure message returned by the receiving end is used as the SMS delivery result.
[0022] In an optional implementation, after sending the SMS delivery package to the receiving end based on the SMS sending request and obtaining the SMS delivery result, the method further includes:
[0023] Receive the SMS uplink packet fed back by the receiving end in response to the SMS sending request;
[0024] Based on the transport layer network protocol and the corresponding SMS uplink channel, the SMS uplink packet is forwarded to the client.
[0025] In an optional implementation, generating a status report for the SMS sending request based on the SMS delivery result and feeding it back to the client includes:
[0026] Generate a status report based on the SMS delivery results, including the number of successful SMS deliveries, the number of failed SMS deliveries, and the reasons for SMS delivery failures;
[0027] Encapsulate the status report into a status report data packet;
[0028] Based on the transport layer network protocol and application connection identifier, the status report data packet is fed back to the client through the corresponding status channel.
[0029] According to another aspect of an embodiment of the present invention, a text message sending device is provided, including: a data acquisition module, used to obtain a text message sending request initiated by a client based on a transport layer network protocol, the text message sending request including a receiving end corresponding to the text message sending package; a text message sending module, used to send the text message sending package to the receiving end based on the text message sending request, and obtain a text message sending result; a result feedback module, used to generate a status report for the text message sending request based on the text message sending result, and feed it back to the client.
[0030] According to another aspect of an embodiment of the present invention, a computer device is provided, comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform the operation of the aforementioned SMS sending method.
[0031] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein the storage medium stores at least one executable instruction, and the executable instruction enables a computer device / apparatus to perform the operations of the aforementioned method for sending a short message.
[0032] The technical solution provided by the embodiment of the present invention first obtains the SMS sending request initiated by the client based on the transport layer network protocol during the SMS sending process to improve the efficiency of SMS sending and transmission, and obtains the SMS sending result by sending the SMS sending package to the receiving end based on the SMS sending request, so as to generate a status report for the SMS sending request based on the SMS sending result and feed it back to the client, so that the client can determine whether to resend the SMS sending package based on the received status report.
[0033] The above description is only an overview of the technical solutions of the embodiments of the present invention. In order to more clearly understand the technical means of the embodiments of the present invention, they can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiments of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are specifically listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The accompanying drawings are only used to illustrate the embodiments and are not to be considered as limiting the present invention. In addition, the same reference symbols are used to represent the same components throughout the drawings. In the drawings:
[0035] Figure 1 A schematic diagram showing a flow chart of a method for sending text messages provided by the present invention is shown;
[0036] Figure 2 Another schematic diagram of a method for sending text messages provided by the present invention is shown;
[0037] Figure 3 Another schematic diagram of a flow chart of a method for sending a text message provided by the present invention is shown;
[0038] Figure 4 A schematic structural diagram of a text message sending device provided by the present invention is shown;
[0039] Figure 5 A schematic structural diagram of a computer device provided by the present invention is shown. DETAILED DESCRIPTION
[0040] To make the purpose, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative efforts shall fall within the scope of protection of the present invention.
[0041] The SMS delivery process typically begins with the SP sending the message to the operator's service (ISMG) using the CMPP / SMGP / SGIP protocol. The ISMG then forwards the message to the SMSC using the SMPP protocol. The SMSC then sends the message to the base station using a link layer protocol. Finally, when the message is delivered to the client, the SP->ISMG->SMSC transport protocol always uses TCP / IP, but in practice, this can be more complex. Because the network link from the SMSC to the client is typically very short, and most SMSCs and base stations have dedicated lines to ensure high network speeds, the majority of the transmission process and transmission time actually occurs via the TCP / IP protocol. If any one link is blocked, the entire link can be blocked, reducing SMS delivery efficiency.
[0042] Related keyword analysis:
[0043] SP (Service Provider): Business provider, information resource station entity provides SMS value-added services.
[0044] SMSC (Short Message Control): Receives short messages from ISMG and sends them to end-user mobile phones.
[0045] ISMG (Internet Short Message Gateway): Sends SMS to SMC or forwards it to other ISMGs based on the SMS-related information of the SP. Generally, operators will establish a set of servers in each province and forward the SMS to the designated ISMG based on the location of the SMS recipient's number.
[0046] SMPP (Short Message Peer to Peer): SMPP is an open short message protocol used for data transmission between SMSC, ISMG, and SP.
[0047] CMPP (China Mobile Peer to Peer) / SMGP (Short Message Gateway Protocol) / SGIP (Short Message Gateway Interface Protocol): These are short message protocols developed by domestic operators based on the SMPP protocol and adapted to their own business conditions. CMPP is China Mobile's short message protocol, SMGP is China Telecom's short message protocol, and SGIP is China Unicom's short message protocol.
[0048] TCP / IP (Transmission Control Protocol / Internet Protocol): Transmission Control Protocol / Internet Protocol is a set of basic protocols used for Internet data communication. It provides a reliable mechanism for data transmission between different devices.
[0049] Figure 1 FIG1 shows a flowchart of a first embodiment of a method for sending short messages according to the present invention, which is executed by a server. Figure 1 As shown, the method includes the following steps:
[0050] Step 110: Obtain a text message sending request initiated by the client based on the transport layer network protocol.
[0051] The SMS sending request includes the receiving end corresponding to the SMS sending package.
[0052] In an optional manner, before obtaining the SMS sending request initiated by the client based on the transport layer network protocol, you can first obtain a first handshake request initiated by the client; perform a first handshake with the client based on the first handshake request, and feed back the handshake result of the first handshake to the client; receive a connection data packet and a second handshake request sent by the client based on the handshake result of the first handshake; perform a second handshake with the client based on the second handshake request and the connection data packet, and establish a transmission link between the server and the client based on the handshake result of the second handshake.
[0053] Specifically, during the first handshake, the client sends a first handshake request to the server. The server performs the first handshake with the client based on the first handshake request and feeds back the server configuration information during the first handshake to the client as the handshake result, so that the client can authenticate the server based on the received server configuration information. After successful authentication, the first handshake is completed. The server configuration information includes a long-term key exchange value, a signature configured by the server, a source address token, an encryption block for verification, the IP address obtained by the server, and the server's current timestamp.
[0054] During the second handshake, after authenticating the server, the client generates its own key exchange value. With both its own and the other party's key exchange values, the client can calculate the initial key and send the connection data packet and the second handshake request to the server using the initial key. After receiving the second handshake request, the server obtains the client's key exchange value, calculates the initial key, and decrypts the connection data packet based on the initial key. It then conducts a second handshake with the client based on the decrypted result, encrypts the handshake result with the session key, and sends it back to the client, allowing the client to decrypt the handshake result based on the session key obtained from the initial key. The client then completes the second handshake with the server based on the decrypted handshake result and establishes a transmission link with the server.
[0055] As mentioned above, by transmitting connection data packets during the handshake between the client and the server, the transmission delay caused by the connection is greatly reduced, and the efficiency of SMS sending is improved. In addition, during the process of establishing the transmission link, the server is authenticated and the handshake results are encrypted using the session key to ensure the security of data transmission.
[0056] In an optional method, when obtaining a text message sending request initiated by a client based on a transport layer network protocol, you can first obtain a heartbeat packet sent by the client based on a datagram; determine the application connection identifier between the client and the server based on the heartbeat packet; and obtain the text message sending request initiated by the client based on the application connection identifier and the transport layer network protocol.
[0057] Specifically, in the process of obtaining a heartbeat packet, the server listens to a specific port, waiting for data packets sent by the client. When a heartbeat packet arrives, the server parses the packet and extracts an application connection identifier, which uniquely identifies the connection between the client and the server. This connection identifier can be generated based on the client's IP address, port number, and a unique identifier assigned to the connection by the server, or it can be generated based on a random matrix. Subsequently, the server searches a preset request queue for a text message sending request that matches the connection identifier based on the application connection identifier and the transport layer network protocol QUIC. If a matching request is found, the server further processes the request and executes the text message sending process. If no matching request is found, the server temporarily stores the heartbeat packet information and continues to listen for subsequent requests, allowing the server to accurately identify and respond to the client's text message sending request, ensuring the accuracy and timeliness of text message sending. By transmitting heartbeat packets in the form of datagrams, non-critical communications are accelerated, greatly improving the efficiency of text message sending. At the same time, by creating a connection identifier, the connection between the client and the server will not be interrupted as long as the connection identifier remains unchanged even if the IP or port changes or is interrupted.
[0058] In an optional manner, when obtaining a text message sending request initiated by a client based on an application connection identifier and a transport layer network protocol, if the client and the server are in a connected state, the text message sending request initiated by the client is obtained based on the application connection identifier and the transport layer network protocol; if the client and the server are in a disconnected state, a third handshake request initiated by the client is obtained; a third handshake is performed with the client based on the third handshake request, and during the third handshake, the text message sending request initiated by the client is obtained based on the transport layer network protocol.
[0059] Specifically, when the client and server are connected, the server continuously listens for incoming data packets. Upon detecting a heartbeat packet containing the application connection identifier and the transport layer network protocol QUIC, the server immediately parses the packet and extracts a text message request. This request contains key information such as the recipient number and the message content. Upon receiving these requests, the server performs a series of checks and processing to ensure the legitimacy and security of the message content.
[0060] However, if the connection between the client and server is interrupted for some reason, such as network fluctuations, the server will detect this disconnection. In this case, the server will wait for the client to initiate a third handshake request to reestablish the connection. Through the three-way handshake, the client and server can confirm the connection status between each other and prepare for subsequent data transmission.
[0061] During the third handshake, the server will again listen to and obtain the SMS sending request initiated by the client based on the transport layer network protocol QUIC. Therefore, during the reconnection process, after the client establishes a connection with the server for the first time, it does not need to wait for round-trip interaction with the server on subsequent connections, and can directly send SMS packets, thereby saving time, significantly improving the connection speed and response performance, and ensuring the reliability and stability of SMS sending.
[0062] Furthermore, in one embodiment, after establishing a transmission link between the server and the client, a heartbeat packet sent by the client can be received based on the transport layer network protocol. Based on the heartbeat packet, the application connection identifiers of the client and server can be determined. The connection status between the client and server can then be managed based on the application connection identifier. This allows real-time monitoring of the connection status between the client and server, ensuring the stability and reliability of the connection. When the heartbeat packet arrives normally, it indicates that the connection between the client and server is active. If the heartbeat packet does not arrive on time, it may indicate a connection problem. In this case, the connection management module will take appropriate action, such as attempting a reconnection or reporting an error. The connection status between the client and server is managed based on the application connection identifier. As a unique identifier for the connection between the client and server, the application connection identifier can be used to distinguish between different client connections, ensuring the orderly transmission and processing of data. A connection status table records the current status of each client connection, such as connection established, connection interrupted, or connection closed. The connection status is updated promptly based on the receipt of heartbeat packets. This allows for effective management and monitoring of client connections, ensuring the stability and reliability of the SMS sending process. At the same time, by adopting the transport layer network protocol for data transmission, the efficiency and security of SMS sending are improved.
[0063] Step 120: Send the SMS sending package to the receiving end based on the SMS sending request to obtain the SMS sending result.
[0064] As described above, the SMS delivery package is delivered to the receiving end based on the SMS delivery request, and the SMS delivery result is obtained, thereby achieving the SMS delivery. The SMS delivery result includes status information of whether the delivery is successful or failed.
[0065] In an optional method, if the SMS delivery result is a sending failure, the server can obtain the failure reason and perform corresponding processing based on the failure reason, such as resending the SMS, recording error logs, etc., to ensure the accuracy of SMS delivery and improve user experience.
[0066] In an optional method, the SMS delivery package is sent to the receiving end based on the SMS sending request. When the SMS delivery result is obtained, the status information of the receiving end can be obtained first. The status information includes the online status of the receiving end, the network status of the operator to which the receiving end belongs, and the effective period of the receiving end in receiving SMS; based on the status information and the corresponding SMS downlink channel, the SMS delivery package is sent to the receiving end; the SMS delivery confirmation information or SMS delivery failure information returned by the receiving end is used as the SMS delivery result.
[0067] Specifically, after obtaining the receiving end's status information, the optimal timing and channel for SMS downlink delivery is determined. For example, when the receiving end is online and the carrier's network is in good condition, the high-speed and stable SMS downlink channel is prioritized for delivery to ensure that the message reaches the receiving end quickly. If the receiving end is offline or the network is poor, a pre-set strategy is used, such as delaying delivery or selecting an alternative channel, to maximize the delivery success rate.
[0068] Furthermore, because different recipients may have time limits for receiving SMS messages, SMS messages can be sent within appropriate time windows. For example, for recipients that have set Do Not Disturb mode, SMS messages can be sent immediately after Do Not Disturb mode ends to avoid missed or delayed SMS messages.
[0069] During the SMS delivery process, the system monitors the delivery status in real time and promptly updates the delivery results upon receiving confirmation or failure information from the receiving end. For failed SMS messages, intelligent processing is performed based on the cause of failure, such as retrying delivery and recording failure logs for subsequent analysis and improvement. This ensures the accuracy and efficiency of SMS delivery and improves the user experience.
[0070] In one embodiment, before sending the SMS delivery package to the receiving end based on the SMS delivery request, the server will first verify the request upon receipt to ensure its validity and legitimacy. This verification may include: whether the request format is correct, whether the parameters in the request are complete, and whether the request comes from a legitimate client. Only requests that pass the verification will be further processed and the SMS delivery process will be executed, thereby preventing illegal requests from interfering with the server and ensuring the security and stability of the SMS delivery process.
[0071] Step 130: Generate a status report for the SMS sending request based on the SMS sending result and feed it back to the client.
[0072] Among them, the results of SMS delivery may include successful delivery, undelivered (such as due to the recipient number not existing, empty, out of service, blacklisted, etc.), partial delivery (such as when sending group SMS, some recipients successfully received it, and some did not receive it). The server generates a detailed status report based on these results. The report can include information such as the time the SMS was sent, the recipient's number, the SMS content, the sending status (success / failure / partial success), and the reason for failure (if applicable). The server feeds back the status report to the client, so that the client can understand the status of SMS sending in a timely manner and perform subsequent operations as needed, such as resending SMS to the recipients who did not deliver it or performing other processing. This not only improves the transparency and traceability of SMS sending, but also enhances the client's control over the SMS sending process, thereby improving the user experience.
[0073] Specifically, a status report for the SMS sending request can be generated based on the SMS delivery result. This report, including information on the success or failure of the SMS delivery, possible reasons for the failure, and corresponding handling suggestions, is then packaged into a status report and sent to the client via a pre-set feedback channel. After receiving the status report, the client can promptly understand the status of the SMS delivery. For SMS messages that failed to be sent, the client can take appropriate actions based on the handling suggestions, such as resending or viewing the error log. This not only improves the transparency of SMS delivery, but also enhances the client's ability to control the SMS delivery process, further improving the user experience.
[0074] Optionally, the status report can also include detailed SMS sending statistics, such as send time, receiver response time, and send success rate, to facilitate in-depth analysis and optimization by the client. Furthermore, the server can use this statistical information to continuously optimize and improve the SMS sending process, further improving the efficiency and accuracy of SMS delivery.
[0075] In an optional approach, when receiving SMS send requests initiated by clients based on transport layer network protocols, a custom congestion control algorithm can be implemented to better adapt to changing network conditions and avoid SMS delays or loss caused by network congestion. Furthermore, bandwidth control and send rate adjustments can more efficiently utilize network resources, ensuring that SMS messages are delivered quickly and accurately to users.
[0076] In actual SMS sending scenarios, SPs usually do not directly act as service providers, but go through multiple layers of intermediaries. Most SPs are encapsulated as a unified SMS gateway, i.e., the server, and provided as a SaaS service to real business parties. There are various ways to provide services, including SMPP access, CMPP, SMGP, SGIP access, and even some provide HTTP access. Therefore, the actual situation is far more complicated than the ideal situation, which means that the transport layer network protocol QUIC can play a more important role in it.
[0077] Typically, a relatively large service provider (SP) acts as an SMS access gateway, providing SaaS services to actual service providers. This service provider needs to connect with upstream and downstream providers, converting different upstream access methods (protocol types) into the protocol types required by the operator. For example, SMS messages sent via HTTP must be sent to the appropriate service provider SP based on the mobile phone number being sent, and then converted to the corresponding protocol type for delivery. For example, if:
[0078] Service provider A needs to send a text message to a mobile phone user of Guangdong Telecom via HTTP.
[0079] Then the link from the sender to the receiver of the routed SMS will be:
[0080] 1. Business provider A->SaaS service provider (HTTP protocol);
[0081] 2. SaaS service provider -> China Telecom Fujian SP (SMGP agreement): SaaS services do not directly connect to Guangdong Telecom's SP and need to be transferred through Fujian Telecom's SP;
[0082] 3. China Telecom Fujian Province SP->China Telecom Fujian Province ISMG (SMGP agreement);
[0083] 4. China Telecom Fujian Province ISMG -> China Telecom Guangdong Province ISMG (SMGP protocol): When the receiving mobile phone number is found to be a Guangdong Province number, the ISMG forwards it to the corresponding provincial ISMG;
[0084] 5. China Telecom Guangdong Province ISMG->SMSC (SMGP protocol);
[0085] 6. SMSC->mobile phone (through optical fiber communication, base station signal transmission, etc.).
[0086] As can be seen from this link, the first five steps are all based on TCP to transmit data over the Internet or dedicated lines. The possibility of network congestion due to TCP is very high. This embodiment adjusts the 4-layer transport layer solution to a transport layer network protocol, which is very beneficial for SMS services, which are highly concurrent and relatively simple services.
[0087] In summary, the SMS sending method provided by the present invention greatly improves the efficiency of SMS sending by transmitting connection data packets during the handshake between the client and the server, and using the transport layer network protocol for data transmission after the transmission link is established. At the same time, the security of data transmission and the accuracy of SMS sending are ensured by authenticating the server, encrypting the handshake results with session keys, verifying the SMS sending request, and generating a sending report. At the same time, by generating a status report for the SMS sending request based on the SMS sending result and feeding it back to the client, the client's ability to control the SMS sending process is enhanced, thereby improving the user experience.
[0088] Figure 2 FIG1 shows a flowchart of another embodiment of the method for sending short messages of the present invention, which is executed by the server. Figure 2 As shown, the method includes the following steps:
[0089] Step 210: Obtain a text message sending request initiated by the client based on the transport layer network protocol.
[0090] For details, please see Figure 1 Step 110 of the illustrated embodiment will not be described in detail here.
[0091] Step 220: Send the SMS sending package to the receiving end based on the SMS sending request to obtain the SMS sending result.
[0092] For details, please see Figure 1 Step 120 of the illustrated embodiment will not be described in detail here.
[0093] Step 230: Generate a status report for the SMS sending request based on the SMS sending result and feed it back to the client.
[0094] Specifically, the above step 230 includes:
[0095] Step 2301: Generate a status report including the number of successful SMS delivery, the number of failed SMS delivery, and the reasons for the SMS delivery failure according to the SMS delivery result.
[0096] Specifically, based on the SMS delivery results, a status report is generated that includes the number of successfully delivered SMS messages, the number of failed SMS messages, and the reasons for the failures. This information can be collated and summarized, including the number of successfully delivered SMS messages, the number of undelivered SMS messages, and the corresponding recipient numbers, SMS content, delivery status, and failure reasons. This generated status report not only provides an overall overview of SMS delivery but also identifies the delivery results of each SMS message, allowing clients to clearly understand the details of SMS delivery.
[0097] Step 2302: encapsulate the status report into a status report data packet.
[0098] Specifically, when encapsulating the status report into a status report data packet, a specific data format and protocol can be used to ensure the integrity and security of the data during transmission. The status report data packet contains all the information in the status report, such as the number of SMS messages sent successfully, the number of SMS messages sent unsuccessfully, and the reasons for SMS message failures.
[0099] Step 2303: Based on the transport layer network protocol and the application connection identifier, the status report data packet is fed back to the client through the corresponding status channel.
[0100] Specifically, the server sends the encapsulated status report data packet back to the client via the status channel. After receiving the status report data packet, the client unpacks it, extracts the information in the status report, quickly locates the failed SMS message, and takes appropriate remedial measures based on the cause of the failure, such as resending the SMS message or adjusting the sending strategy, thereby improving the success rate and efficiency of SMS sending. At the same time, the client can also evaluate and analyze the effectiveness of SMS sending based on the statistical information in the status report, providing a basis for subsequent optimization and improvement. This not only enhances the client's control over the SMS sending process, but also further improves the user experience and ensures the stability and reliability of the SMS sending service.
[0101] The SMS sending method of the embodiments of the present invention achieves rapid response and accurate processing of SMS messages by establishing a stable and efficient communication mechanism between the client and the server. During the SMS sending process, the server not only monitors the SMS sending results but also focuses on real-time interaction with the client, ensuring that the client is able to obtain timely details of the SMS sending. Furthermore, the server further improves the efficiency and accuracy of SMS sending through continuous optimization and improvement of the SMS sending process, providing users with a more stable and reliable SMS sending service.
[0102] Figure 3 FIG1 shows a flowchart of another embodiment of the method for sending short messages of the present invention, which is executed by the server. Figure 3 As shown, the method includes the following steps:
[0103] Step 310: Obtain a text message sending request initiated by the client based on the transport layer network protocol. The text message sending request includes a receiving end corresponding to the text message sending package.
[0104] For details, please see Figure 1 Step 110 of the illustrated embodiment will not be described in detail here.
[0105] Step 320: Send the SMS sending package to the receiving end based on the SMS sending request.
[0106] For details, please see Figure 1 Step 120 of the illustrated embodiment will not be described in detail here.
[0107] Step 330: Receive the SMS uplink packet fed back by the receiving end in response to the SMS sending request.
[0108] Step 340: forward the SMS uplink packet to the client based on the transport layer network protocol and the corresponding SMS uplink channel.
[0109] As described above, by forwarding SMS uplink packets to the client based on the transport layer network protocol and the corresponding SMS uplink channel, bidirectional communication between the receiving end and the client is achieved. During the SMS sending process, the receiving end may generate some SMS-related uplink data, such as SMS replies and SMS status reports. This data is very important to the client because it reflects the receiving end's reception and processing of the SMS. Therefore, after receiving these SMS uplink packets, the server will promptly forward them to the client so that the client can promptly understand the receiving end's feedback and perform subsequent processing as needed.
[0110] Specifically, the SMS uplink packet fed back by the receiving end in response to the SMS sending request may include various types of data, such as the SMS content replied by the receiving end, the SMS confirmation information of the receiving end, the SMS reception status reported by the receiving end, etc. After receiving these uplink packets, the server will perform corresponding processing based on their type and content. For example, for the SMS content replied by the receiving end, the server will encapsulate it into an uplink data packet and forward it to the client through the SMS uplink channel; for the SMS reception status reported by the receiving end, the server will compare it with the previous SMS sending result to verify whether the SMS was successfully delivered and update the SMS sending status report.
[0111] When the server forwards SMS uplink packets to the client based on the transport layer network protocol and the corresponding SMS uplink channel, it encapsulates the uplink packets using a specific data format and protocol to ensure data integrity and security. It also encrypts the packets during transmission to prevent unauthorized interception or tampering. Furthermore, the server identifies different client connections based on the application connection identifier, ensuring that uplink packets are accurately delivered to the appropriate client.
[0112] The SMS sending method of the embodiments of the present invention, through two-way communication between the receiving end and the client, not only improves the efficiency and accuracy of SMS sending, but also enhances the interactivity and real-time nature of SMS services. The client can promptly understand the feedback from the receiving end and perform subsequent processing as needed, thereby improving the flexibility and usability of the SMS service. Furthermore, by continuously optimizing and improving the SMS sending and receiving processes, the server can further enhance the stability and reliability of the SMS service, providing users with a higher-quality SMS service experience.
[0113] Figure 4 FIG. 1 shows a schematic structural diagram of an embodiment of a device for sending short messages according to the present invention. Figure 4 As shown, the device includes:
[0114] The data acquisition module 410 is used to obtain a short message sending request initiated by the client based on the transport layer network protocol. The short message sending request includes a receiving end corresponding to the short message sending package.
[0115] The SMS sending module 420 is used to send the SMS sending package to the receiving end based on the SMS sending request and obtain the SMS sending result.
[0116] The result feedback module 430 is used to generate a status report for the SMS sending request based on the SMS sending result and feed it back to the client.
[0117] In an optional embodiment, the data acquisition module 410 includes:
[0118] A first handshake unit, configured to obtain a first handshake request initiated by a client;
[0119] a handshake feedback unit, configured to perform a first handshake with the client based on the first handshake request, and feed back a handshake result of the first handshake to the client;
[0120] The second handshake unit is configured to receive a connection data packet and a second handshake request sent by the client based on the handshake result of the first handshake;
[0121] The link establishing unit is configured to perform a second handshake with the client based on the second handshake request and the connection data packet, and establish a transmission link between the server and the client based on the handshake result of the second handshake.
[0122] In an optional embodiment, the data acquisition module 410 further includes:
[0123] A heartbeat acquisition unit, configured to acquire a heartbeat packet sent by a client based on a datagram;
[0124] An identification determination unit, configured to determine an application connection identification between the client and the server based on a heartbeat packet;
[0125] The request obtaining unit is used to obtain the SMS sending request initiated by the client based on the application connection identifier and the transport layer network protocol.
[0126] In an optional implementation, the request obtaining unit includes:
[0127] The first request acquisition subunit is used to acquire the SMS sending request initiated by the client based on the application connection identifier and the transport layer network protocol if the client and the server are in a connected state;
[0128] The third handshake request subunit is configured to obtain a third handshake request initiated by the client if the client and the server are in a disconnected state;
[0129] The second request obtaining subunit is configured to perform a third handshake with the client based on the third handshake request, and obtain the SMS sending request initiated by the client based on the transport layer network protocol during the third handshake.
[0130] In an optional implementation, the SMS sending module 420 includes:
[0131] A status information acquisition unit is used to acquire status information of the receiving terminal, the status information including the online status of the receiving terminal, the network status of the operator to which the receiving terminal belongs, and the valid time period for the receiving terminal to receive text messages;
[0132] The SMS packet sending unit is used to send the SMS packet to the receiving end based on the status information and the corresponding SMS downlink channel;
[0133] The sending result determining unit is used to take the SMS sending confirmation information or SMS sending failure information returned by the receiving end as the SMS sending result.
[0134] In some optional implementations, the SMS sending module 420 further includes:
[0135] The SMS uplink packet receiving unit is used to receive the SMS uplink packet fed back by the receiving end in response to the SMS sending request;
[0136] The SMS uplink packet forwarding unit is used to forward the SMS uplink packet to the client based on the transport layer network protocol and the corresponding SMS uplink channel.
[0137] In some optional implementations, the result feedback module 430 includes:
[0138] A status report generating unit, configured to generate a status report including the number of successful SMS messages, the number of failed SMS messages, and the reasons for the SMS message failures according to the SMS message sending result;
[0139] A status report encapsulation unit, configured to encapsulate the status report into a status report data packet;
[0140] The status report feedback unit is used to feed back the status report data packet to the client through the corresponding status channel based on the transport layer network protocol and application connection identifier.
[0141] The further functional description of each of the above modules and units is the same as that of the above corresponding method embodiments and will not be repeated here.
[0142] The technical solution provided by the embodiment of the present invention has the following advantages through the above-mentioned device and its components:
[0143] See also Figure 5 , Figure 5 is a structural diagram of a computer device provided by an optional embodiment of the present invention, such as Figure 5 As shown, the computer device includes: one or more processors 10, memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components utilize different buses to communicate with each other and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in the memory or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Equally, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 10 is taken as an example.
[0144] The processor 10 may be a central processing unit, a network processor, or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic, or any combination thereof.
[0145] The memory 20 stores instructions that can be executed by at least one processor 10, so as to enable at least one processor 10 to execute the method shown in the above embodiment.
[0146] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created based on the use of a computer device for displaying a small program landing page, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a server cluster, a mobile communication network, and a combination thereof.
[0147] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0148] The computer device further includes a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0149] An embodiment of the present invention also provides a computer-readable storage medium storing at least one executable instruction. When the executable instruction runs on a computer device / SMS sending apparatus, the computer device / SMS sending apparatus executes the SMS sending method in any of the above method embodiments.
[0150] The algorithms or displays provided herein are not inherently related to any particular computer, virtual system or other device. In addition, the embodiments of the present invention are not directed to any particular programming language.
[0151] In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the present invention may be practiced without these specific details. Similarly, in order to streamline the present invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of embodiments of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. The claims that follow the detailed description are hereby expressly incorporated into that detailed description, with each claim itself serving as a separate embodiment of the present invention.
[0152] Those skilled in the art will appreciate that the modules in the devices of the embodiments can be adaptively changed and installed in one or more devices different from the embodiments. The modules, units, or components in the embodiments can be combined into one module, unit, or component, and furthermore, they can be divided into multiple submodules, subunits, or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive.
[0153] It should be noted that the above embodiments illustrate rather than limit the invention, and that alternative embodiments may be devised by a person skilled in the art without departing from the scope of the appended claims. In the claims, any reference signs placed between brackets should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising several different elements and by means of appropriately programmed computers. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments should not be understood as limiting the order of execution unless otherwise specified.
Claims
1. A method for sending a text message, characterized in that: Applied to the server, the method includes: Obtaining a text message sending request initiated by the client based on the transport layer network protocol, wherein the text message sending request includes a receiving end corresponding to the text message packet; Sending the SMS sending package to the receiving end based on the SMS sending request, and obtaining an SMS sending result; A status report for the SMS sending request is generated based on the SMS sending result and fed back to the client.
2. The method according to claim 1, characterized in that Before obtaining the SMS sending request initiated by the client based on the transport layer network protocol, the method further includes: Get the first handshake request initiated by the client; Performing a first handshake with the client based on the first handshake request, and feeding back a handshake result of the first handshake to the client; Receive a connection data packet and a second handshake request sent by the client based on the handshake result of the first handshake; A second handshake is performed with the client based on the second handshake request and the connection data packet, and a transmission link is established between the server and the client based on the handshake result of the second handshake.
3. The method according to claim 1, characterized in that The obtaining of a short message sending request initiated by the client based on a transport layer network protocol includes: Get the heartbeat packet sent by the client based on the datagram; Determine an application connection identifier between the client and the server based on the heartbeat packet; Based on the application connection identifier and the transport layer network protocol, a short message sending request initiated by the client is obtained.
4. The method according to claim 3, characterized in that The acquiring, based on the application connection identifier and the transport layer network protocol, a text message sending request initiated by the client, includes: If the client is in a connected state with the server, obtaining a text message sending request initiated by the client based on the application connection identifier and the transport layer network protocol; If the client and the server are in a disconnected state, obtaining a third handshake request initiated by the client; A third handshake is performed with the client based on the third handshake request, and during the third handshake, a short message sending request initiated by the client is obtained based on the transport layer network protocol.
5. The method according to claim 1, wherein The sending of the SMS delivery package to the receiving end based on the SMS sending request to obtain an SMS delivery result includes: Acquire status information of the receiving terminal, the status information including the online status of the receiving terminal, the network status of the operator to which the receiving terminal belongs, and the valid time period for the receiving terminal to receive text messages; Based on the status information and the corresponding SMS downlink channel, the SMS downlink packet is sent to the receiving end; The SMS delivery confirmation information or SMS delivery failure information returned by the receiving end is used as the SMS delivery result.
6. The method according to claim 1, characterized in that After sending the SMS sending package to the receiving end based on the SMS sending request and obtaining the SMS sending result, the method further includes: Receiving an SMS uplink packet fed back by the receiving end in response to the SMS sending request; Based on the transport layer network protocol and the corresponding SMS uplink channel, the SMS uplink packet is forwarded to the client.
7. The method according to claim 1, characterized in that The generating a status report for the SMS sending request based on the SMS sending result and feeding the report back to the client includes: Generate a status report based on the SMS delivery result, including the number of SMS delivery successes, the number of SMS delivery failures, and the reasons for SMS delivery failures; Encapsulating the status report into a status report data packet; Based on the transport layer network protocol and the application connection identifier, the status report data packet is fed back to the client through the corresponding status channel.
8. A text message sending device, characterized in that: The device comprises: A data acquisition module is used to obtain a text message sending request initiated by a client based on a transport layer network protocol, wherein the text message sending request includes a receiving end corresponding to the text message packet; An SMS sending module is used to send the SMS sending package to the receiving end based on the SMS sending request and obtain an SMS sending result; A result feedback module is used to generate a status report for the SMS sending request based on the SMS sending result and feed it back to the client.
9. A computer device, characterized in that: include: A processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform the operation of the SMS sending method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The storage medium stores at least one executable instruction, and when the executable instruction is executed on a computer device, the computer device executes the operation of the SMS sending method according to any one of claims 1 to 7.