Short message cross-channel adaptive fuse routing method based on time decay score
By adopting an adaptive circuit breaker routing method based on time decay scoring, the problem of slow channel fault detection in high-concurrency scenarios of SMS cross-channel routing technology is solved, realizing fast response and efficient SMS transmission, ensuring user experience and system efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI SIRUI INFORMATION TECHNOLOGY CO LTD
- Filing Date
- 2026-04-10
- Publication Date
- 2026-07-03
AI Technical Summary
Existing SMS cross-channel routing technology struggles to detect channel failures in a timely manner under high-concurrency, high-reach, and multi-scenario business requirements, leading to request transmission failures. Furthermore, it lacks smooth circuit breaking and detection mechanisms, resulting in a decline in user experience.
An adaptive circuit breaker routing method based on time decay scoring is adopted. By receiving service requests, allocating TraceID and lifecycle time budget, collecting channel indicators in real time and introducing time decay factors, dynamic channel comprehensive scoring is generated to realize three-state management and circuit breaker detection. The method also optimizes routing decisions by combining local caching and distributed caching.
It improves the system's response speed to channel failures, reduces latency, avoids meaningless retries, ensures timely delivery to users even in extreme network environments, and enhances the accuracy of routing decisions and system efficiency.
Smart Images

Figure CN122340580A_ABST
Abstract
Description
Technical Field
[0001] This invention is a cross-channel adaptive circuit breaker routing method for SMS based on time decay scoring, belonging to the field of Internet communication technology. Background Technology
[0002] With the widespread application of SMS services in scenarios such as verification codes, notifications, and emergency alerts, SMS cross-channel routing technology has become crucial for ensuring SMS delivery rates and improving service quality. Existing SMS cross-channel routing solutions mostly employ traditional linear scoring models combined with static parameter configuration to achieve routing decisions. However, these solutions suffer from numerous technical challenges in practical applications, making it difficult to meet the business needs of high concurrency, high reach, and diverse scenarios.
[0003] First, traditional linear scoring models that use fixed order, polling, or a simple combination of success rate and latency assign the same weight to historical data and the latest data. When a channel experiences a sudden "congestion degradation," the system cannot detect and switch off in time due to the dilution of historical success rates, resulting in a large number of requests being stuck on the failed channel and many requests failing to be effectively transmitted.
[0004] Secondly, existing routing algorithms only focus on the absolute value of current static metrics, ignoring the trend of metric changes. For example, if the success rate of a certain channel is as high as 95%, but is dropping sharply at a rate of 1% per second, it is easy to drive traffic to a channel that is about to collapse, causing request transmission failures. Moreover, when large-scale network jitter occurs, mindless retries not only increase business latency but also trigger a rate-limiting avalanche of upstream channels. There is a lack of smooth circuit breaking and detection mechanisms.
[0005] Although traditional voice backup is usually triggered after a fixed number of failed retries (N), if the first N retries have already taken too long, the final voice broadcast often becomes meaningless, exceeding the user's tolerance time for the verification code. Summary of the Invention
[0006] To address the problems in existing technologies, this invention provides a cross-channel adaptive circuit breaker routing method for SMS based on time decay scoring.
[0007] The technical solution adopted by this invention to solve its technical problem is: a cross-channel adaptive circuit breaker routing method for SMS based on time decay scoring, comprising: S1. Receive business requests and allocate globally unique TraceIDs and lifecycle time budgets; S2. Real-time sliding acquisition of success rate, time consumption and error code of each channel, and introduction of time decay factor for index aggregation; S3. Calculate and generate a dynamic channel comprehensive score based on multi-dimensional operational indicators of the channel, indicator decay trends, and different business types. S4. Implement three-state management for each channel based on dynamic comprehensive scoring. The three states include closed, fuse-off, and half-open detection. S5. Based on the three-state management results, route the request to the appropriate SMS channel; S6. Monitor the overall message flow time. If any of the following occurs: insufficient remaining time budget, circuit breaking of all SMS channels, or excessively low score, immediately block SMS flow and downgrade to TTS call via voice gateway.
[0008] Furthermore, the formula for calculating the comprehensive channel score is as follows: ; The To improve the time decay success rate, an exponential decay is introduced for the request results within the sample window. , For the time difference, The attenuation coefficient; The For the trend penalty term, take the first derivative of the success rate over the past N consecutive time slices. If the derivative is positive, no trend penalty is applied; if the derivative is negative, a trend penalty is applied through the penalty coefficient α. The Weighted by success rate, As time weight, Cost weighting; The for , This represents the slope of the indicator trend.
[0009] Furthermore, the aforementioned The stability evaluation index is determined by the channel stability coefficient and is adjusted collaboratively through channel stability evaluation indexes. The calculation steps for the channel stability coefficient include: Read all weighted multidimensional performance metrics within the current sample window from the cache; Perform fluctuation analysis on the read multidimensional indicators and calculate the variance of each indicator; By using a preset algorithm, the variance of all indicators is normalized to obtain the channel stability coefficient. Bind the channel stability coefficient to the corresponding channel and write it into the cache; The sample window and Based on the preset sample window and In addition, the channel stability coefficient is adjusted in a coordinated manner, and the adjusted sample window and Write to the cache; The channel stability coefficient is recalculated based on a set time interval and adjusted according to the latest channel stability coefficient. .
[0010] Furthermore, the weighted multidimensional operational indicators include success rate indicators, time consumption indicators, and cost indicators, which are derived from... The weighted calculation is obtained and stored in the cache in advance; The weighted multidimensional operating index = original index value × × ; The The scores are automatically recalculated and the cache is updated at preset intervals.
[0011] Furthermore, the aforementioned , based on , The preset base weight values, weighted multidimensional operating indicators within the sample window, indicator decay trends, and current business identifiers and business types are adaptively adjusted, and the adjusted values are further adjusted accordingly. , Write to cache; The Based on preset The numerical values, channel stability coefficients, and current business type adaptability adjustments will be made, and the adjustments will be... The values are stored in the cache.
[0012] Furthermore, the aforementioned Based on preset The numerical values and the fluctuation range of the indicators within the sample window are dynamically adjusted, and based on... The smoothed index is calculated numerically and then written into the cache. The formula for calculating the smoothed index is as follows: Smoothed indicator = (1-Tema) × current indicator value + Tema × previous period indicator value; The system readjusts based on a preset time interval and the latest indicator fluctuations. And update the cache; The The calculation is performed based on the smoothed multidimensional values and the read time slice data, and the calculated values are... Write it to the cache.
[0013] Furthermore, the cache employs both local and distributed caching, with the local cache used to cache the current data of all channels. Scoring, Sample Window and channel stability coefficient; The distributed cache stores historical calculation data and parameter adjustment records for all channels over the past 7 days. The local cache at the same time Supports data synchronization across multiple routing nodes.
[0014] Furthermore, the reading, processing, and writing of all the data are accomplished through a combination of the main thread and asynchronous threads; The main thread only reads from the local cache. Scoring allows for quick decision-making on cross-channel SMS routing. The asynchronous thread processes complex computational tasks in the background, including channel stability coefficient calculation, sample window and λ coordinated adjustment, The score has been recalculated.
[0015] Furthermore, the basis for the three-state management in S4 is as follows: When a channel returns a clear underlying error, bypass the scoring model and instantly put the channel into a circuit breaker state; If the timeout error rate of a certain channel spikes above a set threshold within 1 second, a soft circuit breaker is triggered. After the circuit breaker period ends, the channel enters a half-open state and uses a small amount of real traffic based on the token bucket algorithm to probe for activity. If the success rate of the probe is up to standard, the channel is restored to closed; otherwise, the circuit breaker is rolled back and the circuit breaker time is exponentially reduced.
[0016] Furthermore, the allocation of a suitable SMS channel in S5 includes at least one SMS channel retries; Before each retry of the next SMS channel, the system calculates the time already consumed. The TTS call is determined by calculating the remaining time and a preset time threshold, where the remaining time = lifecycle time budget - time already consumed; If the remaining time is less than the preset time threshold, the SMS retry loop is terminated directly, the voice gateway is asynchronously called to initiate TTS broadcast, and the reach medium transition is marked in the database.
[0017] The beneficial effects of this invention are: 1. By introducing exponential time decay and a trend penalty term, the problem of traditional averaging algorithms being slow to react to transient failures is solved. The system no longer sends traffic to channels that are on the verge of collapse, greatly reducing the latency perceived by the user.
[0018] 2. The circuit breaker pattern in microservice architecture is innovatively applied to the gateway-level scheduling of SMS channels, which avoids the failure of channels being blocked by meaningless retries, and at the same time, a smooth access is achieved after the channel is restored through a half-open mechanism.
[0019] 3. It abandons the rigid logic of retry count and truly calculates time boundaries based on service level agreements and user experience, so that even in extremely poor network environments where all SMS channels are slowed down, it can still reach users via voice within the user's tolerance threshold.
[0020] 4. Based on channel stability, the sample window and attenuation coefficient are synchronously adapted to ensure accurate Rdecay calculation, avoid scoring lag or distortion caused by traditional static parameter configuration, and improve the accuracy of routing decisions.
[0021] 5. By combining local caching with distributed caching, as well as main threads and asynchronous threads, routing decisions and complex calculations are separated, reducing routing latency. This approach is suitable for high-concurrency scenarios and improves system efficiency. Attached Figure Description
[0022] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 This is a flowchart of the SMS cross-channel adaptive circuit breaker routing method based on time decay scoring according to the present invention. Detailed Implementation
[0023] To make the technical means, creative features, objectives and effects of this invention easier to understand, the invention will be further described below in conjunction with specific embodiments.
[0024] like Figure 1 As shown, the embodiments of this application are applicable to SMS service scenarios that require high reach rates, such as verification codes, notification SMS, and emergency SMS, and solve the problems of routing selection, channel anomaly handling, and information delivery in extreme situations when multiple channels coexist.
[0025] Example 1: This application provides a method for adaptive circuit breaker routing of SMS across channels based on time decay scoring, including the following steps: S1. Receive business requests and allocate a globally unique TraceID and a lifecycle time budget, such as 8 seconds; S2. Real-time sliding acquisition of success rate, time consumption and error code of each channel, and introduction of time decay factor for index aggregation; S3. Calculate and generate a dynamic channel comprehensive score based on multi-dimensional operational indicators of the channel, indicator decay trends, and different business types. The specific steps for calculating the dynamic channel comprehensive score include: S31, Read weighted multidimensional operations from cache index, , , Sample window , Parameters; The weighted multidimensional operational metrics include success rate, time consumption, and cost metrics, which are derived from... The weighted calculation is pre-stored in the cache. The specific calculation formula is as follows: Weighted multidimensional operating indicators = Original indicator values × × ; S32. Calculated using a preset scoring formula: ; in To improve the time decay success rate, an exponential decay is introduced for the request results within the sample window. , For the time difference, The attenuation coefficient; For the trend penalty term, take the first derivative of the success rate over the past N consecutive time slices. If the derivative is positive, no trend penalty is applied; if the derivative is negative, a trend penalty is applied through the penalty coefficient α. Weighted by success rate, As time weight, Cost weighting; for , This represents the slope of the indicator trend.
[0026] S33. Calculate the overall channel score. Bind to the corresponding channel, write cache.
[0027] S34. Automatically calculate and comprehensively score update channels based on preset cache update frequency. And write it to the cache, for example, every minute, the system Recalculation This scoring ensures that the score reflects the channel status in real time.
[0028] In S32, the sample window and λ are coordinated and adjusted through a channel stability evaluation index, which consists of the channel stability coefficient. Decide; Channel stability coefficient The calculation steps include: S011. Read all weighted multidimensional operating metrics within the current sample window from the cache; S012. Perform fluctuation analysis on the read multi-dimensional operating indicators and calculate the variance of each indicator, such as the variance of success rate and the variance of delay. The larger the variance, the more drastic the fluctuation of the indicator. S013, Returning via preset algorithm The algorithm normalizes the variance of all indicators to obtain the channel stability coefficient. ; S014, Channel stability coefficient Bind to the corresponding channel and write to the cache for use by the sample window and Read and use during adjustment; The channel stability coefficient is recalculated based on a set time interval and adjusted according to the latest channel stability coefficient. .
[0029] The steps for calculating the sample window in S32 include: S021. Read the preset value of the sample window in the cache; Three sample windows are preset during the initialization phase. Standard values: 1h, 3h, 24h and written to the cache.
[0030] S022. Real-time reading of the channel stability coefficient stored in the cache. ; S023. Adjust the sample window value based on the channel stability coefficient and the preset value of the sample window; Specifically, if This indicates severe fluctuations, and shrinkage. The sample window focuses on recent data to accurately reflect sudden channel conditions; in the event of a sudden channel failure, the sample window will be adjusted from the default 3h to 1h. like This indicates moderate fluctuation, maintaining the sample window. =3h; like This indicates slight fluctuations and relative stability. Expanding the sample window takes into account both new and old data to avoid misjudgment. For example, the sample window can be adjusted to 24 hours. S024. Update the sample window values in the cache.
[0031] The calculation steps for the attenuation coefficient λ in S32 include: S031, Read the preset from the cache Base values and channel stability coefficients; Preset The base value can be 0.5; S032, Adjustment based on channel stability coefficient Numerical values, specifically: like This indicates severe fluctuations and requires adjustment. Increase the attenuation force, quickly reduce the weight of old data, focus on the latest data, and adapt to sudden channel failure scenarios; like This indicates moderate fluctuations and remains unchanged. Use the preset Base value; like This indicates slight fluctuations and requires adjustment. ,reduce The attenuation level should take into account both new and old data. S033, Adjusted The value is updated in the cache; The updated version will be used for subsequent updates. The formula calculates that the larger the value of λ, the better. The faster the weight decays of older data, the more priority is given to the latest data; the higher the value... The slower the decay, the better it takes into account both new and old data.
[0032] S32 The calculation steps include: S041. Read the current system time, target data, or time slice timestamp from the cache; The preset time slice standard is 10 minutes / time slice, and each sample window is divided into... Divided into if A continuous time slice, such as when the sample window = 1 hour, is divided into 6 10-minute time slices; And real-time data collection for each The raw data of each SMS message, such as the sending request, result, and time taken, is carried by each message. Timestamp, after collection is complete Immediately write In cache, for subsequent calculations. ; S042. Calculate according to the formula. The calculation formula is: = Current system time - Timestamp of target data / time slice; S043, calculate The numerical value is bound to the corresponding data or time slice and stored in the cache for later use. Formula calculations and indicator decay trend analysis can be used without repeated calculations. S32 , The calculation steps include: S051, Read from cache , The preset basic weight values, the weighted multidimensional operating indicators within the sample window, the indicator decay trend, and the current business identifier business type; Wherein, the basic weight value is set =0.4、 This is used as the initial weight standard and written into the cache; The indicator decay trend is calculated by the trend analyzer based on the weighted indicator; The current business type is the type corresponding to the business identifier read from the cache. Business types include... High-quality business, low-quality business; S052, Adaptive adjustment based on read data , The details are as follows: For high-priority services such as CAPTCHAs: reduce If adjusted to 0.2, increase If adjusted to 0.4, Maintain a latency of 0.4 to prioritize low latency. For low-priority services such as marketing SMS: Maintain 0.3, reduce If adjusted to 0.2, Increase it to 0.5, prioritizing cost control; For indicators showing a declining trend, such as a continued decrease in success rate: Adjust upwards. ,add The weight of success rate accounts for This guides the routing to select a more stable channel; S053, after adjustment , Write to cache for later use Scoring calculation makes .
[0033] S32 Its function is to correct The formula's attenuation rate compensates for the varying base attenuation coefficient across different channels and business scenarios. Adaptation issues This makes the time-weighted calculation more accurate, with a value range of 0.8-1.2, and a default value of 1.0 when no correction is applied. The calculation steps include: S061, Read the preset from the cache Numerical value; Among them, preset The default value is 1.0, which is written to the cache. S062. Adjust based on the channel stability coefficient read from the cache and the current service type. Numerical values, specifically: like This indicates a high-stability channel; adjustments are needed. ,reduce Attenuation rate correction To avoid over-correction leading to weight bias; like This indicates a high volatility channel, requiring adjustment. ,increase The attenuation rate correction allows the weight of old data to decay faster and more accurately reflect the real-time status of the channel. When optimizing business scenarios, adjust ,Enter To accelerate the decay rate, prioritize the latest data and ensure real-time business operations; In low-optimal business scenarios, adjust Rdecay=0.8 to slow down the decay rate, balance cost and efficiency, and reduce the computational pressure on the system.
[0034] S063, Adjustments will be made The numerical values are bound to the corresponding channels and service types, and written to the cache for later use. Formula calculation is used; S32 Used for smoothing multidimensional motion The indicator's fluctuations are filtered to remove instantaneous abnormal data, such as single extreme delays or occasional failures, to avoid misjudgments in indicator trend analysis. The value range is 0.1-0.3, with a default of 0.2. The larger the value, the stronger the smoothing effect. The calculation steps include: S071. Read the preset Tema value from the cache; The default value for Tema is 0.2. (Write) Caching, as a fundamental standard for trend smoothing S072. Dynamically adjust the Tema value based on the fluctuation range of the indicator within the sample window, specifically: When the indicator fluctuates drastically, such as when the success rate variance is greater than 0.1, adjust Tema=0.3 to enhance the smoothing effect and filter out transient abnormal data; When the indicator fluctuates smoothly, such as when the success rate variance is ≤0.05, adjust Tema=0.1 to reduce the smoothing effect and preserve the true trend of the indicator. S073. Based on the Tema value and the original multidimensional index data within the sample window, calculate the smoothed index using the following formula: Smoothed indicator = (1-Tema) × current indicator value + Tema × previous period indicator value; S074. Write the TEMA and smoothed indicators to the cache for subsequent use. , Calculation makes ; Furthermore, the Tema calculation is based on a preset time interval, combined with the latest indicator fluctuations, to readjust the Tema and update the cache. For example, the time interval can be set to 1 minute. S32 Used to determine whether the indicator is rising, falling, or stable, the value ranges from -1 to 1. Negative numbers indicate a downward trend, i.e., a decaying trend, while positive numbers indicate a downward trend. Indicators are rising, 0 indicates The calculation steps for a stable condition are as follows: S081. Read the smoothed multidimensional indicators from the cache within the sample, and simultaneously read the time slice data; Using time slices as the horizontal axis and smoothed index values as the vertical axis, the trend slope is calculated using a linear regression algorithm. , specific formula:
[0035] Where n is the number of time slices, ti is the timestamp value of the i-th time slice, and xi is the smoothed index value of the i-th time slice; S082, according to Numerical judgment of trends; This indicates a severe decline and a strong downward trend; This indicates a slight decline and a weak weakening trend; This indicates stability; Indicates an upward trend; S083, calculate The numerical values are bound to the corresponding channels and indicators and stored in the cache; S084. Based on a preset time interval, recalculate and update the cache using the latest smoothed indicators, for example, the preset time interval is 1 minute.
[0036] S32 Comprehensive score of the channel Penalties are imposed by deducting points, and the more severe the decline, the worse the penalty. The higher the penalty points, the more it forces routes to avoid inferior channels. The penalty ranges from 0 to 20 points, with 0 points for no decay trend and a maximum of 20 points for a severe decay trend. The calculation steps are as follows: S091, Read from cache and channel stability coefficient; S092, according to The combination of channel stability coefficients is used to classify penalty levels, corresponding to different... ; Severely decaying combinations exhibit severe volatility, i.e. and , The score is set to 15-20 points, for example, 20 points are used when a sudden channel failure occurs. Mildly decaying combinations exhibit moderate volatility. and , Value: 5-10 points; The slightly decaying combination exhibits slight fluctuations. and , Values range from 1 to 4. No decay trend , The score is 0. S093. Based on the above levels and considering the current decline in the channel's success rate, fine-tune the penalty score to ensure the penalty... The degree of attenuation closely matches the actual attenuation situation; S094, After calculation The numerical value is bound to the corresponding channel and written to the cache; S095, Based on a preset time interval, combined with the latest... And the channel stability coefficient, recalculate and update the cache. For example, the preset time interval is 1 minute; S4. Based on dynamic comprehensive scoring, each channel is managed in three states, including closed, circuit breaker, and half-open detection. Dynamic channel comprehensive scoring is used to determine the three states of a channel: closed, circuit broken, or half-open, and is also the core of route allocation. According to the criteria, the value range is 0-100 points, and 60 points is the circuit breaker threshold; The basis for the three-state management is: When a channel returns a clear underlying error, such as gateway offline, account arrears, or insufficient balance, the scoring model is bypassed and the channel is instantly put into an Open circuit breaker state. If the timeout error rate of a certain channel spikes above a set threshold within 1 second, a soft circuit breaker is triggered. After the circuit breaker period ends, the channel enters a half-open state. A small amount of real traffic, such as 1%, is used to probe for activity based on the token bucket algorithm. If the success rate of the probe is up to standard, the channel is restored to closed. Otherwise, the circuit breaker is rolled back and the circuit breaker time is exponentially reduced, such as 20 seconds or 40 seconds.
[0037] The threshold can be set to 30%, and the circuit breaker period can be set to 10 seconds.
[0038] S5. Based on the three-state management results, route the request to the appropriate SMS channel; S6. Monitor the overall message flow time. If there is insufficient remaining time budget, all SMS channels are circuit-broken, or the score is too low, immediately block the SMS flow and downgrade to TTS call by the voice gateway.
[0039] S61. The system assigns an absolute lifecycle to each verification code, for example, a total lifecycle. .
[0040] S62. Before each retry of the next SMS channel, the system calculates the time already consumed. .
[0041] S63, if the remaining time Time threshold; S64. The system determines that continuing to try SMS can no longer meet the best user experience, directly terminates the SMS retry loop, asynchronously calls the voice gateway to initiate TTS broadcast, and marks the reach medium transition in the database.
[0042] The time threshold can be set to 3000ms; Example 2: This application provides another SMS cross-channel adaptive circuit breaker routing method based on time decay scoring. Compared with Example 1, the caching adopts local caching and distributed caching. For local caching, deploy a local cache on each routing node to cache all current channels. Scoring, Sample Window In addition to the channel stability coefficient, and setting the cache expiration time TTL=10 minutes, this design maintains a consistent adjustment cycle with the parameters. This avoids frequent database queries and improves data retrieval efficiency.
[0043] Distributed caching such as Redis stores the historical calculation data and parameter adjustment records of all channels for the past 7 days as a local cache backup. It also supports data synchronization across multiple routing nodes to ensure that the parameter adjustment standards of all routing nodes are met. This is to avoid confusion in routing decisions.
[0044] Preferably, it can also be set to With two fewer redundant distributed cache nodes, when the primary node fails, it automatically switches to the backup node to ensure that cached data is not lost and to guarantee the reliability of the cache. Example 3: This application provides another SMS cross-channel adaptive circuit breaker routing method based on time decay scoring. Compared with Example 2, the processing threads for reading, processing and writing all data are divided into two, namely the main thread and the asynchronous thread. The main thread only reads from the local cache. The scoring system quickly makes cross-channel SMS routing decisions without participating in any complex calculations. To maximize the efficiency of routing decisions; Asynchronous threads handle complex computational tasks in the background, including channel stability coefficient calculation and sample window and λ coordination adjustment. Scoring recalculation, etc., to avoid complex calculations taking up time. Main thread resources.
[0045] Preferably, a concurrency threshold is set, such as 150,000 messages / second, to monitor the system's concurrency in real time and detect issues promptly. In concurrent scenarios, when the concurrency exceeds a threshold, Non-core functions such as automatic overload protection and data statistics during pause periods. Calculation, priority protection Score reading and routing decisions prevent system crashes; Once the concurrency drops below the threshold, the complete computation logic is restored to ensure the integrity of system functions.
[0046] Preferably, every 5 minutes, each routing node will cache the kernel locally. parameter λ and distributed caching Validation to ensure data integrity Consistency; if the verification reveals data discrepancies, Dynamically synchronize distributed cache data to ensure all routing node parameters are correct. To avoid different routing decision criteria at different nodes; In addition, a write-after-read verification mechanism is adopted, which immediately performs a verification read after each data is written to the cache to ensure data integrity. Accuracy is crucial to avoid misjudgments in routing due to data errors.
[0047] This application provides a cross-channel adaptive circuit breaker routing system for SMS based on time decay scoring to implement the above method. The system includes: The request feature extraction module is used to receive business requests and allocate a globally unique TraceID and a lifecycle time budget, such as 8 seconds.
[0048] The dynamic health baseline is based on in-memory time-series data structures such as Redis. It collects the success rate, time consumption, and error codes of each channel in real time and introduces a time decay factor to aggregate the indicators.
[0049] The adaptive weight scoring engine includes a trend analyzer and a weight adaptive adjuster. It generates a dynamic comprehensive score for channels based on multi-dimensional operating indicators of the channels, indicator decay trends, and different business types, such as the time consumption for CAPTCHA optimization and the price for marketing optimization.
[0050] The intelligent fuse and liveness detection module implements three-state management for each channel: Closed, Open, and Half-Open.
[0051] The time budget-aware voice fallback module monitors the overall message flow time. If the remaining time budget is insufficient, or all SMS channels are circuit-broken / score too low, the SMS flow is immediately blocked, and the call is downgraded to a TTS call via the voice gateway.
[0052] Although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.
Claims
1. A cross-channel adaptive circuit breaker routing method for SMS based on time decay scoring, characterized in that: include: S1. Receive business requests and allocate globally unique TraceIDs and lifecycle time budgets; S2. Real-time sliding acquisition of success rate, time consumption and error code of each channel, and introduction of time decay factor for index aggregation; S3. Calculate and generate a dynamic channel comprehensive score based on multi-dimensional operational indicators of the channel, indicator decay trends, and different business types. S4. Implement three-state management for each channel based on dynamic comprehensive scoring. The three states include closed, fuse-off, and half-open detection. S5. Based on the three-state management results, route the request to the appropriate SMS channel; S6. Monitor the overall message flow time. If any of the following occurs: insufficient remaining time budget, circuit breaking of all SMS channels, or excessively low score, immediately block SMS flow and downgrade to TTS call via voice gateway.
2. The SMS cross-channel adaptive circuit breaker routing method based on time decay scoring according to claim 1, characterized in that: The formula for calculating the comprehensive score of the channel is as follows: ; The To improve the time decay success rate, an exponential decay is introduced for the request results within the sample window. , For the time difference, The attenuation coefficient; The For the trend penalty term, take the first derivative of the success rate over the past N consecutive time slices. If the derivative is positive, no trend penalty is applied; if the derivative is negative, a trend penalty is applied through the penalty coefficient α. The Weighted by success rate, As time weight, Cost weighting; The for , This represents the slope of the indicator trend.
3. The SMS cross-channel adaptive circuit breaker routing method based on time decay scoring according to claim 2, characterized in that: The sample window and The stability evaluation index is determined by the channel stability coefficient and is adjusted collaboratively through channel stability evaluation indexes. The calculation steps for the channel stability coefficient include: Read all weighted multidimensional performance metrics within the current sample window from the cache; Perform fluctuation analysis on the read multidimensional indicators and calculate the variance of each indicator; By using a preset algorithm, the variance of all indicators is normalized to obtain the channel stability coefficient. Bind the channel stability coefficient to the corresponding channel and write it into the cache; The sample window and Based on the preset sample window and In addition, the channel stability coefficient is adjusted in a coordinated manner, and the adjusted sample window and Write to the cache; The channel stability coefficient is recalculated based on a set time interval and adjusted according to the latest channel stability coefficient. .
4. The SMS cross-channel adaptive circuit breaker routing method based on time decay scoring according to claim 3, characterized in that: The weighted multidimensional operational metrics include success rate metrics, time consumption metrics, and cost metrics, which are derived from... The weighted calculation is obtained and stored in the cache in advance; The weighted multidimensional operating index = original index value × × ; The The scores are automatically recalculated and the cache is updated at preset intervals.
5. The SMS cross-channel adaptive circuit breaker routing method based on time decay scoring according to any one of claims 4, characterized in that: The , based on , The preset base weight values, weighted multidimensional operating indicators within the sample window, indicator decay trends, and current business identifiers and business types are adaptively adjusted, and the adjusted values are further adjusted accordingly. , Write to cache; The Based on preset The numerical values, channel stability coefficients, and current business type adaptability adjustments will be made, and the adjustments will be... The values are stored in the cache.
6. The SMS cross-channel adaptive circuit breaker routing method based on time decay scoring according to claim 5, characterized in that: The Based on preset The numerical values and the fluctuation range of the indicators within the sample window are dynamically adjusted, and based on... The smoothed index is calculated numerically and then written into the cache. The formula for calculating the smoothed index is as follows: Smoothed indicator = (1-Tema) × current indicator value + Tema × previous period indicator value; The system readjusts based on a preset time interval and the latest indicator fluctuations. And update the cache; The The calculation is performed based on the smoothed multidimensional values and the read time slice data, and the calculated values are... Write it to the cache.
7. The SMS cross-channel adaptive circuit breaker routing method based on time decay scoring according to claim 6, characterized in that: The cache employs both local and distributed caching, with the local cache used to cache all current channels. Scoring, Sample Window and channel stability coefficient; The distributed cache stores historical calculation data and parameter adjustment records for all channels over the past 7 days. The local cache at the same time Supports data synchronization across multiple routing nodes.
8. The SMS cross-channel adaptive circuit breaker routing method based on time decay scoring according to claim 7, characterized in that: All data reading, processing, and writing are accomplished through a combination of the main thread and asynchronous threads. The main thread only reads from the local cache. Scoring allows for quick decision-making on cross-channel SMS routing. The asynchronous thread processes complex computational tasks in the background, including channel stability coefficient calculation, sample window and λ coordinated adjustment, The score has been recalculated.
9. The SMS cross-channel adaptive circuit breaker routing method based on time decay scoring according to any one of claims 1-8, characterized in that: The basis for the three-state management in S4 is as follows: When a channel returns a clear underlying error, bypass the scoring model and instantly put the channel into a circuit breaker state; If the timeout error rate of a certain channel spikes above a set threshold within 1 second, a soft circuit breaker is triggered. After the circuit breaker period ends, the channel enters a half-open state and uses a small amount of real traffic based on the token bucket algorithm to probe for activity. If the success rate of the probe is up to standard, the channel is restored to closed; otherwise, the circuit breaker is rolled back and the circuit breaker time is exponentially reduced.
10. The SMS cross-channel adaptive circuit breaker routing method based on time decay scoring according to claim 9, characterized in that: The allocation of a suitable SMS channel in S5 includes at least one SMS channel retrieval. Before each retry of the next SMS channel, the system calculates the time already consumed. The TTS call is determined by calculating the remaining time and a preset time threshold, where the remaining time = lifecycle time budget - time already consumed; If the remaining time is less than the preset time threshold, the SMS retry loop is terminated directly, the voice gateway is asynchronously called to initiate TTS broadcast, and the reach medium transition is marked in the database.