# US 2022/0044211 A1 · Transaction settlement method and apparatus

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

- Number: US 2022/0044211 A1
- Document ID: US20220044211A1
- Status: Published application
- Kind: A1
- Application number: 17/279,027
- Filed: 2019-11-12
- Published: 2022-02-10
- Earliest claimed: 2018-11-19
- Assignees: China Unionpay Co., Ltd.
- Applicants: China Unionpay Co., Ltd.
- Inventors: Xiaoming ZHANG; Lin CHEN; Fei ZHANG; Sen YANG; Haiyang ZHANG
- Web page: https://patentgrep.com/patent/US20220044211A1

## CPC

- G06Q 20/023: {the neutral party being a clearing house}
- G06F 9/546: {Message passing systems or structures, e.g. queues}
- G06Q 20/209: {Specified transaction journal output feature, e.g. printed receipt or voice output}
- G06Q 20/389: {Keeping log of transactions for guaranteeing non-repudiation of a transaction}
- G06Q 40/02: Banking, e.g. interest calculation or account maintenance (credit or loans G06Q40/03)
- G07F 7/0873: {Details of the card reader}
- G06Q: INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G07F: COIN-FREED OR LIKE APPARATUS (coin sorting G07D3/00; coin testing G07D5/00; {handling coins or paper currencies apart from payment activated apparatus G07D; payment architectures, schemes or protocols G06Q20/00})

## Abstract

A method and a device for transaction clearing are used to increase clearing flexibility and reduce server load pressure. The method includes receiving first clearing requests transmitted by a quantity N of terminals, where N>1 (201); according to the first clearing requests, acquiring transaction data of the quantity N of terminals from a database (202); initializing a cache queue, and loading the transaction data into the cache queue (203); reading the transaction data in the cache queue, and performing a clearing process on the transaction data (204); and writing a clearing result into the database and feeding back the terminals with an execution result of the first clearing requests (205).

## Claims

### Claim 1

A method for transaction clearing, comprising:
receiving first clearing requests transmitted by a quantity N of terminals, wherein N>1;
according to the first clearing requests, acquiring transaction data of the quantity N of terminals from a database;
initializing a cache queue, and loading the transaction data into the cache queue;
reading the transaction data in the cache queue, and performing a clearing process on the transaction data; and
writing a clearing result into the database and feeding back the quantity N of terminals with an execution result of the first clearing requests.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the cache queue is a circular queue, and initializing the cache queue includes:
according to the quantity N of terminals, determining a quantity of cache lines of the circular queue, wherein the quantity of cache lines of the circular queue is 2 to a power of M, wherein 2M>N.

### Claim 3 (depends on 2)

The method according to claim 2, wherein loading the transaction data into the cache queue includes:
allocating sequence numbers to the transaction data, wherein a sequence number is allocated to transaction data of a same terminal; and
for transaction data of any one of the quantity N of terminals, using a sequence number of the transaction data of any one of the quantity N of terminals to perform a modulo operation on the quantity of cache lines of the circular queue, determining a cache line in the circular queue corresponding to the transaction data of any one of the quantity N of terminals, and loading the transaction data of the terminal into the corresponding cache line.

### Claim 4 (depends on 2)

The method according to claim 2, wherein initializing the cache queue further includes:
according to the quantity of terminals, establishing multiple threads; and
reading the transaction data in the cache queue includes:
parallel-reading the transaction data in the cache queue by the multiple threads.

### Claim 5 (depends on 1)

The method according to claim 1, prior to initializing the cache queue and loading the transaction data into the cache queue, further including:
acquiring second clearing requests, wherein the second clearing requests are launched internally after a preset time is detected; and
according to the second clearing requests, acquiring transaction data, from a history time before the preset time to within the preset time, from the database.

### Claim 6

A device for transaction clearing, comprising:
a memory, configured to store program instructions for performing a method for transaction clearing; and
a processor, coupled with the memory and, when executing the program instructions, configured to:
receive first clearing requests transmitted by a quantity N of terminals, wherein N>1;
according to the first clearing requests, acquire transaction data of the quantity N of terminals from a database;
initialize a cache queue and load the transaction data into the cache queue;
read the transaction data in the cache queue and perform a clearing process on the transaction data; and
write a clearing result into the database and feed back the quantity N of terminals with an execution result of the first clearing requests.

### Claim 7 (depends on 6)

The device according to claim 6, wherein the cache queue is a circular queue, and the processor is further configured to:
according to the quantity N of terminals, determine a quantity of cache lines of the circular queue, wherein the quantity of cache lines of the circular queue is 2 to a power of M, wherein 2M>N.

### Claim 8 (depends on 7)

The device according to claim 7, wherein the processor is further configured to:
allocate sequence numbers to the transaction data, wherein a sequence number is allocated to transaction data of a same terminal; and
for transaction data of any one of the quantity N of terminals, use a sequence number of the transaction data of any one of the quantity N of terminals to perform a modulo operation on the quantity of cache lines of the circular queue, determine a cache line in the circular queue corresponding to the transaction data of any one of the quantity N of terminals, and load the transaction data of the terminal into the corresponding cache line.

### Claim 9 (depends on 7)

The device according to claim 7, wherein the processor is further configured to, according to the quantity of terminals, establish multiple threads; and
the processor is further configured to parallel-read the transaction data in the cache queue by the multiple threads.

### Claim 10 (depends on 6)

The device according to claim 6, wherein the processor is further configured to acquire second clearing requests, wherein the second clearing requests are launched internally after a preset time is detected; and
the processor is further configured to, according to the second clearing requests, acquire transaction data, from a history time before the preset time to within the preset time, from the database.

### Claim 11

(canceled)

### Claim 12

A non-transitory computer-readable storage medium, containing program instructions for, when being executed by a processor, performing a method for transaction clearing, the method comprising:
receiving first clearing requests transmitted by a quantity N of terminals, wherein N>1;
according to the first clearing requests, acquiring transaction data of the quantity N of terminals from a database;
initializing a cache queue, and loading the transaction data into the cache queue;
reading the transaction data in the cache queue, and performing a clearing process on the transaction data; and
writing a clearing result into the database and feeding back the quantity N of terminals with an execution result of the first clearing requests.

### Claim 13 (depends on 12)

The storage medium according to claim 12, wherein the cache queue is a circular queue, and initializing the cache queue includes:
according to the quantity N of terminals, determining a quantity of cache lines of the circular queue, wherein the quantity of cache lines of the circular queue is 2 to a power of M, wherein 2M>N.

### Claim 14 (depends on 13)

The storage medium according to claim 13, wherein loading the transaction data into the cache queue includes:
allocating sequence numbers to the transaction data, wherein a sequence number is allocated to transaction data of a same terminal; and
for transaction data of any one of the quantity N of terminals, using a sequence number of the transaction data of any one of the quantity N of terminals to perform a modulo operation on the quantity of cache lines of the circular queue, determining a cache line in the circular queue corresponding to the transaction data of any one of the quantity N of terminals, and loading the transaction data of the terminal into the corresponding cache line.

### Claim 15 (depends on 13)

The storage medium according to claim 13, wherein initializing the cache queue further includes:
according to the quantity of terminals, establishing multiple threads; and
reading the transaction data in the cache queue includes:
parallel-reading the transaction data in the cache queue by the multiple threads.

### Claim 16 (depends on 12)

The storage medium according to claim 12, prior to initializing the cache queue and loading the transaction data into the cache queue, further including:
acquiring second clearing requests, wherein the second clearing requests are launched internally after a preset time is detected; and
according to the second clearing requests, acquiring transaction data, from a history time before the preset time to within the preset time, from the database.
