Multi-national short message group sending method and system
Through the asynchronous communication and connection pooling mechanism, a multi-level number prefix hierarchical structure is built, and the optimal transmission channel is dynamically selected, which solves the problems of low transmission success rate and high latency of the multinational SMS mass sending system, and realizes efficient multi-national SMS sending.
Patent Information
- Application Number
- CN202510821865.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2025-07-18
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing SMS mass sending system is difficult to adapt to dynamic network conditions and complex number attribute structures in cross-border sending scenarios, resulting in low transmission success rate, high latency, and lack of intelligent scheduling mechanism based on behavioral characteristics.
The asynchronous communication mechanism and the connection pool mechanism are used to uniformly manage multiple access protocols, build a cache structure, create a unique identifier for SMS data, establish a multi-level number prefix hierarchical structure, combine network feature data and transmission feature data for real-time evaluation, dynamically select the optimal transmission channel, and analyze the access behavior characteristics in real time.
It achieves the optimal balance between sending success rate, cost control and service quality in a multi-national channel environment, and improves the efficiency and reliability of SMS sending.
Smart Images

Figure CN120343511A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of communication mass sending. More specifically, the present invention relates to a method and system for mass sending multi-country text messages. Background Art
[0002] With the rapid development of international communication services, the efficient and stable sending of multi-country text messages has become a key technical support in scenarios such as cross-border e-commerce, international finance, and remote identity verification. However, due to differences in national communication infrastructure, heterogeneous number resources, inconsistent network transmission quality, and lack of unified access protocol standards, existing text message mass sending systems face a series of challenges in processing multi-source heterogeneous requests, high-concurrency access, number attribution resolution, and optimal path selection.
[0003] The existing technology has the following deficiencies: Currently, text message mass sending usually adopts a fixed channel and a single-layer number matching rule, which is difficult to adapt to the dynamic network conditions and complex number attribution structures in large-scale cross-border sending scenarios. At the same time, it lacks an intelligent scheduling mechanism based on behavioral characteristics. In the case of unstable channel status, frequent connection failures, or abnormal traffic access, it is unable to adjust the sending strategy in a timely manner, resulting in low text message sending success rate and high latency. Therefore, a method and system for mass sending multi-country text messages are proposed.
[0004] The above information disclosed in the background art section is only used to enhance the understanding of the background of the present disclosure. Therefore, it may include information that does not constitute the prior art known to those of ordinary skill in the art. Summary of the Invention
[0005] In order to overcome the above-mentioned defects of the prior art, embodiments of the present invention provide a method and system for mass sending multi-country text messages, which solve the problems raised in the above background art by applying an asynchronous communication mechanism, a protocol unified access module, a standardized data structure construction, a multi-level number parsing algorithm, a real-time channel evaluation model, and an access behavior feature monitoring mechanism.
[0006] To achieve the above object, the present invention provides the following technical solution. A method for mass sending multi-country text messages includes the following steps: Step S1: After receiving the text message data, according to the type of access protocol, uniformly manage the access requests through an asynchronous communication and connection pool mechanism, construct a cache structure, create a unique identifier and a queue for the text message data, and perform an enqueue mark. Step S2: Establish a multi-level number prefix hierarchical structure, configure a retrieval table in each level, substitute each number in the preset number library into a matching algorithm, obtain a parsing result, and embed a place of origin label. Step S3: According to the parsing result, call the network feature data and transmission feature data corresponding to the numbers, substitute them into the real-time evaluation algorithm, sort the priority of the alternative paths, and select the current optimal transmission channel; Step S4: Analyze based on the distance difference between the coordinates of the transmission base station and the center coordinates of the home location of each number and the predicted transmission time of the current optimal transmission channel, determine the priority transmission rights of each number, and continuously analyze the access behavior characteristics to determine the replacement alternative paths and change the priority transmission rights of each number.
[0007] In a preferred embodiment, step S1 includes: S1.1: After receiving the short message data, first rely on the multi-protocol access module as the entry channel, and the short message data is the short message data to be sent; The multi-protocol access module supports multiple protocol access types such as HTTP / HTTPS and TCP; The multi-protocol access module operates in cooperation with the asynchronous communication mechanism and the connection pool mechanism to achieve unified management of heterogeneous access protocols.
[0008] In a preferred embodiment, step S1 includes: S1.2: In the unified management process, use request parsing and standardization. After the requests of various protocols are accessed through the asynchronous mechanism, parse the request data and convert it into a unified format; At the task enqueue identifier, assign a unique identifier to the parsed short message task, introduce a cache component that supports high-concurrency reading and writing, use the unique identifier as the cache key, construct a key-value pair mapping structure, and synchronously establish an enqueue mark.
[0009] In a preferred embodiment, step S2 includes: S2.1: By constructing a hierarchical prefix index rule, obtain the hierarchical structure of the number prefix, and set the following rules: establish the first-level national index node according to the ITU standard; after extracting the country code segment, continue to parse the numbers as the second-level operator-level index node; query the area code carried in the number structure as the third-level administrative region-level index node; Through the gradual extraction and construction of the hierarchical prefix index rule, obtain a multi-level hierarchical prefix structure model.
[0010] In a preferred embodiment, step S2 includes: S2.2: Embed a retrieval table in each layer of the prefix index to store the home location information corresponding to the prefix; Collect data for each number in the preset number library to obtain the matching prefix length and the total number length; Starting from the first digit of the number, compare each level of nodes in the hierarchical prefix index structure in sequence. For each successful match of a prefix field, accumulate the corresponding prefix length. When it is no longer possible to match the next level of the prefix structure downward, record the currently accumulated match length to obtain the matched prefix length. For the pure digital string obtained by removing non-numeric characters from the received number field, count the total number of characters in the pure digital string to obtain the total number length of the number. After performing standardization processing on the matched prefix length and the total number length, substitute them into the number matching confidence score function to obtain the number matching value. The specific calculation formula is as follows: ; In the formula, is the number matching value, is the matched prefix length, is the total number length, is the regional confidence factor, is the operator matching adjustment value.
[0011] In a preferred embodiment, step S2 includes: S2.3: For each number, traverse the number matching values under all matchable hierarchical prefix index rules, and filter out the one with the largest value, which is recorded as the maximum number matching value corresponding to each number. Compare the maximum number matching value corresponding to each number with a preset matching threshold. If the maximum number matching value corresponding to the number is greater than or equal to the matching threshold, then determine that the location of the number belongs to the administrative region operator combination corresponding to the maximum number matching value. Use the numbers greater than or equal to the matching threshold as the parsing results and embed the corresponding location tags.
[0012] In a preferred embodiment, step S3 includes: S3.1: According to the parsing results, call the network feature data and transmission feature data corresponding to the number. The network feature data includes the network load change rate, and the transmission feature data includes the available occupancy ratio of the transmission channel and the average response delay of the channel transmission. The transmission channel is the channel corresponding to the operator available for the current SMS sending. By calculating the difference between the total network traffic in the current period and the total network traffic in the previous period and then calculating the ratio with the total network traffic in the previous period, the network load change rate is obtained. According to the operator-allocated channel pool, obtain the number of currently available transmission channels and calculate the ratio with the total number of channels configured by the location operator to obtain the available occupancy ratio of the transmission channel. Under the network environment of the home operator, the response time difference between sending and receiving text messages within the network traffic cycle is statistically calculated, and an average operation is performed to obtain the average response delay of the channel transmission. S3.2: Standardize the network load change rate, the available proportion of the transmission channel, and the average response delay of the channel transmission, and substitute them into the weighted model for calculation to obtain the optional path sorting score. Specifically, the calculation formula of the weighted model is expressed as; ; In the formula, is the optional path sorting score, is the network load change rate, is the available proportion of the transmission channel, is the average response delay of the channel transmission, , and are the weights corresponding to the network load change rate, the available proportion of the channel, and the response delay respectively; S3.3: Statistically calculate all the optional path sorting scores, sort them from largest to smallest in sequence, and use the transmission channel corresponding to the maximum value of the optional path sorting score as the optimal transmission channel for transmission.
[0013] In a preferred embodiment, step S4 includes: S4.1: According to the optimal channel mapping table provided by the operator channel scheduling system, obtain the coordinate information of the transmission base station bound to the currently selected channel, calculate the distance between the transmission base station coordinate and each number's home location through the Euclidean distance formula, and obtain the distance difference between the transmission base station coordinate and the center coordinate of each number's home location; Summarize the actual transmission delay data of the past preset number of text message tasks of the current optimal transmission channel, the actual response time from text message sending to receipt confirmation, and perform time prediction according to weighted regression to obtain the predicted transmission time of the current optimal transmission channel; S4.2: Standardize the distance difference between the transmission base station coordinate and the center coordinate of each number's home location and the predicted transmission time of the current optimal transmission channel, and substitute them into the logistic regression formula for calculation to obtain the number priority sending score; Statistically calculate the number priority sending scores, sort them from largest to smallest in sequence, and send the text messages of the corresponding numbers one by one according to the sorting order; Continuously analyze the access behavior characteristics for real-time supervision of the sending status, and replace the optimal channel and the number sending order in sequence according to the sending status.
[0014] In a preferred embodiment, step S4 includes: S4.3: The access behavior characteristics include the frequent failure connection rate and the abnormal traffic access frequency; Within a set period, based on the target number, calculate the ratio of the number of failed transmissions to the number of transmission attempts to obtain the frequent failure connection rate; Based on the SMS service scheduling log and the traffic pattern model, if the deviation between the current access frequency and the historical average is greater than the set threshold, and there are fluctuations inconsistent with historical behavior, it is recorded as abnormal traffic, and the current access frequency is recorded as the abnormal traffic access frequency; If the frequent failure connection rate is greater than the preset failure threshold, it means the frequent failure connection rate is too high. Then the current channel enters the offline state, and the channel is marked as offline to block subsequent number routing into this channel; If the abnormal traffic access frequency is greater than the preset abnormal threshold, there is an abnormal traffic access behavior, triggering the sequence replacement process; The sequence replacement process re-evaluates the sending priority score of the current number, replaces the number to which the SMS is to be sent in sequence, and at the same time corrects the sending priority scores of the remaining numbers.
[0015] A mass sending system for multi-country SMS includes a docking module, a retrieval module, a matching and sending module, and a replacement mechanism module, with signal connections between the modules; The docking module is used to, after receiving the SMS data, according to the access protocol type, uniformly manage the access requests through asynchronous communication and the connection pool mechanism, construct a cache structure, create a unique identifier and a queue for the SMS data and perform enqueue marking; The retrieval module is used to establish a multi-level hierarchical structure of number prefixes, configure retrieval tables at each level, substitute each number in the preset number library into the matching algorithm, obtain the parsing result and embed the location tag; The matching and sending module is used to, based on the parsing result, call the network characteristic data and transmission characteristic data of the corresponding number, substitute them into the real-time evaluation algorithm, rank the optional paths by priority, and select the current optimal transmission channel; The replacement mechanism module is used to analyze based on the distance difference between the transmission base station coordinates and the central coordinates of the location of each number and the predicted transmission time of the current optimal transmission channel, determine the priority of sending each number, and continuously analyze the access behavior characteristics to determine the replacement alternative path and change the priority of sending each number.
[0016] The technical effects and advantages of the present invention: The present invention realizes the unified management of requests for various access protocols (such as HTTP, TCP, etc.) based on asynchronous communication and connection pool mechanisms, constructs a cache structure, creates a unique identifier and enqueue mark for each SMS data, and realizes the rapid parsing and label embedding of the number's place of origin by establishing a multi-level hierarchical structure of number prefixes and a high-speed retrieval table, combined with a preset matching algorithm. Based on the parsed results, the network and transmission characteristic data of the target number are obtained, a real-time evaluation model is constructed, the priority of the optional paths is sorted, the optimal transmission channel is dynamically selected, and the transmission delay of each number is predicted and the priority of sending is given in combination with the geographical differences between the transmission base station and the place of origin and the channel status. At the same time, the access behavior characteristics are analyzed in real time to realize the replacement of the channel order and the adjustment of the sending priority, so as to achieve the optimal balance solution among the sending success rate, cost control and service quality in a multi-country channel environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 FIG. is a flowchart for implementing a method for mass sending of multi-country SMS of the present invention.
[0018] Figure 2 FIG. is a flowchart of a method for a multi-country SMS mass sending system of the present invention.
[0019] Figure 3 FIG. is a schematic structural diagram of a multi-country SMS mass sending system of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0020] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0021] Embodiment 1 Please refer to Figures 1 to 2 , a method for mass sending of multi-country SMS, and the specific operation process is as follows: Step S1: After receiving the SMS data, according to the type of access protocol, the access requests are uniformly managed through asynchronous communication and connection pool mechanisms, a cache structure is constructed, and a unique identifier and a queue are created for the SMS data and enqueue marks are made.
[0022] Step S2: Establish a multi-level hierarchical structure of number prefixes, configure a retrieval table in each level, substitute each number in the preset number library into the matching algorithm, and obtain the parsing result and embed the place of origin label.
[0023] Step S3: According to the parsing result, call the network feature data and transmission feature data corresponding to the number, substitute them into the real-time evaluation algorithm, sort the priority of the optional paths, and select the current optimal transmission channel.
[0024] Step S4: Analyze based on the distance difference between the coordinates of the transmission base station and the central coordinates of the number's home location and the predicted transmission time of the current optimal transmission channel, determine the priority of each number for sending, and continuously analyze the access behavior characteristics to determine the replacement alternative paths and change the priority of each number for sending.
[0025] In step S1: S1.1: After receiving the short message data, first rely on the multi-protocol access module as the entry channel to support the access of heterogeneous data from multi-source upstream systems (such as short message platforms, business middle platforms, third-party service interfaces, etc.).
[0026] Among them, the short message data is the short message data to be sent.
[0027] When relying on the multi-protocol access module, the following access protocols are supported to ensure that the short message sending requests can flow smoothly from different systems.
[0028] Among them, the application scenario where the protocol type is HTTP / HTTPS is applicable to Web services and REST API calls, and its receiving method is to use an asynchronous Web listener to receive short message data in JSON format.
[0029] The application scenario including the protocol type is the long connection protocol, which is used for high-reliability platforms, and its receiving method is to establish a persistent connection channel and use non-blocking reading and writing.
[0030] According to the above content, this module supports multiple protocols such as HTTP and TCP, automatically parses and standardizes the input data structure, and constructs a short-term cache structure with high throughput characteristics.
[0031] During the caching process, a unique identifier is assigned to each short message task, and an enqueue mark and a queue index table are established to ensure the orderliness and efficiency of data enqueueing.
[0032] S1.2: In order to uniformly manage requests from different access protocols (such as HTTP, TCP, etc.), usually two technical means of asynchronous communication and connection pool are used to work together, and the specific implementation is as follows: In the asynchronous communication mechanism, use the event-driven architecture to adopt the event-driven model, and monitor various network ports through non-blocking I / O (such as frameworks like JavaNIO, Netty, aiohttp, etc.).
[0033] When the request arrives, the event loop immediately captures it and encapsulates it as an event task and adds it to the pending queue.
[0034] Among them, non-blocking I / O is a mechanism in which a thread does not block and wait for data to return after initiating an I / O request. Instead, it immediately obtains the processing status and continues to execute other tasks, avoiding the waiting time of traditional synchronous blocking calls.
[0035] It should be noted that the event-driven model is a high-performance asynchronous execution method based on an event-triggering mechanism, often implemented through the Reactor or Proactor design patterns, which will not be elaborated here.
[0036] Multi-threaded scheduling efficiently schedules tasks through a thread pool (or coroutines) to ensure that even in high-concurrency scenarios, the system can respond to a large number of requests simultaneously without response delays caused by a single thread being blocked.
[0037] In the connection pool mechanism, connection reuse is utilized. For long-term connections of each protocol type (such as TCP long connections), the system pre-establishes a certain number of connections and uniformly stores them in the connection pool.
[0038] It should be noted that the connection pool is a resource pool management strategy that pre-initializes multiple reusable network connection instances to avoid the system overhead caused by repeatedly creating connections. In this system, each protocol corresponds to a connection pool, and is equipped with parameters such as the maximum number of connections and the connection idle recovery time. The connection pool capacity is dynamically adjusted through configuration to achieve adaptive load control, which will not be elaborated here.
[0039] Each time a new request arrives, an idle connection is quickly allocated from the connection pool. After data transmission and reception are completed, the connection is returned to the connection pool, avoiding the performance loss caused by frequently creating and destroying connections.
[0040] For resource isolation and load balancing, independent connection pools are established according to different access protocols for appropriate resource isolation.
[0041] At the same time, the resource allocation within each connection pool (such as configuration parameters like the maximum number of connections and idle time) can be dynamically adjusted according to real-time traffic to achieve load balancing and ensure that requests of different protocols do not interfere with each other.
[0042] In the unified management process, request parsing and standardization are utilized. When requests of various protocols are accessed through an asynchronous mechanism, the system parses the request data and converts it into a unified format (such as a short message task with a unified data structure) for subsequent processing.
[0043] For the task enqueue identification, a unique identifier is assigned to the parsed short message task, and the tasks are organized into a pending queue according to information such as priority and timestamp to achieve efficient and orderly subsequent distribution and processing.
[0044] Through the above measures, it is possible to quickly capture and process a large number of concurrent requests using an asynchronous communication architecture, and to achieve efficient connection reuse through a connection pool.
[0045] This ensures that access requests for each protocol are uniformly and efficiently managed in a high-concurrency scenario, thereby providing a stable data input basis for subsequent high-speed data preprocessing, number parsing, and channel selection.
[0046] To handle a large amount of high-speed incoming SMS data, the system needs to introduce a cache component that supports high-concurrency reading and writing (such as Redis, Memcached, or an in-memory LRU cache pool) to achieve data access and intermediate state caching within a short period. The core process is as follows: Establish a cache data structure based on key-value pairs: Each SMS data is encapsulated as a cache object MessageObject, including the original content, access source, timestamp, and access protocol type.
[0047] Use a unique identifier as the cache key, construct a key-value pair mapping structure, and synchronously establish an enqueue mark.
[0048] It should be noted that the above unique identifier can be generated by weighted combination of fields such as SMS content, access timestamp, and source address using a hash function (such as SHA-256, MD5) to ensure the uniqueness and anti-collision ability of the identifier within the same access period. Details are not elaborated here.
[0049] In step S2, the receiving number field in the received SMS task is structurally parsed to extract the corresponding prefix field information.
[0050] S2.1: Obtain the hierarchical prefix structure of the number by constructing a hierarchical prefix index rule.
[0051] Among them, the hierarchical prefix index rule refers to a strategy of splitting step by step according to the hierarchical characteristics in the number structure and establishing corresponding index mapping relationships, including but not limited to the following rules.
[0052] The first layer: According to the ITU standard, extract the first 0 to 3 digits in the mobile phone number prefix as the country or region code segment (such as +86 for China, +1 for the United States, +81 for Japan), and establish the first-layer national-level index node.
[0053] The second layer: After extracting the country code segment, continue to parse the next 3 to 4 digits as the operator segment or access number segment to identify different communication operators, such as China Mobile (CMCC), China Unicom (CUCC), China Telecom (CTCC), etc., to form the second-layer operator-level index node.
[0054] The third layer: If the number structure carries a regional code (such as provincial and prefecture-level codes in the first three to five digits), then this field is used as the third-level administrative region index node; at the same time, for virtual operators, Internet of Things dedicated number segments (starting with 170, 171, 140, etc.), exclusive index nodes are constructed.
[0055] Optionally, a fourth layer is constructed as a custom layer, which can be set by those skilled in the art according to the actual application scenario. Specifically, an optional fourth-layer custom index can be introduced according to business needs, such as for identifying enterprise sub-accounts, temporary scenario numbers, routing domain number segments, etc., to support in-depth parsing requirements.
[0056] Through the gradual extraction and construction of the above hierarchical rules, a multi-level hierarchical prefix structure model is obtained. Among them, a corresponding home location information structure (such as region, operator, network type, etc.) is mounted under each node to support fast matching and label writing.
[0057] It should be noted that the prefix index structure can be implemented by a prefix tree (Prefix Tree, Trie structure), a multi-level hash map (Multi-level HashMap), a B+ tree, or a compressed map (such as a Radix Tree), which has advantages such as high query efficiency and strong structure compression ability. The specific implementation method is not limited to the above methods and will not be elaborated here.
[0058] Furthermore, S2.2: Embed a retrieval table in each layer of the prefix index for storing the home location information corresponding to the prefix, including country / region, province / administrative region, and network type.
[0059] It should be noted that the retrieval table includes, for example, a HashMap, a B-tree index, or a Redis-based Key-Region structure, etc., which will not be elaborated here.
[0060] Data collection is performed on each number in the preset number library to obtain the matching prefix length and the total number length.
[0061] The matching prefix length refers to the cumulative length of the prefix fields that are successfully matched with the nodes at all levels in the hierarchical prefix index structure during the process of gradually parsing the received number field. Its acquisition logic is to start from the first digit of the number and compare it with the nodes at all levels in the hierarchical prefix index structure in turn. For each successfully matched prefix field at one layer, the corresponding prefix length of that layer is accumulated. When it is no longer possible to match the next layer of the prefix structure downward, the current cumulative matching length is recorded to obtain the matching prefix length.
[0062] Among them, the hierarchical prefix index structure is obtained according to the rules for constructing the hierarchical prefix index, which has been described above and will not be elaborated here.
[0063] The total length of a number refers to the length of complete numeric characters contained in the number field. It is an auxiliary indicator for determining the depth and accuracy of prefix coverage. Its acquisition logic is to remove non-numeric characters from the received number field and count the total number of characters in the pure numeric string to obtain the total length of the number.
[0064] After the matching prefix length and the total number length are standardized, they are substituted into the number matching confidence scoring function to obtain the number matching value.
[0065] The specific calculation formula is as follows: ; In the formula, is the number matching value, To match the prefix length, is the total length of the number, is the regional confidence factor, Adjust the value for carrier matching.
[0066] It should be noted that the standardization processing methods include but are not limited to standard linear transformation based on interval scaling, Z-Score standardization method based on statistics, or normalization method based on nonlinear mapping function. The application methods of standardization processing are not described in detail here.
[0067] It should be noted that the setting of the regional confidence factor is based on the ratio of the number of levels that pass the hierarchical prefix index rule to the standard number segment of the corresponding country / administrative region level. The higher the ratio, the higher the regional confidence factor. The operator matching adjustment value is set based on the ratio of the operator's standard number segment corresponding to the hierarchical prefix index rule. The higher the ratio, the higher the operator matching adjustment value.
[0068] Specifically, S2.3: for each number, traverse its number matching values under all matching hierarchical prefix index rules, select the one with the largest value, and record it as the maximum number matching value corresponding to each number.
[0069] The maximum number matching value corresponding to each number is compared with the preset matching threshold. If the maximum number matching value corresponding to the number is greater than or equal to the matching threshold, the number is determined to be the administrative district operator combination corresponding to the corresponding maximum number matching value. If the maximum number matching value corresponding to the number is less than the matching threshold, it is determined that the current number cannot be stably attributed to a trusted prefix.
[0070] Among them, the matching threshold is the optimal parameter value obtained by the experimenters through multiple rounds of simulation experiments based on the statistical results of historical number location labeling sample data and the balance principle between location determination accuracy and coverage. It will not be elaborated here.
[0071] For the current number that cannot be stably assigned to a trusted prefix, a confidence dynamic evaluation mechanism and a strategic abnormal number segment identification rule method are used to give a prompt or generate an alarm signal, which will not be elaborated here.
[0072] Use the number greater than or equal to the matching threshold as the parsing result and embed the corresponding location label.
[0073] Among them, embedding the corresponding location label means that after the number location parsing is completed, the determined administrative region operator combination information is written into the data record corresponding to the target number in the form of a structured label for subsequent data flow, policy matching, or behavior determination. The specific label expression form is not limited and will not be elaborated here.
[0074] In step S3: S3.1: According to the parsing result, call the network feature data and transmission feature data of the corresponding number.
[0075] Among them, the network feature data includes the network load change rate, and the transmission feature data includes the available proportion of the transmission channel and the average response delay of the channel transmission.
[0076] Furthermore, the transmission channel is the channel corresponding to the operator available for the current SMS sending.
[0077] The acquisition logic of the network load change rate is to calculate the ratio of the difference between the total network traffic in the current period and the total network traffic in the previous period to the total network traffic in the previous period to obtain the network load change rate.
[0078] Among them, the setting of the network traffic period is obtained by the experimenter according to the load monitoring characteristics of the actual network business peak period and the typical operator SMS service scheduling granularity requirements. The time length of the period is not limited here and will not be elaborated here.
[0079] The acquisition logic of the available proportion of the transmission channel is to calculate the ratio of the number of currently available transmission channels obtained from the operator-allocated channel pool to the total number of channels configured by the location operator to obtain the available proportion of the transmission channel.
[0080] Among them, the operator-allocated channel pool is the set of communication channel resources allocated and scheduled by the location operator in its communication resource scheduling system for SMS services; this channel pool is dynamically configured by the operator according to different regions, different service types, and user access levels, including main channels, standby channels, and special-purpose channels, which will not be elaborated here.
[0081] The acquisition logic of the average response delay of the channel transmission is to count the response time difference between SMS sending and receiving within the network traffic period under the network environment of the location operator and perform an average operation to obtain the average response delay of the channel transmission.
[0082] Among them, the network traffic cycle has been described above and will not be elaborated here. The response time difference between SMS sending and receiving is the total time experienced during the execution of the SMS task, from the successful sending of the instruction at the initiating end (i.e., the sending timestamp recording is completed) to the receipt of the successful receipt returned by the operator at the receiving end (i.e., the receiving timestamp is collected), which reflects the communication delay consumed by the SMS in the transmission link. This time difference is usually recorded in milliseconds (ms) and is used as the response performance index of a single SMS task on the channel, which will not be elaborated here.
[0083] S3.2: Standardize the network load change rate, the available proportion of the transmission channel, and the average response delay of the channel transmission, and substitute them into the weighted model for calculation to obtain the sorting score of the alternative paths.
[0084] Among them, the standardization process has been described above and will not be elaborated here.
[0085] Specifically, the calculation formula of the weighted model is expressed as: ; In the formula, is the sorting score of the alternative paths, is the network load change rate, is the available proportion of the transmission channel, is the average response delay of the channel transmission, , and are the weights corresponding to the network load change rate, the available proportion of the channel, and the response delay respectively, which are dynamically adjusted according to the actual network environment and service requirements.
[0086] As can be seen from the above, when the network load change rate and the average response delay of the channel transmission are smaller, the priority of the corresponding alternative path is higher, and the path can be used for sending. On the contrary, when the available proportion of the transmission channel is smaller, the priority of the corresponding alternative path is lower, and the path cannot be used for sending.
[0087] S3.3: Statistically analyze all the sorting scores of the alternative paths, sort them from largest to smallest, and use the transmission channel corresponding to the maximum sorting score of the alternative paths as the optimal transmission channel for transmission.
[0088] In step S4, analyze the priority sending rights of each number to determine the number to be sent first on the optimal transmission channel.
[0089] S4.1: The logic for obtaining the distance difference between the transmission base station coordinates and the central coordinates of each number's home location is based on the optimal channel mapping table provided by the operator channel scheduling system. Obtain the transmission base station coordinate information bound to the currently selected channel, calculate the distance between the transmission base station coordinates and each number's home location through the Euclidean distance formula, and obtain the distance difference between the transmission base station coordinates and the central coordinates of each number's home location.
[0090] It should be noted that the optimal channel mapping table provided by the operator channel scheduling system is the optimal channel mapping table provided by the operator channel scheduling system, which refers to a type of dynamic channel allocation preference result form generated by the home location operator in its communication resource management and dynamic scheduling platform after comprehensive evaluation based on multi-dimensional indicators such as the current network load status, channel health status, historical success rate, average response time, and geographical area matching degree. Details are not elaborated here.
[0091] The logic for obtaining the predicted transmission time of the current optimal transmission channel is to summarize the actual transmission delay data of the past preset number of SMS tasks on the current optimal transmission channel, the actual response time from SMS sending to receipt confirmation, and perform time prediction based on weighted regression to obtain the predicted transmission time of the current optimal transmission channel.
[0092] It should be noted that the "weighted regression prediction" method used in the logic for obtaining the predicted transmission time of the current optimal transmission channel has the advantage of integrating real-time dynamics and historical performance. The key lies in assigning different weights to the historical SMS transmission data of different time windows to improve the sensitivity and stability of the prediction. Details are not elaborated here.
[0093] S4.2: Standardize the distance difference between the transmission base station coordinates and the central coordinates of each number's home location and the predicted transmission time of the current optimal transmission channel, and substitute them into the logistic regression formula to calculate the number's priority sending score. The specific formula is as follows: ; In the formula, L is the result of the logistic regression calculation, that is, the number's priority sending score, e is the natural base, y is the linear combination term of the logistic regression model, and specifically y is set as: ; In the formula, is the bias term, is the distance difference between the transmission base station coordinates and the central coordinates of each number's home location, is the predicted transmission time of the current optimal transmission channel, and are the regression coefficients of the distance difference between the transmission base station coordinates and the central coordinates of each number's home location and the predicted transmission time of the current optimal transmission channel, respectively.
[0094] Among them, the standardization process has been described above and will not be elaborated here.
[0095] Specifically, the greater the difference between the coordinates of the transmission base station and the central coordinates of each number's home location, and the longer the predicted transmission time of the current optimal transmission channel, the longer the time required for the current number transmission process, the greater the transmission risk, and the more it is necessary to transmit in advance to ensure that the time for the short message to be transmitted to the user side is consistent.
[0096] Statistically analyze the priority sending scores of the numbers, sort them from large to small in sequence, and send the corresponding number short messages one by one according to the sorting order.
[0097] Continuously analyzing the access behavior characteristics is used to monitor the sending status in real time, and the optimal channel and the number sending order will be replaced in sequence according to the sending status.
[0098] S4.3: The access behavior characteristics include the frequent failure connection rate and the abnormal traffic access frequency.
[0099] The acquisition logic of the frequent failure connection rate is to calculate the ratio of the number of sending failures to the number of sending attempts for the target number within a set period to obtain the frequent failure connection rate.
[0100] The acquisition logic of the abnormal traffic access frequency is based on the short message service scheduling log and the traffic pattern model. If the deviation between the current access frequency and the historical average value is greater than the set threshold and there are fluctuation characteristics inconsistent with the historical behavior, it is recorded as abnormal traffic, and the current access frequency is recorded as the abnormal traffic access frequency.
[0101] If the frequent failure connection rate is greater than the preset failure threshold, that is, the frequent failure connection rate is too high, the current channel enters the offline state, then mark this channel as offline and block the subsequent number routing from entering this channel.
[0102] Furthermore, the channel marked as offline can be further determined whether it can resume the available state and eliminate the "offline" mark according to dynamic indicators such as the connection success rate recovery condition and the historical health score trend.
[0103] Among them, the connection success rate recovery condition refers to that the connection success rate of this channel is continuously higher than the reconnection threshold within a set time window, and the historical health score trend refers to the change trend of the comprehensive score of multiple factors such as the historical connection stability, load balancing coefficient, and error return code frequency on the channel side, which will not be limited here.
[0104] Specifically, the evaluation time interval of the connection success rate and the score trend window parameters are set by the experimental team of the present invention based on long-term system training experiments, simulation scheduling verification, and actual operation feedback, and will not be elaborated here.
[0105] Among them, both the failure threshold and the anomaly threshold are set by the experimenter based on the combination of system experiment training, scheduling simulation, and actual operation experience, which will not be elaborated here.
[0106] If the access frequency of abnormal traffic is greater than the preset anomaly threshold, there is an abnormal traffic access behavior, triggering the sequential replacement process.
[0107] The sequential replacement process re-evaluates the sending priority score of the current number, sequentially replaces the number to which the SMS is to be sent, and at the same time corrects the sending priority scores of the remaining numbers.
[0108] In the actual application of mass SMS sending in multiple countries, due to the differences in the service quality and billing standards of SMS gateway operators in each country / region, especially in market environments where telecommunications resources are scattered such as the United States, there are inconsistencies in aspects such as sending success rate, latency, content restrictions, and price costs for different SMS channels.
[0109] Therefore, how to accurately schedule the usage of different lines according to the configured ratio while ensuring high-concurrency sending efficiency has become the key to affecting system performance and cost control.
[0110] Taking the example of sending mass SMS in the United States, assume that the system needs to send SMS to 100 receiving numbers within 1 second, and an asynchronous submission method is used to submit an SMS task every 10 milliseconds. The system has 10 available SMS channels, namely Channel A to Channel J, and the quality and price of each channel are different. To achieve a balance between cost control and sending success rate, the system administrator presets the following ratio configuration strategy: Channel A (high quality and high price) is allocated 30% of the tasks, that is, 30 are sent; Channel B (medium quality and low price) is allocated 15% of the tasks, that is, 15 are sent; A total of 8 channels from Channel C to J jointly bear the remaining 55% of the tasks, that is, 55 SMS, and are evenly distributed to approximately 6.875 SMS per channel (rounded to control the error within ±1).
[0111] However, considering that the system uses an asynchronous single-message submission mechanism and a task distribution needs to be completed every 10 milliseconds, if the allocation ratio is re-statistically calculated and available channels are judged before each sending, it will lead to an increase in latency and affect the throughput efficiency.
[0112] Therefore, a random variable alias sampling algorithm is introduced. Before sending, a fast sampling structure is established according to the configured channel weight table, and a line sampling is completed with an O(1) time complexity when submitting each task, so as to determine which channel the current SMS should be routed to, ensuring that the overall channel usage ratio conforms to the set value.
[0113] Embodiment 2 Please refer toFigure 3 , Figure 3 It is a schematic structural diagram of a group messaging system for multinational text messages, including a docking module, a retrieval module, a proportioning and sending module, and a replacement mechanism module.
[0114] After receiving the text message data, the docking module uniformly manages the access requests through asynchronous communication with the connection pool mechanism according to the access protocol type, constructs a cache structure, creates a unique identifier and a queue for the text message data, and performs an enqueue mark.
[0115] The retrieval module is used to establish a multi-level hierarchical structure of number prefixes, configure a retrieval table at each level, substitute each number in the preset number library into a matching algorithm, obtain an analysis result, and embed a location tag.
[0116] The proportioning and sending module is used to call the network characteristic data and transmission characteristic data of the corresponding number according to the analysis result, substitute them into a real-time evaluation algorithm, rank the priority of the optional paths, and select the current optimal transmission channel.
[0117] The replacement mechanism module is used to analyze based on the distance difference between the transmission base station coordinates and the central coordinates of the location of each number and the predicted transmission time of the current optimal transmission channel, determine the priority of sending each number, and continuously analyze the access behavior characteristics to determine the replacement alternative path and change the priority of sending each number.
[0118] The above formulas are all dimensionless and take their numerical calculations. The formulas are obtained by collecting a large amount of data for software simulation to get a formula closest to the real situation. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.
[0119] The above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from a website, computer, server, or data center to another website, computer, server, or data center in a wired or wireless (such as infrared, wireless, microwave, etc.) manner. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more collections of available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, or magnetic tape), an optical medium (such as a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state drive.
[0120] It should be understood that the term "and / or" in this document is merely a description of the association relationship between associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. Here, A and B can be singular or plural. In addition, the character " / " in this document generally represents an "or" relationship between the associated objects before and after, but it may also represent an "and / or" relationship, which can be specifically understood by referring to the context.
[0121] In the present application, "at least one" means one or more, and "a plurality" means two or more. "At least one of the following" or a similar expression means any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, a - b, a - c, b - c, or a - b - c, where a, b, and c can be single or multiple.
[0122] It should be understood that in various embodiments of the present application, the magnitudes of the sequence numbers of the above processes do not mean the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
[0123] Those of ordinary skill in the art will realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented in electronic hardware, or in a combination of computer software and electronic hardware. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. A professional technician can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0124] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein.
[0125] In several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the devices or units can be in electrical, mechanical, or other forms.
[0126] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0127] In addition, the functional units in each embodiment of this application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.
[0128] When the above-mentioned functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The foregoing storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs.
[0129] The above is only the specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art within the technical scope disclosed by this application can easily think of changes or substitutions, which should all be covered within the protection scope of this application.
Claims
1. A method for mass sending of multi-country text messages, characterized in that: It includes the following steps: Step S1: After receiving the SMS data, according to the access protocol type, uniformly manage the access requests through asynchronous communication and connection pool mechanism, construct a cache structure, create a unique identifier and queue for the SMS data and mark it for enqueueing; Step S2: Establish a multi-level number prefix hierarchical structure, configure a retrieval table in each level, substitute each number in the preset number library into the matching algorithm, obtain the parsing result and embed the location tag; Step S3: According to the parsing result, call the network feature data and transmission feature data of the corresponding number, substitute them into the real-time evaluation algorithm, sort the priority of the optional paths, and select the current optimal transmission channel; Step S4: Analyze based on the distance difference between the transmission base station coordinates and the central coordinates of each number's location and the predicted transmission time of the current optimal transmission channel to determine the priority of each number for sending, and continuously analyze the access behavior characteristics to determine the replacement alternative path and change the priority of each number for sending.
2. A method for mass sending multi-country SMS according to claim 1, characterized in that: Step S1 includes: S1.1: After receiving the SMS data, rely on the multi-protocol access module as the entry channel, and the SMS data is the SMS data to be sent; The multi-protocol access module supports multiple protocol access types such as HTTP / HTTPS and TCP; The multi-protocol access module operates in cooperation with the asynchronous communication mechanism and the connection pool mechanism to achieve unified management of heterogeneous access protocols.
3. A method for mass sending multi-country SMS according to claim 2, characterized in that: Step S1 includes: S1.2: In the unified management process, use request parsing and standardization. When requests of various protocols are accessed through the asynchronous mechanism, parse the request data and convert it into a unified format; At the task enqueue mark, assign a unique identifier to the parsed SMS task, introduce a cache component that supports high-concurrency reading and writing, use the unique identifier as the cache key, construct a key-value pair mapping structure, and synchronously establish an enqueue mark.
4. A method for mass sending multi-country SMS according to claim 1, characterized in that: Step S2 includes: S2.1: Obtain the number prefix hierarchical structure by constructing a hierarchical prefix indexing rule, and set the following rules: establish the first-level national indexing node according to the ITU standard; after extracting the country code segment, continue to parse the numbers as the second-level operator-level indexing node; query the area code carried in the number structure as the third-level administrative region-level indexing node; Through the gradual extraction and construction of the hierarchical prefix indexing rule, obtain a multi-level hierarchical prefix structure model.
5. A method for mass sending multi-country SMS according to claim 4, characterized in that: Step S2 includes: S2.2: Embed a retrieval table in each layer of prefix index for storing the location information corresponding to the prefix; Collect data for each number in the preset number library to obtain the matching prefix length and the total number length; Starting from the first digit of the number, compare each level of nodes in the hierarchical prefix index structure in sequence. For each successful match of a prefix field at one level, accumulate the corresponding prefix length. When it is not possible to continue matching the next level of the prefix structure downward, record the currently accumulated matching length to obtain the matching prefix length. For the pure digital string obtained by removing non-numeric characters from the received number field, count the total number of characters in the pure digital string to obtain the total number of digits of the number. After standardizing the matching prefix length and the total number of digits of the number, substitute them into the number matching confidence scoring function to obtain the number matching value. The specific calculation formula is as follows: ; Wherein, is the number matching value, is the matching prefix length, is the total length of the number, is the regional confidence factor, is the operator matching adjustment value.
6. A method for mass sending of multinational text messages according to claim 5, characterized in that: Step S2 includes: S2.3: For each number, traverse the number matching values of all matchable hierarchical prefix index rules, and select the largest value among them, which is recorded as the maximum number matching value corresponding to each number. Compare the maximum number matching value corresponding to each number with a preset matching threshold. If the maximum number matching value corresponding to the number is greater than or equal to the matching threshold, determine that the region of origin of the number is the administrative region operator combination corresponding to the maximum number matching value. Use the numbers greater than or equal to the matching threshold as the parsing result and embed the corresponding region of origin label.
7. A method for mass sending of multinational text messages according to claim 6, characterized in that: Step S3 includes: S3.1: According to the parsing result, call the network characteristic data and transmission characteristic data of the corresponding number. The network characteristic data includes the network load change rate, and the transmission characteristic data includes the available proportion of the transmission channel and the average response delay of the channel transmission. The transmission channel is the channel corresponding to the operator available for the current text message sending. By calculating the difference between the total network traffic in the current period and the total network traffic in the previous period and then calculating the ratio with the total network traffic in the previous period, the network load change rate is obtained. According to the operator's assigned channel pool, calculate the ratio of the current available number of transmission channels to the total number of channels configured by the operator of the region of origin to obtain the available proportion of the transmission channel. Based on the network environment of the operator of the region of origin, count the response time difference between text message sending and receiving within the network traffic period and perform an average operation to obtain the average response delay of the channel transmission. S3.2: Standardize the network load change rate, the available proportion of the transmission channel, and the average response delay of the channel transmission, and substitute them into the weighted model for calculation to obtain the sorting score of the optional path. Specifically, the calculation formula of the weighted model is expressed as; ; In the formula, is the optional path sorting score, is the network load change rate, is the available proportion of the transmission channel, is the average response delay of the channel transmission, , and are the weights corresponding to the network load change rate, the available proportion of the channel, and the response delay, respectively; S3.3: Count all the sorting scores of the optional paths, sort them from largest to smallest in sequence, and use the transmission channel corresponding to the maximum sorting score of the optional path as the optimal transmission channel for transmission.
8. A method for mass sending of multinational text messages according to claim 7, characterized in that: Step S4 includes: S4.1: According to the optimal channel mapping table provided by the operator channel scheduling system, obtain the coordinate information of the transmission base station bound to the currently selected channel, and calculate the distance between the transmission base station coordinate and the region of origin of each number through the Euclidean distance formula to obtain the distance difference between the transmission base station coordinate and the center coordinate of the region of origin of each number. Summarize the actual transmission delay data of the preset number of SMS tasks of the current optimal transmission channel in the past, the actual response time from the SMS sending to the receipt confirmation, and perform time prediction according to weighted regression to obtain the predicted transmission time of the current optimal transmission channel; S4.2: Standardize the distance difference between the transmission base station coordinates and the central coordinates of each number's home location and the predicted transmission time of the current optimal transmission channel, and substitute them into the logistic regression formula to calculate the priority sending score of the number; Statistically analyze the priority sending scores of the numbers, sort them from largest to smallest, and send the SMS of the corresponding numbers one by one in the order of arrangement; Continuously analyze the access behavior characteristics for real-time supervision of the sending status, and replace the optimal channel and the number sending order in sequence according to the sending status.
9. A method for mass sending multi-country SMS according to claim 8, characterized in that: Step S4 includes: S4.3: The access behavior characteristics include the frequent failure connection rate and the abnormal traffic access frequency; Based on the target number within a set period, calculate the ratio of the number of sending failures to the number of sending attempts to obtain the frequent failure connection rate; Based on the SMS service scheduling log and the traffic pattern model, if the deviation between the current access frequency and the historical average value is greater than the set threshold, there is a fluctuation characteristic inconsistent with the historical behavior, which is recorded as abnormal traffic, and the current access frequency is recorded as the abnormal traffic access frequency; If the frequent failure connection rate is greater than the preset failure threshold, the frequent failure connection rate is too high, and the current channel enters the offline state, then mark this channel as offline and block the subsequent number routing into this channel; If the abnormal traffic access frequency is greater than the preset abnormal threshold, there is an abnormal traffic access behavior, triggering the sequence replacement process; The sequence replacement process re-evaluates the sending priority score of the current number, replaces the number to send the SMS in sequence, and simultaneously corrects the sending priority scores of the remaining numbers.
10. A mass sending system for multi-country text messages, which is used to implement the mass sending method for multi-country text messages described in any one of claims 1-9, and is characterized in that: It includes a docking module, a retrieval module, a matching and sending module, and a replacement mechanism module; The docking module is used to, after receiving the SMS data, according to the access protocol type, uniformly manage the access requests through asynchronous communication and the connection pool mechanism, construct a cache structure, create a unique identifier and queue for the SMS data and perform enqueue marking; The retrieval module is used to establish a multi-level hierarchical structure of number prefixes, configure a retrieval table in each level, substitute each number in the preset number library into the matching algorithm, obtain the parsing result and embed the home location label; The matching and sending module is used to, according to the parsing result, call the network characteristic data and transmission characteristic data of the corresponding number, substitute them into the real-time evaluation algorithm, sort the optional paths by priority, and select the current optimal transmission channel; The replacement mechanism module is used to analyze based on the distance difference between the transmission base station coordinates and the central coordinates of each number's home location and the predicted transmission time of the current optimal transmission channel, determine the priority sending rights of each number, and continuously analyze the access behavior characteristics to determine the replacement alternative path and change the priority sending rights of each number.