CN113220767A - Database connection management method and device - Google Patents

Database connection management method and device Download PDF

Info

Publication number
CN113220767A
CN113220767A CN202110589787.XA CN202110589787A CN113220767A CN 113220767 A CN113220767 A CN 113220767A CN 202110589787 A CN202110589787 A CN 202110589787A CN 113220767 A CN113220767 A CN 113220767A
Authority
CN
China
Prior art keywords
connection
database
request
client
connection request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110589787.XA
Other languages
Chinese (zh)
Inventor
陈郑渊明
侯恩腾
赵少骏
崔文强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110589787.XA priority Critical patent/CN113220767A/en
Publication of CN113220767A publication Critical patent/CN113220767A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt

Abstract

The invention provides a database connection management method and a database connection management device, which relate to the field of finance, and the method comprises the following steps: receiving a database connection request of a client; judging whether to accept the connection request according to a preset connection parameter threshold; and if the connection request is determined to be accepted, allowing the client to perform database connection. The server connection management service can control the number of application connections initiated by the client according to the preset connection parameter threshold, and can make the connection with high priority apply for priority when the connection resources are in shortage. The problem of service downtime caused by uncontrollable connection quantity is well solved, and the availability of the system is improved by preferentially letting the main connections pass through.

Description

Database connection management method and device
Technical Field
The invention relates to a data processing technology, in particular to a database connection management method and a database connection management device.
Background
For client software, there are many data operations that require operating a database, for example, Delphi uses a DataSet control to connect to the database, and since the operations on the database are completely carried by clients, the number of database connections is proportional to the number of clients.
If the client side is directly connected with the database without connection management measures, when a plurality of client sides exist and the same client side has a scene of operating the database concurrently, the problems of downtime of the database, application blocking and the like are caused due to the fact that the number of instantaneous connections is too large. Meanwhile, a client creates a new database connection every time when performing database interaction, and needs explicit open and close in codes, and for a client system related to a large amount of database interaction, database connection needs to be frequently created, and when performing database connection at the same time by a plurality of clients, resource exhaustion of a database connection pool is easily caused, uniform database connection resource management is lacked, critical resource exhaustion of production database connection occurs, and a service system is unavailable.
Disclosure of Invention
Aiming at the defects of database connection in the prior art, the invention provides a database connection management method, which comprises the following steps:
receiving a database connection request of a client;
judging whether to accept the connection request according to a preset connection parameter threshold;
and if the connection request is determined to be accepted, allowing the client to perform database connection.
In the embodiment of the present invention, the connection parameter threshold includes: and presetting a priority application connection threshold value for the maximum connection threshold value of the database.
In the embodiment of the present invention, the determining whether to accept the connection request according to a preset connection parameter threshold includes:
judging whether the connection number of the database is greater than the preset priority application connection threshold value or not, and receiving the connection request if the current connection number of the database is less than the preset priority application connection threshold value;
if the current connection number is not less than the preset priority application connection threshold value, judging whether the current connection number of the database is less than the maximum connection threshold value of the database;
if the connection request is less than the maximum connection threshold value of the database, the connection request is accepted;
if the maximum connection threshold value is not less than the maximum connection threshold value of the database, judging whether the connection request is a preset priority connection application or not
And if the connection request is determined to be the preset priority connection application, accepting the connection request, otherwise rejecting the connection request.
In this embodiment of the present invention, if the determining to accept the connection request and allow the client to perform database connection includes:
determining to accept the connection request and generating a token of the current connection request;
and sending the token to the client and developing a database connection to the client.
In this embodiment of the present invention, if the determining to accept the connection request and then allowing the client to perform database connection further includes:
storing the generated token and recording the connection time of the client.
Meanwhile, the invention also provides a database connection management device, which comprises:
the request receiving module is used for receiving a database connection request of a client;
the judging module judges whether to accept the connection request according to a preset connection parameter threshold;
and the request processing module is used for allowing the client to carry out database connection if the connection request is determined to be accepted.
In the embodiment of the present invention, the determining, by the determining module, whether to accept the connection request according to a preset connection parameter threshold includes:
judging whether the connection number of the database is greater than the preset priority application connection threshold value or not, and receiving the connection request if the current connection number of the database is less than the preset priority application connection threshold value;
if the current connection number is not less than the preset priority application connection threshold value, judging whether the current connection number of the database is less than the maximum connection threshold value of the database;
if the connection request is less than the maximum connection threshold value of the database, the connection request is accepted;
if the connection request is not smaller than the maximum connection threshold value of the database, judging whether the connection request is a preset priority connection application;
and if the connection request is determined to be the preset priority connection application, accepting the connection request, otherwise rejecting the connection request.
In the embodiment of the present invention, the request processing module includes:
the token generation unit is used for determining to accept the connection request and generating a token of the current connection request;
and the connection unit is used for sending the token to the client and developing database connection for the client.
In this embodiment of the present invention, the request processing module further includes:
and the storage unit is used for storing the generated token and recording the connection time of the client.
Meanwhile, the invention also provides computer equipment which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor realizes the method when executing the computer program.
Meanwhile, the invention also provides a computer readable storage medium, and a computer program for executing the method is stored in the computer readable storage medium.
The invention provides a database connection management method and a database connection management device, which judge whether to accept the connection request according to a preset connection parameter threshold; and if the connection request is determined to be accepted, allowing the client to perform database connection. Through the connection management service, the number of application connections initiated by the client can be controlled according to a preset connection parameter threshold, and high-priority connections can be applied preferentially when connection resources are in shortage. The problem of service downtime caused by uncontrollable connection quantity is well solved, and the availability of the system is improved by preferentially letting the main connections pass through.
In order to make the aforementioned and other objects, features and advantages of the invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart of a database connection management method provided by the present invention;
FIG. 2 is a schematic diagram of an embodiment of the present invention;
FIG. 3 is a schematic diagram of an embodiment of the present invention;
FIG. 4 is a block diagram of a database connection management apparatus according to the present invention;
fig. 5 is a schematic diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the prior art, if a connection management measure is not provided when a client is directly connected with a database, when a plurality of clients exist and the same client has a scene of operating the database concurrently, the problems of database downtime, application deadlock and the like are caused due to the fact that the number of instantaneous connections is too large.
In view of the above, the present invention provides a database connection management method, as shown in fig. 1, including:
step S101, receiving a database connection request of a client;
step S102, judging whether to accept the connection request according to a preset connection parameter threshold value;
step S103, if the connection request is determined to be accepted, the client is allowed to perform database connection.
The database connection management method provided by the invention judges whether to accept the connection request according to the preset connection parameter threshold value, provides a database connection management method which can be conveniently configured and uniformly managed in a background, and can preferentially ensure that an important connection application passes and a secondary connection application blocks when the data connection resources are in shortage by utilizing the preset connection parameter threshold value, thereby achieving the purpose of high availability of the system.
Further, in the embodiment of the present invention, the connection parameter threshold includes: and presetting a priority application connection threshold value for the maximum connection threshold value of the database.
In an embodiment of the present invention, a maximum application threshold (i.e., a maximum connection threshold of a database) and a primary application limit threshold (i.e., a preset priority application connection threshold, where the maximum application threshold is greater than the primary application limit threshold) are set, a connection priority parameter (primary or secondary, default to primary when not being transmitted) is attached to a connection application, when there is a connection application, it is determined whether the number of connections that survive in the application record table exceeds the primary application limit threshold, and if so, it is determined whether the maximum application threshold is reached, if so, it is determined whether the connection is a primary application, and if so, the connection is accepted, otherwise, the connection is rejected.
Further, in the embodiment of the present invention, the determining whether to accept the connection request according to a preset connection parameter threshold includes:
judging whether the connection number of the database is greater than the preset priority application connection threshold value or not, and receiving the connection request if the current connection number of the database is less than the preset priority application connection threshold value;
if the current connection number is not less than the preset priority application connection threshold value, judging whether the current connection number of the database is less than the maximum connection threshold value of the database;
if the connection request is less than the maximum connection threshold value of the database, the connection request is accepted;
if the maximum connection threshold value is not less than the maximum connection threshold value of the database, judging whether the connection request is a preset priority connection application or not
And if the connection request is determined to be the preset priority connection application, accepting the connection request, otherwise rejecting the connection request.
Specifically, when a connection application exists, it is first determined whether the number of connections that survive in the application record table exceeds a main application limit threshold, and if so, it is then determined whether the maximum application threshold is reached, and if so, it is then determined whether the connection is a main application, and if so, it is accepted, otherwise, it is rejected. When the client application is rejected, the client initiates retry, the client can set the maximum retry times, and when the retry times exceed the maximum retry times, the upstream is informed, and the application of the database resources fails. Therefore, the problem of service downtime caused by uncontrollable connection quantity is well solved, and the availability of the system is improved by preferentially letting the main connections pass through.
The method comprises the steps of presetting a priority application connection threshold value through the maximum connection threshold value of a database, and judging the number of connections, thereby solving the problems that in the prior art, the application has a difference between a main service and a secondary service, and when the connection resource of the database is in shortage due to the increase of the service volume, the main service cannot be ensured to be available.
In this embodiment of the present invention, if the determining to accept the connection request and allow the client to perform database connection includes:
determining to accept the connection request and generating a token of the current connection request;
and sending the token to the client and developing a database connection to the client.
Specifically, in the embodiment of the present invention, by setting the connection application record table, whenever there is a connection application, a token (token) corresponding to the application is stored, and when the connection is closed, the token is synchronously sent to apply for closing the token. Therefore, the JAVA-based database connection management method is provided, the number of application connections initiated by a client can be controlled through a connection management server, and high-priority connection priority application can be given when connection resources are in shortage.
In this embodiment of the present invention, if the determining to accept the connection request and then allowing the client to perform database connection further includes:
storing the generated token and recording the connection time of the client.
Connection failure caused by network and other reasons is avoided, but connection applications still occupy connection resources in the application form, the application form is monitored in the service, and connection applications which are not released after a fixed time is exceeded are directly deleted.
Interpretation of terms:
Token:
in computer authentication, this means "token". Token is a string of character strings generated by the server and used as a Token requested by the client. In the invention, when the client applies for the first time, a token is generated for the connection request and returned to the client, and when the client requests to close the connection, the server can judge which request is carried out according to the token.
socket
socket is an abstraction of breakpoints for bi-directional communication between application processes on different hosts in a network. A socket is the end of a process's communication over a network and provides a mechanism for application layer processes to exchange data using a network protocol. In the invention, socket is used as a communication means of a delphi end and a JAVA end.
The embodiment of the invention provides a client connection management device, which is used for receiving a database connection request of a client, judging whether to accept the connection request according to a preset connection parameter threshold value, determining to accept the connection request, and allowing the client to carry out database connection so as to overcome the defects of unlimited connection and lack of unified resource management in the prior art; when the data connection resource is short, the important connection application can be preferentially ensured to pass, and the secondary connection application is blocked, so that the aim of high availability of the system is fulfilled.
As shown in fig. 2, a schematic diagram of connection management performed by the client connection management apparatus provided in this embodiment is that a java-based database connection management service is built at a server, and a delphi client and a connection management terminal communicate through a socket.
The delphi client sends an open application to the connection management server through the socket;
after the application is successful, the connection management server generates a token;
returning the generated token to the client for open connection;
the client sends a close application with token through socket;
the connection management server releases the connection;
and informing the client of successful release.
1. In the embodiment of the invention, a connection application record table is arranged in a memory of a connection management server, a token corresponding to the application is stored whenever a connection application exists, and the token is synchronously sent and applied to close when the connection is closed;
2. in the embodiment of the invention, the connection management terminal sets the maximum application threshold maxConnectSize and the main application limit threshold mammaxconnectsize, wherein in the embodiment of the invention, the maximum application threshold is larger than the main application limit threshold.
The connection application is attached with a connection priority parameter (primary or secondary, when not transmitted, the default is primary), when the connection application exists, whether the number of the connections living in the application record table exceeds a primary application limit threshold is judged, if the number exceeds the primary application limit threshold, whether the maximum application threshold is reached is judged, if the maximum application threshold is reached, whether the connection is primarily applied is judged, if the maximum application threshold is exceeded, the connection is accepted, and if the maximum application threshold is not reached, the connection is rejected. When the client application is rejected, retry is initiated, the client can set the maximum retry time maxRetryTime, and when the retry time exceeds the maximum retry time, the upstream is informed, and the application of the database resources fails. Fig. 3 is a schematic flow chart illustrating the connection number determination in the embodiment of the present invention.
In order to avoid connection failure caused by network and the like, but the connection application still occupies connection resources in the application table, the application table is monitored in the service, and the connection application which is not released after the fixed time is exceeded is directly deleted.
The embodiment of the invention provides a JAVA-based database connection management device, which can control the number of application connections initiated by a client through a connection management server and can make a connection with high priority apply for priority when connection resources are in shortage. The problem of service downtime caused by uncontrollable connection quantity is well solved, and the availability of the system is improved by preferentially letting the main connections pass through.
Meanwhile, the present invention further provides a database connection management apparatus, as shown in fig. 4, which is a block diagram of the database connection management apparatus provided by the present invention, and the apparatus includes:
a request receiving module 401, configured to receive a database connection request of a client;
a judging module 402, configured to judge whether to accept the connection request according to a preset connection parameter threshold;
and the request processing module 403, determining to accept the connection request, allowing the client to perform database connection.
The database connection management device provided by the invention judges whether to accept the connection request according to the preset connection parameter threshold value, and provides a database connection management method which can be conveniently configured and uniformly managed in a background.
Further, in the embodiment of the present invention, the connection parameter threshold includes: and presetting a priority application connection threshold value for the maximum connection threshold value of the database.
In an embodiment of the present invention, the database connection management apparatus sets a maximum application threshold (i.e., a maximum connection threshold of the database) and a primary application limit threshold (i.e., a preset priority application connection threshold, where the maximum application threshold is greater than the primary application limit threshold), and attaches a connection priority parameter (primary or secondary, and default to primary when not being transmitted) to the connection application, when there is a connection application, first determines whether the number of connections that survive in the application record table exceeds the primary application limit threshold, and if so, then determines whether the maximum application threshold is reached, if so, then determines whether the connection is a primary application, if so, accepts, otherwise, rejects.
In the embodiment of the present invention, the determining, by the determining module, whether to accept the connection request according to a preset connection parameter threshold includes:
judging whether the connection number of the database is greater than the preset priority application connection threshold value or not, and receiving the connection request if the current connection number of the database is less than the preset priority application connection threshold value;
if the current connection number is not less than the preset priority application connection threshold value, judging whether the current connection number of the database is less than the maximum connection threshold value of the database;
if the connection request is less than the maximum connection threshold value of the database, the connection request is accepted;
if the connection request is not smaller than the maximum connection threshold value of the database, judging whether the connection request is a preset priority connection application;
and if the connection request is determined to be the preset priority connection application, accepting the connection request, otherwise rejecting the connection request.
In the embodiment of the present invention, the request processing module includes:
the token generation unit is used for determining to accept the connection request and generating a token of the current connection request;
and the connection unit is used for sending the token to the client and developing database connection for the client.
In this embodiment of the present invention, the request processing module further includes:
and the storage unit is used for storing the generated token and recording the connection time of the client.
The database connection management apparatus provided in this embodiment presets a priority application connection threshold value through a maximum connection threshold value of a database, and determines the number of connections, thereby solving the problem that in the prior art, when there is a difference between a primary service and a secondary service for an application, and when a connection resource of the database is insufficient due to a large traffic volume, the primary service cannot be guaranteed to be available.
In this embodiment of the present invention, if the determining to accept the connection request and allow the client to perform database connection includes:
determining to accept the connection request and generating a token of the current connection request;
and sending the token to the client and developing a database connection to the client.
In the embodiment of the invention, when a connection application exists, a token (token) corresponding to the application is stored, and when the connection is closed, the token is synchronously sent and applied to close the token. Therefore, the JAVA-based database connection management device is provided, the number of application connections initiated by a client can be controlled through the connection management server, and high-priority connection priority application can be given when connection resources are in shortage. Storing the generated token and recording the connection time of the client. Connection failure caused by network and other reasons is avoided, but connection applications still occupy connection resources in the application form, the application form is monitored in the service, and connection applications which are not released after a fixed time is exceeded are directly deleted.
It should be noted that the method and apparatus for managing database connection according to the present disclosure may be used for connection management of databases in the financial field, and may also be used for connection management of databases in any fields other than the financial field.
The present embodiment also provides an electronic device, which may be a desktop computer, a tablet computer, a mobile terminal, and the like, but is not limited thereto. In this embodiment, the electronic device may refer to the embodiments of the method and the apparatus, and the contents thereof are incorporated herein, and repeated descriptions are omitted.
Fig. 5 is a schematic block diagram of a system configuration of an electronic apparatus 600 according to an embodiment of the present invention. As shown in fig. 5, the electronic device 600 may include a central processor 100 and a memory 140; the memory 140 is coupled to the central processor 100. Notably, this diagram is exemplary; other types of structures may also be used in addition to or in place of the structure to implement telecommunications or other functions.
In one embodiment, the database connection management function may be integrated into the central processor 100. The central processor 100 may be configured to control as follows:
receiving a database connection request of a client;
judging whether to accept the connection request according to a preset connection parameter threshold;
and if the connection request is determined to be accepted, allowing the client to perform database connection.
In the embodiment of the present invention, the connection parameter threshold includes: and presetting a priority application connection threshold value for the maximum connection threshold value of the database.
In the embodiment of the present invention, the determining whether to accept the connection request according to a preset connection parameter threshold includes:
judging whether the connection number of the database is greater than the preset priority application connection threshold value or not, and receiving the connection request if the current connection number of the database is less than the preset priority application connection threshold value;
if the current connection number is not less than the preset priority application connection threshold value, judging whether the current connection number of the database is less than the maximum connection threshold value of the database;
if the connection request is less than the maximum connection threshold value of the database, the connection request is accepted;
if the maximum connection threshold value is not less than the maximum connection threshold value of the database, judging whether the connection request is a preset priority connection application or not
And if the connection request is determined to be the preset priority connection application, accepting the connection request, otherwise rejecting the connection request.
In this embodiment of the present invention, if the determining to accept the connection request and allow the client to perform database connection includes:
determining to accept the connection request and generating a token of the current connection request;
and sending the token to the client and developing a database connection to the client.
In this embodiment of the present invention, if the determining to accept the connection request and then allowing the client to perform database connection further includes:
storing the generated token and recording the connection time of the client.
In another embodiment, the database connection management apparatus may be configured separately from the central processor 100, for example, the database connection management apparatus may be configured as a chip connected to the central processor 100, and the database connection management function is realized by the control of the central processor.
As shown in fig. 5, the electronic device 600 may further include: communication module 110, input unit 120, audio processing unit 130, display 160, power supply 170. It is noted that the electronic device 600 does not necessarily include all of the components shown in fig. 5; furthermore, the electronic device 600 may also comprise components not shown in fig. 5, which may be referred to in the prior art.
As shown in fig. 5, the central processor 100, sometimes referred to as a controller or operational control, may include a microprocessor or other processor device and/or logic device, the central processor 100 receiving input and controlling the operation of the various components of the electronic device 600.
The memory 140 may be, for example, one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable device. The information relating to the failure may be stored, and a program for executing the information may be stored. And the central processing unit 100 may execute the program stored in the memory 140 to realize information storage or processing, etc.
The input unit 120 provides input to the cpu 100. The input unit 120 is, for example, a key or a touch input device. The power supply 170 is used to provide power to the electronic device 600. The display 160 is used to display an object to be displayed, such as an image or a character. The display may be, for example, an LCD display, but is not limited thereto.
The memory 140 may be a solid state memory such as Read Only Memory (ROM), Random Access Memory (RAM), a SIM card, or the like. There may also be a memory that holds information even when power is off, can be selectively erased, and is provided with more data, an example of which is sometimes called an EPROM or the like. The memory 140 may also be some other type of device. Memory 140 includes buffer memory 141 (sometimes referred to as a buffer). The memory 140 may include an application/function storage section 142, and the application/function storage section 142 is used to store application programs and function programs or a flow for executing the operation of the electronic device 600 by the central processing unit 100.
The memory 140 may also include a data store 143, the data store 143 for storing data, such as contacts, digital data, pictures, sounds, and/or any other data used by the electronic device. The driver storage portion 144 of the memory 140 may include various drivers of the electronic device for communication functions and/or for performing other functions of the electronic device (e.g., messaging application, address book application, etc.).
The communication module 110 is a transmitter/receiver 110 that transmits and receives signals via an antenna 111. The communication module (transmitter/receiver) 110 is coupled to the central processor 100 to provide an input signal and receive an output signal, which may be the same as in the case of a conventional mobile communication terminal.
Based on different communication technologies, a plurality of communication modules 110, such as a cellular network module, a bluetooth module, and/or a wireless local area network module, may be provided in the same electronic device. The communication module (transmitter/receiver) 110 is also coupled to a speaker 131 and a microphone 132 via an audio processor 130 to provide audio output via the speaker 131 and receive audio input from the microphone 132 to implement general telecommunications functions. Audio processor 130 may include any suitable buffers, decoders, amplifiers and so forth. In addition, an audio processor 130 is also coupled to the central processor 100, so that recording on the local can be enabled through a microphone 132, and so that sound stored on the local can be played through a speaker 131.
An embodiment of the present invention further provides a computer-readable program, where when the program is executed in an electronic device, the program causes a computer to execute the database connection management method in the electronic device according to the above embodiment.
An embodiment of the present invention further provides a storage medium storing a computer-readable program, where the computer-readable program enables a computer to execute the database connection management in an electronic device according to the above embodiment.
According to the database connection management method and device provided by the invention, the number of application connections initiated by the client can be controlled through the connection management server, and high-priority connection priority application can be carried out when connection resources are in shortage. The problem of service downtime caused by uncontrollable connection quantity is well solved, and the availability of the system is improved by preferentially letting the main connections pass through.
The preferred embodiments of the present invention have been described above with reference to the accompanying drawings. The many features and advantages of the embodiments are apparent from the detailed specification, and thus, it is intended by the appended claims to cover all such features and advantages of the embodiments that fall within the true spirit and scope thereof. Further, since numerous modifications and changes will readily occur to those skilled in the art, it is not desired to limit the embodiments of the invention to the exact construction and operation illustrated and described, and accordingly, all suitable modifications and equivalents may be resorted to, falling within the scope thereof.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The principle and the implementation mode of the invention are explained by applying specific embodiments in the invention, and the description of the embodiments is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (12)

1. A database connection management method, the method comprising:
receiving a database connection request of a client;
judging whether to accept the connection request according to a preset connection parameter threshold;
and if the connection request is determined to be accepted, allowing the client to perform database connection.
2. The database connection management method of claim 1, wherein the connection parameter threshold comprises: and presetting a priority application connection threshold value for the maximum connection threshold value of the database.
3. The database connection management method according to claim 2, wherein said determining whether to accept the connection request according to a preset connection parameter threshold comprises:
judging whether the connection number of the database is greater than the preset priority application connection threshold value or not, and receiving the connection request if the current connection number of the database is less than the preset priority application connection threshold value;
if the current connection number is not less than the preset priority application connection threshold value, judging whether the current connection number of the database is less than the maximum connection threshold value of the database;
if the connection request is less than the maximum connection threshold value of the database, the connection request is accepted;
if the connection request is not smaller than the maximum connection threshold value of the database, judging whether the connection request is a preset priority connection application;
and if the connection request is determined to be the preset priority connection application, accepting the connection request, otherwise rejecting the connection request.
4. The database connection management method of claim 1, wherein the determining to accept the connection request and then allowing the client to make a database connection comprises:
determining to accept the connection request and generating a token of the current connection request;
and sending the token to the client and developing a database connection to the client.
5. The database connection management method of claim 4, wherein said determining to accept the connection request and then allowing the client to make a database connection further comprises:
storing the generated token and recording the connection time of the client.
6. A database connection management apparatus, comprising:
the request receiving module is used for receiving a database connection request of a client;
the judging module judges whether to accept the connection request according to a preset connection parameter threshold;
and the request processing module is used for allowing the client to carry out database connection if the connection request is determined to be accepted.
7. The database connection management apparatus of claim 6, wherein the connection parameter threshold comprises: and presetting a priority application connection threshold value for the maximum connection threshold value of the database.
8. The database connection management apparatus as claimed in claim 7, wherein the determining module for determining whether to accept the connection request according to a preset connection parameter threshold comprises:
judging whether the connection number of the database is greater than the preset priority application connection threshold value or not, and receiving the connection request if the current connection number of the database is less than the preset priority application connection threshold value;
if the current connection number is not less than the preset priority application connection threshold value, judging whether the current connection number of the database is less than the maximum connection threshold value of the database;
if the connection request is less than the maximum connection threshold value of the database, the connection request is accepted;
if the connection request is not smaller than the maximum connection threshold value of the database, judging whether the connection request is a preset priority connection application;
and if the connection request is determined to be the preset priority connection application, accepting the connection request, otherwise rejecting the connection request.
9. The database connection management apparatus according to claim 6, wherein the request processing module comprises:
the token generation unit is used for determining to accept the connection request and generating a token of the current connection request;
and the connection unit is used for sending the token to the client and developing database connection for the client.
10. The database connection management apparatus according to claim 9, wherein the request processing module further comprises:
and the storage unit is used for storing the generated token and recording the connection time of the client.
11. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of any of claims 1 to 5 when executing the computer program.
12. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program for executing the method of any one of claims 1 to 5.
CN202110589787.XA 2021-05-28 2021-05-28 Database connection management method and device Pending CN113220767A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110589787.XA CN113220767A (en) 2021-05-28 2021-05-28 Database connection management method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110589787.XA CN113220767A (en) 2021-05-28 2021-05-28 Database connection management method and device

Publications (1)

Publication Number Publication Date
CN113220767A true CN113220767A (en) 2021-08-06

Family

ID=77099044

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110589787.XA Pending CN113220767A (en) 2021-05-28 2021-05-28 Database connection management method and device

Country Status (1)

Country Link
CN (1) CN113220767A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102915374A (en) * 2012-11-07 2013-02-06 北京搜狐新媒体信息技术有限公司 Method, device and system for controlling access to database resources
US20160044038A1 (en) * 2014-08-07 2016-02-11 International Business Machines Corporation Prevention of query overloading in a server application
CN109787908A (en) * 2018-12-13 2019-05-21 平安普惠企业管理有限公司 Server current-limiting method, system, computer equipment and storage medium
CN110222034A (en) * 2019-06-04 2019-09-10 北京奇艺世纪科技有限公司 A kind of database maintenance method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102915374A (en) * 2012-11-07 2013-02-06 北京搜狐新媒体信息技术有限公司 Method, device and system for controlling access to database resources
US20160044038A1 (en) * 2014-08-07 2016-02-11 International Business Machines Corporation Prevention of query overloading in a server application
CN109787908A (en) * 2018-12-13 2019-05-21 平安普惠企业管理有限公司 Server current-limiting method, system, computer equipment and storage medium
CN110222034A (en) * 2019-06-04 2019-09-10 北京奇艺世纪科技有限公司 A kind of database maintenance method and device

Similar Documents

Publication Publication Date Title
US11671826B2 (en) Voice control and telecommunications service integration
RU2621643C2 (en) Information display method and device
CN103036597B (en) Method and device of sharing resources among devices in close range
KR20130140785A (en) Wireless network interface with infrastructure and direct modes
US20210320923A1 (en) Method and apparatus for revoking authorization of api invoker
WO2020253634A1 (en) Data processing method, system and device
CN109669690B (en) Business workflow generation method, device, equipment and computer readable storage medium
CN110830481A (en) Vehicle-mounted equipment internet surfing method and device, server and storage medium
CN111163130A (en) Network service system and data transmission method thereof
WO2019047708A1 (en) Resource configuration method and related product
CN111371695B (en) Service flow limiting method and device
WO2023178924A1 (en) Payment method, user terminal, apparatus, device, system, and medium
CN115883669A (en) Data distribution method, system, equipment and medium
CN113722114A (en) Data service processing method and device, computing equipment and storage medium
CN113271364A (en) Sharing system, method, computer device and storage medium of service arrangement data
JP2003067194A (en) Terminal device
US9577967B2 (en) Method and system for managing an informational site using a social networking application
WO2024016634A1 (en) Smart routing-based remote payment method and apparatus, terminal, system, and medium
CN111464652A (en) Bank safe deposit box service providing method and device
CN113220767A (en) Database connection management method and device
CN109992298B (en) Examination and approval platform expansion method and device, examination and approval platform and readable storage medium
JP4610651B2 (en) Bootstrap message security transmission method and device in device management
CN111090818A (en) Resource management method, resource management system, server, and computer storage medium
CN105519055A (en) Dynamic equilibrium method and apparatus for QoS of I/O channel
JP6737049B2 (en) Information processing system, information processing apparatus, and program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination