Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

A database connection processing method and device

A processing method and technology of a processing device, which are applied in the field of data communication, can solve the problems of large consumption of server resources, confusion of user rights, and increase in the number of connections, and achieve the effect of saving server resources and avoiding the continuous increase of the total number of connections.

Active Publication Date: 2016-12-07
BEIJING QIHOO TECH CO LTD
View PDF3 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Now that a client is connecting, and the user name has not been sent at this stage, how should the connection pool decide whether to create a new connection or reuse a connection? There are two possible principles: one is that all queues are less than 64 before creating a new one Connection, the problem brought about is that user B always has only 1 connection (because user A has reached 64 connections), which is likely to be insufficient and cause the client to report an error, so this method is not feasible; the second is that there is a queue lower than 64 This way of creating a new connection is also a very serious problem. Just imagine, if user A keeps coming to connect, a new connection will be created because the number of user B connections is small. The queue length is getting bigger and bigger, the number of connections is rising, and the limit of "reserved number" is useless
[0010] From the above analysis, it can be seen that according to the existing connection pool implementation scheme, when all user names share a connection queue, user A may take out the connection of user B from the queue, resulting in confusion of user permissions; and when each user name When using your own queue to store connections, the total number of connections will continue to rise, resulting in excessive resource consumption on the server side

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
  • A database connection processing method and device
  • A database connection processing method and device
  • A database connection processing method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0045] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided for more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0046] figure 1 The application scenarios of the embodiments of the present invention are shown. exist figure 1 In the shown application scenario, it includes multiple clients (two are shown in the figure, respectively client one and client two), a connection pool module and a server, and the server has the client needs to access and operate The database, the MySQL database shown in the figure, of course, can also be other types ...

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 invention discloses a database connection processing method and device, belonging to the technical field of data communication. The method includes: when receiving a database connection request from a client, judging whether the length of the connection queue of the connection pool is less than a preset threshold, wherein the database connection associated with the user name is stored in the connection queue; when the connection When the length of the queue is greater than or equal to the preset threshold, take out a database connection from the connection queue; judge whether the user name used by the client is the same as the user name of the taken out database connection; if they are the same, assign the database connection to the client Use, otherwise, notify the server to authenticate the client, and assign the database connection to the client after the authentication is passed. The present invention realizes multi-user authority isolation, avoids the continuous increase of the total number of database connections, and saves server resources consumed by connection pools.

Description

technical field [0001] The invention relates to the technical field of data communication, in particular to a database connection processing method and device. Background technique [0002] In database applications, each data access request from the client needs to go through the steps of establishing a database connection with the server, opening the database, accessing data, and closing the database connection. Connecting and opening the database is a resource-consuming and time-consuming task. , if such database operations occur frequently, the performance of the system will inevitably drop sharply. The database connection pool technology does not close the database connection after the data access operation is completed, but stores it. The next database operation request can directly use this database connection. By reusing the established database connection, it can be extremely efficient. Greatly save system resources and database operation time. [0003] When using ...

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
IPC IPC(8): H04L29/06G06F17/30
Inventor 朱超陈飞王超
Owner BEIJING QIHOO TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products