[go: up one dir, main page]

CN115309782A - Transaction asynchronous processing method, device, equipment, medium and program product - Google Patents

Transaction asynchronous processing method, device, equipment, medium and program product Download PDF

Info

Publication number
CN115309782A
CN115309782A CN202210828526.3A CN202210828526A CN115309782A CN 115309782 A CN115309782 A CN 115309782A CN 202210828526 A CN202210828526 A CN 202210828526A CN 115309782 A CN115309782 A CN 115309782A
Authority
CN
China
Prior art keywords
transaction
data
transaction data
sequence number
initiator
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210828526.3A
Other languages
Chinese (zh)
Inventor
夏帅
王学文
王立伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Boc Financial Technology Co ltd
Original Assignee
Boc Financial Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Boc Financial Technology Co ltd filed Critical Boc Financial Technology Co ltd
Priority to CN202210828526.3A priority Critical patent/CN115309782A/en
Publication of CN115309782A publication Critical patent/CN115309782A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • G06F16/273Asynchronous replication or reconciliation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Development Economics (AREA)
  • General Business, Economics & Management (AREA)
  • Technology Law (AREA)
  • Computing Systems (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a transaction asynchronous processing method, a device, equipment, medium and program product, comprising: receiving transaction data, determining a target data cache region corresponding to a transaction initiator of the transaction data, and storing the transaction data into the target data cache region; under the condition that a preset transaction processing condition is met, acquiring a transaction data packet corresponding to a target data cache region; the calling sequence number generator is used for marking the transaction sequence number of each transaction data in the transaction data packet, and each transaction data in the transaction data packet is processed in order according to the transaction sequence number, so that the transaction data of each transaction initiator is stored in a partition mode, and the transaction data in the same partition mode are executed in order according to the transaction sequence number, so that the ordered execution of the transactions in the same account is guaranteed, and the processing performance of the system is improved.

Description

交易异步处理方法、装置、设备、介质和程序产品Transaction asynchronous processing method, device, device, medium and program product

技术领域technical field

本发明涉及计算机通信技术领域,尤其涉及一种交易异步处理方法、装置、设备、介质和程序产品。The present invention relates to the technical field of computer communication, in particular to a transaction asynchronous processing method, device, equipment, medium and program product.

背景技术Background technique

伴随着金融业务蓬勃发展,不断出现新的金融业务场景,在金融交易这个场景中,对于一些时效性要求不高的交易场景,即一些交易并非立即执行,而是延期执行,例如:预约转账、定期扣款、自动还款等。With the vigorous development of financial business, new financial business scenarios continue to emerge. In the financial transaction scenario, for some transaction scenarios that do not require high timeliness, that is, some transactions are not executed immediately, but delayed execution, such as: scheduled transfer, Regular deduction, automatic repayment, etc.

目前现有方案中,对于此类型交易,通常采用把交易整体通过文件的方式传递给核心系统,如把同一个省区域的交易整体打包传递给核心系统,或者把同一时间区段的交易整体打包传递给核心系统,之后逐条执行。In the current existing solutions, for this type of transaction, the entire transaction is usually transmitted to the core system through a file, such as the entire package of transactions in the same province and region is transmitted to the core system, or the entire transaction of the same time period is packaged Pass it to the core system, and then execute it one by one.

然而随着核心银行系统的业务量的不断增长,此种方式导致核心系统压力越来越大,系统处理性能越来越差,逐条执行交易效率低,另外此种方式还存在同一个账户下的交易执行顺序不一致问题,进而使得后续交易处理易出错,不稳定。However, as the business volume of the core banking system continues to grow, this method leads to increasing pressure on the core system, worsening system processing performance, and low efficiency in executing transactions one by one. The inconsistency of transaction execution order makes subsequent transaction processing error-prone and unstable.

发明内容Contents of the invention

本发明提供一种交易异步处理方法、装置、设备、介质和程序产品,用以解决现有技术中核心系统压力大,且同一个账户下的交易不能有序执行的缺陷。The present invention provides a transaction asynchronous processing method, device, equipment, medium and program product, which are used to solve the defects in the prior art that the core system is under high pressure and transactions under the same account cannot be executed in an orderly manner.

本发明提供一种交易异步处理方法,包括:The present invention provides a transaction asynchronous processing method, including:

接收交易数据,确定所述交易数据的交易发起方对应的目标数据缓存区,并将所述交易数据存储至所述目标数据缓存区;receiving transaction data, determining a target data buffer corresponding to the transaction initiator of the transaction data, and storing the transaction data in the target data buffer;

在达到预设交易处理条件的情况下,获取所述目标数据缓存区对应的交易数据包;Obtain the transaction data packet corresponding to the target data cache area when the preset transaction processing condition is met;

对所述交易数据包中的各交易数据进行交易序号的标记,并根据所述交易序号有序处理所述交易数据包中的各交易数据。Each transaction data in the transaction data packet is marked with a transaction sequence number, and each transaction data in the transaction data packet is sequentially processed according to the transaction sequence number.

根据本发明提供的交易异步处理方法,所述达到预设交易处理条件,具体包括:According to the transaction asynchronous processing method provided by the present invention, the meeting the preset transaction processing conditions specifically includes:

在监测到所述目标数据缓存区中的交易数据量达到预设数据量阈值的情况下,判定达到预设交易处理条件。When it is detected that the amount of transaction data in the target data cache area reaches a preset data amount threshold, it is determined that a preset transaction processing condition is met.

根据本发明提供的交易异步处理方法,所述达到预设交易处理条件,具体包括:According to the transaction asynchronous processing method provided by the present invention, the meeting the preset transaction processing conditions specifically includes:

在监测到达到预设交易执行时间,判定达到预设交易处理条件。When the preset transaction execution time is reached, it is determined that the preset transaction processing condition is met.

根据本发明提供的交易异步处理方法,所述对所述交易数据包中的各交易数据进行交易序号的标记,具体包括:According to the transaction asynchronous processing method provided by the present invention, the marking of the transaction sequence number on each transaction data in the transaction data package specifically includes:

确定所述目标数据缓存区对应的区号标识,并获取所述交易数据包中的各交易数据对应的交易序号;Determine the area code identifier corresponding to the target data cache area, and obtain the transaction sequence number corresponding to each transaction data in the transaction data packet;

根据所述区号标识及所述交易序号生成所述各交易数据的交易序号。The transaction sequence number of each transaction data is generated according to the area code identifier and the transaction sequence number.

根据本发明提供的交易异步处理方法,所述接收交易数据之前,还包括:According to the transaction asynchronous processing method provided by the present invention, before receiving the transaction data, it also includes:

在接收到交易发起方发送的数据包的情况下,对所述数据包进行解密验签,以获取解密验签后的交易数据。If the data packet sent by the transaction initiator is received, decryption and signature verification are performed on the data packet, so as to obtain transaction data after decryption and signature verification.

根据本发明提供的交易异步处理方法,所述对所述数据包进行解密验签之后,还包括:According to the transaction asynchronous processing method provided by the present invention, after the said data package is decrypted and verified, it also includes:

在所述数据包解密验签失败的情况下,向所述交易发起方发送解密验签失败提示消息。In the case that the decryption and signature verification of the data packet fails, a prompt message of decryption and signature verification failure is sent to the transaction initiator.

本发明还提供一种交易异步处理装置,包括:The present invention also provides a transaction asynchronous processing device, including:

接收单元,用于接收交易数据,确定所述交易数据的交易发起方对应的目标数据缓存区,并将所述交易数据存储至所述目标数据缓存区;A receiving unit, configured to receive transaction data, determine a target data cache area corresponding to the transaction initiator of the transaction data, and store the transaction data in the target data cache area;

获取单元,用于在达到预设交易处理条件的情况下,获取所述目标数据缓存区对应的交易数据包;An acquisition unit, configured to acquire the transaction data packet corresponding to the target data buffer area when the preset transaction processing condition is met;

处理单元,用于对所述交易数据包中的各交易数据进行交易序号的标记,并根据所述交易序号有序处理所述交易数据包中的各交易数据。The processing unit is configured to mark the transaction sequence number of each transaction data in the transaction data packet, and sequentially process each transaction data in the transaction data packet according to the transaction sequence number.

本发明还提供一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如上述任一种所述交易异步处理方法。The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and operable on the processor. When the processor executes the program, it realizes asynchronous transaction processing as described in any one of the above. method.

本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如上述任一种所述交易异步处理方法。The present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the transaction asynchronous processing method described in any one of the above-mentioned methods is implemented.

本发明还提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现如上述任一种所述交易异步处理方法。The present invention also provides a computer program product, including a computer program. When the computer program is executed by a processor, the transaction asynchronous processing method described in any one of the above methods is implemented.

本发明提供的交易异步处理方法、装置、设备、介质和程序产品,通过接收交易数据,确定交易数据的交易发起方对应的目标数据缓存区,并将交易数据存储至目标数据缓存区;在达到预设交易处理条件的情况下,获取目标数据缓存区对应的交易数据包;调用序号生成器对交易数据包中的各交易数据进行交易序号的标记,并根据交易序号有序处理交易数据包中的各交易数据,由此通过对各交易发起方的交易数据进行分区存储,且对同一分区下的交易数据按照交易序号有序执行,保证了同一个账户下的交易有序执行的同时,还提高了系统处理性能。The transaction asynchronous processing method, device, equipment, medium and program product provided by the present invention determine the target data buffer area corresponding to the transaction initiator of the transaction data by receiving the transaction data, and store the transaction data in the target data buffer area; In the case of preset transaction processing conditions, obtain the transaction data package corresponding to the target data buffer area; call the serial number generator to mark the transaction serial number of each transaction data in the transaction data package, and process the transaction data package in an orderly manner according to the transaction serial number The transaction data of each transaction, so by partitioning and storing the transaction data of each transaction initiator, and executing the transaction data in the same partition in an orderly manner according to the transaction sequence number, it ensures that the transactions under the same account are executed in an orderly manner, and at the same time Improved system processing performance.

附图说明Description of drawings

为了更清楚地说明本发明或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the present invention or the technical solutions in the prior art, the accompanying drawings that need to be used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings in the following description are the present invention. For some embodiments of the invention, those skilled in the art can also obtain other drawings based on these drawings without creative effort.

图1是本发明提供的交易异步处理方法的流程示意图之一;Fig. 1 is one of the flow diagrams of the transaction asynchronous processing method provided by the present invention;

图2是本发明提供的交易异步处理装置的结构示意图;Fig. 2 is a schematic structural diagram of a transaction asynchronous processing device provided by the present invention;

图3是本发明提供的电子设备的结构示意图。Fig. 3 is a schematic structural diagram of an electronic device provided by the present invention.

具体实施方式Detailed ways

为使本发明的目的、技术方案和优点更加清楚,下面将结合本发明中的附图,对本发明中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the present invention. Obviously, the described embodiments are part of the embodiments of the present invention , but not all examples. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

下面结合图1描述本发明的一种交易异步处理方法。A transaction asynchronous processing method of the present invention is described below in conjunction with FIG. 1 .

图1为本发明提供的交易异步处理方法的流程示意图之一,如图1所示,该方法包括:Fig. 1 is one of the flow diagrams of the transaction asynchronous processing method provided by the present invention. As shown in Fig. 1, the method includes:

步骤100,接收交易数据,确定所述交易数据的交易发起方对应的目标数据缓存区,并将所述交易数据存储至所述目标数据缓存区;Step 100, receiving transaction data, determining a target data buffer corresponding to the transaction initiator of the transaction data, and storing the transaction data in the target data buffer;

需要说明的是,交易数据指代双方账户之间的交易数据,例如转账汇款等交易的数据。其中,交易发起方指代付款方账户,例如账户A发起了一笔向账户B转账的交易,则账户A即为交易发起方。It should be noted that the transaction data refers to the transaction data between the accounts of both parties, such as transaction data such as transfer and remittance. Among them, the transaction initiator refers to the payer account. For example, account A initiates a transaction to transfer money to account B, then account A is the transaction initiator.

本实施例中调用系统中的异步交易收集器,异步交易收集器实时接收交易发起方发送的交易数据,但不立即发起处理交易数据的线程,由此可以避免短时间处理大量交易产生的系统异常。其中,异步交易收集器是负责初步收集交易数据的装置,主要功能是收集交易、排序交易、解密验签、设定打包交易条件等。In this embodiment, the asynchronous transaction collector in the system is invoked, and the asynchronous transaction collector receives the transaction data sent by the transaction initiator in real time, but does not immediately initiate a thread for processing transaction data, thereby avoiding system exceptions caused by processing a large number of transactions in a short time . Among them, the asynchronous transaction collector is a device responsible for the preliminary collection of transaction data. Its main functions are to collect transactions, sort transactions, decrypt and verify signatures, and set packaging transaction conditions.

其中,本发明异步交易收集器采用散列算法将不同付款方账户的交易数据分区处理,例如MD2、MD4、MD5等散列算法,本发明对此不作限制。具体地,同一付款方账户散列到同一分区,并统计各同一分区的交易数量总额,由此在当分区交易数量总额到达指定总额阀值或指定交易数据执行时间时,批量执行同一分区的交易数量,进而达到保证交易可以顺序执行,提高处理性能的目的。Wherein, the asynchronous transaction collector of the present invention partitions the transaction data of different payer accounts using a hash algorithm, such as MD2, MD4, MD5 and other hash algorithms, which is not limited by the present invention. Specifically, the same payer account is hashed to the same partition, and the total transaction quantity of each same partition is counted, so that when the total transaction quantity of the partition reaches the specified total threshold or the specified transaction data execution time, the transactions of the same partition are executed in batches Quantity, and then achieve the purpose of ensuring that transactions can be executed sequentially and improving processing performance.

具体地,目标数据缓存区指代用于缓存该交易发起方的交易数据的数据缓存区。本发明中,为了实现同一个账户下交易顺序一致,采用对交易数据进行分区缓存处理的交易机制,即对于接收到的若干个交易发起方传输的交易数据,分别将各交易发起方的交易数据缓存至各自匹配的数据缓存区中,每个数据缓存区的资源访问独立进行,互不干扰。其中,各分区的数据容纳量可以相同,也可以不相同,本发明对此不作限制。Specifically, the target data cache refers to a data cache for caching the transaction data of the transaction initiator. In the present invention, in order to realize the consistent order of transactions under the same account, a transaction mechanism for partitioning and buffering transaction data is adopted, that is, for the received transaction data transmitted by several transaction initiators, the transaction data of each transaction initiator is respectively The resources are cached in their respective matching data buffer areas, and the resource access of each data buffer area is performed independently without interfering with each other. Wherein, the data capacity of each partition may be the same or different, which is not limited in the present invention.

在一实施例中,为了加快交易分区的处理速度,预先划分若干个数据缓存区,各数据缓存区中的数据缓存容量一致,在接收到一个交易发起方的第一笔的交易数据之后,确定当前数据缓存量为零的数据缓存区,将其作为目标数据缓存区,且生成该交易发起方与数据缓存区之间的缓存路径的映射关系,通过该映射关系对应的缓存路径实现交易数据的存储。In one embodiment, in order to speed up the processing speed of the transaction partition, several data buffer areas are pre-divided, and the data buffer capacity in each data buffer area is consistent. After receiving the first transaction data of a transaction initiator, determine The data cache area whose current data cache volume is zero is used as the target data cache area, and the mapping relationship between the transaction initiator and the data cache area is generated, and the transaction data is realized through the cache path corresponding to the mapping relationship. storage.

换句话说,本实施例中,在实际应用中,系统记录有若干条交易发起方与数据存储区之间的缓存路径的映射关系列表,因此在接收到交易数据之后,先遍历映射关系列表中是否存在该交易数据的交易发起方对应的缓存路径的映射关系,若存在,则根据该映射关系中映射的缓存路径将交易数据存储至对应的目标数据缓存区中,如不存在,则遍历当前各数据缓存区中的缓存量,确定当前数据缓存量为零的数据缓存区,将其作为目标数据缓存区。此外,由于数据缓存区数量有限,且交易发起方存在若干个,因此本实施例中生成各交易发起方与各数据缓存区之间的缓存路径的映射关系之后,在交易发起方对应的数据存储区中的数据被处理之后,自动断开它们之间的映射关系,由此保证了数据缓存区不被空闲的交易发起方占用。In other words, in this embodiment, in practical applications, the system records several mapping relationship lists of cache paths between the transaction initiator and the data storage area, so after receiving the transaction data, it first traverses the mapping relationship list Whether there is a mapping relationship of the cache path corresponding to the transaction initiator of the transaction data, if it exists, store the transaction data in the corresponding target data cache area according to the cache path mapped in the mapping relationship, if not, traverse the current For the buffering amount in each data buffering area, determine the data buffering area whose current data buffering amount is zero, and use it as the target data buffering area. In addition, since the number of data buffers is limited and there are several transaction initiators, in this embodiment, after the mapping relationship between each transaction initiator and each data buffer is generated, the data storage corresponding to the transaction initiator After the data in the area is processed, the mapping relationship between them is automatically disconnected, thereby ensuring that the data buffer area is not occupied by idle transaction initiators.

步骤200,在达到预设交易处理条件的情况下,获取所述目标数据缓存区对应的交易数据包;Step 200: Obtain the transaction data packet corresponding to the target data cache area when the preset transaction processing condition is met;

该步骤中,调用系统中的异步交易执行器从目标数据缓存区中依次读取存储的交易数据,并在读取完毕之后将所有的交易数据打包成交易数据包以便后续进行批量处理。具体地,交易数据包中不仅包括所有的交易数据,还包括存储各交易数据的时间戳。In this step, the asynchronous transaction executor in the calling system sequentially reads the stored transaction data from the target data buffer, and packs all the transaction data into a transaction data packet for subsequent batch processing after reading. Specifically, the transaction data packet not only includes all transaction data, but also includes a time stamp for storing each transaction data.

其中,异步交易执行器是负责接收交易收集器发送的需要分区处理的交易数据,并对同一区内的交易数据进行排序后批量处理的装置。Among them, the asynchronous transaction executor is a device responsible for receiving the transaction data sent by the transaction collector that needs to be processed in partitions, sorting the transaction data in the same region and then processing them in batches.

具体地,本实施例中,预设交易处理条件主要包括以下几种情况:Specifically, in this embodiment, the preset transaction processing conditions mainly include the following situations:

第一:在监测到所述目标数据缓存区中的交易数据量达到预设数据量阈值的情况下,判定达到预设交易处理条件。First: when it is detected that the amount of transaction data in the target data cache area reaches a preset data amount threshold, it is determined that a preset transaction processing condition is met.

其中,交易数据量指代缓存的交易数据的交易请求发起次数的数量,例如数据缓存区A缓存了53个交易请求的交易数据,数据缓存区B缓存了20个交易请求的交易数据,数据缓存区C缓存了100个交易请求的交易数据,则数据缓存区A的交易数据量为53,数据缓存区B的交易数据量为20,数据缓存区C的交易数据量为100,在预设数量阈值100的情况下,则数据缓存区C达到预设交易处理条件。Among them, the amount of transaction data refers to the number of transaction requests initiated by the cached transaction data. For example, data cache area A caches transaction data of 53 transaction requests, data cache area B caches transaction data of 20 transaction requests, and data cache Area C caches the transaction data of 100 transaction requests, so the transaction data volume of data cache area A is 53, the transaction data volume of data cache area B is 20, and the transaction data volume of data cache area C is 100. When the threshold is 100, the data buffer C reaches the preset transaction processing conditions.

具体地,本实施例中,通过调用系统中的异步交易收集器实时接收交易数据,并把交易数据对应存储至目标数据缓存区中,异步交易收集器在把交易数据存储之后,系统可以实时记录目标数据缓存区当前已经缓存的交易数据量,当检测到当前目标数据缓存区的交易数据量已经达到预设数据量阈值的情况下,调用系统中的异步交易执行器从目标数据缓存区中依次读取存储的交易数据。Specifically, in this embodiment, by invoking the asynchronous transaction collector in the system to receive transaction data in real time, and correspondingly store the transaction data in the target data buffer area, after the asynchronous transaction collector stores the transaction data, the system can record in real time The amount of transaction data that is currently cached in the target data buffer area. When it is detected that the amount of transaction data in the current target data buffer area has reached the preset data volume threshold, the asynchronous transaction executor in the system is called from the target data buffer area. Read stored transaction data.

此外需要说明的是,各数据缓存区的预设数据量阈值可以为固定不可变的数值,也可为灵活可变动的数值,在一实施中,为了提高分区批量执行的灵活性,可以通过读取交易发起方的历史交易数据灵活设定此次该交易发起方对应的目标数据缓存区的预设数据量阈值。In addition, it should be noted that the preset data volume threshold of each data buffer area can be a fixed value, or a flexible value. In one implementation, in order to improve the flexibility of partition batch execution, you can Get the historical transaction data of the transaction initiator and flexibly set the preset data volume threshold of the target data cache area corresponding to the transaction initiator.

其中,历史交易数据可以为与当前处理时间处于同一时间批次的历史交易数据的交易数据量,同一时间批次可以指代同一天批次、还可以指代同一星期批次,还可以为同一月份批次等,对此不作限制。Among them, the historical transaction data can be the transaction data volume of the historical transaction data batch at the same time as the current processing time, and the same time batch can refer to the batch of the same day, or the batch of the same week, or the same Monthly batches, etc., there is no limit to this.

例如,系统于2022年7月1号进行此次的批量交易处理,则读取2021年7月1号至2021年7月7号期间的交易发起方A的交易数据量,由此根据交易发起方A在2021年7月1号至2021年7月7号期间的交易数据量设定交易发起方A对应的目标数据缓存区的此次的预设数据量阈值。For example, if the system performs this batch transaction processing on July 1, 2022, it will read the transaction data volume of transaction initiator A from July 1, 2021 to July 7, 2021, and then according to the transaction initiation The transaction data volume of party A during the period from July 1, 2021 to July 7, 2021 sets the preset data volume threshold of the target data cache area corresponding to transaction initiator A.

第二:在监测到达到预设交易执行时间,判定达到预设交易处理条件。Second: After the monitoring reaches the preset transaction execution time, it is determined that the preset transaction processing conditions are met.

具体地,预设交易执行时间可以为某一个固定时间点值,例如每天上午10点,每天下午4点,每天晚上6点等。Specifically, the preset transaction execution time can be a certain fixed time point value, such as 10:00 am every day, 4:00 pm every day, 6:00 pm every day, and so on.

此外,预设交易执行时间还可以为某一个固定时长值。为了便于理解,对此举例说明。例如对于交易发起方A,交易发起方A在发送交易数据之前,与系统之间约定交易发起方A的交易数据最长缓存时间为24小时,则系统将交易发起方A的交易数据存储至目标数据缓存区后,系统调用计时器对该目标数据存储区的数据缓存时间进行监测,若监测到目标数据缓存区从缓存交易发起方A的第一笔交易数据开始计时,若在24小时内目标数据缓存区中存储的交易数据已被处理,则计时器自动对当前所累计的时长进行清零,若监测到在经过24小时后目标数据缓存区内的数据未内被处理,则计时器输出相应的提示消息,以通知系统调用异步交易执行器对目标数据缓存区中的交易数据进行处理。In addition, the preset transaction execution time can also be a certain fixed duration value. For ease of understanding, this is illustrated with an example. For example, for the transaction initiator A, before sending the transaction data, the transaction initiator A agrees with the system that the transaction data of the transaction initiator A can be cached for up to 24 hours, then the system will store the transaction data of the transaction initiator A in the target After the data cache area, the system calls the timer to monitor the data cache time of the target data storage area. If it is detected that the target data cache area starts counting from the first transaction data cached by transaction initiator A, if within 24 hours the target If the transaction data stored in the data buffer has been processed, the timer will automatically clear the current accumulated time. If it is detected that the data in the target data buffer has not been processed after 24 hours, the timer will output The corresponding prompt message is used to notify the system to call the asynchronous transaction executor to process the transaction data in the target data buffer.

另外需要说明的是,本实施例中,预设交易执行时间可以由系统根据实际情况自行设置,还可以为交易发起方在发送交易数据之前或者交易数据之后通知系统设定的,对此不作限制。In addition, it should be noted that in this embodiment, the preset transaction execution time can be set by the system itself according to the actual situation, and it can also be set by the transaction initiator notifying the system before or after sending the transaction data. There is no limit to this .

由此本实施例中通过预设交易处理条件保障在一些交易发起方的交易数据的交易数据量在比较少的情况下,交易发起方的交易数据不会一直被缓存处理,且也进一步避免了由于数据缓存区被一些少量的交易数据占用导致其他交易发起方的交易数据无法及时处理,从而可以实现交易数据的及时处理,进一步还可以提升系统的性能。Therefore, in this embodiment, the preset transaction processing conditions are used to ensure that the transaction data of the transaction initiator will not be cached all the time when the amount of transaction data of some transaction initiators is relatively small, and it is further avoided. Since the data cache area is occupied by a small amount of transaction data, the transaction data of other transaction initiators cannot be processed in time, so that the transaction data can be processed in a timely manner, and the performance of the system can be further improved.

步骤300,对所述交易数据包中的各交易数据进行交易序号的标记,并根据所述交易序号有序处理所述交易数据包中的各交易数据。Step 300: mark each transaction data in the transaction data packet with a transaction sequence number, and sequentially process each transaction data in the transaction data packet according to the transaction sequence number.

该步骤中,在从目标数据缓存区中获取交易数据包之后,对交易数据包进行解压,得到所有的交易数据及各交易数据的时间戳,其中,时间戳指代存储各交易数据的时间点信息。In this step, after the transaction data package is obtained from the target data cache area, the transaction data package is decompressed to obtain all transaction data and the time stamps of each transaction data, wherein the time stamp refers to the time point when each transaction data is stored information.

其中,交易序号用于表征接收到各交易数据的先后顺序的序号,同理交易序号也表征处理各交易数据的先后顺序的序号,由此系统可以根据各交易数据的交易序号有序处理缓存后的若干笔交易数据。Among them, the transaction sequence number is used to represent the sequence number of the received transaction data, and similarly, the transaction sequence number also represents the sequence number of the processing sequence of each transaction data, so the system can sequentially process the cached data according to the transaction sequence number of each transaction data several transaction data.

具体地,调用序号生成器根据各交易数据的时间戳按照存储时间前后顺序标记每一笔交易数据,之后按照交易序号从小到大的顺序依次处理各笔交易数据。Specifically, the call sequence number generator marks each transaction data in order of storage time according to the time stamp of each transaction data, and then processes each transaction data sequentially according to the transaction sequence number from small to large.

本发明提供的交易异步处理方法,通过接收交易数据,确定交易数据的交易发起方对应的目标数据缓存区;将交易数据存储至目标数据缓存区,并生成交易数据的交易序号;在目标数据缓存区中的交易数据的数据缓存参数达到预设缓存参数阈值的情况下,基于交易序号有序处理目标数据缓存区中的交易数据,由此通过对各交易发起方的交易数据进行分区存储,且对同一分区下的交易数据按照交易序号有序执行,保证了同一个账户下的交易有序执行的同时,还提高了系统处理性能。The transaction asynchronous processing method provided by the present invention, by receiving the transaction data, determines the target data buffer area corresponding to the transaction initiator of the transaction data; stores the transaction data in the target data buffer area, and generates the transaction sequence number of the transaction data; When the data cache parameters of the transaction data in the area reach the preset cache parameter threshold, the transaction data in the target data cache area is processed in an orderly manner based on the transaction sequence number, thereby partitioning and storing the transaction data of each transaction initiator, and The transaction data under the same partition is executed in an orderly manner according to the transaction sequence number, which ensures the orderly execution of transactions under the same account and improves the system processing performance.

基于以上实施例,步骤100还包括:Based on the above embodiments, step 100 also includes:

遍历交易发起方分区列表,并在交易发起方分区列表中包括交易发起方的情况下,根据交易发起方分区列表的数据缓存区映射函数确定交易数据对应的目标数据缓存区。Traverse the partition list of the transaction initiator, and determine the target data buffer corresponding to the transaction data according to the data buffer mapping function of the partition list of the transaction initiator when the transaction initiator is included in the partition list of the transaction initiator.

其中,交易发起方分区列表中记录的为当前已存在的数据缓存区信息及各数据缓存区所关联的交易发起方信息。Wherein, the transaction initiator partition list records the currently existing data buffer information and the transaction initiator information associated with each data buffer.

在实际应用中,由于同一段时间可能同时接到到多个交易发起方发送的交易数据,则本实施例中为了提高数据分区的处理速度,通过建立交易发起方分区列表,在接收到交易数据之后,先在交易发起方分区列表中遍历是否存在该交易数据的交易发起方信息,若存在,则直接读取交易发起方分区列表该交易发起方信息关联的数据缓存区信息,由此确定出该交易数据的数据存储位置,并将交易数据进行存储。In practical applications, since the transaction data sent by multiple transaction initiators may be received at the same time, in this embodiment, in order to improve the processing speed of the data partition, by establishing a list of transaction initiator partitions, after receiving the transaction data Afterwards, first traverse whether there is transaction initiator information of the transaction data in the transaction initiator partition list, and if so, directly read the data buffer information associated with the transaction initiator information in the transaction initiator partition list, thereby determining the The data storage location of the transaction data, and store the transaction data.

进一步地,在另一实施例中,遍历交易发起方分区列表之后,还包括:在交易发起方分区列表中不包括交易发起方的情况下,建立所交易发起方对应的目标数据缓存区;对交易发起方与目标数据存储区进行关联映射,并在交易发起方分区列表中存储交易发起方。Further, in another embodiment, after traversing the partition list of transaction initiators, it also includes: in the case that the transaction initiator is not included in the partition list of transaction initiators, establishing a target data buffer area corresponding to the transaction initiator; The transaction initiator is associated with the target data storage area, and the transaction initiator is stored in the transaction initiator partition list.

该步骤中,若未在交易发起方分区列表中遍历到该交易数据的交易发起方信息,则表明当前系统中不存在存储该交易数据的数据缓存区位置。此种情况下,本实施例中建立所交易发起方对应的目标数据缓存区,其中,建立一个新的交易发起方的目标数据缓存区的流程同上述实施例中一致,本实施例在此不再赘述。由此在建立好目标数据缓存区后,对交易发起方与目标数据存储区进行关联映射,并在交易发起方分区列表中存储交易发起方,使得后续该交易发起方的交易数据可以直接存储至对应的目标数据缓存区处,进而可以提高数据分区处理速度,有效缓解系统压力,提高吞吐量,进而可以提升系统稳定性和性能。In this step, if the transaction initiator information of the transaction data is not traversed in the transaction initiator partition list, it indicates that there is no data buffer location for storing the transaction data in the current system. In this case, in this embodiment, the target data cache area corresponding to the transaction initiator is established, wherein, the process of establishing a new target data cache area of the transaction initiator is consistent with the above-mentioned embodiment, and this embodiment does not mention here Let me repeat. Therefore, after the target data cache area is established, the transaction initiator and the target data storage area are associated and mapped, and the transaction initiator is stored in the transaction initiator partition list, so that the subsequent transaction data of the transaction initiator can be directly stored in At the corresponding target data cache area, the data partition processing speed can be improved, system pressure can be effectively relieved, throughput can be improved, and system stability and performance can be improved.

基于以上实施例,步骤300具体包括:Based on the above embodiments, step 300 specifically includes:

确定所述目标数据缓存区对应的区号标识,并获取所述交易数据包中的各交易数据对应的交易序号;Determine the area code identifier corresponding to the target data cache area, and obtain the transaction sequence number corresponding to each transaction data in the transaction data packet;

根据所述区号标识及所述交易序号生成所述各交易数据的交易序号。The transaction sequence number of each transaction data is generated according to the area code identifier and the transaction sequence number.

具体地,采用区号标识+交易序号的方式标记各交易数据,例如‘1+1’、‘1+2’,其中,第一个位置的1表示区号标识1的目标数据缓存区,第二个位置的1与2分别表示标识1的目标数据缓存区内存储的第一笔交易数据及第二笔交易数据。其中,交易序号的生成方式同以上实施例中所记载的交易序号生成方式一致,在此不再赘述。Specifically, each transaction data is marked in the way of area code identification + transaction serial number, such as '1+1', '1+2', where the 1 in the first position indicates the target data cache of area code identification 1, and the second Positions 1 and 2 respectively indicate the first transaction data and the second transaction data stored in the target data cache marked with 1. Wherein, the generation method of the transaction serial number is consistent with the generation method of the transaction serial number recorded in the above embodiments, and will not be repeated here.

本实施例中,为了保证交易有序执行,且便于后续数据追溯,采用区号标识加交易序号标识的方式对交易数据进行标记,由此后续在数据出现错误的时候,可以通过区号标识校验同一存储区内的其他交易数据,且通过交易序号可以保障系统能够按照交易序号从小到大的顺序依次处理各笔交易数据。In this embodiment, in order to ensure the orderly execution of the transaction and to facilitate subsequent data traceability, the transaction data is marked by the area code identification plus the transaction serial number identification, so that when the data is wrong, the same can be verified through the area code identification. Other transaction data in the storage area, and the transaction sequence number can ensure that the system can process each transaction data in order of transaction sequence number from small to large.

基于以上实施例,步骤100之前,具体包括:Based on the above embodiment, before step 100, specifically include:

在接收到交易发起方发送的数据包的情况下,对所述数据包进行解密验签,以获取解密验签后的交易数据。If the data packet sent by the transaction initiator is received, decryption and signature verification are performed on the data packet, so as to obtain transaction data after decryption and signature verification.

该步骤中,为了防止交易信息被篡改,保证安全性和完整性,交易发起方在发送交易数据之前,采用将交易数据加密加签成数据包的形式传输。In this step, in order to prevent the transaction information from being tampered with and ensure security and integrity, the transaction initiator encrypts and signs the transaction data into data packets before sending the transaction data.

在实际应用中,可以使用MD5WithRSA算法生成公钥和私钥,公钥发给交易发起方,交易发起方使用公钥对交易数据进行加密加签成数据包后发送至系统,系统接收后使用私钥对数据包进行解密验签得到交易数据,之后进行后续处理。In practical applications, the MD5WithRSA algorithm can be used to generate a public key and a private key. The public key is sent to the transaction initiator. The transaction initiator uses the public key to encrypt and sign the transaction data and send it to the system. After receiving it, the system uses the private key The key is used to decrypt and verify the signature of the data packet to obtain the transaction data, and then perform subsequent processing.

进一步地,所述对所述数据包进行解密验签之后,还包括:Further, after said decrypting and verifying the data packet, it also includes:

在所述数据包解密验签失败的情况下,向所述交易发起方发送解密验签失败提示消息。In the case that the decryption and signature verification of the data packet fails, a prompt message of decryption and signature verification failure is sent to the transaction initiator.

其中,本实施例中的解密验签失败主要包括以下几种情况:Among them, the failure of decryption and signature verification in this embodiment mainly includes the following situations:

第一:使用私钥无法打开数据包;First: the packet cannot be opened using the private key;

第二:使用私钥打开数据包之后,数据包中的交易数据存在缺失。Second: After using the private key to open the data packet, the transaction data in the data packet is missing.

本实施例中,在使用约定的私钥对数据包进行解密验签失败的情况下,发送相应的提示消息,以提示交易发起方进行数据核验,进而避免交易发起方此笔交易数据不能及时被处理。In this embodiment, when the agreed private key is used to decrypt and verify the signature of the data packet, a corresponding prompt message is sent to remind the transaction initiator to perform data verification, thereby avoiding that the transaction data of the transaction initiator cannot be processed in time. deal with.

下面对本发明提供的交易异步处理装置进行描述,下文描述的交易异步处理装置与上文描述的交易异步处理方法可相互对应参照。The asynchronous transaction processing device provided by the present invention is described below, and the asynchronous transaction processing device described below and the asynchronous transaction processing method described above can be referred to in correspondence.

参考图2,图2是本发明提供的交易异步处理装置的结构示意图,如图2所示,所述交易异步处理装置包括:接收单元210,用于接收交易数据,确定所述交易数据的交易发起方对应的目标数据缓存区,并将所述交易数据存储至所述目标数据缓存区;获取单元220,用于在达到预设交易处理条件的情况下,获取所述目标数据缓存区对应的交易数据包;处理单元230,用于对所述交易数据包中的各交易数据进行交易序号的标记,并根据所述交易序号有序处理所述交易数据包中的各交易数据。Referring to FIG. 2, FIG. 2 is a schematic structural diagram of the transaction asynchronous processing device provided by the present invention. As shown in FIG. 2, the transaction asynchronous processing device includes: a receiving unit 210 for receiving transaction data and determining the transaction The target data cache area corresponding to the initiator, and store the transaction data in the target data cache area; the acquiring unit 220 is configured to acquire the target data cache area corresponding to the The transaction data packet; the processing unit 230, configured to mark each transaction data in the transaction data packet with a transaction sequence number, and sequentially process each transaction data in the transaction data packet according to the transaction sequence number.

进一步地,获取单元220,还用于在监测到所述目标数据缓存区中的交易数据量达到预设数据量阈值的情况下,判定达到预设交易处理条件。Further, the acquiring unit 220 is further configured to determine that a preset transaction processing condition is met when it is monitored that the transaction data volume in the target data buffer reaches a preset data volume threshold.

进一步地,获取单元220,还用于在监测到达到预设交易执行时间,判定达到预设交易处理条件。Further, the acquisition unit 220 is also configured to determine that the preset transaction processing condition is met when the preset transaction execution time is detected.

进一步地,处理单元230,还用于确定所述目标数据缓存区对应的区号标识,并获取所述交易数据包中的各交易数据对应的交易序号;根据所述区号标识及所述交易序号生成所述各交易数据的交易序号。Further, the processing unit 230 is also configured to determine the area code identifier corresponding to the target data cache area, and obtain the transaction sequence number corresponding to each transaction data in the transaction data packet; generate The transaction serial number of each transaction data.

进一步地,接收单元210,还用于在接收到交易发起方发送的数据包的情况下,对所述数据包进行解密验签,以获取解密验签后的交易数据。Further, the receiving unit 210 is further configured to, in the case of receiving the data packet sent by the transaction initiator, perform decryption and signature verification on the data packet, so as to obtain the decrypted and signature-verified transaction data.

进一步地,接收单元210,还用于在所述数据包解密验签失败的情况下,向所述交易发起方发送解密验签失败提示消息。Further, the receiving unit 210 is further configured to send a prompt message of decryption and signature verification failure to the transaction initiator when the data packet decryption and signature verification fail.

本发明提供的交易异步处理装置,通过接收交易数据,确定交易数据的交易发起方对应的目标数据缓存区,并将交易数据存储至目标数据缓存区;在达到预设交易处理条件的情况下,获取目标数据缓存区对应的交易数据包;调用序号生成器对交易数据包中的各交易数据进行交易序号的标记,并根据交易序号有序处理交易数据包中的各交易数据,由此通过对各交易发起方的交易数据进行分区存储,且对同一分区下的交易数据按照交易序号有序执行,保证了同一个账户下的交易有序执行的同时,还提高了系统处理性能。The transaction asynchronous processing device provided by the present invention determines the target data buffer area corresponding to the transaction initiator of the transaction data by receiving the transaction data, and stores the transaction data in the target data buffer area; when the preset transaction processing conditions are met, Obtain the transaction data packet corresponding to the target data cache area; call the sequence number generator to mark the transaction sequence number of each transaction data in the transaction data packet, and process each transaction data in the transaction data packet in an orderly manner according to the transaction sequence number. The transaction data of each transaction initiator is partitioned and stored, and the transaction data under the same partition is executed sequentially according to the transaction sequence number, which ensures the orderly execution of transactions under the same account and improves the system processing performance.

图3示例了一种电子设备的实体结构示意图,如图3所示,该电子设备可以包括:处理器(processor)310、通信接口(Communications Interface)320、存储器(memory)330和通信总线340,其中,处理器310,通信接口320,存储器330通过通信总线340完成相互间的通信。处理器310可以调用存储器330中的逻辑指令,以执行交易异步处理方法,该方法包括:接收交易数据,确定所述交易数据的交易发起方对应的目标数据缓存区,并将所述交易数据存储至所述目标数据缓存区;在达到预设交易处理条件的情况下,获取所述目标数据缓存区对应的交易数据包;对所述交易数据包中的各交易数据进行交易序号的标记,并根据所述交易序号有序处理所述交易数据包中的各交易数据。FIG. 3 illustrates a schematic diagram of the physical structure of an electronic device. As shown in FIG. 3 , the electronic device may include: a processor (processor) 310, a communication interface (Communications Interface) 320, a memory (memory) 330 and a communication bus 340, Wherein, the processor 310 , the communication interface 320 , and the memory 330 communicate with each other through the communication bus 340 . The processor 310 can call the logic instructions in the memory 330 to execute the transaction asynchronous processing method, the method includes: receiving the transaction data, determining the target data cache area corresponding to the transaction initiator of the transaction data, and storing the transaction data to the target data buffer area; when the preset transaction processing conditions are met, obtain the transaction data packet corresponding to the target data buffer area; mark the transaction sequence number of each transaction data in the transaction data packet, and Each transaction data in the transaction data packet is sequentially processed according to the transaction serial number.

此外,上述的存储器330中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。In addition, the above-mentioned logic instructions in the memory 330 may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes. .

另一方面,本发明还提供一种计算机程序产品,所述计算机程序产品包括计算机程序,计算机程序可存储在非暂态计算机可读存储介质上,所述计算机程序被处理器执行时,计算机能够执行上述各方法所提供的交易异步处理方法,该方法包括:接收交易数据,确定所述交易数据的交易发起方对应的目标数据缓存区,并将所述交易数据存储至所述目标数据缓存区;在达到预设交易处理条件的情况下,获取所述目标数据缓存区对应的交易数据包;对所述交易数据包中的各交易数据进行交易序号的标记,并根据所述交易序号有序处理所述交易数据包中的各交易数据。On the other hand, the present invention also provides a computer program product. The computer program product includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can Executing the transaction asynchronous processing method provided by the above methods, the method includes: receiving transaction data, determining the target data buffer corresponding to the transaction initiator of the transaction data, and storing the transaction data in the target data buffer ; In the case of reaching the preset transaction processing conditions, obtain the transaction data package corresponding to the target data buffer area; mark the transaction sequence number of each transaction data in the transaction data package, and order according to the transaction sequence number Each transaction data in the transaction data package is processed.

又一方面,本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现以执行上述各方法提供的交易异步处理方法,该方法包括:接收交易数据,确定所述交易数据的交易发起方对应的目标数据缓存区,并将所述交易数据存储至所述目标数据缓存区;在达到预设交易处理条件的情况下,获取所述目标数据缓存区对应的交易数据包;对所述交易数据包中的各交易数据进行交易序号的标记,并根据所述交易序号有序处理所述交易数据包中的各交易数据。In another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it is implemented to execute the transaction asynchronous processing method provided by the above-mentioned methods, the method includes : Receive transaction data, determine the target data cache area corresponding to the transaction initiator of the transaction data, and store the transaction data in the target data cache area; when the preset transaction processing conditions are met, obtain the The transaction data package corresponding to the target data cache area; marking the transaction sequence number of each transaction data in the transaction data package, and orderly processing each transaction data in the transaction data package according to the transaction sequence number.

以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network elements. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. It can be understood and implemented by those skilled in the art without any creative effort.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。Through the above description of the implementations, those skilled in the art can clearly understand that each implementation can be implemented by means of software plus a necessary general hardware platform, and of course also by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the prior art can be embodied in the form of software products, and the computer software products can be stored in computer-readable storage media, such as ROM/RAM, magnetic discs, optical discs, etc., including several instructions to make a computer device (which may be a personal computer, server, or network device, etc.) execute the methods described in various embodiments or some parts of the embodiments.

最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still be Modifications are made to the technical solutions described in the foregoing embodiments, or equivalent replacements are made to some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims (10)

1.一种交易异步处理方法,其特征在于,包括:1. A transaction asynchronous processing method, characterized in that, comprising: 接收交易数据,确定所述交易数据的交易发起方对应的目标数据缓存区,并将所述交易数据存储至所述目标数据缓存区;receiving transaction data, determining a target data buffer corresponding to the transaction initiator of the transaction data, and storing the transaction data in the target data buffer; 在达到预设交易处理条件的情况下,获取所述目标数据缓存区对应的交易数据包;Obtain the transaction data packet corresponding to the target data cache area when the preset transaction processing condition is met; 对所述交易数据包中的各交易数据进行交易序号的标记,并根据所述交易序号有序处理所述交易数据包中的各交易数据。Each transaction data in the transaction data packet is marked with a transaction sequence number, and each transaction data in the transaction data packet is sequentially processed according to the transaction sequence number. 2.根据权利要求1所述的交易异步处理方法,其特征在于,所述达到预设交易处理条件,具体包括:2. The transaction asynchronous processing method according to claim 1, wherein the meeting the preset transaction processing conditions specifically includes: 在监测到所述目标数据缓存区中的交易数据量达到预设数据量阈值的情况下,判定达到预设交易处理条件。When it is detected that the amount of transaction data in the target data cache area reaches a preset data amount threshold, it is determined that a preset transaction processing condition is met. 3.根据权利要求1所述的交易异步处理方法,其特征在于,所述达到预设交易处理条件,具体包括:3. The transaction asynchronous processing method according to claim 1, wherein the meeting the preset transaction processing conditions specifically includes: 在监测到达到预设交易执行时间,判定达到预设交易处理条件。When the preset transaction execution time is reached, it is determined that the preset transaction processing condition is met. 4.根据权利要求1所述的交易异步处理方法,其特征在于,所述对所述交易数据包中的各交易数据进行交易序号的标记,具体包括:4. The transaction asynchronous processing method according to claim 1, wherein the marking of the transaction sequence number on each transaction data in the transaction data package specifically includes: 确定所述目标数据缓存区对应的区号标识,并获取所述交易数据包中的各交易数据对应的交易序号;Determine the area code identifier corresponding to the target data cache area, and obtain the transaction sequence number corresponding to each transaction data in the transaction data packet; 根据所述区号标识及所述交易序号生成所述各交易数据的交易序号。The transaction sequence number of each transaction data is generated according to the area code identifier and the transaction sequence number. 5.根据权利要求1至4任一项所述的交易异步处理方法,其特征在于,所述接收交易数据之前,还包括:5. The transaction asynchronous processing method according to any one of claims 1 to 4, characterized in that before receiving the transaction data, it also includes: 在接收到交易发起方发送的数据包的情况下,对所述数据包进行解密验签,以获取解密验签后的交易数据。If the data packet sent by the transaction initiator is received, decryption and signature verification are performed on the data packet, so as to obtain transaction data after decryption and signature verification. 6.根据权利要求5所述的交易异步处理方法,其特征在于,所述对所述数据包进行解密验签之后,还包括:6. The transaction asynchronous processing method according to claim 5, characterized in that, after decrypting and verifying the signature of the data packet, further comprising: 在所述数据包解密验签失败的情况下,向所述交易发起方发送解密验签失败提示消息。In the case that the decryption and signature verification of the data packet fails, a prompt message of decryption and signature verification failure is sent to the transaction initiator. 7.一种交易异步处理装置,其特征在于,包括:7. An asynchronous transaction processing device, comprising: 接收单元,用于接收交易数据,确定所述交易数据的交易发起方对应的目标数据缓存区,并将所述交易数据存储至所述目标数据缓存区;A receiving unit, configured to receive transaction data, determine a target data cache area corresponding to the transaction initiator of the transaction data, and store the transaction data in the target data cache area; 获取单元,用于在达到预设交易处理条件的情况下,获取所述目标数据缓存区对应的交易数据包;An acquisition unit, configured to acquire the transaction data packet corresponding to the target data buffer area when the preset transaction processing condition is met; 处理单元,用于对所述交易数据包中的各交易数据进行交易序号的标记,并根据所述交易序号有序处理所述交易数据包中的各交易数据。The processing unit is configured to mark the transaction sequence number of each transaction data in the transaction data packet, and sequentially process each transaction data in the transaction data packet according to the transaction sequence number. 8.一种电子设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现如权利要求1至6任一项所述交易异步处理方法。8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, wherein the processor according to claim 1 is implemented when executing the program. The transaction asynchronous processing method described in any one of to 6. 9.一种非暂态计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至6任一项所述交易异步处理方法。9. A non-transitory computer-readable storage medium on which a computer program is stored, wherein when the computer program is executed by a processor, the transaction asynchronous processing method according to any one of claims 1 to 6 is implemented. 10.一种计算机程序产品,包括计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至6任一项所述交易异步处理方法。10. A computer program product, comprising a computer program, characterized in that, when the computer program is executed by a processor, the transaction asynchronous processing method according to any one of claims 1 to 6 is realized.
CN202210828526.3A 2022-07-13 2022-07-13 Transaction asynchronous processing method, device, equipment, medium and program product Pending CN115309782A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210828526.3A CN115309782A (en) 2022-07-13 2022-07-13 Transaction asynchronous processing method, device, equipment, medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210828526.3A CN115309782A (en) 2022-07-13 2022-07-13 Transaction asynchronous processing method, device, equipment, medium and program product

Publications (1)

Publication Number Publication Date
CN115309782A true CN115309782A (en) 2022-11-08

Family

ID=83856374

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210828526.3A Pending CN115309782A (en) 2022-07-13 2022-07-13 Transaction asynchronous processing method, device, equipment, medium and program product

Country Status (1)

Country Link
CN (1) CN115309782A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110222116A (en) * 2019-05-07 2019-09-10 北京奇艺世纪科技有限公司 A kind of control method, device and the storage medium of transaction data storage
CN111414374A (en) * 2020-03-20 2020-07-14 深圳市网心科技有限公司 A method, device and device for concurrent processing of blockchain transactions
CN112395300A (en) * 2021-01-20 2021-02-23 腾讯科技(深圳)有限公司 Data processing method, device and equipment based on block chain and readable storage medium
CN114218173A (en) * 2021-12-30 2022-03-22 北京宇信科技集团股份有限公司 Batch processing system, processing method, medium and equipment for account-transfer transaction files

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110222116A (en) * 2019-05-07 2019-09-10 北京奇艺世纪科技有限公司 A kind of control method, device and the storage medium of transaction data storage
CN111414374A (en) * 2020-03-20 2020-07-14 深圳市网心科技有限公司 A method, device and device for concurrent processing of blockchain transactions
CN112395300A (en) * 2021-01-20 2021-02-23 腾讯科技(深圳)有限公司 Data processing method, device and equipment based on block chain and readable storage medium
CN114218173A (en) * 2021-12-30 2022-03-22 北京宇信科技集团股份有限公司 Batch processing system, processing method, medium and equipment for account-transfer transaction files

Similar Documents

Publication Publication Date Title
EP3346379B1 (en) Database management system with dynamic allocation of database requests
CN110224808B (en) Bank data sharing method and device based on block chain, computer equipment and storage medium
WO2020014954A1 (en) Data control method and terminal device
CN108805704A (en) Block chain service implementation method, audiomonitor, storage medium and system
CN111182551B (en) Network security protection method and system
CN101262405A (en) Network Processor-Based High-Speed Security Virtual Private Network Channel and Its Realization Method
CN110276688A (en) Method and device for transaction processing in blockchain
CN113592639B (en) Block chain transaction deleting method and system
CN112995167B (en) Kafka mechanism-based electricity consumption information acquisition method, blockchain network and user terminal
CN114374566B (en) An attack detection method and device
CN111260475B (en) Data processing method, block link point equipment and storage medium
CN113495927B (en) Block management method and device
CN119299393A (en) Communication data transmission and temporary storage method, device and storage medium
CN111641563A (en) Flow self-adaption method and system based on distributed scene
CN110009347A (en) A method and device for auditing blockchain transaction information
CN110310192A (en) Transaction processing method, device, device and storage medium based on data analysis
CN113468574B (en) A method and device for uploading blockchain data
CN114969803B (en) A data storage method, device and storage medium
CN113362064B (en) Multiple signature method, computer device, and storage medium
CN114641014B (en) User plane entity, configuration method, system and equipment
CN115309782A (en) Transaction asynchronous processing method, device, equipment, medium and program product
JP7622261B2 (en) Blockchain-Based Integrity Assurance for CDR
CN116455576A (en) Block chain consensus method, device, storage medium and equipment based on Internet of things
CN107592361A (en) A kind of data transmission method based on double IB networks, device, equipment
CN116361383A (en) Block generation method, block chain system, storage medium and related equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination