Check patentability & draft patents in minutes with Patsnap Eureka AI!

Method and system for achieving concurrent requests based on connection pool of lock

A connection pool and connection number technology, applied in the field of computer communication, can solve problems such as memory leaks, achieve the effect of improving performance, simplifying the process, and avoiding the establishment and destruction of connections

Pending Publication Date: 2021-01-15
FUJIAN TQ DIGITAL
View PDF5 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Among them, the allocation and release strategy of the connection pool is very important for the effective reuse of connections. At present, the reference counting (reference counting) method is generally used in the industry. Although this Reference Counting (reference counting) is simple and intuitive, it is convenient to implement, but it But there is a fatal flaw, which is easy to cause memory leaks
That is, if there is a circular reference, then Reference Counting may cause a memory leak

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
  • Method and system for achieving concurrent requests based on connection pool of lock
  • Method and system for achieving concurrent requests based on connection pool of lock
  • Method and system for achieving concurrent requests based on connection pool of lock

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0022] The present invention will be further described below in conjunction with the accompanying drawings.

[0023] see figure 1 As shown, a method for implementing concurrent requests based on a lock-based connection pool of the present invention, the method includes the following steps:

[0024] Step S1, setting a connection pool of a lock, the connection pool includes a lock array and a connection array, the lock array corresponds to the connection array one by one, and there are N connections in the connection pool, each connection in the connection pool All correspond to create a connection array unit, where the lock array is set with an available state and a lock state. If the lock in the lock array is in the available state, it means that the corresponding connection array unit is not used, and the lock in the lock array is in the lock state. It means that the unit of the corresponding connection array is used;

[0025] Step S2, when the external site requests to acc...

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 provides a method for achieving concurrent requests based on a connection pool of a lock, which comprises the following steps of: S1, setting the connection pool of the lock, the connection pool comprising a lock array and a connection array; s2, when an external site requests to access a database cache or service, firstly initializing a connection pool, and setting each lock in thelock array to be in an available state; s3, when an external site requests to access, calling an interface of the GetConnection to carry out connection to obtain an available connection, and setting the lock of the lock array corresponding to the connected connection array unit to be in a lock state; and S4, after the database cache or service is requested and a certain connection is used up, putting the connection back, that is, the lock of the lock array corresponding to the connected connection array unit is restored to the available state, so that concurrent execution of multiple requestsis realized, and the performance of the system is improved.

Description

technical field [0001] The invention relates to the technical field of computer communication, in particular to a method and system for realizing concurrent requests based on a lock-based connection pool. Background technique [0002] The core idea of ​​the current connection pool technology is: connection reuse. By establishing a database connection pool and a set of connection usage, allocation, and management strategies, the connections in the connection pool can be reused efficiently and safely, avoiding the need for database connections. The overhead of frequent establishment and shutdown. Among them, the allocation and release strategy of the connection pool is very important for the effective reuse of connections. At present, the reference counting (reference counting) method is generally used in the industry. Although this Reference Counting (reference counting) is simple and intuitive, it is convenient to implement, but it But there is a fatal flaw, that is, it is ...

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 Applications(China)
IPC IPC(8): G06F16/2455G06F16/25
CPCG06F16/24552G06F16/252
Inventor 刘德建岳万恕郑彬陈宏展
Owner FUJIAN TQ DIGITAL
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More