Connection control method of distributed database system and distributed database system

By acquiring and dynamically adjusting the connection control configuration information and service node status of the distributed database system, the problem of request processing failure was solved, load balancing and resource optimization were achieved in complex network environments, and the stability and efficiency of the system were improved.

CN121579596APending Publication Date: 2026-02-27CHINA TELECOM CLOUD TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202511765075.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-27
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

Distributed database systems suffer from request processing failures when handling client connection requests. Existing connection control methods struggle to adapt to dynamic changes in business connections and load, especially in complex network environments where dynamic adjustment and balancing of the number of connections is difficult.

Method used

By acquiring pre-configured connection control information and service node running status information, the maximum number of connections for each service node and the system is dynamically adjusted. Combined with load balancing strategies, node-level and system-level connection control is achieved, avoiding resource contention and network latency.

Benefits of technology

It improves the efficiency and stability of request processing in distributed database systems, avoids connection request failures, and achieves load balancing and resource optimization in complex network environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121579596A_ABST
    Figure CN121579596A_ABST
Patent Text Reader

Abstract

The invention relates to a connection control method and device of a distributed database system, the distributed database system, computer equipment, a computer readable storage medium and a computer program product. The distributed database system comprises a plurality of service nodes, and the method comprises the following steps: under the condition that a connection request of a client for a first node in the plurality of service nodes is received, obtaining connection control configuration information pre-configured for the distributed database system and running state information of the first node; extracting node configuration information of the first node from the connection control configuration information; and processing the connection request according to the node configuration information and the operation state information. By adopting the method, the problem that the request processing fails when the distributed database system processes the request can be solved, and the reliability of the request processing of the distributed database system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of distributed database, and in particular to a connection control method and device of a distributed database system, the distributed database system, a computer device, a computer readable storage medium and a computer program product. BACKGROUND

[0002] With the rapid advancement of global digitization process, traditional centralized databases face severe bottlenecks in scalability, availability and cost control, and are difficult to support high concurrency, massive data and elastic modern business requirements. Distributed databases provide high-performance, high-reliability and flexible data service guarantees for clients with their horizontal expansion, high-availability disaster recovery, multi-active deployment and almost unlimited throughput, laying the technical foundation for enterprise core competitiveness and continuous innovation in the digital economy era.

[0003] At present, when a distributed database system processes a connection request from a client, there may be a request processing failure. SUMMARY

[0004] Therefore, it is necessary to provide a connection control method, device, system, computer device, computer readable storage medium and computer program product of a distributed database system to solve the request processing failure problem when the distributed database system processes a request and improve the reliability of request processing of the distributed database system.

[0005] In a first aspect, the present application provides a connection control method of a distributed database system, the distributed database system comprising a plurality of service nodes, the method comprising:

[0006] In the case of receiving a connection request from a client for a first node in the plurality of service nodes, obtaining connection control configuration information pre-configured for the distributed database system and running state information of the first node;

[0007] Extracting node configuration information of the first node from the connection control configuration information;

[0008] Processing the connection request according to the node configuration information and the running state information.

[0009] In one embodiment, processing the connection request according to the node configuration information and the running state information comprises:

[0010] Parsing the node configuration information to obtain an upper limit of the node connection number of the first node;

[0011] analyzing the running state information to obtain the established connection number of the first node;

[0012] In a case where the established connection number does not reach the node connection number upper limit, based on the connection request, calling the first node to establish a communication connection with the client.

[0013] In an embodiment, the method further comprises:

[0014] In a case where the established connection number reaches the node connection number upper limit, feeding back a redirection response to the connection request to the client; the redirection response is used to instruct the client to resend a connection request to a second node in the plurality of service nodes.

[0015] In an embodiment, the method further comprises:

[0016] counting the established connection number of each of the plurality of service nodes to obtain the system connection number of the distributed database system;

[0017] extracting the system connection number upper limit of the distributed database system from the connection control configuration information;

[0018] In a case where the system connection number reaches the system connection number upper limit, rejecting a new connection request from the client.

[0019] In an embodiment, the analysis result of the node configuration information further comprises a connection idle duration, and the method further comprises:

[0020] In a case where the established connection number reaches the node connection number upper limit, sending indication information to the first node to update the established connection number of the first node; the indication information is used to instruct the first node to close a communication connection with a communication idle duration greater than the connection idle duration;

[0021] Based on the comparison result between the updated established connection number and the node connection number upper limit, processing the connection request.

[0022] In an embodiment, the method further comprises:

[0023] For a plurality of remaining nodes in the plurality of service nodes except the first node, analyzing the running state information of each of the remaining nodes to obtain the established connection number and the node load of each of the remaining nodes;

[0024] In a case where the established connection number of the remaining node is less than a quantity threshold value and the node load is less than a load threshold value, determining the remaining node as the second node.

[0025] In one of the embodiments, the method further comprises:

[0026] extracting, from the connection control configuration information, a balancing strategy matching the first node;

[0027] determining a service node in the balancing strategy as the second node.

[0028] In one of the embodiments, the analysis result of the running state information further comprises a node load; and the method further comprises:

[0029] in a case where the node load is less than a preset lower limit of load, and a number difference between the established connection number and the node connection number upper limit is greater than a preset threshold, lowering the node connection number upper limit of the first node.

[0030] In one of the embodiments, the method further comprises:

[0031] in a case where the node connection number upper limit of the first node is lowered, increasing the node connection number upper limit of a target node in the remaining nodes;

[0032] determining the target node as the second node.

[0033] In one of the embodiments, the method further comprises:

[0034] predicting a connection demand of the first node according to historical connection data of the first node;

[0035] adjusting the node connection number upper limit of the first node based on the predicted connection demand.

[0036] In a second aspect, the application provides a connection control device of a distributed database system, the distributed database system comprising a plurality of service nodes, the device comprising:

[0037] an obtaining module, configured to, in a case where a connection request of a client for a first node in the plurality of service nodes is received, obtain connection control configuration information pre-configured for the distributed database system, and running state information of the first node;

[0038] an extracting module, configured to extract node configuration information of the first node from the connection control configuration information;

[0039] a processing module, configured to process the connection request according to the node configuration information and the running state information.

[0040] In a third aspect, the present application provides a distributed database system, comprising an agent node and a plurality of service nodes; the agent node is configured to execute the steps of the method in the first aspect or any one of the first aspect.

[0041] In a fourth aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the following steps:

[0042] In a case where a connection request of a client for a first node in the plurality of service nodes is received, connection control configuration information preconfigured for the distributed database system and running state information of the first node are acquired; the distributed database system comprises a plurality of service nodes;

[0043] Node configuration information of the first node is extracted from the connection control configuration information;

[0044] The connection request is processed according to the node configuration information and the running state information.

[0045] In a fifth aspect, the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the following steps:

[0046] In a case where a connection request of a client for a first node in the plurality of service nodes is received, connection control configuration information preconfigured for the distributed database system and running state information of the first node are acquired; the distributed database system comprises a plurality of service nodes;

[0047] Node configuration information of the first node is extracted from the connection control configuration information;

[0048] The connection request is processed according to the node configuration information and the running state information.

[0049] In a sixth aspect, the present application further provides a computer program product, comprising a computer program, and the computer program is executed by a processor to implement the following steps:

[0050] In a case where a connection request of a client for a first node in the plurality of service nodes is received, connection control configuration information preconfigured for the distributed database system and running state information of the first node are acquired; the distributed database system comprises a plurality of service nodes;

[0051] Node configuration information of the first node is extracted from the connection control configuration information;

[0052] According to the node configuration information and the running state information, the connection request is processed.

[0053] The connection control method and device of the distributed database system, the distributed database system, the computer device, the computer readable storage medium and the computer program product can improve the processing efficiency of the connection request by obtaining the preconfigured connection control configuration information, and can improve the running stability of the distributed database system by processing the connection request in combination with the node configuration information and the running state information of the service node. BRIEF DESCRIPTION OF DRAWINGS

[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the description of the embodiments of the present application or the related art will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other related drawings can be obtained by those skilled in the art without creative labor.

[0055] Figure 1 The application environment diagram of the connection control method of the distributed database system in an embodiment;

[0056] Figure 2 The flowchart of the connection control method of the distributed database system in an embodiment;

[0057] Figure 3 The flowchart of processing the connection request according to the node configuration information and the running state information in an embodiment;

[0058] Figure 4 The flowchart of the connection control method of the distributed database system in another embodiment;

[0059] Figure 5 The flowchart of determining the second node in an embodiment;

[0060] Figure 6 The connection control diagram of the distributed database system in an embodiment;

[0061] Figure 7A flowchart of a connection control method of a distributed database system in another embodiment;

[0062] Figure 8 A structural block diagram of a connection control device of a distributed database system in an embodiment;

[0063] Figure 9 An internal structure diagram of a computer device in an embodiment. DETAILED DESCRIPTION

[0064] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not intended to limit the present application.

[0065] It should be noted that the terms "first", "second", and the like used in the present application can be used to describe various nodes, but these nodes are not limited by these terms. These terms are only used to distinguish the first node from the second node. The terms "include" and "have" and any variations thereof used in the present application are intended to cover non-exclusive inclusion. The term "multiple" used in the present application refers to two and more than two. The term "and / or" used in the present application refers to one of the options or any combination of multiple options.

[0066] With the explosive growth of digital scenarios, the amount of business data is rapidly increasing, and distributed databases are widely used in various industries. When the distributed database system processes connection requests from clients, due to the complexity of the running environment and system implementation, there are cases where the request processing fails, therefore, it is necessary to solve the problems in multiple aspects such as network delay, fault recovery, traffic balancing, and the like, and the connection control plays an important role in ensuring system performance and stability, etc.

[0067] Firstly, connection control can optimize network communication efficiency and optimize performance. In the distributed database system, due to high network communication cost, frequent connection establishment and disconnection will increase network load and increase request processing delay. By reusing existing connections, network overhead can be reduced and data transmission efficiency can be improved.

[0068] Secondly, connection control helps to control traffic balancing and prevent resource overload. When multiple client applications simultaneously access the same service node in the distributed database system, it will cause the service node resource to be exhausted, affecting the stability and availability of the system. By implementing connection control, the number of connections to a single service node can be limited to avoid resource contention and ensure that requests to a single service node are processed in a timely manner. Also, the connection of the client can be scattered among multiple service nodes to achieve load balancing.

[0069] Currently, the commonly used connection control method of the distributed database system is to reuse connections through connection pools, to limit the number of connections of the system as a whole based on load balancing components, and to balance the connections, etc. However, for the distributed database system with multiple service nodes, the commonly used connection control method has the following problems: firstly, the commonly used connection number limit is mostly statically configured, and cannot dynamically adjust the maximum number of connections (i.e. the upper limit of the number of connections) of each service node according to the load of each service node of the system, nor can it dynamically adjust the maximum number of connections of the system as a whole, which is difficult to adapt to the dynamic changes of business connections and loads; secondly, when using a single load balancing component to realize the connection balancing among multiple service nodes of the distributed database, it is difficult to realize the overall connection control in a complex network environment, such as when deployed across regions, it is not suitable to proxy business access through a single load balancing component, it is difficult to limit the overall number of connections through a single load balancing component, and it is also difficult to realize the connection balancing of multiple nodes.

[0070] Therefore, the embodiments of the present application provide a connection control method of a distributed database system, which can be applied to an application environment as shown in Figure 1 The distributed database system 10 communicates with the client 20 through a network, and can provide data read-write access services to the client 20. The distributed database system 10 includes a proxy node 102 and a service node cluster 104, and the service node cluster 104 includes multiple service nodes. Specifically, the distributed database system 10 provides data read-write access services to the client 20 through the service nodes.

[0071] The distributed database system is a database system deployed in a distributed environment, which often uses multiple service nodes to store and manage data, and provides multiple service nodes to provide data read-write access services to the client to ensure high availability of services. The client initiates a connection request to these service nodes to start data read-write access.

[0072] Specifically, in the case of receiving a connection request of the client 20 to a first node in the multiple service nodes, the proxy node 102 obtains the connection control configuration information pre-configured for the distributed database system and the running state information of the first node, and extracts the node configuration information of the first node from the connection control configuration information, and processes the connection request according to the node configuration information and the running state information.

[0073] In one embodiment, as shown in Figure 2 A connection control method of a distributed database system is provided, which is applied to the proxy node 102 in Figure 1 For example, the following steps are included:

[0074] S202, in the case of receiving a connection request of a client for a first node in a plurality of service nodes, obtaining connection control configuration information pre-configured for the distributed database system and running state information of the first node.

[0075] The service node refers to a computer node in the distributed database system that provides data read-write access services to the client. The client connects to the service node directly or indirectly through a network proxy or load balancing component for data read-write access.

[0076] The connection control configuration information refers to information pre-configured by an operation and maintenance personnel for the distributed database system, including but not limited to system connection limit, node connection limit of each service node, connection idle time of each service node, and balancing strategy between service nodes.

[0077] The system connection limit refers to the maximum number of clients that can be connected to the distributed database system, that is, the sum of the node connection limits of the plurality of service nodes is equal to the system connection limit. The node connection limit refers to the upper limit of the number of clients that the service node provides data read-write access services. The connection idle time refers to the connection idle time when the service node maintains the established connection and triggers active disconnection.

[0078] The running state information refers to the sum of a series of quantitative indicators and data reflecting the health status, resource utilization, performance, and service capacity of the first node. For example, the running state information includes but is not limited to node load and established connection number. For example, the node load can include CPU usage, memory usage, and network throughput. The established connection number refers to the number of clients that have established communication connection with the first node.

[0079] In some embodiments, the client initiates a connection request to the first node after obtaining a legal authorization.

[0080] S204, extracting the node configuration information of the first node from the connection control configuration information.

[0081] The connection control configuration information includes node configuration information of each service node. The node configuration information includes but is not limited to node connection limit and connection idle time.

[0082] S206, processing the connection request according to the node configuration information and the running state information.

[0083] According to the method in the above embodiment, in a case where a connection request of a client for a first node in the plurality of service nodes is received, the connection request is processed according to the node configuration information and the running state information of the first node by obtaining the connection control configuration information pre-configured for the distributed database system, and extracting the node configuration information of the first node from the connection control configuration information. Thus, by obtaining the pre-configured connection control configuration information, the processing efficiency of the connection request can be improved. By processing the connection request in combination with the node configuration information and the running state information of the service node, the situation that the connection request processing fails due to the abnormality of the service node can be avoided, and the running stability of the distributed database system can be improved.

[0084] In one embodiment, as shown in Figure 3 the connection request is processed according to the node configuration information and the running state information, including the following steps:

[0085] S302, the node configuration information is parsed to obtain the node connection upper limit of the first node.

[0086] S304, the running state information is parsed to obtain the established connection number of the first node.

[0087] S306, in a case where the established connection number does not reach the node connection upper limit, a communication connection between the first node and the client is established based on the connection request.

[0088] According to the method in the above embodiment, by comparing the established connection number of the first node with the node connection upper limit, the connection admission capacity of the first node can be determined. In a case where the established connection number does not reach the node connection upper limit, it indicates that the first node can still establish a connection with the client. Thus, by establishing a connection with the client, the data read-write access service of the client can be provided through the first node, the probability of connection establishment failure can be reduced, and the running stability of the distributed database system is improved.

[0089] In one embodiment, the method further includes: in a case where the established connection number reaches the node connection upper limit, feeding back a redirection response for the connection request to the client; the redirection response is used to instruct the client to resend the connection request to a second node in the plurality of service nodes. Thus, by instructing the client to request to establish a connection with the second node, the situation that the first node fails to establish a connection with the client can be avoided, and the success rate of connection establishment can be improved.

[0090] In one embodiment, as shown in Figure 4 the method further includes:

[0091] S402, count the number of established connections corresponding to each of the plurality of service nodes to obtain the system connection number of the distributed database system.

[0092] Specifically, the sum of the number of established connections corresponding to each of the plurality of service nodes is determined as the system connection number of the distributed database system.

[0093] S404, extract the system connection number upper limit of the distributed database system from the connection control configuration information.

[0094] S406, in the case where the system connection number reaches the system connection number upper limit, reject the new connection request from the client.

[0095] The method of the above embodiment can analyze the request processing capacity of the system as a whole by considering the comparison result between the system connection number reaching the system connection number upper limit; in the case where the system connection number reaches the system connection number upper limit, it indicates that the request processing capacity of the system has reached the upper limit, therefore, by rejecting the new connection request from the client, the client can be prevented from being in invalid waiting and repeated failure attempts, and the efficiency of request processing of the distributed database system and the user experience can be improved.

[0096] In one embodiment, the analysis result of the node configuration information further includes a connection idle duration, and the method further includes: in the case where the number of established connections reaches the node connection number upper limit, indicating information to the first node to update the number of established connections of the first node; the indication information is used to instruct the first node to close the communication connection with a communication idle duration greater than the connection idle duration; and based on the comparison result between the updated number of established connections and the node connection number upper limit, processing the connection request.

[0097] The communication idle duration of the communication connection refers to the duration that the communication connection is not carrying data read / write access service.

[0098] Specifically, based on the comparison result between the updated number of established connections and the node connection number upper limit, processing the connection request includes: in the case where the updated number of established connections does not reach the node connection number upper limit, based on the connection request, calling the first node to establish a communication connection with the client; in the case where the updated number of established connections reaches the node connection number upper limit, feeding back a redirection response to the connection request to the client; the redirection response is used to instruct the client to resend the connection request to a second node in the plurality of service nodes.

[0099] The method of the above embodiment can release the corresponding related resources by actively closing the long-idle communication connection, so as to provide resources for other clients and improve the success rate of connection requests.

[0100] The second node can be determined by the steps provided in the following embodiments, and specifically:

[0101] In one embodiment, the method shown in the figure for determining the second node comprises the following steps: Figure 5 The method shown in the figure for determining the second node comprises the following steps:

[0102] S502, for the remaining nodes in the plurality of service nodes except the first node, analyzing the running state information of each remaining node to obtain the respective established connection number and node load of each remaining node.

[0103] Among the plurality of service nodes, the service nodes except the first node can be referred to as remaining nodes.

[0104] S504, in the case that the established connection number of the remaining node is less than the number threshold and the node load is less than the load threshold, determining the remaining node as the second node.

[0105] The number of remaining nodes meeting the condition can be one or more, and the condition is that the established connection number is less than the number threshold and the node load is less than the load threshold.

[0106] In some embodiments, in the case that the number of remaining nodes meeting the condition is multiple, any one of the multiple remaining nodes meeting the condition is determined as the second node. Alternatively, the remaining node with the smallest established connection number among the multiple remaining nodes meeting the condition is determined as the second node. Alternatively, the remaining node with the lowest node load among the multiple remaining nodes meeting the condition is determined as the second node.

[0107] By comparing the established connection number and the node load of the remaining nodes in the plurality of service nodes except the first node with the corresponding thresholds respectively, the method of the above embodiments can select the remaining node with less connection number and lighter load from the multiple remaining nodes as the second node. When the client applies to establish a connection with the second node, the accuracy of connection establishment can be improved.

[0108] In one embodiment, the method further comprises: extracting a balancing strategy matching the first node from the connection control configuration information; and determining the service node in the balancing strategy as the second node. Thus, by configuring the balancing strategy between the service nodes in advance, when a certain service node is abnormal, the connection request of the client can be processed directly based on the service node in the balancing strategy, and the success rate of request processing can be improved.

[0109] In an embodiment, the parsing result of the running state information further comprises a node load, and the method further comprises: in a case where the node load is less than a preset lower limit of the load, and a quantity difference between the established connection number and the node connection number upper limit is greater than a preset threshold, adjusting the node connection number upper limit of the first node downward. Thus, a corresponding processing procedure can be executed based on a comparison result between the adjusted node connection number upper limit and the established connection number.

[0110] By using the method of the above embodiment, the node connection number upper limit of the service node with a lower usage frequency is adjusted downward, so that the success rate of request processing can be improved while maintaining the system connection number upper limit of the distributed database system unchanged.

[0111] It can be understood that, since the preconfigured connection control configuration information comprises the node connection number upper limit, adjusting the node connection number upper limit actually means adjusting the preconfigured connection control configuration information. Therefore, the method provided in the present application can adaptively adjust the connection control configuration information based on the node load and the established connection number of the service node, so that the connection control configuration information can be dynamically adjusted to adapt to the request processing situation in an actual scenario, and the stability and reliability of the distributed database system in request processing can be improved.

[0112] In a possible implementation manner, the connection control configuration information can be updated periodically.

[0113] In an embodiment, the method further comprises: for a plurality of remaining nodes in the plurality of service nodes other than the first node, in a case where the node connection number upper limit of the first node is adjusted downward, adjusting the node connection number upper limit of a target node in the plurality of remaining nodes upward; and determining the target node as a second node. Thus, by taking the node with the adjusted node connection number upper limit as the node connected with the client, the accuracy of successful connection establishment can be improved.

[0114] The target node in the plurality of remaining nodes can be determined in the following manner. For example, a remaining node with the largest node load in the plurality of remaining nodes can be determined as the target node. Alternatively, any node in the plurality of remaining nodes can be determined as the target node. Alternatively, a node with the smallest node connection number upper limit in the plurality of remaining nodes can be determined as the target node.

[0115] In an embodiment, the method further comprises: predicting a connection demand of the first node according to historical connection data of the first node; and adjusting the node connection number upper limit of the first node based on the predicted connection demand. Thus, a corresponding processing procedure can be executed based on a comparison result between the adjusted node connection number upper limit and the established connection number.

[0116] The historical connection data refers to connection information related to the first node before the current time point, including but not limited to: a client identifier, a client location, a duration of connection of the client corresponding to the client identifier, and a number of connection failures of the client corresponding to the client identifier, and a time period of frequent connection of the node. The connection demand is used to represent the number of clients that establish connection with the first node at a predicted future time.

[0117] In a possible implementation, the connection demand of the first node is predicted according to the historical connection data of the first node, including: analyzing the historical connection data by using a data analysis model or a machine learning model to predict the connection demand of the first node. Thus, by using the model to predict the connection demand of the first node, the analysis efficiency can be improved, and further the efficiency of processing the connection request can be improved.

[0118] In a possible implementation, the node connection number upper limit of the first node is adjusted based on the predicted connection demand, including: when the predicted connection demand represents that the node load of the first node presents an increasing trend, the node connection number upper limit of the first node is increased.

[0119] In a possible implementation, the node connection number upper limit of the first node is adjusted based on the predicted connection demand, including: when the predicted connection demand represents that the node load of the first node presents a decreasing trend, the node connection number upper limit of the first node is decreased.

[0120] By using the above implementation, the node connection number upper limit of the first node can be adaptively adjusted by combining the future load condition of the first node, the elastic allocation of resources of the distributed database system is realized, and the running stability and reliability of the distributed database system are improved.

[0121] In combination with the above content, as shown in FIG. 1, Figure 6 A connection control diagram of a distributed database system is provided, wherein the distributed database system 10 communicates with the client 20 through a network. The distributed database system 10 can provide data read-write access services to the client 20. The distributed database system 10 includes a proxy node 102 and a service node cluster 104, and the service node cluster 104 includes a plurality of service nodes. Specifically, the distributed database system 10 provides data read-write access services to the client 20 through the service nodes.

[0122] Specifically, proxy node 102 is used to obtain pre-configured connection control configuration information for the distributed database system and the running status information of the first node when receiving a connection request from a client for the first node among multiple service nodes. The connection control configuration information includes the node configuration information of the first node and the system connection limit of the distributed database system; the node configuration information includes the node connection limit of the first node and the connection idle time; and the running status information includes the node load.

[0123] The proxy node 102 is also used to, based on the connection request, call the first node to establish a communication connection with the client when the number of established connections has not reached the node connection limit; and to send a redirection response to the client for the connection request when the number of established connections has reached the node connection limit. The redirection response is used to instruct the client to resend the connection request to the second node among multiple service nodes.

[0124] The proxy node 102 is also used to lower the upper limit of the number of node connections for the first node when the node load is less than a preset lower load limit and the difference between the number of established connections and the upper limit of the number of node connections is greater than a preset threshold; or, based on the historical connection data of the first node, predict the connection demand of the first node; and adjust the upper limit of the number of node connections for the first node based on the predicted connection demand. Thus, by adjusting the upper limit of the number of node connections, the pre-configured connection control configuration information can be updated.

[0125] Combination Figure 6 The content shown is as follows: Figure 7 As shown, taking the application of this method to a calling node as an example, the steps include:

[0126] S702, upon receiving a connection request from a client for the first node among multiple service nodes, obtains the pre-configured connection control configuration information for the distributed database system and the running status information of the first node; the connection control configuration information includes the node configuration information of the first node and the system connection limit of the distributed database system; the node configuration information includes the node connection limit of the first node and the connection idle time; the running status information includes the node load.

[0127] S704: If the number of established connections has not reached the node connection limit, the first node is invoked to establish a communication connection with the client based on the connection request.

[0128] S706, when the number of established connections reaches the node connection limit, sends a redirection response to the client regarding the connection request; the redirection response is used to instruct the client to resend the connection request to the second node among multiple service nodes.

[0129] The contents of S702-S706 can be referred to the foregoing adaptive description.

[0130] As can be seen from the above, the method provided by the application can be used for a distributed database system with service nodes to realize dynamic node-level and system-level maximum connection number limitation, does not depend on another load balancing component, has the ability to realize connection dispersion balancing in a complex network environment, and thus improves the processing performance and stability of the distributed database system as a whole.

[0131] For a distributed database system with multiple service nodes, the commonly used connection control method often sets the maximum connection number of each service node as a static configuration, which is difficult to adapt to the dynamic changes of business connections and loads. The connection control method provided by the application can dynamically adjust the maximum connection number of each service node and the whole system according to the current system established connection number and load condition, can flexibly and efficiently cope with business connection and load changes, and improves the system resource utilization and stability.

[0132] In a complex network environment, such as cross-regional deployment, a single load balancing component cannot be used to proxy business access, thereby limiting the overall connection number of the whole system, and this commonly used technical means cannot be used to realize connection dispersion balancing of multiple service nodes in the distributed database system. The method provided by the application does not depend on another load balancing component, can realize the limitation of the overall connection number of the system in a complex network environment, and has the effect of dispersing and balancing business connections among multiple service nodes.

[0133] In summary, the method provided by the application realizes dynamic service node-level and system-level maximum connection number limitation for a distributed database with multiple service nodes, can flexibly and efficiently adapt to business connection and load changes, does not depend on another load balancing component, has the ability to realize connection dispersion balancing in a complex network environment, and thus improves the processing performance and stability of the system as a whole. Compared with the commonly used technical means, it has stronger functions and wider application scenarios. Therefore, realizing connection and load balancing of multiple service nodes in a distributed environment helps to avoid resource contention and improve the throughput capacity of the system.

[0134] It should be understood that although each step in the flowchart involved in each embodiment as described above is shown in sequence according to the direction of the arrow, these steps are not necessarily executed in the order indicated by the arrow. Unless otherwise specified herein, there is no strict order limitation for the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in the flowchart involved in each embodiment as described above can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but can be alternately or alternately executed with at least some of the other steps or steps or stages in other steps. It can be understood that the steps in different embodiments can be freely combined as needed, and various non-contradictory schemes formed by the combination are within the scope of protection of the present application.

[0135] Based on the same inventive concept, the embodiments of the present application also provide a connection control device of a distributed database system for implementing the connection control method of the distributed database system as described above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more connection control device embodiments of the distributed database system provided below can refer to the limitations of the connection control method of the distributed database system described above, and will not be repeated here.

[0136] In one exemplary embodiment, as shown in Figure 8 A connection control device of a distributed database system is provided, the distributed database system comprising a plurality of service nodes, the device comprising: an acquisition module 802, an extraction module 804, and a processing module 806, wherein:

[0137] The acquisition module 802 is configured to, in a case where a connection request of a client for a first node of the plurality of service nodes is received, acquire connection control configuration information pre-configured for the distributed database system and running state information of the first node; the extraction module 804 is configured to extract node configuration information of the first node from the connection control configuration information; and the processing module 806 is configured to process the connection request according to the node configuration information and the running state information.

[0138] In one embodiment, the processing module 806 is further configured to: parse the node configuration information to obtain a node connection upper limit of the first node; parse the running state information to obtain an established connection number of the first node; and in a case where the established connection number does not reach the node connection upper limit, establish a communication connection between the first node and the client based on the connection request.

[0139] In one of the embodiments, the processing module 806 is further configured to: in the case that the number of established connections reaches the upper limit of the number of connections of the node, feed back a redirection response to the client for the connection request; the redirection response is used to instruct the client to resend a connection request to a second node in the plurality of service nodes.

[0140] In one of the embodiments, the processing module 806 is further configured to: count the number of established connections corresponding to each of the plurality of service nodes to obtain a system connection number of the distributed database system; extract the upper limit of the system connection number of the distributed database system from the connection control configuration information; in the case that the system connection number reaches the upper limit of the system connection number, reject a new connection request from the client.

[0141] In one of the embodiments, the analysis result of the node configuration information further includes a connection idle duration, and the processing module 806 is further configured to: in the case that the number of established connections reaches the upper limit of the number of connections of the node, send indication information to the first node to update the number of established connections of the first node; the indication information is used to instruct the first node to close a communication connection with a communication idle duration greater than the connection idle duration; and perform processing on the connection request based on a comparison result between the updated number of established connections and the upper limit of the number of connections of the node.

[0142] In one of the embodiments, the processing module 806 is further configured to: for a plurality of remaining nodes in the plurality of service nodes except the first node, analyze running state information of each of the remaining nodes to obtain a number of established connections and a node load of each of the remaining nodes; in the case that the number of established connections of the remaining node is less than a quantity threshold value and the node load is less than a load threshold value, determine the remaining node as the second node.

[0143] In one of the embodiments, the processing module 806 is further configured to: extract a balancing strategy matched with the first node from the connection control configuration information; and determine the service node in the balancing strategy as the second node.

[0144] In one of the embodiments, the analysis result of the running state information further includes a node load; and the processing module 806 is further configured to: in the case that the node load is less than a preset lower limit of the load, and a quantity difference between the number of established connections and the upper limit of the number of connections of the node is greater than a preset threshold value, lower the upper limit of the number of connections of the first node.

[0145] In one of the embodiments, the processing module 806 is further configured to: for a plurality of remaining nodes in the plurality of service nodes except the first node, increase the node connection number upper limit of a target node in the plurality of remaining nodes under the condition that the node connection number upper limit of the first node is decreased; and determine the target node as the second node.

[0146] In one of the embodiments, the processing module 806 is further configured to: predict the connection demand of the first node according to the historical connection data of the first node; and adjust the node connection number upper limit of the first node based on the predicted connection demand.

[0147] The modules in the connection control apparatus of the distributed database system can be implemented by software, hardware, or a combination thereof. The modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory in the computer device in software form, so as to be called and executed by the processor to perform the operations corresponding to the modules.

[0148] In one of the embodiments, a computer device is provided, which can be a distributed database system. The internal structure diagram of the computer device can be as shown in Figure 9 The computer device includes a processor, a memory, an input / output interface, and a communication interface. The processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The database of the computer device is configured to store data in the connection control of the distributed database system. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to communicate with external terminals through a network connection. The computer program is executed by the processor to implement a connection control method of a distributed database system.

[0149] Those skilled in the art can understand that Figure 8 The structure shown in the above-mentioned embodiments is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0150] In one example embodiment, a computer device is provided, comprising a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program: in a case where a connection request from a client to a first node in a plurality of service nodes is received, obtaining connection control configuration information pre-configured for the distributed database system and running state information of the first node; the distributed database system comprising a plurality of service nodes; from the connection control configuration information, extracting node configuration information of the first node; and processing the connection request according to the node configuration information and the running state information.

[0151] In one of the embodiments, the processor further implements the following steps when executing the computer program: parsing the node configuration information to obtain an upper limit of a node connection number of the first node; parsing the running state information to obtain an established connection number of the first node; and in a case where the established connection number does not reach the upper limit of the node connection number, establishing a communication connection between the first node and the client based on the connection request.

[0152] In one of the embodiments, the processor further implements the following steps when executing the computer program: in a case where the established connection number reaches the upper limit of the node connection number, feeding back a redirection response to the connection request to the client; the redirection response being used to instruct the client to resend a connection request to a second node in the plurality of service nodes.

[0153] In one of the embodiments, the processor further implements the following steps when executing the computer program: counting the established connection numbers of the plurality of service nodes respectively to obtain a system connection number of the distributed database system; extracting an upper limit of a system connection number of the distributed database system from the connection control configuration information; and in a case where the system connection number reaches the upper limit of the system connection number, rejecting a new connection request from the client.

[0154] In one of the embodiments, the parsing result of the node configuration information further comprises a connection idle duration, and the processor further implements the following steps when executing the computer program: in a case where the established connection number reaches the upper limit of the node connection number, sending indication information to the first node to update the established connection number of the first node; the indication information being used to instruct the first node to close a communication connection with an idle duration greater than the connection idle duration; and processing the connection request based on a comparison result between the updated established connection number and the upper limit of the node connection number.

[0155] In one of the embodiments, the processor, when executing the computer program, further implements the following steps: analyzing the running state information of each of the remaining nodes to obtain the number of established connections and the node load of each of the remaining nodes, for the remaining nodes other than the first node among the plurality of service nodes; determining the remaining node as the second node, in the case that the number of established connections of the remaining node is less than the number threshold and the node load is less than the load threshold.

[0156] In one of the embodiments, the processor, when executing the computer program, further implements the following steps: extracting the balancing strategy matched with the first node from the connection control configuration information; and determining the service node in the balancing strategy as the second node.

[0157] In one of the embodiments, the analysis result of the running state information further comprises the node load; and the processor, when executing the computer program, further implements the following steps: lowering the node connection number upper limit of the first node, in the case that the node load is less than the preset lower limit of the load and the number difference between the number of established connections and the node connection number upper limit is greater than the preset threshold.

[0158] In one of the embodiments, the processor, when executing the computer program, further implements the following steps: increasing the node connection number upper limit of a target node among the plurality of remaining nodes, in the case that the node connection number upper limit of the first node is lowered, for the remaining nodes other than the first node among the plurality of service nodes; and determining the target node as the second node.

[0159] In one of the embodiments, the processor, when executing the computer program, further implements the following steps: predicting the connection demand of the first node according to the historical connection data of the first node; and adjusting the node connection number upper limit of the first node based on the predicted connection demand.

[0160] In one of the embodiments, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program. The processor, when executing the computer program, implements the following steps: obtaining the connection control configuration information pre-configured for the distributed database system and the running state information of the first node, in the case that a connection request of a client for a first node among a plurality of service nodes is received; the distributed database system comprises the plurality of service nodes; extracting the node configuration information of the first node from the connection control configuration information; and processing the connection request according to the node configuration information and the running state information.

[0161] In one of the embodiments, the computer program, when executed by the processor, further implements the following steps: parsing the node configuration information to obtain the node connection upper limit of the first node; parsing the running state information to obtain the established connection number of the first node; in the case that the established connection number does not reach the node connection upper limit, based on the connection request, calling the first node to establish a communication connection with the client.

[0162] In one of the embodiments, the computer program, when executed by the processor, further implements the following steps: in the case that the established connection number reaches the node connection upper limit, feeding back a redirection response to the connection request to the client; the redirection response is used to instruct the client to resend a connection request to a second node in the plurality of service nodes.

[0163] In one of the embodiments, the computer program, when executed by the processor, further implements the following steps: counting the established connection number of each of the plurality of service nodes to obtain the system connection number of the distributed database system; extracting the system connection upper limit of the distributed database system from the connection control configuration information; in the case that the system connection number reaches the system connection upper limit, rejecting a new connection request from the client.

[0164] In one of the embodiments, the parsing result of the node configuration information further includes a connection idle duration, and the computer program, when executed by the processor, further implements the following steps: in the case that the established connection number reaches the node connection upper limit, sending an indication information to the first node to update the established connection number of the first node; the indication information is used to instruct the first node to close a communication connection with a communication idle duration greater than the connection idle duration; based on the comparison result between the updated established connection number and the node connection upper limit, processing the connection request.

[0165] In one of the embodiments, the computer program, when executed by the processor, further implements the following steps: for a plurality of remaining nodes in the plurality of service nodes except the first node, analyzing the running state information of each of the remaining nodes to obtain the established connection number and the node load of each of the remaining nodes; in the case that the established connection number of the remaining node is less than a quantity threshold value and the node load is less than a load threshold value, determining the remaining node as the second node.

[0166] In one of the embodiments, the computer program, when executed by the processor, further implements the following steps: extracting a balancing strategy matched with the first node from the connection control configuration information; determining the service node in the balancing strategy as the second node.

[0167] In one of the embodiments, the analysis result of the running state information further comprises a node load; and the computer program, when executed by the processor, further implements the following steps: in a case where the node load is less than a preset lower limit of the load, and a quantity difference between the established connection number and the node connection number upper limit of the first node is greater than a preset threshold, the node connection number upper limit of the first node is lowered.

[0168] In one of the embodiments, the computer program, when executed by the processor, further implements the following steps: for a plurality of remaining nodes in the plurality of service nodes except the first node, in a case where the node connection number upper limit of the first node is lowered, the node connection number upper limit of a target node in the plurality of remaining nodes is raised; and the target node is determined as the second node.

[0169] In one of the embodiments, the computer program, when executed by the processor, further implements the following steps: according to historical connection data of the first node, a connection demand of the first node is predicted; and based on the predicted connection demand, the node connection number upper limit of the first node is adjusted.

[0170] In one of the embodiments, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the following steps: in a case where a connection request of a client for a first node in a plurality of service nodes is received, connection control configuration information pre-configured for a distributed database system and running state information of the first node are obtained; the distributed database system comprises the plurality of service nodes; from the connection control configuration information, node configuration information of the first node is extracted; and according to the node configuration information and the running state information, the connection request is processed.

[0171] In one of the embodiments, the computer program, when executed by the processor, further implements the following steps: the node configuration information is analyzed to obtain a node connection number upper limit of the first node; the running state information is analyzed to obtain an established connection number of the first node; and in a case where the established connection number does not reach the node connection number upper limit, based on the connection request, the first node and the client establish a communication connection.

[0172] In one of the embodiments, the computer program, when executed by the processor, further implements the following steps: in a case where the established connection number reaches the node connection number upper limit, a redirection response to the connection request is fed back to the client; and the redirection response is used to instruct the client to resend the connection request to a second node in the plurality of service nodes.

[0173] In one of the embodiments, the computer program, when executed by the processor, further implements the following steps: counting the number of established connections corresponding to each of the plurality of service nodes to obtain a system connection number of the distributed database system; extracting the upper limit of the system connection number of the distributed database system from the connection control configuration information; and rejecting a new connection request from the client in a case where the system connection number reaches the upper limit of the system connection number.

[0174] In one of the embodiments, the analysis result of the node configuration information further includes a connection idle duration, and the computer program, when executed by the processor, further implements the following steps: sending indication information to the first node to update the number of established connections of the first node in a case where the number of established connections reaches the upper limit of the node connection number; the indication information is used to instruct the first node to close a communication connection with a communication idle duration greater than the connection idle duration; and processing the connection request based on a comparison result between the updated number of established connections and the upper limit of the node connection number.

[0175] In one of the embodiments, the computer program, when executed by the processor, further implements the following steps: analyzing the running state information of each of the plurality of remaining nodes except the first node in the plurality of service nodes to obtain the number of established connections and the node load of each of the plurality of remaining nodes; and determining the plurality of remaining nodes as the second node in a case where the number of established connections of the plurality of remaining nodes is less than a quantity threshold value and the node load is less than a load threshold value.

[0176] In one of the embodiments, the computer program, when executed by the processor, further implements the following steps: extracting a balancing strategy matched with the first node from the connection control configuration information; and determining the service node in the balancing strategy as the second node.

[0177] In one of the embodiments, the analysis result of the running state information further includes a node load, and the computer program, when executed by the processor, further implements the following steps: lowering the upper limit of the node connection number of the first node in a case where the node load is less than a preset lower limit of the load and a quantity difference between the number of established connections and the upper limit of the node connection number is greater than a preset threshold value.

[0178] In one of the embodiments, the computer program, when executed by the processor, further implements the following steps: increasing the upper limit of the node connection number of a target node in the plurality of remaining nodes in a case where the upper limit of the node connection number of the first node is lowered; and determining the target node as the second node.

[0179] In one of the embodiments, the computer program, when executed by the processor, further implements the following steps: predicting the connection demand of the first node according to historical connection data of the first node; and adjusting the upper limit of the node connection number of the first node based on the predicted connection demand.

[0180] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant regulations.

[0181] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. The non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. The volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., without being limited thereto.

[0182] The technical features of the above embodiments can be combined in any manner. To make the description concise, not all possible combinations of the technical features in the above embodiments are described, but as long as the combinations of the technical features do not exist contradictions, they should be considered as the scope of the present application.

[0183] The above-described embodiments are merely illustrative of several embodiments of the present application, and the description is relatively specific and detailed, but should not be understood as a limitation on the scope of the patent. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of protection of the present application should be subject to the appended claims.

Claims

1. A connection control method of a distributed database system, characterized by, The distributed database system comprises a plurality of service nodes, and the method comprises: In the case of receiving a connection request of a client for a first node in the plurality of service nodes, obtaining connection control configuration information pre-configured for the distributed database system and running state information of the first node; From the connection control configuration information, extracting node configuration information of the first node; According to the node configuration information and the running state information, processing the connection request.

2. The method of claim 1, wherein, The processing of the connection request according to the node configuration information and the running state information comprises: Parsing the node configuration information to obtain an upper limit of the node connection number of the first node; Parsing the running state information to obtain the established connection number of the first node; In the case that the established connection number does not reach the upper limit of the node connection number, based on the connection request, calling the first node to establish a communication connection with the client.

3. The method of claim 2, wherein, The method further comprises: In the case that the established connection number reaches the upper limit of the node connection number, feeding back a redirection response to the client for the connection request; the redirection response is used to instruct the client to resend a connection request to a second node in the plurality of service nodes.

4. The method of claim 3, wherein, The method further comprises: Counting the respective established connection numbers of the plurality of service nodes to obtain a system connection number of the distributed database system; From the connection control configuration information, extracting an upper limit of the system connection number of the distributed database system; In the case that the system connection number reaches the upper limit of the system connection number, refusing to receive a new connection request from the client.

5. The method of claim 2, wherein, The parsing result of the node configuration information further comprises a connection idle time length, and the method further comprises: In the case that the established connection number reaches the upper limit of the node connection number, sending indication information to the first node to update the established connection number of the first node; the indication information is used to instruct the first node to close a communication connection with a communication idle time length greater than the connection idle time length; Based on the comparison result between the updated established connection number and the upper limit of the node connection number, processing the connection request.

6. The method of claim 3, wherein, The method further comprises: For a plurality of remaining nodes in the plurality of service nodes except the first node, analyzing the running state information of each of the remaining nodes to obtain the respective established connection number and node load of each of the remaining nodes; In the case that the established connection number of the remaining node is less than a quantity threshold value and the node load is less than a load threshold value, determining the remaining node as the second node.

7. The method of claim 3, wherein, The method further comprises: From the connection control configuration information, extracting a balancing strategy matched with the first node; Determining the service node in the balancing strategy as the second node.

8. The method of claim 3, wherein, The parsing result of the running state information further comprises a node load; the method further comprises: In the case that the node load is less than a preset lower limit of load, and the quantity difference between the established connection number and the upper limit of the node connection number is greater than a preset threshold value, lowering the upper limit of the node connection number of the first node.

9. The method of claim 8, wherein, The method further comprises: for a plurality of remaining nodes in the plurality of service nodes, increasing the node connection number upper limit of a target node in the plurality of remaining nodes under the condition that the node connection number upper limit of the first node is decreased; determining the target node as the second node.

10. The method according to any one of claims 2 to 7, characterized in that, The method further comprises: predicting the connection demand of the first node according to historical connection data of the first node; adjusting the node connection number upper limit of the first node based on the predicted connection demand.

11. A connection control apparatus of a distributed database system, characterized by comprising: The distributed database system comprises a plurality of service nodes, and the device comprises: an obtaining module, configured to, in a case where a connection request of a client for a first node in the plurality of service nodes is received, obtain connection control configuration information pre-configured for the distributed database system and running state information of the first node; an extracting module, configured to extract node configuration information of the first node from the connection control configuration information; a processing module, configured to process the connection request according to the node configuration information and the running state information.

12. A distributed database system, characterized by The distributed database system comprises a proxy node and a plurality of service nodes; the proxy node is configured to implement the steps of the method in any one of claims 1 to 10.

13. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor executes the computer program to implement the steps of the method in any one of claims 1 to 10.

14. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 10.

15. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 10. The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 10.

Citation Information

Patent Citations

  • Cross-cluster load balancing method and device, equipment and storage medium

    CN117149445A

  • Medical alliance chain dynamic security resource configuration method

    CN119271500A

  • Data distribution method and device, electronic equipment and storage medium

    CN119440826A

  • Method and apparatus for allocating resources and tasks in distributed system, and system

    WO2021036936A1

  • Timestamp generation method and apparatus, and electronic device, and non-volatile storage medium

    WO2025112858A1