Transaction settlement method and apparatus
AssigneeChina Unionpay Co., Ltd.
InventorsXiaoming Zhang, Lin Chen, Fei Zhang, Sen Yang, Haiyang Zhang
Life of this patent
Estimating the term…
Abstract
The present disclosure provides a method and a device for transaction clearing. The method includes receiving first clearing requests transmitted by a quantity N of terminals, where 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 terminals with an execution result of the first clearing requests.
Claims9
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;
- according to the quantity N of terminals, determining a quantity of cache lines of a cache queue and establishing multiple threads, wherein the cache queue is a circular queue, and the quantity of cache lines of the circular queue is 2 to a power of M, wherein 2M>N;
- initializing the cache queue, and loading the transaction data into the cache queue;
- parallel-reading the transaction data in the cache queue by the multiple threads, 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.
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;
- according to the quantity N of terminals, determine a quantity of cache lines of a cache queue and establish multiple threads, wherein the cache queue is a circular queue, and the quantity of cache lines of the circular queue is 2 to a power of M, wherein 2M>N;
- initialize the cache queue and load the transaction data into the cache queue;
- parallel-read the transaction data in the cache queue by the multiple threads 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.
A non-transitory computer-readable storage medium, containing program instructions that, when being executed by a processor, causing the processor to perform:
- 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;
- according to the quantity N of terminals, determining a quantity of cache lines of a cache queue and establishing multiple threads, wherein the cache queue is a circular queue, and the quantity of cache lines of the circular queue is 2 to a power of M, wherein 2M>N;
- initializing the cache queue, and loading the transaction data into the cache queue;
- parallel-reading the transaction data in the cache queue by the multiple threads, 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.
Dependencies are inferred from the claim text.