Database server automatic reconnection system

By dynamically adjusting the reconnection waiting time through the monitoring module, the problems of increased server load and avalanche effect caused by traditional reconnection strategies are solved, realizing intelligent load management of the database server and improving the availability and reliability of the system.

CN120729929BActive Publication Date: 2025-12-30BEIJING GENGDUN DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511164533.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-20
Publication Date
2025-12-30
Estimated Expiration
2045-08-20

AI Technical Summary

Technical Problem

Traditional database server reconnection strategies lack flexibility, which may lead to increased server load and a cascading failure effect, failing to effectively improve application availability and reliability.

Method used

A monitoring module is introduced to monitor server CPU utilization in real time, set CPU utilization thresholds, dynamically adjust the growth multiple and maximum waiting time of reconnection waiting time according to load conditions, and adopt an exponential backoff strategy for intelligent reconnection management.

Benefits of technology

It effectively avoids server overload, balances reconnection efficiency and server security, and achieves intelligent adjustment when the load changes, thereby improving the availability and reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120729929B_ABST
    Figure CN120729929B_ABST
Patent Text Reader

Abstract

The application provides a database server automatic reconnection system, which can automatically adjust the reconnection waiting time in an exponential backoff mode as time elapses under the condition that two CPU usage rate thresholds are set, thereby avoiding overload of the server due to reconnection at any time in real time, limiting the reconnection waiting time in a reasonable range at all times, reasonably limiting the maximum waiting time, and reasonably adjusting the maximum waiting time according to the specific load of the server as time elapses, so that the reconnection waiting is monitored and adjusted most reasonably in an automatic and intelligent manner, and the server safety and reconnection efficiency are taken into account.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an automatic reconnection system for a database server. Background Art

[0002] In modern distributed systems and network environments, the connection between the database server and the client may fail due to various factors (such as network congestion, high server load, etc.). To improve the availability and reliability of applications, an automatic reconnection mechanism is usually applied.

[0003] However, traditional automatic reconnection strategies usually adopt fixed reconnection intervals or simple exponential backoff strategies, which do not fully consider the actual load conditions of the server, may lead to further加重服务器的负担,甚至引发雪崩效应。换言之,传统的重连策略往往较为简单,缺乏灵活性,可能导致网络拥堵或服务过载。 Summary of the Invention

[0004] The present invention provides an automatic reconnection system for a database server, which effectively solves the above technical problems existing in the prior art.

[0005] Specifically, the present invention provides an automatic reconnection system for a database server, which aims to reconnect between the client and the server. Here, the server is set for the database, so it is called an automatic reconnection system for a database server. The system includes a reconnection module and a monitoring module. Among them, when the connection between the client and the server fails, the reconnection module发起k次自动重连,每相邻两次自动重连之间的时间为重连等待时间,重连等待时间依次预计为t1、t2、…、t k , the k-th reconnection waiting time t k 达到最大等待时间M,其中k≥2,在自然数1至k-1中的任意整数i,均有t i =t1 a i-1 <M,其中a为增长倍数,而t k =M≤t1 a k-1 , the monitoring module sets the first CPU usage threshold CA and the second CPU usage threshold CB, where CA>CB. When starting any i-th reconnection waiting time t i , the CPU real-time usage rate in the server monitored by the monitoring module in real time is C i , if C i <CB, the growth multiple a remains unchanged, and at the same time, the maximum waiting time M remains unchanged; if CB≤C i <CA, the growth multiple is updated from a to a’, , and at the same time, the maximum waiting time M remains unchanged; if C It should be noted that there are some unclear or incorrect expressions in the original text, such as "加重服务器的负担,甚至引发雪崩效应" which is not accurately translated here as the original expression is not clear. And the text seems to be incomplete at the end. You may need to check and correct the original text for a more accurate translation.i ≥CA, the growth multiple is updated from a to a'', , and at the same time the maximum waiting time is updated from M to M'. .

[0006] Preferably, in any case of the i'-th reconnect waiting time started after the i-th reconnect waiting time t i , where i'>i, once the monitoring module monitors that the CPU real-time utilization rate C at this time i’ <CB, the growth multiple returns to the initial value a.

[0007] Preferably, once the CPU real-time utilization rate C monitored by the monitoring module i’ satisfies CB≤C i’ <CA, the growth multiple is updated to , and there is no need to update the maximum waiting time.

[0008] Preferably, once the monitoring module monitors that the CPU real-time utilization rate C i’ ≥CA, the growth multiple is updated to , and the maximum waiting time is updated to .

[0009] Optionally, a = 2, M = 60 seconds, t1 = 3 seconds, then t2 = 3 ×2 = 6 seconds, t3 = 3 ×2 2 = 12 seconds, t4 = 3 ×2 3 = 24 seconds, t5 = 3 ×2 4 = 48 seconds, t6 = M = 60 seconds ≤ 3 ×2 5 seconds, so, k = 6.

[0010] In summary, the database server automatic reconnect system provided by the present invention can automatically adjust the reconnect waiting time in the exponential backoff mode over time under the condition of setting two CPU utilization rate thresholds, thereby avoiding the overload situation of the server due to reconnect at any moment in real time, and limiting the reconnect waiting time within a reasonable range at all times. At the same time, a reasonable limit is also made on the maximum waiting time, and the maximum waiting time can also be reasonably adjusted according to the specific load situation of the server over time, so as to monitor the reconnect waiting at all times in an automated and intelligent manner and make the most reasonable adjustment, taking into account both server security and reconnect efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be discussed below. Obviously, the technical solutions described in conjunction with the accompanying drawings are only some embodiments of the present invention. For those skilled in the art, other embodiments and their accompanying drawings can be obtained based on the embodiments shown in these drawings without creative effort.

[0012] Figure 1 A general flowchart of the database server automatic reconnection system according to the present invention is shown. Detailed Implementation

[0013] The technical solutions of various embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments described in the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0014] Figure 1 A general flowchart of the database server automatic reconnection system according to the present invention is shown. The following will be based on... Figure 1 This invention provides a detailed description of the automatic reconnection system for database servers. The reconnection system provided by this invention automatically reconnects between the server and the client. The adjustment of related data can essentially be considered as an adjustment of the database, hence the name "automatic reconnection system for database servers".

[0015] In summary, this invention provides an automatic reconnection system for a database server. The system first sets up a reconnection module. When the network connection between the client and the server fails, the reconnection module starts an automatic reconnection mechanism, which adopts an exponential backoff method, waits for a period of time, and then attempts to reconnect again. Moreover, the waiting time after each failed reconnection will increase exponentially until the preset maximum waiting time is reached.

[0016] This approach helps avoid frequent reconnection requests during network outages, thus reducing network load and providing time for network self-recovery. For example, when the reconnection module automatically reconnects, the initial waiting time is 3 seconds, and after each failed reconnection, the waiting time is doubled, with a maximum waiting time of 1 minute.

[0017] In other words, once the reconnection module initiates the automatic reconnection mechanism, the reconnection waiting times are t1, t2, ..., t... k until t k The maximum waiting time M is reached, where k ≥ 2. For any integer i from the natural number 1 to k-1, t... i =t1 a i-1 <M, where a is the growth multiple and t k =M ≤ t1 a k-1 . For example, in the previous example, a = 2, t1 = 3 seconds, t2 = 3 2 = 6 seconds, t3 = 3 2 2 = 12 seconds, t4 = 3 2 3 = 24 seconds, t5 = 3 2 4 = 48 seconds, t6 = M = 60 seconds ≤ 3 2 5 seconds.

[0018] If only such network reconnection is carried out according to the reconnection module, the traditional exponential backoff strategy is implemented. As mentioned before, it lacks flexibility and is prone to trigger the avalanche effect.

[0019] Therefore, this system also introduces a monitoring module to monitor the load status of the server, especially the real-time CPU usage rate in the server. It should be noted that the CPU usage rate is one of the important indicators to measure the server load, which reflects the server's ability to process tasks and its busyness within a given time.

[0020] During the reconnection process, the monitoring module monitors the real-time CPU usage rate in the server in real time, so as to effectively monitor the server load and adjust the waiting time in real time according to the load status.

[0021] Specifically, the first CPU usage rate threshold CA and the second CPU usage rate threshold CB are set in the monitoring module, where CA > CB.

[0022] When any t i period is started, the real-time CPU usage rate monitored by the monitoring module in real time is C i . According to this definition, in the t1 period, the real-time CPU usage rate is C1, in the t2 period, the real-time CPU usage rate is C2, in the t3 period, the real-time CPU usage rate is C3, and so on.

[0023] If the monitoring module monitors that the real-time CPU usage rate is C i during the start of any t i <CB, it indicates that the real-time CPU usage rate at this time is small enough. In other words, the server load is not large. Then, the duration of the reconnection waiting time t i remains unchanged. That is to say, the growth multiple a remains unchanged, and at the same time, the maximum waiting time M remains unchanged.

[0024] If the monitoring module monitors that the real-time CPU usage rate is C iDuring the period, it is monitored that the real-time CPU usage rate is CB ≤ C i <CA, it indicates that the real-time CPU usage rate at this time is relatively large. In other words, the load burden on the server is relatively large, and at this time, it is necessary to appropriately extend the reconnection waiting time t i , that is to say, it is necessary to appropriately increase the growth multiple a. In this case, the growth multiple is updated to a':

[0025]

[0026] Since in this case, the load burden on the server is only relatively large, it is not necessary to update the maximum waiting time M yet.

[0027] Thus, the i-th reconnection waiting time t i is updated to t i = t1 a' i-1 . In other words, in this formula, the multiple a is replaced by a'. Then from this time on, the subsequent reconnection waiting times after the t i period are all calculated using a', rather than using the multiple a for calculation.

[0028] If the monitoring module monitors that the real-time CPU usage rate is C i during any t i ≥ CA, it indicates that the real-time CPU usage rate at this time is already quite large. In other words, the load burden on the server is extremely heavy, and at this time, it is necessary to extend the reconnection waiting time t i , that is to say, it is necessary to increase the growth multiple a. In this case, the growth multiple is updated to a'':

[0029]

[0030] At the same time, considering that in this case, the load burden on the server is already very heavy, it is necessary to update the maximum waiting time at this time, and update the maximum waiting time from M to M':

[0031]

[0032] Thus, the i-th reconnection waiting time t i is updated to t i = t1 a'' i-1 . In other words, in this formula, the multiple a is replaced by a''. Then from this time on, the subsequent reconnection waiting times after the t i period are all calculated using a'', rather than using the multiple a for calculation.

[0033] At the same time, the maximum waiting time M is also updated. In other words, based on the current update, the maximum waiting time for each period will eventually not exceed M'.

[0034] For example, if the first threshold for CPU utilization is set to 90% and the second threshold for CPU utilization is set to 70%, then if the current CPU utilization is 60%, which is lower than the second threshold, then the system will evolve according to the predetermined exponential backoff strategy, with the growth factor remaining unchanged and the maximum waiting time also remaining unchanged.

[0035] If the current CPU utilization is 80%, which is between the first and second thresholds, the growth factor will be increased appropriately, while the maximum waiting time will remain unchanged.

[0036] If the current CPU utilization rate is 95%, which is greater than the first threshold, the growth factor will increase, and the maximum waiting time will also increase.

[0037] As time progresses, the real-time CPU utilization monitored by the monitoring module may change at any time. Therefore, when any i'-th reconnection wait time is started after the i-th reconnection wait time (i'>i), once the monitoring module detects the real-time CPU utilization C... i’ If the value is less than the second threshold CB, the growth factor reverts to the initial value a, and the i'th waiting time t... i’ Return to the original computation time t i’ =t1 a i’-1 .

[0038] Once the monitoring module detects the real-time CPU utilization C i’ If the value is greater than the second threshold CB but not greater than the first threshold CA, then the growth factor is updated to... No need to update the maximum waiting time.

[0039] Once the monitoring module detects the real-time CPU utilization C i’ If ≥CA, then the growth factor is updated to The maximum waiting time has been updated to .

[0040] In summary, the database server automatic reconnection system provided by this invention, by setting two CPU utilization thresholds, can automatically adjust the reconnection waiting time under the exponential backoff mode over time, thereby preventing the server from becoming overloaded due to reconnection at any time, while always limiting the reconnection waiting time within a reasonable range. At the same time, a reasonable limit is also made on the maximum waiting time, and the maximum waiting time can also be reasonably adjusted according to the specific load of the server over time. Thus, the reconnection waiting is monitored in real time and the most reasonable adjustment is made in an automated and intelligent way, taking into account both server security and reconnection efficiency.

[0041] The above description is merely an exemplary embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A database server automatic reconnection system, characterized by, The system comprises a reconnection module and a monitoring module, wherein, In the case of a connection failure between the client and the server of the database, the reconnection module initiates k automatic reconnections to the server, and the time between each two adjacent automatic reconnections is a reconnection waiting time, and the reconnection waiting times are expected to be t1, t2, …, t in turn k , the kth reconnection waiting time t k reaches a maximum waiting time M, where k≥2, and for any integer i in the natural numbers 1 to k-1, t i =t1 a i-1 <M, where a is a growth multiple, and t k =M≤t1 a k-1 , The monitoring module is provided with a first threshold CA of CPU usage and a second threshold CB of CPU usage, wherein CA>CB, When the i-th reconnection waiting time t is started i , the real-time CPU usage of the server monitored by the monitoring module is C i , if C i <CB, the growth multiple a remains unchanged, and the maximum waiting time M remains unchanged; if CB≤C i <CA, the growth multiple is updated to a', , and the maximum waiting time M remains unchanged; if C i ≥CA, the growth multiple is updated to a", , and the maximum waiting time is updated from M to M', .

2. The system of claim 1, wherein, At the i-th reconnection waiting time t i In case of any i'-th reconnection waiting time t' started later, i'>i, once the monitoring module monitors the CPU real-time usage C i’ <CB, the growth factor reverts to the initial value a.

3. The system of claim 2, wherein, Once the monitoring module monitors the real-time CPU usage C i’ Satisfy CB≤C i’ <CA, the growth multiple is updated to No need to update the maximum waiting time.

4. The system of claim 2, wherein, Once the monitoring module monitors that the CPU real-time usage rate C i’ ≥ CA, the growth multiple is updated to , and the maximum waiting time is updated to .

5. The system of claim 1, wherein, a = 2, M = 60 seconds, t1 = 3 seconds, then t2 = 3 2 = 6 seconds, t3 = 3 2 2 = 12 seconds, t4 = 3 2 3 = 24 seconds, t5 = 3 2 4 = 48 seconds, t6 = M = 60 seconds < 3 2 5 seconds, therefore, k = 6.

Citation Information

Patent Citations

  • Redis use control method and device

    CN113722364A

  • Customer service work order management system based on network employer service

    CN120317878A