Unlock instant, AI-driven research and patent intelligence for your innovation.

Connection method, device, equipment and storage medium of database cluster

A connection method and database technology, applied in the database field, can solve problems such as affecting the speed of database connection, and achieve the effect of preventing database overload and improving connection speed.

Active Publication Date: 2021-11-02
SHANGHAI DAMENG DATABASE
View PDF9 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

The connection between the client and the database is realized through a third-party intermediary, which affects the speed of the database connection

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Connection method, device, equipment and storage medium of database cluster
  • Connection method, device, equipment and storage medium of database cluster
  • Connection method, device, equipment and storage medium of database cluster

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0049] figure 1 It is a flow chart of a method for connecting a database cluster provided by Embodiment 1 of the present invention. This embodiment is applicable to the situation when a client connects to a database cluster. and / or software, and generally can be integrated in computers, servers and all terminals that can access the background database. Such as figure 1 As shown, the method specifically includes the following steps.

[0050] Step 110, the user equipment obtains the number of databases of the database cluster to be connected.

[0051] Wherein, the database cluster may be a virtual single database composed of two or more databases, so as to provide database services to clients. The number of databases is the number of databases included in the data cluster.

[0052] Optionally, before the user equipment obtains the number of databases of the database cluster to be connected, the following steps are further included: configuring the database connection address...

Embodiment 2

[0064] Figure 2a The flow chart of a database cluster connection method provided by Embodiment 2 of the present invention is based on the above embodiments, as shown in Figure 2a As shown, the method includes the following steps.

[0065] Step 210, configure the database connection address set in the setting configuration file.

[0066] Step 220, analyze the setting configuration file to obtain a database connection address set, and determine the number of databases to be connected to the database cluster according to the number of elements contained in the database connection address set.

[0067] Step 230 , judging whether it is the first time for the user equipment to establish a connection with the database cluster, if yes, execute step 240 , if not, execute step 250 .

[0068] In this embodiment, when configuring the database connection address set, a connection initial value is set, and the connection initial value can be set to -1. When the user equipment receives a...

Embodiment 3

[0083] image 3 It is a schematic structural diagram of a connection device for a database cluster provided by Embodiment 3 of the present invention. Such as image 3 As shown, the device includes: a database number acquisition module 310 , a target database connection address determination module 320 and a database cluster connection module 330 .

[0084] A database quantity acquisition module 310, configured to acquire the database quantity of the database cluster to be connected;

[0085] The target database connection address determination module 320 is used to determine the target database connection address according to the random number and the number of databases;

[0086] The database cluster connection module 330 is configured to connect to the database cluster according to the target database connection address.

[0087] Optionally, also include:

[0088] The database connection address set configuration module is used to configure the database connection addres...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The embodiment of the invention discloses a database cluster connection method, device, equipment and storage medium. The method includes: the user equipment obtains the number of databases of the database cluster to be connected; the user equipment determines a target database connection address according to the random number and the database number; the user equipment connects to the database cluster according to the target database connection address. The connection method of the database cluster provided in this embodiment determines the connection address of the target database according to the random number and the number of databases, so that each time the client connects to the database, it is evenly distributed, preventing the database from being overloaded by only connecting one or several of them at a time. , realizes the load balancing connection of the database cluster, and does not use middleware, which can improve the connection speed.

Description

technical field [0001] Embodiments of the present invention relate to the technical field of databases, and in particular, to a database cluster connection method, device, device, and storage medium. Background technique [0002] With the development of the Internet and the advent of the era of big data, more and more websites or enterprise servers use database clusters to provide services in the background, which can not only improve the stability of the database, but also improve the performance of the server. A database cluster is a virtual single database composed of two or more databases, thereby providing database services to clients. [0003] With the emergence of database clusters, in order to ensure the maximum performance of the database cluster and provide efficient services, it is particularly important to perform load balancing among multiple databases. In related technologies, third-party middleware is usually used to implement load-balanced connections of dat...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F16/25G06F16/27G06F9/50
CPCG06F9/5083
Inventor 王家贤韩冷
Owner SHANGHAI DAMENG DATABASE