Short message merging processing method and device, short message service center and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-08
- Publication Date
- 2026-08-11
AI Technical Summary
由于长短信是会话隔离的,各个长短信会分别被保存、处理,需要对每条长短信建立长短信的唯一编号与存储长短信的各个拆分短信的列表位置之间的映射,并利用Map结构存储此映射,耗费内存较多;并且,在每个新的拆分信息到达时,都需要对列表进行检查,判断此长短信的所有拆分信息是否已经到达,耗费时间较多,处理效率较低
[0022]The SMS merging processing method, apparatus, SMS service center, storage medium, and computer program product disclosed herein store the SMS content from the split information of a long SMS message in a first storage data structure corresponding to the long SMS message. Based on the first sending ratio information, key-value information, and address information of the first storage data structure, a first skip list node for the long SMS message is generated and stored in the skip list data structure. The skip list data structure is searched, and based on the first sending ratio information, a second skip list node corresponding to the sent long SMS message is determined for merging processing. This reduces the memory occupied by long SMS message splicing, reduces the time required to check whether all split information has arrived, improves the success rate and processing efficiency of long SMS message splicing, and ensures the integrity, accuracy, and timeliness of long SMS messages.
Smart Images

Figure CN122554789A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, SMS service center, storage medium, and computer program product for merging and processing SMS messages. Background Technology
[0002] SMPP (Short Message Peer-to-Peer) is a standard protocol for sending and receiving SMS messages, applicable to scenarios such as SMS communication between enterprises and service providers. Due to limitations of the SMPP protocol, there are certain requirements on the length of SMS content transmitted in a single message. SMS messages with content exceeding the maximum supported SMS content length by the SMPP protocol (e.g., 255 bytes) are called long SMS messages. When the content of a long SMS message exceeds 255 bytes, it is split into multiple segments and sent separately. The Short Message Service Center (SMSC) needs to reassemble these segments to reconstruct the long SMS message. Currently, for each long SMS message, the SMSC allocates a list to store all the segments. When a new segment arrives, it checks if all segments have arrived. If all segments have arrived, they are reassembled in the order they were received to obtain the long SMS message, which is then processed further. If any segments have not yet arrived, the SMSC continues to wait. Because long text messages are session-isolated, each long text message is saved and processed separately. It is necessary to establish a mapping between the unique number of each long text message and the position of each segmented text message in the list where the long text message is stored, and to store this mapping using a Map structure, which consumes a lot of memory. In addition, when each new segmented information arrives, the list needs to be checked to determine whether all the segmented information of this long text message has arrived, which consumes a lot of time and has low processing efficiency. Summary of the Invention
[0003] This disclosure provides a method, apparatus, SMS service center, storage medium, and computer program product for merging SMS messages.
[0004] According to a first aspect of this disclosure, a method for merging and processing SMS messages is provided, comprising: upon receiving splitting information of a long SMS message, determining first sending ratio information and key-value information of the long SMS message; storing the SMS content in the splitting information in a first storage data structure corresponding to the long SMS message; generating a first skip list node for the long SMS message based on the first sending ratio information, the key-value information, and address information of the first storage data structure; storing the first skip list node using the skip list data structure; searching the skip list data structure and determining a second skip list node corresponding to the long SMS message that has been sent, based on the first sending ratio information, among all the first skip list nodes; and performing merging and processing on the long SMS message that has been sent, based on the second skip list node.
[0005] Optionally, storing the first skip list node using a skip list data structure includes: when the long SMS is a newly received long SMS, inserting the first skip list node into the skip list data structure according to the first sending ratio information.
[0006] Optionally, storing the first skip list node using a skip list data structure includes: if the long SMS is a received long SMS, deleting the third skip list node corresponding to the long SMS in the skip list data structure; and inserting the first skip list node into the skip list data structure according to the first sending ratio information.
[0007] Optionally, if the long text message is a newly received long text message, a mapping relationship is established between the key value information and the second sending ratio information, wherein the value of the second sending ratio information is the same as the value of the first sending ratio information; the mapping relationship is stored using a second storage data structure.
[0008] Optionally, deleting the third skip list node corresponding to the long SMS message in the skip list data structure includes: obtaining the second sending ratio information in the second storage data structure according to the mapping relationship and the key value information; determining the third skip list node in the skip list data structure according to the second sending ratio information and the key value information, and deleting it.
[0009] Optionally, if the long SMS message is a received long SMS message and the first skip list node is inserted into the skip list data structure, the value of the second sending ratio information is updated to the value of the first sending ratio information in the second storage data structure according to the mapping relationship and the key value information.
[0010] Optionally, the second storage data structure includes a hash table data structure.
[0011] Optionally, the splitting information includes first PDU data obtained by the client after splitting the long SMS message, and the method includes: receiving second PDU data; and determining the second PDU data as the first PDU data if the second PDU data contains a long SMS message identifier parameter.
[0012] Optionally, determining the first sending ratio information of the long SMS message includes: obtaining the total number of PDU data segments of the long SMS message and the sequence number information of the first PDU data in the first PDU data; and determining the first sending ratio information based on the sequence number information and the total number.
[0013] Optionally, determining the key-value information of the long SMS message includes: obtaining the serial number information of the long SMS message from the first PDU data; obtaining the session serial number information of the client sending the first PDU data; and generating the key-value information based on the serial number information of the long SMS message and the session serial number information.
[0014] Optionally, if the long text message is a newly received long text message, a first storage data structure corresponding to the long text message is established, wherein the first storage data structure includes a linked list.
[0015] Optionally, the search of the skip list data structure includes: periodically searching the skip list data structure at preset time intervals.
[0016] Optionally, the first skip table node includes the first transmission ratio information, the key value information, and the address information, wherein the first transmission ratio information of the second skip table node is greater than or equal to the ratio threshold.
[0017] Optionally, the step of merging the sent long SMS messages according to the second skip table node includes: obtaining all SMS content stored in the first storage data structure according to the address information of the second skip table node; merging the all SMS content to obtain the concatenated long SMS message.
[0018] According to a second aspect of this disclosure, a text message merging processing apparatus is provided, comprising: a memory; and a processor coupled to the memory, the processor being configured to perform a video conferencing information sharing method as described above based on instructions stored in the memory.
[0019] According to a third aspect of this disclosure, a text messaging service center is provided, comprising: the text messaging merging and processing apparatus as described above.
[0020] According to a fourth aspect of this disclosure, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions that, when executed by a processor, implement the SMS merging processing method described above.
[0021] According to a fifth aspect of this disclosure, a computer program product is provided, the computer program product storing computer instructions, which, when executed by a processor, implement the SMS merging processing method described above.
[0022] The SMS merging processing method, apparatus, SMS service center, storage medium, and computer program product disclosed herein store the SMS content from the split information of a long SMS message in a first storage data structure corresponding to the long SMS message. Based on the first sending ratio information, key-value information, and address information of the first storage data structure, a first skip list node for the long SMS message is generated and stored in the skip list data structure. The skip list data structure is searched, and based on the first sending ratio information, a second skip list node corresponding to the sent long SMS message is determined for merging processing. This reduces the memory occupied by long SMS message splicing, reduces the time required to check whether all split information has arrived, improves the success rate and processing efficiency of long SMS message splicing, and ensures the integrity, accuracy, and timeliness of long SMS messages. Attached Figure Description
[0023] The above and other objects, features, and advantages of this disclosure will become more apparent from the more detailed description of the embodiments thereof in conjunction with the accompanying drawings. The accompanying drawings are provided to further illustrate the embodiments of this disclosure and form part of the specification. They are used together with the embodiments of this disclosure to explain the disclosure and do not constitute a limitation thereof. The above and other objects and advantages of this disclosure will be further described below with reference to specific embodiments and the accompanying drawings. In the drawings, the same or corresponding technical features or components will be represented by the same or corresponding reference numerals.
[0024] Figure 1 This is a flowchart illustrating some embodiments of the SMS merging processing method according to the present disclosure;
[0025] Figure 2 This is a flowchart illustrating the storage of the first skip table node in some embodiments of the SMS merging processing method according to the present disclosure;
[0026] Figure 3 This is a schematic diagram illustrating the principle of a skip list data structure in some embodiments of the SMS merging processing method according to this disclosure;
[0027] Figure 4 This is a schematic diagram illustrating the process of maintaining the mapping relationship between key value information and second sending ratio information and deleting third skip table nodes in some embodiments of the SMS merging processing method according to this disclosure.
[0028] Figure 5A This is a schematic diagram of a first skip table node in some embodiments of the SMS merging processing method according to the present disclosure. Figure 5B This is a schematic diagram illustrating the mapping relationship between key-value information and second sending ratio information in some embodiments of the SMS merging processing method according to this disclosure;
[0029] Figure 6The present invention provides a schematic diagram of modules for some embodiments of a text message merging processing apparatus according to the present disclosure.
[0030] Figure 7 The following is a schematic diagram of modules according to other embodiments of the SMS merging processing apparatus of the present disclosure;
[0031] Figure 8 This is a schematic diagram of some embodiments of the SMS service center according to the present disclosure. Detailed Implementation
[0032] Exemplary embodiments of the present disclosure will be described below with reference to the accompanying drawings. For clarity and brevity, not all features of the embodiments are described in the specification. However, it should be understood that many implementation-specific settings must be made in carrying out the embodiments to achieve the developer's specific goals, such as complying with constraints related to the device and business, and these constraints may vary depending on the implementation. Furthermore, it should be understood that while development work can be very complex and time-consuming, such development work is merely a routine task for those skilled in the art who benefit from the present disclosure.
[0033] It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of this disclosure.
[0034] Those skilled in the art will understand that the terms "first," "second," etc., in the embodiments of this disclosure are only used to distinguish different steps, devices, or modules, and do not represent any specific technical meaning, nor do they indicate a necessary logical order between them.
[0035] It should also be understood that in the embodiments disclosed herein, "multiple" can refer to two or more, and "at least one" can refer to one, two or more.
[0036] It should also be understood that any component, data or structure mentioned in the embodiments of this disclosure can generally be understood as one or more unless expressly defined or given to the contrary in the context.
[0037] Furthermore, the term "and / or" in this disclosure is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this disclosure generally indicates that the preceding and following related objects have an "or" relationship.
[0038] It should also be understood that the description of the various embodiments in this disclosure emphasizes the differences between the various embodiments, and the similarities or similarities can be referred to each other. For the sake of brevity, they will not be described in detail.
[0039] At the same time, it should be understood that, for ease of description, the dimensions of the various parts shown in the accompanying drawings are not drawn according to actual scale.
[0040] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit this disclosure or its application or use.
[0041] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.
[0042] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.
[0043] Furthermore, to avoid obscuring this disclosure with unnecessary detail, only processing steps and / or apparatus structures closely related to at least the solutions according to this disclosure are shown in the accompanying drawings, while other details less relevant to this disclosure are omitted. It should also be noted that similar reference numerals and letters in the drawings indicate similar items, and therefore once an item is defined in one drawing, it need not be discussed again in subsequent drawings.
[0044] Figure 1 This is a flowchart illustrating some embodiments of the SMS merging processing method according to this disclosure. For example... Figure 1 As shown, the SMS merging processing method includes steps S101-S105.
[0045] Step S101: Upon receiving the splitting information of the long SMS message, determine the first sending ratio information and key value information of the long SMS message.
[0046] The client can be a variety of devices and can use the SMPP protocol to deliver SMS messages to nodes such as the SMSC (Short Message Service Center). The SMPP protocol is a binary protocol that defines a series of protocol data units (PDUs) for operations and the data exchanged between the client and the SMSC. The SMSC is a network node used for storing, forwarding, and delivering SMS messages.
[0047] The client establishes an SMPP session with the SMSC via the SMPP protocol and sends SMS messages to the SMSC through this session. SUBMIT_SM is a command in the SMPP protocol used to submit SMS messages to the SMSC. The client can send an SMS to the SMSC using the SUBMIT_SM command, specifying the recipient's address, message content, sender information, etc. Upon receiving the SUBMIT_SM command, the SMSC forwards the SMS to the recipient.
[0048] If the content of a text message exceeds the maximum text message content length supported by the SMPP protocol (e.g., 255 bytes), it is considered a long text message. A long text message can be split into multiple segments for transmission, such as PDU (Protocol Data Unit) data. When the content of a long text message exceeds the capacity of a single PDU, it needs to be split into multiple PDUs for transmission. Upon receiving the segmentation information for a long text message, the initial transmission ratio and key value information can be determined according to preset rules.
[0049] Step S102: Store the SMS content in the split information in the first storage data structure corresponding to the long SMS.
[0050] The split information can be PDU data, etc. The SMS content is extracted from the PDU data and stored in the first storage data structure corresponding to the long SMS. The first storage data structure can be a linked list, etc. For the SMS content in the split information of the long SMS, it is added to the linked list in the order in which the SMS content is received.
[0051] Step S103: Based on the first sending ratio information, key value information and address information of the first storage data structure, generate the first skip list node for the long SMS message, and store the first skip list node using the skip list data structure.
[0052] A skip list data structure is similar to an ordered linked list, improving search efficiency by adding multiple pointers to other nodes at each node. Skip lists allow insertion, deletion, and search operations to be performed in O(log n) time complexity. Storing the first skip list node using a skip list data structure enables retrieval and manipulation of that node with lower time complexity. Various skip list data structures can be used to store the first skip list node.
[0053] Each node in the skip list data structure is the first skip list node of a long SMS message. The first skip list node includes first sending ratio information, key value information, and address information of the first storage data structure, etc. For an SMSC, a skip list can be used to record the first skip list nodes of all long SMS messages. The first sending ratio information of the first skip list node represents the degree of reception of long SMS messages (the proportion of the long SMS messages that have been received to the total number of long SMS messages). The first sending ratio information is used as the sorting basis of the skip list data structure.
[0054] Step S104: Search the skip list data structure and, based on the first sending ratio information, determine the second skip list node corresponding to the long SMS message that has been sent in all the first skip list nodes.
[0055] The first transmission ratio information can be used as the search basis for the skip list data structure, and various search methods for skip list data structures can be used. The second skip list node can be any node in the first skip list whose first transmission ratio information is greater than a preset ratio threshold.
[0056] Step S105: Merge the long SMS messages that have been sent according to the second skip table node.
[0057] The client can be an e-commerce marketing customer's device, using the SMPP protocol to establish an SMPP session with the SMSC. When transmitting a long SMS message through the SMPP session, the client splits the long SMS message into multiple segments for transmission. The SMSC merges these segments, ensuring the integrity, accuracy, and timeliness of the long SMS message. The SMSC can then perform compliance checks and keyword avoidance on the assembled long SMS message. After processing, the long SMS message is sent to the operator, who then forwards it to the customer's mobile phone, allowing the customer to view the message.
[0058] The SMS merging processing method disclosed herein stores the SMS content from the split information of a long SMS message in a first storage data structure corresponding to the long SMS message. Based on the first sending ratio information, key-value information, and address information of the first storage data structure, a first skip list node for the long SMS message is generated and stored in the skip list data structure. The skip list data structure is searched, and based on the first sending ratio information, a second skip list node corresponding to the sent long SMS message is determined for merging processing. This method reduces the memory occupied by long SMS message splicing, reduces the time required to check whether all split information has arrived, improves the success rate and processing efficiency of long SMS message splicing, ensures the integrity, accuracy, and timeliness of long SMS messages, and improves the service quality of long SMS messages.
[0059] Figure 2This is a flowchart illustrating the storage of the first skip table node in some embodiments of the SMS merging processing method according to this disclosure, such as... Figure 2 As shown:
[0060] Step S201: Determine whether the long SMS message is a received long SMS message. If yes, proceed to step S202; otherwise, proceed to step S203.
[0061] In step S202, if the long SMS is a newly received long SMS, the first skip list node is inserted into the skip list data structure according to the first sending ratio information.
[0062] The key-value information of a long SMS message can be used to determine if it is a newly received long SMS message. If it is, the first skip list node is inserted into the skip list data structure. The skip list data structure can accelerate search operations by building indexes at different levels of the linked list. In the skip list data structure, nodes are sorted according to their scores. When inserting, searching, or deleting the first skip list node, the insertion position needs to be determined based on the score. The first sending ratio information of the first skip list node can be used as the score to determine the position of the first skip list node.
[0063] Step S203: If the long SMS message is a received long SMS message, determine the third jump table node corresponding to the long SMS message in the jump table data structure and delete it.
[0064] Step S204: Insert the first skip list node into the skip list data structure according to the first transmission ratio information.
[0065] The first sending ratio information can be used as a score. Using various skip list search methods, the position of the stored third skip list node corresponding to the long SMS message can be determined within the skip list data structure based on the first sending ratio information, and then the third skip list node can be deleted. After deleting the third skip list node, the first sending ratio information can be used as a score, and using various skip list insertion methods, the first skip list node can be inserted into the skip list data structure.
[0066] In some embodiments, the presence of a long SMS identifier parameter in the received PDU data can be used to determine whether the PDU data is a segmentation of a long SMS message. The long SMS identifier parameter can be any of several parameters. If the received PDU data carries a long SMS identifier parameter, then the PDU is determined to belong to a long SMS message.
[0067] For example, the splitting information includes the first PDU data obtained by the client after splitting the long SMS message; when the second PDU data is received, if it is determined that the received second PDU data contains the long SMS message identifier parameter d1, then the second PDU data is determined to be the first PDU data obtained after splitting the long SMS message, that is, the splitting information of the long SMS message has been received.
[0068] If the second PDU data does not contain the long SMS identifier parameter d1, it is determined that a regular SMS has been received. The content of this SMS is then subjected to corresponding compliance checks, keyword avoidance, and other business processing. After processing is completed, the SMS is sent to the operator, who then sends the SMS to the customer's mobile phone, allowing the customer to view the SMS.
[0069] Several methods can be used to determine the first transmission ratio and key value information of a long SMS message. In the first PDU data, the total number of PDU data segments from the long SMS message and the sequence number information of the first PDU data are obtained. Based on the sequence number information and the total number of PDU data, the first transmission ratio information is determined.
[0070] For example, the client can segment a long SMS message into five first PDU data sets. Each first PDU data set can include a long SMS message identifier parameter, a long SMS message number, the total number of first PDU data sets, and a sequence number. Upon receiving a first PDU data set, the client extracts the total number of PDU data sets segmented from the long SMS message (5) and the sequence number information of the first PDU data sets (3). The first transmission ratio is then calculated as: (Sequence number information 3 / Total number 5) = 60%. Alternatively, based on the key value information, the client can determine that the number of first PDU data sets already received is 3, and the first transmission ratio is calculated as: (Number of first PDU data sets received 3 / Total number 5) = 60%.
[0071] There are several methods to determine the key-value information of a long SMS message. One method involves retrieving the long SMS message's ID from the first PDU data and obtaining the session ID information from the client that sent the first PDU data. Based on the long SMS message's ID and the session ID information, key-value information is generated.
[0072] For example, when a client sends a long SMS message, it establishes an SMPP session with the SMSC and obtains the session number A1 from the first PDU data obtained after the client segments the long SMS message. This is the number of the SMPP session. When the client receives the first PDU data obtained after segmenting the long SMS message, it extracts the long SMS message number information as B1 from the first PDU data. Based on the long SMS message number information and the session number information, the generated key-value information can be: long SMS message number information + session number information (the session number information of the first PDU data obtained after the client segments the long SMS message), that is, the key-value information is B1 + A1.
[0073] When the long SMS message is a newly received long SMS message, a first storage data structure corresponding to the long SMS message is established. This first storage data structure can be a linked list, a queue, etc. A linked list consists of a series of nodes, each node containing two parts: the first part stores the data, and the second part stores a pointer or link to the next node. A queue is a linear data structure that follows the First-In-First-Out (FIFO) principle.
[0074] For example, upon receiving the first PDU data, it is determined whether the long SMS message to which the first PDU data belongs is a newly received long SMS message. If so, a linked list corresponding to the long SMS message is created, and the SMS content in the first PDU data is stored in the linked list corresponding to the long SMS message in the order of receipt. If not, the linked list address information corresponding to the long SMS message is obtained, and the SMS content in the first PDU data is stored in the linked list corresponding to the long SMS message based on the linked list address information. A corresponding linked list is configured for each long SMS message, which can store the correspondence between the key-value information of the long SMS message and the linked list address. Based on this correspondence, the linked list address information corresponding to the long SMS message can be obtained.
[0075] In some embodiments, the client establishes an SMPP session with the SMSC, and the client sends long SMS messages to the SMSC through the SMPP session. Each SMPP session corresponds to one long SMS message. The SMSC uses the same skip list data structure to store the first skip list node of all long SMS messages. Each first skip list node corresponds to one long SMS message. The first skip list node includes first sending ratio information, key value information, and address information of the first storage data structure, etc.
[0076] Various skip list data structures can be used to store the first skip list node. For example, a skip list is a multi-level linked list where the last level stores all skip list elements (first skip list nodes), and the parent level of each level contains approximately half the nodes of the current level. Each level of the skip list is a subset of the previous level; the higher the level, the fewer the nodes. Each node contains only a subset of nodes in its index level, and the higher the level, the larger the gaps between nodes.
[0077] Before performing insert, search, or delete operations, it is necessary to determine the position of the data in the skip list. The skip list structure allows queries to start from the top level, quickly locating the approximate position of the target node, and then approximating downwards layer by layer, similar to a binary search, starting from the top level and searching downwards until the precise position is found.
[0078] A skip list is a randomized data structure that accelerates search operations by building indexes at different levels of the linked list. In a skip list data structure, nodes are sorted according to their scores, and the position is determined based on the first transmission ratio information of the first skip list node.
[0079] For example, such as Figure 3 As shown, the three-level linked list skip list data structure contains 7 first skip list nodes (for simplicity, only a part of the levels are shown here). Figure 3 The scores (first transmission ratio information) of the 7 nodes are 10%, 20%, 30%, 40%, 50%, 60%, and 70%, respectively. If the first transmission ratio information (score) of the first skip list node to be searched is 40%, then in the first-level index, 40% is between 10% and 50%, so it moves down to the next level index; in the second-level index, 40% is between 30% and 50%, so it moves to the next level index; in the third-level index, the node with a score (first transmission ratio information) of 40% can be found, which is used to determine the position of the first skip list node.
[0080] In the search process of the skip list data structure, efficient searching can be achieved through a multi-level index structure with low time complexity. This makes skip lists perform well when processing large amounts of ordered data, with efficient search performance, support for efficient insertion and deletion operations, and reasonable memory usage. It is advantageous in systems that require high concurrency access.
[0081] Figure 4 This is a schematic diagram illustrating the process of maintaining the mapping relationship between key-value information and second sending ratio information, and deleting a third skip table node, in some embodiments of the SMS merging processing method according to this disclosure. Figure 4 As shown:
[0082] Step S401: Determine whether the long SMS message is a received long SMS message. If yes, proceed to step S402; otherwise, proceed to step S404.
[0083] Step 402: In the case that the long text message is a newly received long text message, establish a mapping relationship between key value information and second sending ratio information, wherein the value of the second sending ratio information is the same as the value of the first sending ratio information.
[0084] Step S403: Store the mapping relationship using the second storage data structure.
[0085] The second storage data structure can be various data structures, such as a hash table data structure. For example... Figure 5AAs shown, the first skip list node includes first sending ratio information, key value information, and address information of the first storage data structure, etc. For an SMSC, a skip list data structure can be used to record the first skip list nodes of all long SMS messages. Each node in the skip list data structure represents the first skip list node of a long SMS message.
[0086] The mapping relationship between key value information and second transmission ratio information is as follows: Figure 5B As shown, the key-value information of the first skip list node is the same as the key-value information in the mapping relationship. A hash table data structure can be used for the mapping relationship. A mapping relationship can be a key-value pair stored in a hash table data structure, where the key information is the key and the value information is the second sending ratio information.
[0087] Step S404: Obtain the second transmission ratio information from the second storage data structure according to the mapping relationship and key value information.
[0088] Step S405: Based on the second transmission ratio information and key value information, determine the third skip list node in the skip list data structure and delete it.
[0089] To quickly modify the first sending ratio information when a long SMS message is split, a data structure combining skip lists and hash tables is needed. The second sending ratio information can be retrieved from the hash table data structure based on the key-value pairs (mapping relationship) and key-value information stored in the hash table data structure. By storing the mapping relationship between key-value information and second sending ratio information through the hash table data structure, the sending ratio information of a long SMS message can be quickly queried.
[0090] For example, based on the key-value pairs (mapping relationship) and key-value information stored in the hash table data structure, the second sending ratio information r1 is obtained from the hash table data structure, where r1 is 30%. Based on the second sending ratio information r1, using r1 as a fraction, at least one skip list node can be quickly found in the skip list data structure by the interval of the fraction / fraction. Based on the key-value information, the third skip list node corresponding to the long SMS message is determined in this at least one skip list node, and this third skip list node is deleted.
[0091] In step S406, if the long SMS is a received long SMS and the first skip list node is inserted into the skip list data structure, the second sending ratio information is updated to the first sending ratio information in the second storage data structure according to the mapping relationship and key value information.
[0092] For example, after deleting the third skip list node, the first skip list node is inserted into the skip list data structure. If the long SMS message is a received long SMS message and the first skip list node is inserted into the skip list data structure, based on the key-value pairs (mapping relationship) and key-value information stored in the hash table data structure, the second sending ratio information r1 in the corresponding key-value pair is updated in the hash table data structure to the first sending ratio information r2 of the first skip list node inserted into the skip list data structure, where r2 is 40%.
[0093] In some embodiments, the skip list data structure is periodically searched at preset intervals. Based on the first sending ratio information, a second skip list node corresponding to a completed long SMS message is determined from all first skip list nodes. The first sending ratio information of the second skip list node is greater than or equal to a ratio threshold. The ratio threshold can be set, for example, a ratio threshold of 100%; due to data calculation errors, the ratio threshold can also be in the range of 99.99% to 100.01%. Alternatively, the skip list data structure can be searched after receiving a fixed number of long SMS message splitting information. By setting an appropriate search frequency instead of continuously looping the search, unnecessary thread time consumption can be avoided, and the real-time performance of long SMS messages can be improved while reducing the CPU time occupied by threads.
[0094] After obtaining the second skip table node, based on the address information of the second skip table node, all SMS content stored in the first storage data structure is obtained, and all SMS content is merged to obtain the concatenated long SMS.
[0095] For example, based on the address information of the second skip list node, all stored SMS content is retrieved from the linked list corresponding to the long SMS message. After sorting and deduplication checks of the stored SMS content, it is concatenated to generate the initial complete SMS content of the long SMS message. This content is then handed over to the specific processing logic of the session according to its associated session for further processing. Various methods can be used to sort and deduplicate the stored SMS content based on sequence number information, key-value information, etc. After processing, corresponding memory and storage space release operations can be performed, such as deleting the second skip list node and releasing the linked list corresponding to the processed long SMS message.
[0096] The time complexity of receiving and splicing long SMS messages is as follows (assuming there are currently n unprocessed long SMS messages, and there are m long SMS messages with a first sending ratio of 100%, and the length of a long SMS message is l): Time complexity of receiving the split information and performing skip list processing: O(log(n)); Time complexity of adding the SMS content to the first storage data structure corresponding to the long SMS message: O(1); Time complexity of obtaining the first sending ratio information of all long SMS messages with a first sending ratio of 100%: O(log(n)); Time complexity of removing all long SMS messages with a first sending ratio of 100%: O(m * log(n)); Time complexity of sorting and splicing to obtain the complete content of the long SMS message: O(log l).
[0097] The SMS merging processing method in the above embodiments can reduce the memory occupied by long SMS splicing, reduce the time required to check whether all split information has arrived, improve the success rate and processing efficiency of long SMS splicing, and ensure the integrity, accuracy and timeliness of long SMS.
[0098] In some embodiments, such as Figure 6 As shown, this disclosure provides a text message merging processing device 60, including: an information determination module 61, a content storage module 62, a node generation module 63, a data processing module 64, a node search module 65, and a text message merging module 64. Upon receiving splitting information for a long text message, the information determination module 61 determines the first sending ratio information and key value information of the long text message. The content storage module 62 stores the text message content from the splitting information in a first storage data structure corresponding to the long text message.
[0099] The node generation module 63 generates the first skip list node for long SMS messages based on the first sending ratio information, key value information, and address information of the first storage data structure. The data processing module 64 stores the first skip list node using the skip list data structure.
[0100] The node search module 65 searches the skip list data structure and, based on the first sending ratio information, determines the second skip list node corresponding to the long SMS message that has been sent, from all the nodes in the first skip list. The SMS merging module 66 then merges the long SMS messages that have been sent, based on the second skip list node.
[0101] In some embodiments, when the long SMS message is a newly received long SMS message, the data processing module 64 inserts the first skip list node into the skip list data structure according to the first sending ratio information. When the long SMS message is a previously received long SMS message, the data processing module 64 deletes the third skip list node corresponding to the long SMS message from the skip list data structure and inserts the first skip list node into the skip list data structure according to the first sending ratio information.
[0102] When the long SMS is a newly received long SMS, the data processing module 64 establishes a mapping relationship between key value information and second sending ratio information. The value of the second sending ratio information is the same as the value of the first sending ratio information. The data processing module 64 uses the second storage data structure to store the mapping relationship.
[0103] The data processing module 64 obtains the second transmission ratio information from the second storage data structure based on the mapping relationship and key value information; the data processing module 64 determines the third skip list node in the skip list data structure based on the second transmission ratio information and key value information, and deletes it.
[0104] When the long SMS message is a received long SMS message and the first skip list node is inserted into the skip list data structure, the data processing module 64 updates the value of the second sending ratio information to the value of the first sending ratio information in the second storage data structure according to the mapping relationship and key value information.
[0105] In some embodiments, the splitting information includes first PDU data obtained by the client after splitting the long SMS message, and the information determination module 61 receives second PDU data; if the second PDU data contains a long SMS message identification parameter, the information determination module 61 determines the second PDU data as the first PDU data.
[0106] The information determination module 61 obtains the total number of PDU data segments of the long SMS message and the sequence number information of the first PDU data from the first PDU data; the information determination module 61 determines the first sending ratio information based on the sequence number information and the total number.
[0107] The information determination module 61 obtains the long SMS number information from the first PDU data; the information determination module 61 obtains the session number information of the client sending the first PDU data; the information determination module 61 generates key-value information based on the long SMS number information and the session number information.
[0108] When the long SMS message is a newly received long SMS message, the content storage module 62 establishes a first storage data structure corresponding to the long SMS message. The first storage data structure includes a linked list. The node search module 65 periodically searches the skip list data structure at preset intervals. The SMS merging module 65 retrieves all SMS message content stored in the first storage data structure based on the address information of the second skip list nodes; the SMS merging module 65 then merges all the SMS message content to obtain the concatenated long SMS message.
[0109] like Figure 7As shown, the SMS merging processing apparatus may include a memory 71, a processor 72, a communication interface 73, and a bus 74. The memory 71 is used to store instructions, and the processor 72 is coupled to the memory 71. The processor 72 is configured to execute the above-described SMS merging processing method based on the instructions stored in the memory 71.
[0110] The memory 71 can be a high-speed RAM, non-volatile memory, or a memory array. The memory 71 may also be divided into blocks, and these blocks can be combined into virtual volumes according to certain rules. The processor 72 can be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the SMS merging processing method of this disclosure.
[0111] In some embodiments, this disclosure provides a text messaging service center, including the text messaging merging and processing apparatus as described in any of the above embodiments. Figure 8 As shown, the SMS service center 82 includes an SMS merging and processing device 821 and a business processing module 822, etc. The client 81 establishes an SMPP session with the SMS merging and processing device 821 using the SMPP protocol. When transmitting a long SMS message through the SMPP session, the client 81 splits the long SMS message into multiple segments for transmission.
[0112] The SMS merging and processing device 821 merges multiple segments of a long SMS message, ensuring the integrity, accuracy, and timeliness of the message. The business processing module 822 performs compliance checks and keyword avoidance on the assembled long SMS message. After processing, the long SMS message is sent to the communication provider device 83, which then forwards it to the user's mobile phone 84.
[0113] In some embodiments, this disclosure provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the SMS merging processing method as described in any of the foregoing embodiments.
[0114] Computer-readable storage media may take the form of any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may, for example, include, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples (not an exhaustive list) of readable storage media may include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0115] Embodiments of this disclosure may also be computer program products, including computer program instructions that, when executed by a processor, cause the processor to perform the steps in the methods according to various embodiments of this disclosure described in the "Exemplary Methods" section above.
[0116] The SMS merging processing method, apparatus, SMS service center, storage medium, and computer program product in the above embodiments can reduce the memory occupied by long SMS splicing, reduce the time required to check whether all split information has arrived, improve the success rate and processing efficiency of long SMS splicing, ensure the integrity, accuracy, and timeliness of long SMS, improve the service quality of long SMS, and enhance the user experience.
[0117] The basic principles of this disclosure have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in this disclosure are merely examples and not limitations, and should not be considered as essential features of each embodiment of this disclosure. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the scope of this disclosure to the necessity of employing the aforementioned specific details for implementation.
[0118] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For system embodiments, since they largely correspond to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0119] The block diagrams of devices, apparatuses, devices, and systems disclosed herein are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context clearly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.
[0120] It should also be noted that in the apparatus, devices, and methods of this disclosure, the components or steps can be disassembled and / or recombined. These disassemblies and / or recombinations should be considered as equivalent solutions to this disclosure.
[0121] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of this disclosure. Therefore, this disclosure is not intended to be limited to the aspects shown herein, but rather to be carried out within the widest scope consistent with the principles and novel features disclosed herein.
[0122] The above description has been given for illustrative and descriptive purposes. Furthermore, this description is not intended to limit the embodiments of this disclosure to the forms disclosed herein. Although several exemplary aspects and embodiments have been discussed above, those skilled in the art will understand that the above embodiments are illustrative only and do not limit the scope of this disclosure. Those skilled in the art will understand that the above embodiments can be combined, modified, or replaced without departing from the scope and spirit of this disclosure.
Claims
1. A method for merging and processing SMS messages, comprising: Upon receiving information about splitting a long text message, determine the first sending ratio information and key value information of the long text message; The SMS content in the split information is stored in the first storage data structure corresponding to the long SMS message; Based on the first sending ratio information, the key value information, and the address information of the first storage data structure, the first skip table node of the long SMS message is generated. The first skip list node is stored using a skip list data structure; The skip list data structure is searched, and based on the first sending ratio information, the second skip list node corresponding to the long SMS message that has been sent is determined from all the first skip list nodes. Based on the second skip list node, the long text messages that have been sent are merged.
2. The SMS merging processing method as described in claim 1, wherein, The method of storing the first skip list node using a skip list data structure includes: If the long text message is a newly received long text message, the first skip list node is inserted into the skip list data structure according to the first sending ratio information.
3. The SMS merging processing method as described in claim 2, wherein, The method of storing the first skip list node using a skip list data structure includes: If the long text message is a received long text message, delete the third skip list node corresponding to the long text message in the skip list data structure; Based on the first transmission ratio information, the first skip list node is inserted into the skip list data structure.
4. The SMS merging processing method as described in claim 3, comprising: When the long text message is a newly received long text message, a mapping relationship is established between the key value information and the second sending ratio information, wherein the value of the second sending ratio information is the same as the value of the first sending ratio information; The mapping relationship is stored using a second storage data structure.
5. The SMS merging processing method as described in claim 4, wherein, Deleting the third skip list node corresponding to the long SMS message in the skip list data structure includes: Based on the mapping relationship and the key information, the second transmission ratio information is obtained from the second storage data structure; Based on the second transmission ratio information and the key value information, the third skip list node is determined in the skip list data structure and then deleted.
6. The SMS merging processing method as described in claim 5, comprising: If the long SMS message is a received long SMS message and the first skip list node is inserted into the skip list data structure, then according to the mapping relationship and the key-value information, the value of the second sending ratio information is updated to the value of the first sending ratio information in the second storage data structure.
7. The SMS merging processing method as described in claim 4, wherein, The second storage data structure includes a hash table data structure.
8. The SMS merging processing method as described in claim 1, wherein, The splitting information includes the first PDU data obtained by the client after splitting the long SMS message, and the method includes: Receive second PDU data; If the second PDU data contains a long SMS identifier parameter, the second PDU data is determined to be the first PDU data.
9. The SMS merging processing method as described in claim 8, wherein, The information for determining the first sending ratio of the long text message includes: In the first PDU data, obtain the total number of PDU data segments of the long SMS message and the sequence number information of the first PDU data; The first transmission ratio information is determined based on the sequence number information and the total quantity.
10. The SMS merging processing method as described in claim 8, wherein, The key-value information for determining the long text message includes: From the first PDU data, obtain the number information of the long text message; Obtain the session number information of the client that sent the first PDU data; The key-value information is generated based on the serial number of the long text message and the session serial number.
11. The SMS merging processing method as described in claim 1, comprising: If the long text message is a newly received long text message, a first storage data structure corresponding to the long text message is established, wherein the first storage data structure includes a linked list.
12. The SMS merging processing method as described in claim 1, wherein, The search of the skip list data structure includes: The skip list data structure is searched periodically at preset intervals.
13. The SMS merging processing method according to any one of claims 1 to 12, wherein, The first skip table node includes the first transmission ratio information, the key value information, and the address information, wherein the first transmission ratio information of the second skip table node is greater than or equal to the ratio threshold.
14. The SMS merging processing method as described in claim 13, wherein, The step of merging the sent long SMS messages according to the second skip list node includes: Based on the address information of the second skip table node, obtain all SMS messages stored in the first storage data structure; All the text messages are merged to obtain the concatenated long text message.
15. A text message merging processing device, comprising: Memory; And a processor coupled to the memory, the processor being configured to perform the video conferencing information sharing method as described in any one of claims 1 to 14 based on instructions stored in the memory.
16. A text messaging service center, comprising: The SMS merging processing device as described in claim 15.
17. A computer-readable storage medium storing computer instructions that, when executed by a processor, implement the SMS merging processing method as described in any one of claims 1 to 14.
18. A computer program product storing computer instructions that, when executed by a processor, implement the SMS merging processing method as described in any one of claims 1 to 14.