# US 2022/0292096 A1 · Distributed database preprocessing method, agent layer, system and storage medium

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2022/0292096 A1
- Document ID: US20220292096A1
- Status: Published application
- Kind: A1
- Application number: 17/625,567
- Filed: 2020-07-13
- Published: 2022-09-15
- Earliest claimed: 2019-07-17
- Assignees: Zte Corporation
- Applicants: ZTE Corporation
- Inventors: Jun ZHANG
- Web page: https://patentgrep.com/patent/US20220292096A1

## CPC

- H04L 67/568: Storing data temporarily at an intermediate stage, e.g. caching
- G06F 16/2443: {Stored procedures}
- G06F 16/24539: {using cached or materialised query results}
- G06F 16/2455: Query execution
- G06F 16/24552: {Database cache management}
- G06F 16/252: {between a Database Management System and a front-end application}
- G06F 16/27: Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
- H04L 67/146: Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Disclosed are a distributed database preprocessing method, a database proxy layer, a system and a non-transitory computer-readable storage medium. The distributed database preprocessing method, applied to a database proxy layer, may include: receiving a request corresponding to a prepared statement; and performing processing according to the request corresponding to the prepared statement and a session identifier cached in a prepared statement cache library, a session corresponding to the session identifier cached in the prepared statement cache library is a prepared statement session where a connection is successfully established between a client and a database.

## Claims

### Claim 1

A distributed database preprocessing method, applied to a database proxy layer, the distributed database preprocessing method comprising:
receiving a request corresponding to a prepared statement; and
performing processing according to the request corresponding to the prepared statement and a session identifier cached in a prepared statement cache library,
wherein a session corresponding to the session identifier cached in the prepared statement cache library is a prepared statement session where a connection is successfully established between a client and a database.

### Claim 2 (depends on 1)

The distributed database preprocessing method of claim 1, wherein, in response to the received request corresponding to the prepared statement being a prepare request, performing processing according to the request corresponding to the prepared statement and a session identifier cached in a prepared statement cache library comprises:
in response to a session identifier corresponding to a current prepare request session being found in the prepared statement cache library, sending a response message of the prepare request to the client; and
in response to the session identifier corresponding to the current prepare request session being not found in the prepared statement cache library, sending the prepare request to the database, and performing, by the database, processing and sending the response message of the prepare request to the client.

### Claim 3 (depends on 2)

The distributed database preprocessing method of claim 2, wherein after sending the prepare request to the database, and performing, by the database, processing and sending the response message of the prepare request to the client, the method further comprises:
caching the session identifier corresponding to the current prepare request session into the prepared statement cache library.

### Claim 4 (depends on 1)

The distributed database preprocessing method of claim 1, wherein, in response to the received request corresponding to the prepared statement being an execute request, performing processing according to the request corresponding to the prepared statement and a session identifier cached in a prepared statement cache library comprises:
in response to a session identifier corresponding to an idle prepare request session being found in the prepared statement cache library, sending the execute request to the database, and performing, by the database, processing and sending a response message of the execute request to the client; and
in response to the session identifier corresponding to the idle prepare request session being not found in the prepared statement cache library, waiting until an idle prepare request session is available, sending the execute request to the database, and performing, by the database, processing and sending the response message of the execute request to the client.

### Claim 5 (depends on 4)

The distributed database preprocessing method of claim 4, wherein performing, by the database, processing and sending the response message of the execute request to the client comprises:
receiving a result set or failure message generated after execution of the execute request by the database, and sending the result set or failure message to the client.

### Claim 6 (depends on 5)

The distributed database preprocessing method of claim 5, wherein after sending the result set or failure message to the client, the method further comprises:
in response to the received request corresponding to the prepared statement being a deallocate request, processing and sending a response message of the deallocate request to the client.

### Claim 7 (depends on 6)

The distributed database preprocessing method of claim 6, wherein processing and sending a response message of the deallocate request to the client comprises:
deallocating a session corresponding to the prepared statement currently established with the client, and sending the response message of the deallocate request to the client.

### Claim 8

A database proxy layer, comprising a receiving module and a processing module,
the receiving module being configured to receive a request corresponding to a prepared statement; and
the processing module being configured to perform processing according to the request corresponding to the prepared statement and a session identifier cached in a prepared statement cache library,
wherein a session corresponding to the session identifier cached in the prepared statement cache library is a prepared statement session where a connection is successfully established between a client and a database.

### Claim 9 (depends on 8)

The database proxy layer of claim 8, wherein the processing module is configured to:
in response to a session identifier corresponding to a current prepare request session being found in the prepared statement cache library, send a response message of the prepare request to the client; and
in response to the session identifier corresponding to the current prepare request session being not found in the prepared statement cache library, send the prepare request to the database, and perform, by the database, processing and send the response message of the prepare request to the client.

### Claim 10 (depends on 9)

The database proxy layer of claim 9, further comprising a cache module configured to:
cache the session identifier corresponding to the current prepare request session into the prepared statement cache library after the processing module sends the prepare request to the database and the database performs processing and sends the response message of the prepare request to the client.

### Claim 11 (depends on 10)

The database proxy layer of claim 10, wherein the processing module is configured to:
in response to a session identifier corresponding to an idle prepare request session being found in the prepared statement cache library, send the execute request to the database, and perform, by the database, processing and send a response message of the execute request to the client; and
in response to the session identifier corresponding to the idle prepare request session being not found in the prepared statement cache library, wait until an idle prepare request session is available, send the execute request to the database, and perform, by the database, processing and send the response message of the execute request to the client.

### Claim 12 (depends on 8)

A system, comprising a client, a database and a database proxy layer of claim 8;
the client sending a request corresponding to a prepared statement to the database proxy layer;
the database proxy layer performing processing according to the received request corresponding to the prepared statement and a session identifier cached in a prepared statement cache library, wherein a session corresponding to the session identifier cached in the prepared statement cache library is a prepared statement session where a connection is successfully established between a client and a database; and
the database maintaining a connection to the session corresponding to the session identifier cached in the prepared statement cache library in the database proxy layer.

### Claim 13 (depends on 1)

A non-transitory computer-readable storage medium, storing one or more programs which, when executed by one or more processors, cause the one or more processors to perform the distributed database preprocessing method of claim 1.

### Claim 14 (depends on 2)

The distributed database preprocessing method of claim 2, wherein, in response to the received request corresponding to the prepared statement being an execute request, performing processing according to the request corresponding to the prepared statement and a session identifier cached in a prepared statement cache library comprises:
in response to a session identifier corresponding to an idle prepare request session being found in the prepared statement cache library, sending the execute request to the database, and performing, by the database, processing and sending a response message of the execute request to the client; and
in response to the session identifier corresponding to the idle prepare request session being not found in the prepared statement cache library, waiting until an idle prepare request session is available, sending the execute request to the database, and performing, by the database, processing and sending the response message of the execute request to the client.

### Claim 15 (depends on 3)

The distributed database preprocessing method of claim 3, wherein, in response to the received request corresponding to the prepared statement being an execute request, performing processing according to the request corresponding to the prepared statement and a session identifier cached in a prepared statement cache library comprises:
in response to a session identifier corresponding to an idle prepare request session being found in the prepared statement cache library, sending the execute request to the database, and performing, by the database, processing and sending a response message of the execute request to the client; and
in response to the session identifier corresponding to the idle prepare request session being not found in the prepared statement cache library, waiting until an idle prepare request session is available, sending the execute request to the database, and performing, by the database, processing and sending the response message of the execute request to the client.
