Dynamic, fault and self-healing gateway switching method, system, equipment and medium
Through real-time monitoring and dynamic gateway switching, combined with multi-attribute decision algorithm, the problems of gateway failure, performance fluctuations and high costs in the SMS platform are solved, which improves the sending success rate and reduces costs, and realizes the stability and continuity of SMS services. .
Patent Information
- Application Number
- CN202410955382.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-11-19
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When sending SMS messages, the fixed gateway method is likely to cause gateway failures, performance fluctuations and high costs, and cannot respond to gateway performance changes in real time, resulting in an increase in sending failure rate and unoptimized cost.
By monitoring the performance data of each gateway in real time, dynamically switching the optimal gateway, using a multi-attribute decision algorithm to comprehensively consider the sending success rate, response time and expenses, automatically perform gateway switching to ensure the continuity and cost optimization of SMS services.
It significantly improves the success rate of SMS sending, reduces the cost of SMS sending, realizes automated fault handling and service continuity, optimizes gateway selection, and solves the problems of low SMS sending success rate, high cost and untimely fault handling in the existing technology. .
Smart Images

Figure CN118984475A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing and communication technology, and in particular to a dynamic, fault and self-healing gateway switching method, system, device and medium. Background Art
[0002] Currently, when sending text messages, SMS platforms usually use fixed SMS gateways to transmit information.
[0003] However, the existing fixed gateway method has the following problems:
[0004] ① Gateway failure: When the selected gateway fails, all SMS messages sent through the gateway will fail, affecting the user experience.
[0005] ②Performance fluctuation: The performance of different gateways may fluctuate at different times. Fixed selection of a certain gateway may lead to an increase in the sending failure rate.
[0006] ③ Cost is not optimized: Different gateways have different fee structures. Fixedly selecting a certain gateway may result in high SMS sending fees.
[0007] Some existing solutions include manual switching of gateways or simple gateway polling strategies, but these methods cannot respond to changes in gateway performance in real time and cannot implement the optimal sending strategy.
[0008] Therefore, how to improve the success rate of SMS sending, reduce SMS costs, and ensure the continuity of SMS services is a technical problem that needs to be solved urgently. Summary of the invention
[0009] The technical task of the present invention is to provide a dynamic, fault-tolerant and self-healing gateway switching method, system, device and medium to solve the problem of how to improve the success rate of SMS sending, reduce SMS costs and ensure the continuity of SMS services.
[0010] The technical task of the present invention is achieved in the following way: a dynamic, fault-tolerant and self-healing gateway switching method, which is specifically as follows:
[0011] Real-time monitoring of the performance data of each gateway; the performance data of the gateway includes the sending success rate, response time and cost;
[0012] Dynamic switching: Based on monitoring data and preset strategies, dynamically select the optimal SMS gateway for switching;
[0013] Gateway switching: Automatically switch gateways based on dynamic switching strategies to ensure that SMS messages are sent through the optimal gateway;
[0014] Fault detection: monitor the working status of each gateway in real time and generate warning information when a fault is detected;
[0015] Early warning processing: Receive early warning information of fault detection and respond according to the preset processing strategy, including switching to the backup gateway or notifying the operation and maintenance personnel;
[0016] Self-healing mechanism: After detecting a gateway failure, the gateway switching operation is automatically triggered to switch to a gateway with normal performance as a backup to ensure uninterrupted SMS service.
[0017] As a preferred method, the performance data of each gateway is monitored in real time as follows:
[0018] Data collection: Obtain performance data from each gateway through the application programming interface (API interface);
[0019] Data storage: The collected gateway performance data is stored in the performance database for subsequent analysis and decision-making;
[0020] Real-time monitoring: Analyze data in real time to detect changes in gateway performance;
[0021] Dynamic switching uses a multi-attribute decision-making algorithm to make decisions, comprehensively considering the sending success rate, response time and cost, and selects the current optimal gateway; the details are as follows:
[0022] Strategy setting: preset strategies for different business needs. The strategies for business needs give priority to gateways with high success rates or low costs.
[0023] Data analysis: extract data from the gateway performance database and conduct comprehensive evaluation;
[0024] A multi-attribute decision-making algorithm is used to make decisions. Specifically, each attribute is assigned a weight through weighted scoring, each gateway is scored, and finally a comprehensive score is calculated. The attributes include the sending success rate, response time, and cost. The weights are assigned according to the attributes of different business scenarios.
[0025] As a preferred embodiment, the gateway switching is specifically as follows:
[0026] Query operation: query the most suitable gateway according to the SMS service type;
[0027] Switch execution: according to the query results, switch to the optimal gateway and execute the SMS sending operation;
[0028] Fault detection is to monitor the response status of the gateway and trigger a fault warning when multiple consecutive abnormal responses are detected; the details are as follows:
[0029] Regularly monitor the response status of the gateway: send HTTP requests to the gateway regularly (for example, every minute) and record the response status code and response time;
[0030] Set abnormal response standards: Set the relevant parameters and thresholds for abnormal responses. The relevant parameters and thresholds for abnormal responses include the response status code is not in the 2xx series, or the response time exceeds the threshold;
[0031] Record the number of consecutive exceptions: Use a counter to record the number of consecutive abnormal responses;
[0032] Trigger fault warning: If the number of consecutive abnormalities exceeds the preset threshold, a fault warning notification is triggered;
[0033] Restore to normal state: If the response is found to be normal in one test, reset the continuous abnormality counter.
[0034] Preferably, the warning processing is as follows:
[0035] Receive warnings: process warning information from fault detection;
[0036] Backup gateway query: query the backup gateway list;
[0037] Switching execution: Select a backup gateway with normal performance for switching;
[0038] The self-healing mechanism is as follows:
[0039] Fault response: Automatically switch to the backup gateway after detecting a fault;
[0040] Operation log: Record the switching operation log for subsequent analysis.
[0041] A dynamic, fault and self-healing gateway switching system, the system comprising a dynamic gateway switching subsystem and a fault warning and self-healing gateway switching subsystem;
[0042] Among them, the dynamic gateway switching subsystem includes:
[0043] The gateway performance monitoring module is used to monitor the performance data of each gateway in real time; the performance data of the gateway includes the sending success rate, response time and cost;
[0044] Dynamic switching strategy module, used to dynamically select the best SMS gateway for switching based on monitoring data and preset strategies;
[0045] The gateway switching execution module is used to automatically execute gateway switching according to the dynamic switching strategy to ensure that SMS messages are sent through the optimal gateway;
[0046] The fault warning and self-healing gateway switching subsystem includes:
[0047] Fault detection module, used to monitor the working status of each gateway in real time and generate warning information when a fault is detected;
[0048] The warning processing module is used to receive warning information of fault detection and respond according to the preset processing strategy, including switching to the backup gateway or notifying the operation and maintenance personnel;
[0049] The self-healing mechanism module is used to automatically trigger the gateway switching operation after detecting a gateway failure, switching to a gateway with normal performance as a backup to ensure uninterrupted SMS services.
[0050] Preferably, the gateway performance monitoring module includes:
[0051] The data collection submodule is used to obtain performance data from each gateway through the application program interface (API interface);
[0052] The data storage submodule is used to store the collected gateway performance data in the performance database for subsequent analysis and decision-making;
[0053] The real-time monitoring submodule is used to analyze data in real time to detect changes in gateway performance;
[0054] The dynamic switching strategy module uses a multi-attribute decision-making algorithm to make decisions, comprehensively consider the sending success rate, response time and cost, and select the current optimal gateway; the dynamic switching strategy module includes:
[0055] The strategy setting submodule is used to preset strategies for different business requirements. The strategies for business requirements give priority to gateways with high success rates or low costs.
[0056] The data analysis submodule is used to extract data from the gateway performance database and conduct comprehensive evaluation;
[0057] The decision submodule is used to make decisions using a multi-attribute decision algorithm. Specifically, each attribute is assigned a weight through weighted scoring, each gateway is scored, and finally a comprehensive score is calculated. The attributes include the sending success rate, response time, and cost. The weights are assigned according to the attributes of different business scenarios.
[0058] Preferably, the gateway switching execution module includes:
[0059] The query submodule is used to query the most suitable gateway according to the SMS service type;
[0060] The switching execution submodule is used to switch to the optimal gateway and execute the SMS sending operation according to the query results;
[0061] The fault detection module monitors the response status of the gateway and triggers a fault warning when multiple consecutive abnormal responses are detected; the fault detection module includes:
[0062] The gateway response status periodic monitoring submodule is used to send HTTP requests to the gateway regularly (for example, every minute) and record the response status code and response time;
[0063] The abnormal response standard setting submodule is used to set the relevant parameters and thresholds of the abnormal response. The relevant parameters and thresholds of the abnormal response include that the response status code is not in the 2xx series, or the response time exceeds the threshold;
[0064] A continuous exception number recording submodule is used to record the number of continuous abnormal responses using a counter;
[0065] Fault warning trigger submodule, used to trigger fault warning notification when the number of consecutive abnormalities exceeds a preset threshold;
[0066] The normal state recovery submodule is used to reset the continuous abnormality counter when a normal response is found in a detection.
[0067] Preferably, the early warning processing module includes:
[0068] The early warning receiving submodule is used to process the early warning information from the fault detection;
[0069] The backup gateway query submodule is used to query the backup gateway list;
[0070] The switching execution submodule is used to select a backup gateway with normal performance for switching;
[0071] The self-healing mechanism modules include:
[0072] A fault response submodule is used to automatically switch to a backup gateway after a fault is detected;
[0073] The operation log module is used to record the switching operation log for subsequent analysis.
[0074] An electronic device comprising: a memory and at least one processor;
[0075] Wherein, the memory stores a computer program;
[0076] The at least one processor executes the computer program stored in the memory, so that the at least one processor performs the dynamic, fault and self-healing gateway switching method as described above.
[0077] A computer-readable storage medium stores a computer program, which can be executed by a processor to implement the dynamic, fault-tolerant and self-healing gateway switching method as described above.
[0078] The dynamic, fault and self-healing gateway switching method, system, device and medium of the present invention have the following advantages:
[0079] (i) The present invention uses a gateway performance monitoring module to collect and analyze the sending success rate, response time and cost data of each gateway in real time, and dynamically selects the best SMS gateway for switching. Through a priority algorithm and comprehensive evaluation, it ensures that the gateway with the best current performance is selected before each sending, which significantly improves the sending success rate of SMS, reduces the sending failures caused by gateway performance fluctuations, and improves the sending success rate of SMS;
[0080] (ii) The present invention uses a dynamic switching strategy module to automatically select the gateway with the best cost for SMS sending based on real-time cost and performance information. By presetting strategies for different business needs and comprehensively considering factors such as sending success rate, response time and cost, the gateway selection is dynamically optimized, which greatly reduces the cost of SMS sending and optimizes the sending cost;
[0081] (III) The present invention monitors the working status of each gateway in real time through the fault detection module and the early warning processing module. When a fault is detected, it automatically generates early warning information and executes response measures. Through the self-healing mechanism module, it automatically triggers the gateway switching operation to switch to a backup gateway with normal performance. The automated fault handling ensures the continuity and stability of the SMS service. By recording the switching operation log, it provides the traceability of the fault handling and the basis for subsequent analysis.
[0082] (IV) The present invention solves the problems of low SMS sending success rate, high sending cost and untimely fault handling in the prior art by providing an efficient dynamic gateway switching system and a reliable fault warning and self-healing mechanism, thereby achieving the technical effects of improving the SMS sending success rate, optimizing the sending cost and automating fault handling. BRIEF DESCRIPTION OF THE DRAWINGS
[0083] The present invention is further described below in conjunction with the accompanying drawings.
[0084] Attached Figure 1 It is a structural diagram of the dynamic gateway switching subsystem;
[0085] Attached Figure 2 This is a structural diagram of the fault warning and self-healing gateway switching subsystem. DETAILED DESCRIPTION
[0086] The dynamic, fault and self-healing gateway switching method, system, device and medium of the present invention are described in detail below with reference to the accompanying drawings and specific embodiments of the specification.
[0087] Embodiment 1:
[0088] This embodiment provides a dynamic, fault-tolerant and self-healing gateway switching method, which is specifically as follows:
[0089] S1. Real-time monitoring of the performance data of each gateway; wherein the performance data of the gateway includes the sending success rate, response time and cost;
[0090] S2, Dynamic Switching: Based on monitoring data and preset strategies, dynamically select the optimal SMS gateway for switching;
[0091] S3, Gateway switching: Automatically switch gateways according to dynamic switching strategies to ensure that SMS messages are sent through the optimal gateway;
[0092] S4, Fault detection: monitor the working status of each gateway in real time and generate warning information when a fault is detected;
[0093] S5, early warning processing: receiving early warning information of fault detection and responding according to the preset processing strategy, including switching to the backup gateway or notifying the operation and maintenance personnel;
[0094] S6, Self-healing mechanism: After detecting a gateway failure, the gateway switching operation is automatically triggered to switch to a gateway with normal performance as a backup to ensure that the SMS service is not interrupted.
[0095] The performance data of each gateway monitored in real time in step S1 of this embodiment is specifically as follows:
[0096] S101, data collection: obtaining performance data from each gateway through an application programming interface (API interface);
[0097] S102, data storage: storing the collected gateway performance data in a performance database for subsequent analysis and decision-making;
[0098] S103, real-time monitoring: performing real-time analysis on data to detect changes in gateway performance.
[0099] The dynamic switching in step S2 of this embodiment adopts a multi-attribute decision-making algorithm to make a decision, comprehensively considering the sending success rate, response time and cost, and selecting the current optimal gateway; the details are as follows:
[0100] S201, strategy setting: preset strategies for different business requirements, and the strategies for business requirements give priority to gateways with high success rates or low costs;
[0101] S202, data analysis: extracting data from the gateway performance database and conducting a comprehensive evaluation;
[0102] S203. Use a multi-attribute decision-making algorithm to make a decision, specifically: assign a weight to each attribute through weighted scoring, then score each gateway, and finally calculate the comprehensive score; wherein the attributes include the sending success rate, response time and cost; and the weights are assigned different weights according to the attributes of different business scenarios.
[0103] The gateway switching in step S3 of this embodiment is specifically as follows:
[0104] S301, query operation: query the most suitable gateway according to the SMS service type;
[0105] S302, switch execution: according to the query result, switch to the optimal gateway and execute the SMS sending operation.
[0106] The fault detection in step S4 of this embodiment is to monitor the response status of the gateway and trigger a fault warning when multiple consecutive abnormal responses are detected; the details are as follows:
[0107] S401, regularly monitor the response status of the gateway: regularly (for example, every minute) send HTTP requests to the gateway, and record the response status code and response time;
[0108] S401, setting abnormal response standards: setting relevant parameters and thresholds for abnormal responses, wherein the relevant parameters and thresholds for abnormal responses include that the response status code is not in the 2xx series, or the response time exceeds the threshold;
[0109] S403, record the number of consecutive exceptions: use a counter to record the number of consecutive abnormal responses;
[0110] S404, triggering fault warning: if the number of consecutive abnormalities exceeds a preset threshold, a fault warning notification is triggered;
[0111] S405, restore to normal state: if the response is found to be normal in one detection, reset the continuous abnormality times counter.
[0112] The warning processing in step S5 of this embodiment is specifically as follows:
[0113] S501, receiving warning: processing warning information from fault detection;
[0114] S502, backup gateway query: query the backup gateway list;
[0115] S503, switch execution: select a standby gateway with normal performance for switch.
[0116] The self-healing mechanism in step S6 of this embodiment is specifically as follows:
[0117] S601, fault response: automatically switch to the backup gateway after detecting a fault;
[0118] S602, operation log: record the switching operation log for subsequent analysis.
[0119] Embodiment 2:
[0120] This embodiment provides a dynamic, fault and self-healing gateway switching system, which includes a dynamic gateway switching subsystem and a fault warning and self-healing gateway switching subsystem;
[0121] Among them, as attached Figure 1 As shown, the dynamic gateway switching subsystem includes:
[0122] The gateway performance monitoring module is used to monitor the performance data of each gateway in real time; the performance data of the gateway includes the sending success rate, response time and cost;
[0123] Dynamic switching strategy module, used to dynamically select the best SMS gateway for switching based on monitoring data and preset strategies;
[0124] The gateway switching execution module is used to automatically execute gateway switching according to the dynamic switching strategy to ensure that SMS messages are sent through the optimal gateway;
[0125] As attached Figure 2 As shown, the fault warning and self-healing gateway switching subsystem includes:
[0126] Fault detection module, used to monitor the working status of each gateway in real time and generate warning information when a fault is detected;
[0127] The warning processing module is used to receive warning information of fault detection and respond according to the preset processing strategy, including switching to the backup gateway or notifying the operation and maintenance personnel;
[0128] The self-healing mechanism module is used to automatically trigger the gateway switching operation after detecting a gateway failure, switching to a gateway with normal performance as a backup to ensure uninterrupted SMS services.
[0129] The gateway performance monitoring module in this embodiment includes:
[0130] The data collection submodule is used to obtain performance data from each gateway through the application program interface (API interface);
[0131] The data storage submodule is used to store the collected gateway performance data in the performance database for subsequent analysis and decision-making;
[0132] The real-time monitoring submodule is used to analyze data in real time to detect changes in gateway performance.
[0133] The dynamic switching strategy module in this embodiment adopts a multi-attribute decision-making algorithm to make decisions, comprehensively considers the sending success rate, response time and cost, and selects the current optimal gateway; the dynamic switching strategy module includes:
[0134] The strategy setting submodule is used to preset strategies for different business requirements. The strategies for business requirements give priority to gateways with high success rates or low costs.
[0135] The data analysis submodule is used to extract data from the gateway performance database and conduct comprehensive evaluation;
[0136] The decision submodule is used to make decisions using a multi-attribute decision algorithm. Specifically, each attribute is assigned a weight through weighted scoring, each gateway is scored, and finally a comprehensive score is calculated. The attributes include the sending success rate, response time, and cost. The weights are assigned according to the attributes of different business scenarios.
[0137] The gateway switching execution module in this embodiment includes:
[0138] The query submodule is used to query the most suitable gateway according to the SMS service type;
[0139] The switching execution submodule is used to switch to the optimal gateway and execute the SMS sending operation according to the query results.
[0140] The fault detection module in this embodiment monitors the response status of the gateway and triggers a fault warning when multiple consecutive abnormal responses are detected; the fault detection module includes:
[0141] The gateway response status periodic monitoring submodule is used to send HTTP requests to the gateway regularly (for example, every minute) and record the response status code and response time;
[0142] The abnormal response standard setting submodule is used to set the relevant parameters and thresholds of the abnormal response. The relevant parameters and thresholds of the abnormal response include that the response status code is not in the 2xx series, or the response time exceeds the threshold;
[0143] A continuous exception number recording submodule is used to record the number of continuous abnormal responses using a counter;
[0144] Fault warning trigger submodule, used to trigger fault warning notification when the number of consecutive abnormalities exceeds a preset threshold;
[0145] The normal state recovery submodule is used to reset the continuous abnormality counter when a normal response is found in a detection.
[0146] The early warning processing module in this embodiment includes:
[0147] The early warning receiving submodule is used to process the early warning information from the fault detection;
[0148] The backup gateway query submodule is used to query the backup gateway list;
[0149] The switching execution submodule is used to select a backup gateway with normal performance for switching.
[0150] The self-healing mechanism module in this embodiment includes:
[0151] A fault response submodule is used to automatically switch to a backup gateway after a fault is detected;
[0152] The operation log module is used to record the switching operation log for subsequent analysis.
[0153] Embodiment 3:
[0154] The marketing management system of a certain brand of wine needs to send various types of SMS to users, including statistical SMS of daily product delivery, sales data, etc., warning SMS of abnormal data, SMS verification code and marketing activity SMS. In order to ensure high SMS sending success rate, low sending cost and service continuity, the system of the present invention is applied to the following specific scenarios:
[0155] Scenario 1: Statistical SMS of daily product delivery, sales and other data. The implementation steps are as follows:
[0156] (1) Data collection: The system collects statistical data on product placement and sales every day.
[0157] (2) Gateway performance monitoring: The gateway performance monitoring module monitors the performance of multiple SMS gateways in real time, including data such as sending success rate, response time, and cost.
[0158] (3) Dynamic switching strategy: The dynamic switching strategy module uses the SMS gateway with the best cost based on the gateway performance data of the day, because the statistics of SMS do not require real-time performance. Assuming that gateway A has a high success rate but a high cost, and gateway B has a low cost but a slightly longer response time, the system will select gateway B for sending after comprehensive evaluation.
[0159] (4) Gateway switching execution: When sending a statistical SMS, the gateway switching execution module queries the gateway with the lowest current cost and sends the SMS through gateway B.
[0160] Technical effect: By selecting the gateway with the best performance, a high success rate and reasonable cost for SMS statistics can be ensured.
[0161] Scenario 2: Warning SMS for data anomalies. The implementation steps are as follows:
[0162] (1) Anomaly detection: The system monitors data in real time and generates warning information when an abnormal situation is detected (such as an abnormal surge or decrease in sales data).
[0163] (2) Fault detection and warning: The fault detection module monitors the gateway status. If the current gateway fails (such as abnormal response), the system generates a fault warning.
[0164] (3) Warning processing: The warning processing module receives the fault warning information, immediately queries the backup gateway list, and selects a backup gateway with normal performance. For example, if the currently used gateway A fails, the system automatically switches to backup gateway B.
[0165] (4) Self-healing mechanism: The self-healing mechanism module records the switching operation log to ensure the traceability of the fault handling process.
[0166] Technical effect: Under abnormal circumstances, the system can respond quickly and automatically switch to the backup gateway to ensure that warning text messages are sent in time, ensuring data security and system stability.
[0167] Scenario 3: SMS verification code is sent. The implementation steps are as follows:
[0168] (1) User request: The user requests a text message verification code for identity authentication in a certain platform’s wine marketing management system.
[0169] (2) Gateway performance monitoring: The system monitors the performance data of each gateway in real time.
[0170] (3) Dynamic switching strategy: According to the current gateway's sending success rate and response time, select the gateway with the fastest response. For example, gateway C has an advantage in response time, and the system selects gateway C to send the verification code.
[0171] (4) Gateway switching execution: Query the current optimal gateway before sending, and send the SMS verification code through gateway C.
[0172] Technical effect: By selecting the gateway with the shortest response time, it ensures that the SMS verification code can reach the user quickly, improving the user experience.
[0173] Scenario 4: Marketing campaign SMS, the implementation steps are as follows:
[0174] (1) Activity launch: A brand of wine marketing management system launches a new marketing campaign and needs to send activity text messages to a large number of users.
[0175] (2) Gateway performance monitoring: The system monitors the sending success rate and cost of each gateway.
[0176] (3) Dynamic switching strategy: To reduce marketing costs, the system gives priority to gateways with low costs and high success rates. For example, gateway D performs well in terms of cost and success rate, so the system chooses gateway D to send campaign SMS.
[0177] (4) Gateway switching execution: Query the current optimal gateway before sending, and send the SMS through gateway D.
[0178] Technical effect: In the case of large-scale sending, by selecting a low-cost and stable gateway, the sending cost of marketing activities can be reduced, ensuring that the activity information can reach users smoothly.
[0179] Embodiment 4:
[0180] This embodiment also provides an electronic device, including: a memory and a processor;
[0181] Wherein, the memory stores computer-executable instructions;
[0182] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the dynamic, fault-tolerant and self-healing gateway switching method in any embodiment of the present invention.
[0183] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor may be a microprocessor or any conventional processor, etc.
[0184] The memory can be used to store computer programs and / or modules. The processor realizes various functions of the electronic device by running or executing the computer programs and / or modules stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created according to the use of the terminal, etc. In addition, the memory can also include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (SMC), a secure digital (SD) card, a flash memory card, at least one disk storage period, a flash memory device, or other volatile solid-state storage devices.
[0185] Embodiment 5:
[0186] This embodiment also provides a computer-readable storage medium, which stores a plurality of instructions, which are loaded by a processor to enable the processor to execute the dynamic, fault and self-healing gateway switching method in any embodiment of the present invention. Specifically, a system or device equipped with a storage medium can be provided, on which a software program code that implements the functions of any of the above embodiments is stored, and a computer (or CPU or MPU) of the system or device reads and executes the program code stored in the storage medium.
[0187] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.
[0188] The storage medium embodiments for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RYM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer via a communication network.
[0189] In addition, it should be clear that the functions of any of the above embodiments can be implemented not only by executing the program code read by the computer, but also by enabling an operating system operating on the computer to complete part or all of the actual operations based on instructions from the program code.
[0190] In addition, it can be understood that the program code read from the storage medium is written to a memory provided in an expansion board inserted into the computer or written to a memory provided in an expansion unit connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or the expansion unit is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above-mentioned embodiments.
[0191] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A dynamic, fault-tolerant and self-healing gateway switching method, characterized in that: The method is as follows: Real-time monitoring of the performance data of each gateway; the performance data of the gateway includes the sending success rate, response time and cost; Dynamic switching: Based on monitoring data and preset strategies, dynamically select the optimal SMS gateway for switching; Gateway switching: Automatically switch gateways based on dynamic switching strategies to ensure that SMS messages are sent through the optimal gateway; Fault detection: monitor the working status of each gateway in real time and generate warning information when a fault is detected; Early warning processing: Receive early warning information of fault detection and respond according to the preset processing strategy, including switching to the backup gateway or notifying the operation and maintenance personnel; Self-healing mechanism: After detecting a gateway failure, the gateway switching operation is automatically triggered to switch to a gateway with normal performance as a backup to ensure uninterrupted SMS service.
2. The dynamic, fault-tolerant and self-healing gateway switching method according to claim 1, characterized in that: The performance data of each gateway monitored in real time are as follows: Data collection: Obtain performance data from each gateway through the application program interface; Data storage: The collected gateway performance data is stored in the performance database for subsequent analysis and decision-making; Real-time monitoring: Analyze data in real time to detect changes in gateway performance; Dynamic switching uses a multi-attribute decision-making algorithm to make decisions, comprehensively considering the sending success rate, response time and cost, and selects the current optimal gateway; the details are as follows: Strategy setting: preset strategies for different business needs. The strategies for business needs give priority to gateways with high success rates or low costs. Data analysis: extract data from the gateway performance database and conduct comprehensive evaluation; The decision is made using a multi-attribute decision-making algorithm, which is as follows: each attribute is assigned a weight through weighted scoring, each gateway is scored, and finally a comprehensive score is calculated; the attributes include the sending success rate, response time, and cost; Weights are assigned according to the attributes of different business scenarios.
3. The dynamic, fault-tolerant and self-healing gateway switching method according to claim 1, characterized in that: The gateway switching is as follows: Query operation: query the most suitable gateway according to the SMS service type; Switch execution: according to the query results, switch to the optimal gateway and execute the SMS sending operation; Fault detection is to monitor the response status of the gateway and trigger a fault warning when multiple consecutive abnormal responses are detected; the details are as follows: Regularly monitor the gateway response status: regularly send HTTP requests to the gateway and record the response status code and response time; Set abnormal response standards: Set the relevant parameters and thresholds for abnormal responses. The relevant parameters and thresholds for abnormal responses include the response status code is not in the 2xx series, or the response time exceeds the threshold; Record the number of consecutive exceptions: Use a counter to record the number of consecutive abnormal responses; Trigger fault warning: If the number of consecutive abnormalities exceeds the preset threshold, a fault warning notification is triggered; Restore to normal state: If the response is found to be normal in one test, reset the continuous abnormality counter.
4. The method for dynamic, fault and self-healing gateway switching according to any one of claims 1 to 3, characterized in that: The specific warning processing is as follows: Receive warnings: process warning information from fault detection; Backup gateway query: query the backup gateway list; Switching execution: Select a backup gateway with normal performance for switching; The self-healing mechanism is as follows: Fault response: Automatically switch to the backup gateway after detecting a fault; Operation log: Record the switching operation log for subsequent analysis.
5. A dynamic, fault-tolerant and self-healing gateway switching system, characterized in that: The system includes a dynamic gateway switching subsystem and a fault warning and self-healing gateway switching subsystem; Among them, the dynamic gateway switching subsystem includes: The gateway performance monitoring module is used to monitor the performance data of each gateway in real time; the performance data of the gateway includes the sending success rate, response time and cost; Dynamic switching strategy module, used to dynamically select the best SMS gateway for switching based on monitoring data and preset strategies; The gateway switching execution module is used to automatically execute gateway switching according to the dynamic switching strategy to ensure that SMS messages are sent through the optimal gateway; The fault warning and self-healing gateway switching subsystem includes: Fault detection module, used to monitor the working status of each gateway in real time and generate warning information when a fault is detected; The warning processing module is used to receive warning information of fault detection and respond according to the preset processing strategy, including switching to the backup gateway or notifying the operation and maintenance personnel; The self-healing mechanism module is used to automatically trigger the gateway switching operation after detecting a gateway failure, switching to a gateway with normal performance as a backup to ensure uninterrupted SMS services.
6. The dynamic, fault-tolerant and self-healing gateway switching system according to claim 5, characterized in that: The gateway performance monitoring module includes: The data collection submodule is used to obtain performance data from each gateway through the application program interface; The data storage submodule is used to store the collected gateway performance data in the performance database for subsequent analysis and decision-making; The real-time monitoring submodule is used to analyze data in real time to detect changes in gateway performance; The dynamic switching strategy module uses a multi-attribute decision-making algorithm to make decisions, comprehensively consider the sending success rate, response time and cost, and select the current optimal gateway; the dynamic switching strategy module includes: The strategy setting submodule is used to preset strategies for different business requirements. The strategies for business requirements give priority to gateways with high success rates or low costs. The data analysis submodule is used to extract data from the gateway performance database and conduct comprehensive evaluation; The decision submodule is used to make decisions using a multi-attribute decision algorithm. Specifically, each attribute is assigned a weight through weighted scoring, each gateway is scored, and finally a comprehensive score is calculated. The attributes include the sending success rate, response time, and cost. The weights are assigned according to the attributes of different business scenarios.
7. The dynamic, fault-tolerant and self-healing gateway switching system according to claim 5, characterized in that: The gateway switching execution module includes: The query submodule is used to query the most suitable gateway according to the SMS service type; The switching execution submodule is used to switch to the optimal gateway and execute the SMS sending operation according to the query results; The fault detection module monitors the response status of the gateway and triggers a fault warning when multiple consecutive abnormal responses are detected; the fault detection module includes: The gateway response status periodic monitoring submodule is used to periodically send HTTP requests to the gateway and record the response status code and response time; The abnormal response standard setting submodule is used to set the relevant parameters and thresholds of the abnormal response. The relevant parameters and thresholds of the abnormal response include that the response status code is not in the 2xx series, or the response time exceeds the threshold; A continuous exception number recording submodule is used to record the number of continuous abnormal responses using a counter; Fault warning trigger submodule, used to trigger fault warning notification when the number of consecutive abnormalities exceeds a preset threshold; The normal state recovery submodule is used to reset the continuous abnormality counter when a normal response is found in a detection.
8. The dynamic, fault and self-healing gateway switching system according to any one of claims 5 to 7, characterized in that: The warning processing module includes: The early warning receiving submodule is used to process the early warning information from the fault detection; The backup gateway query submodule is used to query the backup gateway list; The switching execution submodule is used to select a backup gateway with normal performance for switching; The self-healing mechanism modules include: A fault response submodule is used to automatically switch to a backup gateway after a fault is detected; The operation log module is used to record the switching operation log for subsequent analysis.
9. An electronic device, characterized in that: include: memory and at least one processor; Wherein, the memory stores a computer program; The at least one processor executes the computer program stored in the memory, so that the at least one processor executes the dynamic, fault and self-healing gateway switching method according to any one of claims 1 to 4.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which can be executed by a processor to implement the dynamic, fault-free and self-healing gateway switching method as claimed in any one of claims 1 to 4.
Citation Information
Patent Citations
Short message gateway selection method and device, server and readable storage medium
CN107889069A
Gateway connection method and device, storage medium, electronic equipment and gateway equipment
CN110838991A
Gateway monitoring method and device, electronic equipment and storage medium
CN111865688A
Method and system for realizing self-healing API (Application Program Interface) gateway
CN116633762A
Gateway fault detection method, gateway, storage medium and device
CN117320052A
Cited By
Gateway distributed cache transmission system and method
CN120358281A
