A short message routing and scheduling method and device based on multi-channel aggregation

CN122994715APending Publication Date: 2026-10-27BEIJING BAIJU YIXING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611098704.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-23
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0006]为了解决现有技术中存在的单点故障风险高、通道资源利用率低等技术问题,本发明提供了一种基于多通道聚合的短信路由调度方法及装置

Benefits of technology

第一,显著提升了系统的可用性与可靠性。通过聚合多通道并基于综合权重进行动态路由,有效消除了单点故障。当任一通道出现临时性故障时,智能故障分型与跨通道重试机制能够实现秒级的自动容灾切换,将请求无缝迁移至健康的通道,避免了业务中断。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122994715A_ABST
    Figure CN122994715A_ABST
Patent Text Reader

Abstract

The application discloses a kind of short message routing scheduling method and device based on multi-channel aggregation, belong to communication technical field, to solve the problem of high single-point failure risk and low channel utilization rate of existing single-channel scheme;The method comprises: receiving short message sending request and generating unique message identifier;Based on the static attribute and dynamic performance index of channel, the comprehensive weight is calculated;According to the comprehensive weight, the target channel is selected, and the probability of being selected by the channel with high weight is higher;When sending fails, distinguish between temporary failure and permanent failure;For temporary failure, the weight of the failed channel is dynamically reduced, and the channel is reselected from the candidate set excluding the failed channel to retry;For permanent failure, retry is terminated;The application realizes automatic disaster recovery switching of channel and dynamic allocation of traffic through dynamic routing and intelligent fault handling, significantly improves the availability, reliability and overall throughput of short message sending.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communication technology, and specifically to a method and apparatus for SMS routing and scheduling based on multi-channel aggregation. Background Technology

[0002] SMS, as a crucial communication method, plays a vital role in enterprise applications, widely used for user authentication, business notifications, and marketing promotions. To ensure high availability and delivery rates for SMS services, enterprises typically need to connect to multiple SMS service providers to diversify risk, improve concurrent processing capabilities, and dynamically select based on cost.

[0003] In existing technologies, a common approach is to use a single channel or a simple primary / backup mode. Developers integrate a specific SMS service provider's software development kit (SDK) or application programming interface (API) into their business systems, and all SMS sending requests are processed through this single channel. When the primary channel fails, manual intervention or a simple timed detection mechanism is required to switch to the backup channel. This static switching method is slow to respond and makes seamless failover difficult.

[0004] Another approach is to use a simple polling or random strategy to distribute traffic across multiple channels. However, this method does not take into account the real-time operating status of each channel, such as the current success rate of delivery, response time, or concurrent load. When the performance of a channel degrades or becomes congested, this approach cannot reduce the traffic allocated to that channel in a timely manner, causing some SMS messages to be delayed or fail, thereby affecting the overall service throughput and stability.

[0005] In summary, existing technologies generally suffer from high single-point failure risk, untimely fault switching, low channel resource utilization, and lack of adaptive scheduling of real-time channel status when handling multi-channel SMS sending, making it difficult to meet the needs of business scenarios with strict requirements for high availability and high reliability. Summary of the Invention

[0006] To address the technical problems of high single-point failure risk and low channel resource utilization in existing technologies, this invention provides a method and apparatus for SMS routing and scheduling based on multi-channel aggregation. This scheme significantly improves the availability and reliability of SMS sending services by aggregating and managing multiple channels, combining static attributes and dynamic performance indicators for intelligent routing decisions, and designing a refined fault classification and adaptive retry mechanism.

[0007] This invention provides a multi-channel aggregation-based SMS routing and scheduling method, applied to an SMS routing and scheduling system that aggregates multiple SMS channels. The method includes: receiving SMS sending requests from a business system through a unified request receiving interface and generating a unique message identifier for the request; calculating a comprehensive weight for each candidate channel in a preset candidate channel set based on at least one static attribute configured for the channel and at least one dynamic performance indicator obtained from the channel's real-time operating status; selecting a target channel from the candidate channel set based on the comprehensive weights of each candidate channel, wherein channels with higher comprehensive weights have a higher probability of being selected; sending the SMS through the target channel; when sending the SMS through the target channel fails, the target channel is designated as a failed channel, and the reason for the failure is categorized into one of several preset failure types, including at least temporary and permanent failure types; when the failure is determined to be a temporary failure type, re-executes the routing decision from the candidate channel set excluding the failed channel to select a new target channel for retry. After a transmission failure occurs, the value of the dynamic performance indicator corresponding to the failed channel is dynamically reduced; when the transmission failure is determined to be a permanent fault type, the retry process for sending the SMS message is terminated. In this way, traffic can be dynamically allocated based on the real-time health status of the channel, and automatic cross-channel disaster recovery switching can be performed in the event of a temporary failure. This avoids ineffective waiting and retries on a single failed channel, improving the system's fault tolerance and the final success rate of SMS message transmission.

[0008] Optionally, the at least one static attribute includes at least one of channel cost or Service Level Agreement (SLA); the at least one dynamic performance metric includes at least one of channel transmission success rate, average latency, or concurrency. This allows the calculation of the comprehensive weight to balance cost-effectiveness and real-time service quality, enabling more refined routing strategies.

[0009] Furthermore, the permanent failure type includes transmission failure due to incorrect service parameters; the temporary failure type includes transmission failure due to momentary network failure, temporary server failure, or channel rate limiting. By accurately classifying the causes of failure, ineffective retries can be avoided for problems that cannot be resolved by retries, such as incorrect service parameters, thus saving system resources and enabling faster feedback of deterministic failure results to the business system.

[0010] In one implementation, dynamically reducing the value corresponding to the dynamic performance index of the failed channel includes: attenuating the value when transmission fails; the method further includes: restoring the value when subsequent transmissions through the failed channel are successful or no failures occur within a preset time period. This "attenuation-restoration" closed-loop adjustment mechanism enables the system to automatically remove traffic from temporarily unstable channels and smoothly guide traffic back after recovery, forming an adaptive dynamic balance system.

[0011] Optionally, after selecting a target channel and before sending an SMS message through the target channel, the method further includes: performing a rate-limiting check based on the remaining capacity of a token bucket independently maintained for the target channel, and executing the sending after the check passes. By setting an independent rate-limiting mechanism for each channel, it is possible to effectively prevent downstream single-channel services from being overwhelmed by upstream request surges, thus ensuring the overall stability of the system.

[0012] Furthermore, the method also includes: encapsulating the SMS channel APIs of multiple different service providers into a unified internal interface through a channel adaptation module. The step of sending SMS messages through the target channel is implemented by calling the unified internal interface corresponding to the target channel. This greatly reduces the system's access complexity, allowing business systems to disregard the interface differences of the underlying channels, and also facilitating the rapid addition, deletion, or replacement of SMS channels in the future.

[0013] In one implementation, the method further includes a callback processing step, which comprises: receiving heterogeneous status reports from various channels and converting them into a standard format within the system according to a preset mapping rule; after converting the heterogeneous status reports into the standard format but before pushing them to the business system, using a two-level deduplication mechanism combining a Bloom filter and an LRU cache to filter duplicate status reports; pushing the standard format status reports to the business system, and using an exponential backoff strategy for asynchronous retries when the push fails, and storing the unpushable status reports in a dead-letter queue after the asynchronous retries reach a preset retry count threshold. This callback processing mechanism ensures the uniqueness, format consistency, and reliability of status reports, solving the problems of chaotic, duplicate, and lost callback data in multi-channel scenarios.

[0014] Optionally, the method also includes: real-time monitoring of key system indicators, and sending alarm information to operations and maintenance personnel when the indicators meet preset alarm rules. This enables operations and maintenance personnel to grasp the system's health status in real time, promptly identify and handle potential problems, and ensure high service availability.

[0015] Furthermore, the step of selecting a target channel from the candidate channel set based on the comprehensive weight of each candidate channel includes using a weighted random algorithm or a weighted round-robin algorithm for selection. These algorithms can effectively perform probabilistic selection based on comprehensive weights, ensuring that traffic is allocated to each channel in the expected proportion.

[0016] This invention also provides a multi-channel aggregation-based SMS routing and scheduling device, which aggregates multiple SMS channels. The device includes: a unified interface access module, used to receive SMS sending requests from a business system through a unified request receiving interface, and generate a unique message identifier for the request; a routing decision module, used to calculate the comprehensive weight of each candidate channel in the candidate channel set based on at least one static attribute configured for the channel and at least one dynamic performance indicator obtained according to the real-time operating status of the channel; the routing decision module is further used to select a target channel from the candidate channel set according to the comprehensive weight of each candidate channel, wherein the channel with a higher comprehensive weight has a higher probability of being selected; and send the SMS through the target channel; fault. The retry module is used to, when sending an SMS through the target channel fails, designate the target channel as a failed channel and classify the reason for the failure into one of a set of preset failure types, including at least temporary and permanent failure types. The retry module is also used to, when the failure is determined to be a temporary failure, trigger the routing decision module to reselect a new target channel from the candidate channel set that excludes the failed channel for retrying. The routing decision module is also used to, after the failure occurs, dynamically reduce the value corresponding to the dynamic performance index of the failed channel. The retry module is also used to, when the failure is determined to be a permanent failure, terminate the retry process for the SMS sending request.

[0017] Compared with the prior art, the present invention has the following beneficial effects: First, it significantly improves the availability and reliability of the system. By aggregating multiple channels and performing dynamic routing based on comprehensive weights, single points of failure are effectively eliminated. When any channel experiences a temporary failure, intelligent fault typing and cross-channel retry mechanisms can achieve automatic disaster recovery switching within seconds, seamlessly migrating requests to healthy channels and avoiding business interruption.

[0018] Secondly, it improves system throughput and resource utilization. The weighting mechanism based on dynamic performance metrics allows traffic to be allocated in real time to channels with better performance, avoiding wasted resources on inefficient or congested channels and thus maximizing the overall system throughput. Simultaneously, the channel-level token bucket rate limiting mechanism effectively smooths traffic peaks, preventing excessive impact on a single channel and ensuring system stability under high concurrency.

[0019] Third, it significantly reduces the complexity of operation and maintenance and access. A unified API interface and standardized callback handling mechanism shield the underlying implementation differences of multiple channels. Business systems only need to connect once to utilize the capabilities of all channels, significantly reducing development workload. A unified logging, monitoring, and alarm system provides operations personnel with a global view of system health, making fault location and capacity planning more efficient and accurate. Attached Figure Description

[0020] Figure 1 This is an architectural block diagram of an SMS routing and scheduling system provided in an embodiment of the present invention.

[0021] Figure 2 This is a flowchart of a text message routing and scheduling method provided in an embodiment of the present invention.

[0022] Explanation of reference numerals in the attached figures 10 - Unified Interface Access Module, 20 - Routing Decision Module, 30 - Rate Limiting Module, 40 - Channel Adaptation Module, 50 - Fault Retry Module, 60 - Callback Processing Module, 70 - Log Center Module, 80 - Data Statistics Module, 90 - Alarm Module, S1 - Channel Access and Configuration Loading, S2 - Unified Interface Request Reception, S3 - Routing Decision, S4 - Rate Limiting Check, S5 - Sending and Fault Retry, S6 - Asynchronous Callback Processing, S7 - Log Recording and Statistics, S8 - Alarm Triggering Detailed Implementation To facilitate understanding of the present invention by those skilled in the art, the technical solutions of the present invention will be described more comprehensively and in detail below with reference to the accompanying drawings. It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other.

[0023] In current communication technologies, enterprise-level SMS sending services generally face the problems of high single-point failure risk and low channel resource utilization. For example, when a business system relies on only a single SMS channel, once that channel fails, all SMS sending services will be immediately interrupted. Even with a simple primary / backup solution, there are still issues of switching delays and wasted backup channel resources. This invention aims to solve the above problems by providing an SMS routing and scheduling method and apparatus based on multi-channel aggregation. Its core idea is to aggregate multiple heterogeneous SMS channels, make intelligent routing decisions based on dynamically changing comprehensive weights, and combine refined failure classification and differentiated retry strategies to form a highly available, highly reliable, and self-healing SMS routing and scheduling system.

[0024] In the technical solution of this invention, "comprehensive weight" is a core concept. It is not a static, unchanging value, but a dynamic quantitative score reflecting the current comprehensive service capability of an SMS channel. This comprehensive weight is calculated by combining the channel's static attributes and dynamic performance indicators, and is used to guide traffic allocation during routing decisions, enabling channels with stronger comprehensive service capabilities to handle more sending requests. Another core concept is the classification of failure types. This invention classifies the causes of sending failures into at least two types: "temporary failure types" and "permanent failure types." "Temporary failure types" refer to sending failures that are usually caused by network jitter, brief server anomalies, or traffic limitations, and are expected to recover on their own within a short time or be resolved by switching to other channels. "Permanent failure types," on the other hand, refer to sending failures that cannot be resolved by retries and require manual intervention or parameter correction by the business system. By accurately classifying failures, this invention can adopt the most efficient response strategy, avoid ineffective retries, and quickly isolate faults.

[0025] The technical solution of this invention will be described in detail below. This invention provides a multi-channel aggregation-based SMS routing and scheduling method, which is applied to an SMS routing and scheduling system that aggregates multiple SMS channels. The method first receives SMS sending requests from the business system through a unified request receiving interface and generates a unique message identifier for each request. This unique message identifier, for example, generated using UUID v4 or the Snowflake algorithm, ensures unique tracking of the request throughout the entire system lifecycle, providing a foundation for subsequent log tracing, status updates, and troubleshooting.

[0026] Next, the method proceeds to the routing decision phase. For each candidate channel in the candidate channel set, the system calculates its overall weight. This calculation is based on at least one static attribute configured for the channel and at least one dynamic performance metric obtained from the channel's real-time operating status. After calculation, the system selects a target channel from the candidate channel set based on the overall weights of each candidate channel. This selection process ensures that channels with higher overall weights have a higher probability of being selected, thereby dynamically and intelligently directing traffic to the channel with the best current service quality.

[0027] When sending an SMS message fails through the selected target channel, the method does not simply terminate or blindly retry on the original channel. Instead, it first categorizes the cause of the failure into one of several preset failure types, including at least temporary and permanent failure types. When the failure is determined to be a temporary failure, the system initiates an intelligent retry mechanism. This involves re-executing the routing decision from the set of candidate channels that have excluded the currently failed channel to select a new target channel for retry. This cross-channel retry mechanism is the key difference between this invention and traditional same-channel retry, effectively avoiding persistent or intermittent channel failures. To ensure that the routing decision reflects the latest health status of the channel in real time, the system dynamically reduces the value of the dynamic performance indicators corresponding to the failed channel after any failure occurs. For example, it can reduce the score or success rate statistics representing its health status, which directly leads to a decrease in its overall weight, thereby reducing the probability of it being selected in subsequent routing selections. This achieves rapid deweighting and traffic isolation of the failed channel. Conversely, when a sending failure is determined to be a permanent fault, since retries cannot solve the problem, the system will directly terminate the retry process for the SMS sending request and return the specific reason for the failure to the business system, thereby avoiding the waste of valuable system resources on meaningless retries.

[0028] To make the calculation of the overall weight more scientific and closer to actual business needs, the at least one static attribute can specifically include channel cost or Service Level Agreement (SLA). For example, a lower-cost channel can be assigned a higher initial weight, while in scenarios with extremely high stability requirements, a channel with a higher SLA commitment can be assigned a higher initial weight. Correspondingly, the at least one dynamic performance indicator can specifically include the channel's transmission success rate, average latency, or current concurrency. For example, a channel with a high recent success rate, short average latency, and low concurrency pressure will have a higher dynamic performance indicator score, and its overall weight will also increase accordingly.

[0029] Furthermore, to achieve precise handling of failures, the failure types can be defined more precisely. Specifically, permanent failure types can include sending failures caused by incorrect business parameters (such as incorrect mobile number format or unreported SMS templates). These failures are unrelated to the quality of the channel itself, and switching channels will not succeed. Temporary failure types can include sending failures caused by transient network failures (such as connection timeouts), temporary server failures (such as HTTP 5xx errors), or channel rate limiting (such as HTTP 429 errors). Through this detailed classification, the system can directly return an error for failures caused by incorrect business system parameters, while performing effective cross-channel retries for genuine temporary channel failures.

[0030] To enable the system to have self-healing capabilities and form a complete dynamic adjustment closed loop, the mechanism for dynamically reducing the dynamic performance index value of failed channels should also include a recovery mechanism. Specifically, after attenuating the value when a transmission fails, the method further includes gradually restoring the value when subsequent transmissions through the channel are successful or no failures occur within a preset time period. This "attenuation-recovery" closed-loop mechanism allows the channel's weight to automatically recover after a brief failure, enabling it to re-participate in traffic scheduling, thereby ensuring that the system can always maximize the utilization of all available channel resources in a dynamically changing environment.

[0031] To prevent sudden surges in traffic from impacting downstream SMS channels, causing channel overload or even temporary blocking by service providers, this invention adds a rate-limiting check step after selecting the target channel and before sending SMS messages through it. This step performs a rate-limiting check based on the remaining tokens in an independently maintained token bucket for each target channel, and only executes sending if there are sufficient tokens. By setting an independent token bucket for each channel and replenishing tokens at a rate set according to its service capacity, fine-grained traffic control can be achieved for each channel, ensuring that the sending rate is always within the channel's carrying capacity, thereby improving the overall stability of the system.

[0032] To shield the implementation differences of multiple heterogeneous SMS channels at the underlying level and simplify system access and expansion, this invention also includes a channel adaptation module 40 that encapsulates the SMS channel APIs of multiple different service providers into a unified internal interface. When an SMS needs to be sent through a target channel, the system actually calls the unified internal interface corresponding to that target channel. This adapter-based design means that when adding or replacing an SMS channel, only a new adapter needs to be developed and configured, without modifying the core routing and retry logic, greatly improving the system's scalability and maintainability.

[0033] To ensure eventual consistency of SMS sending status and provide reliable status receipts to the business system, this invention also includes a detailed callback processing step. This step first receives heterogeneous status reports from various channels, each with a different format, and converts them into a standard internal format according to preset mapping rules. Before pushing the reports to the business system, to address the issue of potential duplicate reports from the channel, the system employs a two-level deduplication mechanism combining a Bloom filter and an LRU cache to efficiently filter duplicate status reports. Finally, the standardized status report is pushed to the business system, and an exponential backoff strategy is used for asynchronous retries in case of push failure. Reports that still fail after multiple retries are stored in a dead-letter queue, ensuring that status data is neither duplicated nor lost.

[0034] To achieve unattended monitoring of system health, this invention also includes the step of real-time monitoring of key system indicators and sending alarm information to maintenance personnel via instant messaging tools when the indicators meet preset alarm rules. Monitored indicators may include: failure rate of specific channels, average latency, number of overall system rate limiting triggers, and backlog length of callback processing queues. Through this proactive alarm mechanism, maintenance personnel can intervene and handle problems at their initial stages, ensuring the long-term stable operation of the system.

[0035] As a preferred implementation, the step of selecting a target channel from the candidate channel set based on the comprehensive weight of each candidate channel can specifically employ a weighted random algorithm or a weighted round-robin algorithm. The weighted random algorithm can select channels probabilistically based on weights, resulting in a smoother traffic distribution, while the weighted round-robin algorithm strictly allocates requests sequentially according to weight ratios. Both algorithms have their advantages, and the choice can be made based on the specific business scenario.

[0036] Accordingly, the present invention also provides a text message routing and scheduling device based on multi-channel aggregation. For example... Figure 1 As shown, this device aggregates multiple SMS channels, and its internal structure corresponds to the steps of the method described above. The device includes: a unified interface access module 10, a routing decision module 20, and a fault retry module 50. The unified interface access module 10 is responsible for receiving SMS sending requests from the business system and generating unique message identifiers. The routing decision module 20 is responsible for calculating the comprehensive weight of each channel based on static attributes and dynamic performance indicators, and selecting the target channel according to the weight. When a transmission fails, the fault retry module 50 is responsible for classifying the failure. If it is a temporary fault, the routing decision module 20 is triggered to retry by selecting a new channel after excluding the failed channel. Simultaneously, the routing decision module 20 is also responsible for dynamically reducing the dynamic performance indicator value of the failed channel after a failure occurs. If it is a permanent fault, the fault retry module 50 terminates the retry process. These modules work together to achieve the same technical effect as the aforementioned method.

[0037] To more clearly illustrate the technical solution of the present invention, a detailed description is provided below with reference to an embodiment. For example... Figure 1 and Figure 2As shown, after receiving an SMS sending request, the SMS routing scheduling system of the present invention first generates a unique message identifier for the request by the unified interface access module 10. Then, the request is passed to the routing decision module 20. The routing decision module 20 maintains a candidate channel set and associates each channel with a value related to static attributes (such as a preset priority) and a value related to dynamic performance indicators (such as a score reflecting recent health status). The routing decision module 20 calculates a comprehensive weight based on these two values ​​and, according to this weight, probabilistically selects a target channel from the candidate channel set. After selecting the target channel, the request is distributed to the corresponding channel for sending. If the sending operation fails, the fault retry module 50 intervenes. This module first determines whether the failure is a retryable temporary fault or a non-retryable permanent fault. If it is determined to be a temporary fault, the fault retry module 50 notifies the routing decision module 20 to re-enter the currently failed request into the decision process, but in this retry decision, the channel that just failed will be temporarily excluded from the candidate channel set. Simultaneously, the routing decision module 20 lowers the value of the dynamic performance metric corresponding to the failed channel, reducing its probability of being selected in subsequent requests. If the failure is determined to be a permanent fault, the fault retry module 50 terminates all subsequent processing of the request and records the failure status. Through this series of steps, the system achieves the core closed loop of dynamic routing, failure classification, cross-channel retries, and dynamic weight reduction.

[0038] Furthermore, in a specific embodiment, the routing decision module 20 can calculate the comprehensive weight for each channel in the candidate channel set according to the following formula. : in, It is with the channel A basic weight value related to static attributes, which can be preset by operations and maintenance personnel based on factors such as channel procurement cost and SLA service level, reflecting the inherent priority of the channel. It is based on the channel A health coefficient is calculated from dynamic performance indicators, ranging from 0 to 1. This coefficient is calculated based on real-time data such as the channel's transmission success rate and average response time within the most recent time window. A healthy channel has a coefficient close to 1, while a faulty or degraded channel has a coefficient close to 0. By multiplying static business strategies with dynamic real-time states, the comprehensive weight calculation reflects business intent while also sensitively adapting to real-time changes in the channel.

[0039] In another embodiment, the failure type judgment logic of the fault retry module 50 can be specified. For example, a mapping table can be preset to map the original error information returned by the channel to temporary or permanent failure types. Specifically, when the HTTP status code returned by the channel is in the 5xx series (such as 500, 502, 503, 504), or a specific business error code indicates "temporary server failure," it can be classified as a temporary failure type. Similarly, when the HTTP status code is 429 (Too Many Requests) or the business error code explicitly indicates "rate limiting," it can also be classified as a temporary failure type. When the error code returned by the channel explicitly indicates problems directly related to business parameters such as "incorrect mobile number format," "insufficient balance," or "signature not reported," which cannot be resolved by retries, it is classified as a permanent failure type. This specific mapping mechanism automates and accurately categorizes the failure type.

[0040] In addition, such as Figure 1 As shown, the system may include a rate limiting module 30, positioned between the routing decision module 20 and the channel adaptation module 40. After the routing decision module 20 selects the target channel, the request is not sent immediately but first passes through the rate limiting module 30. The rate limiting module 30 maintains an independent token bucket for each channel. Before sending, it checks the token balance in the token bucket corresponding to the target channel. If there are enough tokens, one token is consumed and sending is allowed; if there are not enough tokens, it means that the current sending rate of the channel has reached its limit. At this time, the system can process requests according to preset strategies. For example, requests with high real-time requirements (such as verification codes) can be directly rejected and an error returned, while requests with acceptable delays (such as marketing SMS messages) can be placed in a queue and processed after the token bucket is replenished. This design effectively prevents downstream channels from being overwhelmed by sudden traffic surges.

[0041] To further enhance system reliability, this embodiment provides a detailed description of the implementation of the callback processing module 60. Upon receiving heterogeneous status reports from different service providers such as "Service Provider A," "Service Provider B," and "Service Provider C," this module first queries a preset field mapping table. Fields with different names, such as `err_code` and `report_status`, and status values ​​with different formats, such as `"DELIVERED"` and `"SUCCESS"`, are uniformly converted to the system's internal standard format, for example, `status="Delivered"`. After conversion, to prevent the channel provider from repeatedly pushing the same status due to network issues, the module first uses a Bloom filter to quickly screen the message IDs. If the Bloom filter deems it potentially duplicate, a precise comparison is performed in the LRU cache, achieving efficient two-level deduplication. Finally, when pushing this standardized status report to the business system, if the push fails, the module initiates an exponential backoff strategy, such as retrying multiple times at intervals of 1 second, 2 seconds, 4 seconds, etc., to ensure that the status report is delivered to the business system as much as possible.

[0042] To more comprehensively demonstrate the preferred embodiments of the present invention, a complete embodiment including all technical features is described below. This embodiment is applied to a verification code sending scenario of a travel service platform, which sends approximately 500,000 verification codes per day, with peak QPS reaching 2000. Figure 1 As shown, after system deployment, the configuration of three SMS channels is first loaded through the configuration center (corresponding to step S1): Channel A (Service Provider A SMS), initial weight 5, rate limiting threshold 200 QPS; Channel B (Service Provider B), initial weight 3, rate limiting threshold 150 QPS; Channel C (Service Provider C), initial weight 2, rate limiting threshold 100 QPS.

[0043] Reference Figure 2 When a request to send a verification code arrives, the processing flow is as follows: Step S2, the unified interface access module 10 receives the request, generates a unique message identifier after verification, and synchronously returns it to the business system. Step S3, the routing decision module 20 begins the decision-making process. First, candidate channels are screened to confirm that the signatures and templates of the three channels have been filed. Then, the multi-factor comprehensive weight is calculated. Assume the initial comprehensive weights are A=5.0, B=3.0, and C=2.0. The system uses a weighted random algorithm, with the probability of channel A being selected being 50% (5 / (5+3+2)), channel B being 30%, and channel C being 20%.

[0044] Assume this request selects channel A. In step S4, the rate limiting module 30 checks the token bucket of channel A, which is replenished at a rate of 200 tokens per second. If a token is available, one is consumed and the request is allowed. In step S5, the request is sent through the channel adaptation module 40. Assume that channel A returns an HTTP 503 error at this time, indicating a temporary server failure. The fault retry module 50 immediately intervenes, first notifying the routing decision module 20 to decay the dynamic performance indicators of channel A, for example, reducing its corresponding health coefficient from 1.0 to 0.85. This change is recorded in real-time in the log center module 70 (corresponding to step S7). Simultaneously, the data statistics module 80 performs multi-dimensional real-time statistical analysis (such as channel transmission success rate, average latency, etc.) based on the operation logs collected by the log center module 70, thus providing data support for updating the dynamic performance indicators of the routing decision module 20. Subsequently, the fault retry module 50 re-releases the request back into the routing queue and instructs the routing decision module 20 to exclude channel A in this retry. At this point, the routing decision module 20 re-weights the random selection between channels B and C according to their weights of 3:2, thereby seamlessly switching the request to the healthy channel.

[0045] In subsequent requests, because the dynamic performance metrics of channel A have decayed, its overall weight becomes... At this point, the weight ratio of the three channels becomes 4.25:3:2, and the probability of channel A being selected automatically decreases from 50% to approximately 46%, achieving automatic traffic transfer to the faulty channel. If subsequent transmissions through channel A continue to be successful, the corresponding values ​​of its dynamic performance indicators will gradually revert to the initial level, restoring its original weight. This complete closed loop of "failure classification → weight decay → faulty channel elimination → reweighting and routing" ensures the system's strong fault tolerance in the face of channel fluctuations.

[0046] Regarding callback processing (step S6), when the SMS status report from channel A is asynchronously pushed to the callback processing module 60, the module performs pipelined processing. First, the status returned by the channel is converted to an internal standard status according to the mapping table. Then, a two-level deduplication process is performed using a unique message identifier in a Bloom filter and an LRU cache. Next, the correct order of status changes is ensured. Finally, the standardized JSON format status report is reliably pushed to the callback address of the business system via HTTP POST. If the push fails, an exponential backoff retries are initiated, with a maximum of 7 retries. If the number of retries is exceeded, the report is stored in a dead-letter queue, monitored by the alarm module 90, which then notifies the operations and maintenance department for handling (corresponding to step S8).

[0047] The beneficial effects of this invention have been verified in multiple comparative experiments. When comparing the fault-based retry scheme of this invention with the traditional indiscriminate full retry scheme, the results show that for failures caused by incorrect business parameters, this invention eliminates 100% of invalid retries, reducing the average response time for such errors from approximately 30 seconds (waiting for 3 retry timeouts) to less than 50 milliseconds. When verifying the effect of cross-channel rerouting, the scheme of this invention was compared with the traditional "same-channel retry queue" scheme. In a scenario simulating a single channel with a 20% probability of intermittent unavailability, the final success rate of the same-channel retry scheme was only 88.5%, while the cross-channel rerouting scheme of this invention, by immediately transferring retry requests to healthy channels, achieved a final success rate of 99.92%. When verifying the effect of unified callback standardization, compared with the scheme where the business system needs to adapt to each channel itself, the unified callback processing module of this invention reduces the amount of access code in the business system by approximately 73%, and through a two-level deduplication and reliable re-push mechanism, improves the duplicate push identification rate to over 99.9% and reduces the callback loss rate to below 0.01%.

[0048] As alternative implementations, the routing algorithm in the routing decision module 20 can be weighted random, or it can also employ weighted round-robin, response time-based adaptive algorithms, or consistent hashing algorithms. The token bucket algorithm in the rate limiting module 30 can also be replaced by a leaky bucket algorithm or a sliding window algorithm. The channel adaptation module 40 can adopt a strategy pattern or a pluggable architecture, in addition to the adapter pattern. The push method in the callback processing module 60 can be HTTP POST, or it can be a message queue or WebSocket. These alternative solutions do not depart from the core idea of ​​this invention. Those skilled in the art can modify or make equivalent substitutions to the above embodiments. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this invention should be included within the protection scope of this invention.

Claims

1. A method for SMS routing and scheduling based on multi-channel aggregation, applied to an SMS routing and scheduling system, which aggregates multiple SMS channels, characterized in that... The method includes: The system receives SMS sending requests from the business system through a unified request receiving interface and generates a unique message identifier for the request. For each candidate channel in the preset candidate channel set, the comprehensive weight of the channel is calculated based on at least one static attribute configured for the channel and at least one dynamic performance index obtained according to the real-time running status of the channel. Based on the comprehensive weight of each candidate channel, a target channel is selected from the candidate channel set, wherein the channel with a higher comprehensive weight has a higher probability of being selected. Send SMS messages through the target channel; When sending a text message through the target channel fails, the target channel is designated as the failed channel, and the reason for the failure is classified into one of a number of preset failure types, including at least temporary failure types and permanent failure types. When the transmission failure is determined to be a temporary fault type, the routing decision is re-executed from the candidate channel set that excludes the failed channel to select a new target channel for retry; After the transmission failure occurs, the value of the dynamic performance index corresponding to the failed channel is dynamically reduced. When the sending failure is determined to be a permanent fault type, the retry process for sending the SMS message is terminated.

2. The method according to claim 1, characterized in that, The at least one static attribute includes at least one of channel cost or service level agreement (SLA); the at least one dynamic performance metric includes at least one of channel transmission success rate, average latency, or concurrency.

3. The method according to claim 1, characterized in that, The permanent fault types include transmission failures caused by incorrect service parameters; the temporary fault types include transmission failures caused by momentary network failures, temporary server failures, or channel rate limiting.

4. The method according to claim 1, characterized in that, The method of dynamically reducing the value corresponding to the dynamic performance index of the failed channel includes: attenuating the value when transmission fails; the method also includes: restoring the value when subsequent transmissions through the failed channel are successful or no failures occur within a preset time period.

5. The method according to claim 1, characterized in that, After selecting the target channel and before sending the SMS message through the target channel, the method also includes: A rate-limiting check is performed based on the remaining capacity of a token bucket maintained independently for the target channel, and transmission is executed after the check passes.

6. The method according to claim 1, characterized in that, The method also includes: encapsulating the SMS channel APIs of multiple different service providers into a unified internal interface through a channel adaptation module, wherein the step of sending SMS messages through the target channel is implemented by calling the unified internal interface corresponding to the target channel.

7. The method according to claim 1, characterized in that, The method further includes a callback processing step, which includes: Receive heterogeneous status reports from each channel and convert them into the system's internal standard format according to preset mapping rules; After converting heterogeneous status reports into a standard format and before pushing them to business systems, a two-level deduplication mechanism combining Bloom filters and LRU caching is used to filter duplicate status reports. The standard format status report is pushed to the business system, and an exponential backoff strategy is used to retry asynchronously when the push fails. After the asynchronous retry reaches a preset retry number threshold, the status report that cannot be pushed is stored in the dead letter queue.

8. The method according to claim 1, characterized in that, The method also includes: real-time monitoring of key system indicators, and sending alarm information to maintenance personnel when the indicators meet preset alarm rules.

9. The method according to claim 1, characterized in that, The step of selecting a target channel from the candidate channel set based on the comprehensive weight of each candidate channel includes using a weighted random algorithm or a weighted round-robin algorithm for selection.

10. A text message routing and scheduling device based on multi-channel aggregation, which aggregates multiple text message channels, characterized in that: The device includes: The unified interface access module is used to receive SMS sending requests from business systems through a unified request receiving interface and generate a unique message identifier for the request. The routing decision module is used to calculate the comprehensive weight of each candidate channel in the preset candidate channel set based on at least one static attribute configured for the channel and at least one dynamic performance index obtained according to the real-time running status of the channel. The routing decision module is also used to select a target channel from the candidate channel set according to the comprehensive weight of each candidate channel, wherein the channel with a higher comprehensive weight has a higher probability of being selected. The fault retry module is used to treat the target channel as a failed channel when the SMS message fails to be sent through the target channel, and to classify the reason for the failure into one of a number of preset failure types, including at least temporary failure types and permanent failure types. The fault retry module is also used to trigger the routing decision module to reselect a new target channel from the candidate channel set that excludes the failed channel when the transmission failure is determined to be the temporary fault type; The routing decision module is also used to dynamically reduce the value of the dynamic performance index corresponding to the failed channel after the transmission failure occurs. The fault retry module is also used to terminate the retry process for sending the SMS message when it is determined that the sending failure is a permanent fault type.