Transaction data processing method, apparatus and server
By acquiring and calculating the resource data status of transaction data in the bank payment system, and filtering and adjusting the matching queue, the problem of unreasonable matching queues in the existing technology is solved, and efficient transaction data processing is achieved.
Patent Information
- Application Number
- CN202310323405.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-29
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2043-03-29
AI Technical Summary
The matching queues determined by existing methods are not reasonable enough, which affects the processing efficiency of queued transaction data in the bank payment system.
By acquiring transaction data from the initial queue, calculating resource data in the final state of data objects, filtering out data objects that do not meet preset conditions, determining the target matching queue according to preprocessing rules, ensuring that there is no deadlock in the transaction data in the queue, and processing the transaction data.
Accurately identify the target matching queue with the best performance, efficiently and rationally process the transaction data in the queue, avoid deadlock, and improve overall processing efficiency.
Smart Images

Figure CN116501745B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present specification belongs to the technical field of transaction data processing, and particularly relates to a transaction data processing method and device and a server. BACKGROUND
[0002] In a financial service scenario, a bank payment system server often faces a large number of queued transaction data initiated by users or institutions.
[0003] Based on the existing method, for the above queued transaction data, it is usually necessary to first find out the matching queue; and then perform a one-time difference processing on the transaction data in the matching queue, so as to improve the overall processing efficiency of the queued transaction data.
[0004] However, the matching queue determined based on the existing method is often not reasonable, and the use effect is not ideal, thereby affecting the overall processing efficiency of the queued transaction data.
[0005] At present, no effective solution has been proposed for the above problems. SUMMARY
[0006] The present specification provides a transaction data processing method, device and server, which can accurately determine a target matching queue with better effect, and can complete the processing of the transaction data in the queue based on the target matching queue more efficiently and reasonably.
[0007] The present specification provides a transaction data processing method applied to a server, comprising:
[0008] Obtaining first transaction data in an initial queue to be processed; wherein the first transaction data at least involves resource data of a data object initiated for other data objects;
[0009] According to the resource data of the data object in the initial state and the first transaction data in the initial queue, the resource data of the data object in the first end state is calculated under the condition that the execution of the first transaction data in the initial queue is completed;
[0010] According to the resource data of the data object in the first end state, it is detected whether the initial queue meets a preset first processing condition;
[0011] In a case where it is determined that the initial queue does not meet the preset first processing condition, a data object with resource data less than a preset lower limit value of resource data is selected as a first data object;
[0012] From the first transaction data in the initial queue, first transaction data with the first data object as the initiating object is determined as second transaction data;
[0013] Based on the preset pre-processing rules and the second transaction data, the target matching queue of the initial queue is determined through pre-processing; wherein the transaction data contained in the target matching queue is not in a deadlock state.
[0014] Process transaction data for the target matching queue of the initial queue.
[0015] In one embodiment, detecting whether the initial queue meets a preset first processing condition based on the resource data in the first end state of the data object includes:
[0016] Check whether at least one data object in the first end state has resource data that is less than a preset lower limit value for resource data.
[0017] If at least one data object in the first end state of the resource data is less than the preset lower limit of the resource data, then the initial queue is determined not to meet the preset first processing condition.
[0018] In one embodiment, based on preset pre-processing rules and second transaction data, the target matching queue of the initial queue is determined through pre-processing, including:
[0019] According to the preset preprocessing rules, the second transaction data is arranged according to the first sorting rule to obtain the first sequence group;
[0020] Based on the resource data in the first end state of the data object, and based on the first sequence group, the second transaction data in the first sequence group are sequentially checked to see if they meet the first detection requirements; and the second transaction data that meets the first detection requirements are removed from the initial queue to obtain the first candidate matching queue.
[0021] Based on the first candidate matching queue, the target matching queue of the initial queue is determined.
[0022] In one embodiment, the first sorting rule includes one of the following: a sorting rule based on resource data from largest to smallest, a sorting rule based on resource data from smallest to largest, a sorting rule based on the initiation time of transaction data from first to last, and a sorting rule based on the initiation time of transaction data from last to first.
[0023] In one embodiment, based on the resource data in the first end state of the data object, and based on the first sequence group, it is sequentially detected whether the second transaction data in the first sequence group meets the first detection requirement, including:
[0024] The following method is used to check whether the current second transaction data in the first sequence group meets the first detection requirement:
[0025] Based on the resource data in the first end state of the data object and the remaining second transaction data in the current first sequence group, it is detected whether the resource data in the end state of the initiating object corresponding to the current second transaction data has changed to a value greater than or equal to the preset lower limit of resource data without initiating the current second transaction data; and whether the resource data in the end state of the receiving object corresponding to the current second transaction data is greater than or equal to the preset lower limit of resource data.
[0026] If, without initiating the current second transaction data, the resource data in the end state of the initiating object corresponding to the current second transaction data is transformed to a value greater than or equal to the preset lower limit of resource data; and the resource data in the end state of the receiving object corresponding to the current second transaction data is greater than or equal to the preset lower limit of resource data, then the current second transaction data is determined to meet the first detection requirement.
[0027] In one embodiment, determining the target matching queue of the initial queue based on the first candidate matching queue includes:
[0028] Based on the resource data of the data object in its initial state and the third transaction data in the first candidate matching queue, calculate the resource data of the data object in its second final state after the execution of the third transaction data in the first candidate matching queue.
[0029] Based on the resource data of the data object in the second end state, detect whether the first candidate matching queue meets the preset second condition;
[0030] If the first candidate matching queue meets the preset second condition, the first candidate matching queue is determined as the target matching queue.
[0031] In one embodiment, after detecting whether the first candidate matching queue meets a preset second condition based on the resource data of the second end state of the data object, the method further includes:
[0032] If it is determined that the first candidate matching queue does not meet the preset second condition, the data object whose resource data in the second ending state is less than the preset lower limit of resource data is determined as the second data object;
[0033] From the first candidate matching queue, select the third transaction data whose initiating object is the second data object, and use it as the fourth transaction data;
[0034] Based on the preset preprocessing rules and the fourth transaction data, the target matching queue is obtained by adjusting the first candidate matching queue.
[0035] In one embodiment, based on preset preprocessing rules and fourth transaction data, the target matching queue is obtained by adjusting the first candidate matching queue, including:
[0036] According to the preset preprocessing rules, the fourth transaction data is arranged according to the second sorting rule to obtain the second sequence group;
[0037] Based on the resource data in the second end state of the data object, and based on the second sequence group, the fourth transaction data in the second sequence group is sequentially checked to see if it meets the second detection requirements; and the fourth transaction data that meets the second detection requirements is removed to obtain the second candidate matching queue.
[0038] Based on the second candidate matching queue, determine the target matching queue of the initial queue.
[0039] In one embodiment, based on the resource data in the second end state of the data object, and based on the second sequence group, it is sequentially detected whether the fourth transaction data in the second sequence group meets the second detection requirement, including:
[0040] The following method is used to check whether the current fourth transaction data in the second sequence group meets the second detection requirement:
[0041] Based on the resource data in the second end state of the data object and the remaining fourth transaction data in the current second sequence group, detect whether the resource data in the end state of the receiving object corresponding to the current fourth transaction data is greater than or equal to the preset lower limit of the resource data without initiating the current fourth transaction data.
[0042] If, without initiating the current fourth transaction data, the resource data in the end state of the receiving object corresponding to the current fourth transaction data is greater than or equal to the preset lower limit of resource data, then the current fourth transaction data is determined to meet the second detection requirement.
[0043] In one embodiment, determining the target matching queue of the initial queue based on the second candidate matching queue includes:
[0044] Based on the second candidate matching queue, calculate the resource data of the data object in the third final state after the fifth transaction data in the second candidate matching queue has been executed;
[0045] Based on the resource data in the third end state of the data object, check whether the second candidate matching queue meets the preset third condition;
[0046] If the second candidate matching queue meets the preset third condition, the second candidate matching queue is determined as the target matching queue.
[0047] In one embodiment, after detecting whether the second candidate matching queue meets a preset third condition based on the resource data of the third end state of the data object, the method further includes:
[0048] If the second candidate matching queue does not meet the preset third condition, the target matching queue of the initial queue is determined by processing the second candidate matching queue according to the preset basic processing rules.
[0049] In one embodiment, while processing transaction data for the target matching queue of the initial queue, the method further includes:
[0050] Check whether the remaining transaction dataset in the initial queue, excluding the target matching queue, is an empty set;
[0051] If it is determined that the remaining transaction dataset is not an empty set, generate an assistance request for the remaining transaction dataset;
[0052] Initiate an assistance request to the relevant data objects so that they can complete the transaction data processing for the remaining transaction dataset by injecting resource data.
[0053] This specification also provides a transaction data processing device, applied to a server, including:
[0054] The acquisition module is used to acquire the first transaction data in the initial queue to be processed; wherein, the first transaction data involves at least resource data initiated by a data object for other data objects;
[0055] The calculation module is used to calculate the resource data of the data object in its first final state after the execution of the first transaction data in the initial queue, based on the resource data in the initial state of the data object and the first transaction data in the initial queue.
[0056] The detection module is used to detect whether the initial queue meets the preset first processing condition based on the resource data in the first end state of the data object.
[0057] The filtering module is used to filter out data objects whose resource data in the first ending state is less than the preset lower limit of resource data, and use them as the first data objects, when it is determined that the initial queue does not meet the preset first processing condition.
[0058] The determination module is used to determine the first transaction data whose initiating object is the first data object from the first transaction data in the initial queue, and use it as the second transaction data;
[0059] The pre-processing module is used to determine the target matching queue of the initial queue through pre-processing based on preset pre-processing rules and second transaction data; wherein the transaction data contained in the target matching queue is not in a deadlock state.
[0060] The transaction processing module is used to process transaction data in the target matching queue of the initial queue.
[0061] This specification also provides a server, including a processor and a memory for storing processor-executable instructions, wherein the processor executes the instructions to implement the relevant steps of the transaction data processing method.
[0062] This specification also provides a computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the relevant steps of the method for processing the transaction data.
[0063] This specification also provides a computer program product comprising a computer program that, when executed by a processor, performs the following steps: acquiring first transaction data in an initial queue to be processed; wherein the first transaction data at least involves resource data initiated by a data object against other data objects; calculating, based on the resource data in the initial state of the data object and the first transaction data in the initial queue, the resource data in the first final state of the data object after the first transaction data in the initial queue has been executed; detecting, based on the resource data in the first final state of the data object, whether the initial queue meets a preset first processing condition; if it is determined that the initial queue does not meet the preset first processing condition, selecting data objects whose resource data in the first final state is less than a preset lower limit of resource data as first data objects; determining, from the first transaction data in the initial queue, the first transaction data whose initiating object is the first data object as second transaction data; determining, through preprocessing, a target matching queue of the initial queue based on preset preprocessing rules and the second transaction data; wherein the transaction data contained in the target matching queue does not have a deadlock state; and processing the transaction data of the target matching queue of the initial queue.
[0064] Based on the transaction data processing method, apparatus, and server provided in this specification, after the server of the payment system obtains the first transaction data to be processed in the initial queue, it can first obtain and calculate the resource data of the data object in the first end state after the execution of the first transaction data in the initial queue, based on the resource data of the data object in the initial state and the first transaction data in the initial queue; and based on the resource data of the data object in the first end state, detect whether the initial queue meets the preset first processing conditions; if it is determined that the initial queue does not meet the preset first processing conditions, select data objects whose resource data in the first end state is less than the preset lower limit of resource data as the first data objects; then determine the first transaction data whose initiating object is the first data object from the first transaction data in the initial queue as the second transaction data; and determine the target matching queue of the initial queue through preprocessing based on the preset preprocessing rules and the second transaction data; wherein the transaction data contained in the target matching queue is not in a deadlock state; and process the transaction data of the target matching queue of the initial queue. Furthermore, if a suitable target matching queue cannot be determined through pre-processing, further matching processing can be performed based on preset basic processing rules to ultimately determine a target matching queue that performs better than the initial queue. This involves first checking if the initial queue meets preset first processing conditions; if it does not, selecting a first data object whose resource data in the first termination state is less than a preset lower limit, and second transaction data initiated by the first data object; then, based on heuristic preset pre-processing rules and the second transaction data, pre-processing determines a target matching queue free from deadlock; and finally, transaction data processing is performed on the target matching queue of the initial queue. This allows for accurate determination of a better-performing target matching queue, and enables efficient and reasonable processing of transaction data within the queue. Attached Figure Description
[0065] To more clearly illustrate the embodiments of this specification, the accompanying drawings used in the embodiments will be briefly introduced below. The drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0066] Figure 1 This is a flowchart illustrating a method for processing transaction data provided in one embodiment of this specification;
[0067] Figure 2 This is a schematic diagram illustrating one embodiment of the transaction data processing method provided in the embodiments of this specification, applied in a scenario example.
[0068] Figure 3 is a schematic diagram of one embodiment of the method for processing transaction data provided by the embodiments of the present specification in one scenario example;
[0069] Figure 4 is a schematic diagram of one embodiment of the method for processing transaction data provided by the embodiments of the present specification in one scenario example;
[0070] Figure 5 is a schematic diagram of one embodiment of the method for processing transaction data provided by the embodiments of the present specification in one scenario example;
[0071] Figure 6 is a schematic diagram of one embodiment of the method for processing transaction data provided by the embodiments of the present specification in one scenario example;
[0072] Figure 7 is a schematic diagram of the structure of a server provided by one embodiment of the present specification;
[0073] Figure 8 is a schematic diagram of the structure of a transaction data processing device provided by one embodiment of the present specification;
[0074] Figure 9 is a schematic diagram of one embodiment of the method for processing transaction data provided by the embodiments of the present specification in one scenario example;
[0075] Figure 10 is a schematic diagram of one embodiment of the method for processing transaction data provided by the embodiments of the present specification in one scenario example;
[0076] Figure 11 is a schematic diagram of one embodiment of the method for processing transaction data provided by the embodiments of the present specification in one scenario example;
[0077] Figure 12 is a schematic diagram of one embodiment of the method for processing transaction data provided by the embodiments of the present specification in one scenario example;
[0078] Figure 13 is a schematic diagram of one embodiment of the method for processing transaction data provided by the embodiments of the present specification in one scenario example;
[0079] Figure 14 is a schematic diagram of one embodiment of the method for processing transaction data provided by the embodiments of the present specification in one scenario example;
[0080] Figure 15FIG. 1 is a schematic diagram of an embodiment of a method for processing transaction data according to an embodiment of the present specification;
[0081] Figure 16 FIG. 1 is a schematic diagram of an embodiment of a method for processing transaction data according to an embodiment of the present specification;
[0082] Figure 17 FIG. 1 is a schematic diagram of an embodiment of a method for processing transaction data according to an embodiment of the present specification;
[0083] Figure 18 FIG. 1 is a schematic diagram of an embodiment of a method for processing transaction data according to an embodiment of the present specification. DETAILED DESCRIPTION
[0084] In order to enable persons skilled in the art to better understand the technical solutions in the present specification, the technical solutions in the present specification will be described clearly and completely in the present specification with reference to the drawings in the embodiments of the present specification. Obviously, the described embodiments are only some of the embodiments of the present specification, not all the embodiments. Based on the embodiments in the present specification, all other embodiments obtained by persons skilled in the art without creative labor should fall within the scope of protection of the present specification.
[0085] Referring to Figure 1 As shown in the drawings, the present specification provides a method for processing transaction data, wherein the method is specifically applied to the server side. In specific implementation, the method can include the following contents:
[0086] S101: acquiring first transaction data in an initial queue to be processed; wherein the first transaction data at least involves resource data initiated by a data object to other data objects;
[0087] S102: calculating resource data of a first end state of the data object in the case that the first transaction data in the initial queue is executed completely according to the resource data of the initial state of the data object and the first transaction data in the initial queue;
[0088] S103: detecting whether the initial queue meets a preset first processing condition according to the resource data of the first end state of the data object;
[0089] S104: in the case that it is determined that the initial queue does not meet the preset first processing condition, screening out the data object with the resource data of the first end state less than the lower limit value of the preset resource data as a first data object;
[0090] S105: From the first transaction data in the initial queue, determine the first transaction data whose initiating object is the first data object, and use it as the second transaction data;
[0091] S106: Based on the preset pre-processing rules and the second transaction data, the target matching queue of the initial queue is determined through pre-processing; wherein the transaction data contained in the target matching queue is not in a deadlock state.
[0092] S107: Process transaction data for the target matching queue of the initial queue.
[0093] In some embodiments, see Figure 2 As shown, the above transaction data processing method can be specifically applied to the server side.
[0094] Specifically, the aforementioned server may include a backend server applied to the payment system side of a trading institution or trading platform (e.g., a bank), capable of data transmission, data processing, and other functions. Specifically, the server may be, for example, an electronic device with data processing, storage, and network interaction capabilities. Alternatively, the server may be a software program running on the electronic device, providing support for data processing, storage, and network interaction. In this embodiment, the number of servers is not specifically limited. The server may be a single server, several servers, or a server cluster formed by several servers.
[0095] In some embodiments, see Figure 2 As shown, the payment system receives a large amount of pending transaction data within a certain time period, for example, transaction data 1, transaction data 2, ..., transaction data N. Transaction data that cannot be processed in time will form a task queue, denoted as the initial queue. This initial queue may contain multiple pending first transaction data.
[0096] Specifically, each transaction involves at least one data object (which can be referred to as the initiating object) initiating resource data for another data object (which can be referred to as the receiving object). This resource data can be financial data or computing resources, such as CPU, GPU, etc.
[0097] For example, in a transaction involving Bank A lending 500,000 to Company B, Bank A can be recorded as the initiator, Company B as the recipient, and the 500,000 can be recorded as resource data. Implementing this transaction data will decrease Bank A's resource data balance (e.g., Bank A's liquidity balance) by 500,000; simultaneously, it will increase Company B's resource data balance by 500,000.
[0098] In some embodiments, after the server obtains the first transaction data in the initial queue to be processed, it can first determine the data objects involved in the first transaction data, including the initiating object and the receiving object; then, by querying the current resource data balance of the data object used to specify the processing of transaction data, it can determine the resource data of the data object before executing the first transaction data in the initial queue, which is recorded as the resource data of the data object in its initial state.
[0099] In some embodiments, during specific implementation, it can be assumed that all the first transaction data in the initial queue has been executed. Then, based on the resource data in the initial state of the data object and the first transaction data in the initial queue, the resource data in the first final state of the data object after the first transaction data in the initial queue has been executed can be calculated.
[0100] Specifically, the aforementioned first ending state can be understood as the state after executing the first transaction data contained in the initial queue.
[0101] In some embodiments, the above-described method of detecting whether the initial queue meets the preset first processing condition based on the resource data in the first end state of the data object may specifically include the following:
[0102] S1: Detect whether there is at least one data object whose resource data in the first end state is less than the preset lower limit of resource data in the first end state of the data object;
[0103] S2: If at least one data object in the resource data of the first end state of the determined data object has resource data in the first end state that is less than the preset lower limit of resource data, then the initial queue does not meet the preset first processing condition.
[0104] The lower limit of the aforementioned preset resource data can be a very small value, such as 0.
[0105] In some embodiments, when at least one data object in the first end state has resource data that is less than a preset lower limit for resource data (e.g., at least one data object in the first end state has a negative resource data balance), it can be determined that the matching operation cannot be completed for all data in the current initial queue at once. That is, the current initial queue is in a deadlock state, which may be partially resolved or cannot be resolved after further processing.
[0106] Specifically, the aforementioned gridlock refers to a state in a payment system where netting and settlement operations cannot be completed for all transaction data at once.
[0107] The above deadlock (or liquidity deadlock) can be specifically referred to as a state in which, in a payment system, for the data objects involved, additional liquidity resource data needs to be injected to complete the settlement of the transaction data.
[0108] Specifically, the lock and the deadlock can be defined in the following manner.
[0109] For a non-empty set Q, there is a non-empty subset X. For example, for any data object numbered i in the data object, there is the following relationship:
[0110]
[0111]
[0112] Where i is the number of the data object, i = 1, …, n; X i is the part of the transaction data involving the data object numbered i in the first transaction data of the initial queue and capable of being settled at the same time; i is a subset of Q i of the data object numbered i; is the resource data of the data object numbered i in the initial state before settlement; S(X i is the resource data (or liquidity) that the data object numbered i needs to pay to other data objects at the time of settlement; R(X -i is the resource data (or liquidity) received by the data object numbered i from other data objects at the time of settlement.
[0113] Specifically, based on the above formula (1), if there is a subset X in the initial queue, the transaction data in X can be settled at the same time, and the balance of the resource data after settlement of the data object is not negative. At the same time, the liquidity limit is assumed. Based on the above formula (2), if there is a subset X, then there is no transaction data q outside X that is paid earlier than any transaction data X in X.
[0114] Based on the above formula, the deadlock can be defined as Q being a non-empty set but X being an empty set.
[0115] When the payment system is in a liquidity deadlock state, it is considered that the state can be changed from deadlock to lock or queue release by adjusting the payment order or injecting external liquidity.
[0116] According to the above definitions of the deadlock and the lockup, the queue state of the initial queue containing the first transaction data to be processed can be divided into three types: empty, lockup, and deadlock. The empty means that the queue does not need to be queued and the lockup release mechanism can complete the settlement. The lockup means that part or all of the transaction data (or business) in the queue needs to be settled under certain constraints. The deadlock means that all the transaction data (or business) in the queue cannot be settled.
[0117] For the initial queue, the rescue scheme can be further divided into: unable to rescue, partially rescue, and completely rescue.
[0118] Specifically, based on the formula (1) and the formula (2), referring to Table 1, the above unable to rescue can specifically mean that the queue state before and after the settlement of the queue is in the deadlock state. The partially rescue means that the state before the settlement of the queue is in the lockup state, and part of the transaction data in the queue is rescued after the settlement, and part of the transaction data becomes the deadlock state. The completely rescue means that the queue is in the lockup state before the settlement, and becomes empty after the settlement.
[0119] Table 1
[0120]
[0121] For the above initial queue, a suitable matching strategy is often needed to make the transaction data in the initial queue be settled as effectively as possible in a more reasonable way, for example, based on the target of the number of transaction data or the amount, to find a suitable matching queue to make as much transaction data in the initial queue as possible to be settled as soon as possible.
[0122] Specifically, for example, if the target is the number of transaction data to be settled to the greatest extent, it can be denoted as N(x); if the target is the amount of transaction data to be settled to the greatest extent, it can be denoted as V(x).
[0123] Let the transaction data involved by the data object numbered i in the initial queue have m i transactions, A represents the upper limit of the amount of the payment system, and any one transaction data numbered k in the transaction data involved by the data object numbered i in the initial queue is composed of the following three elements:
[0124] 1) Amount:
[0125] 2) Initiating object (or payment party): r i,k ∈{1, 2,..., n}i;
[0126] 3) Whether the payment belongs to the matching solution: χ i,k ∈{0, 1}.
[0127] Define the index vector: X = {x1, x2, ..., x} n Correspondingly, the matching problem can be expressed in the following form:
[0128] And satisfying the condition when i = 1, ..., n, we have
[0129] in,
[0130] The function I() has the following values: when true, I = 1; otherwise, I = 0.
[0131] Based on the above approach, the problem can be transformed into an NP-complete (Non-deterministic Polynomial) problem. NP-complete problems typically lack algorithms that guarantee finding the optimal solution; furthermore, the time required to solve the problem explodes with the increase in transaction data volume, thus impacting the overall timeliness of transaction data processing. Therefore, it is necessary to simplify the matching process by adding additional constraints and to find a more efficient matching queue to complete the solution efficiently.
[0132] In addition, depending on the specific financial business scenario, the following requirements must be met during the matching process: 1) Fair matching results, that is, the matching process and matching results should be neutral and should not benefit data objects such as one or a few commercial banks; 2) Short calculation time, since the matching mechanism is generally applied to real-time payment systems, the time for each round of matching should not be too long; 3) No legal risks, that is, the matching mechanism should not cause any legal risks to the relevant data objects.
[0133] Based on the above situation and the related problems to be solved, and combined with the specific requirements of financial business scenarios, this application proposes a heuristic-based pre-processing rule (or pre-processing model) through creative work. It can quickly and accurately determine the target matching queue with better performance in the initial queue through matching processing, either by using the above-mentioned pre-processing rule alone or by using the pre-processing rule and the pre-processing rule (or basic model) in combination. Then, based on the target matching queue, the settlement of transaction data in the initial queue can be realized efficiently and reasonably.
[0134] In some embodiments, after detecting whether the initial queue meets a preset first processing condition based on the resource data in the first end state of the data object, the method further includes:
[0135] If the initial queue meets the preset first processing conditions, it can be determined that the initial queue can transition from a deadlocked state to an empty state. At this point, the initial queue as a whole can be designated as the target matching queue. Furthermore, without the need for additional resource injections or external liquidity, a one-time netting settlement operation can be performed directly on the transaction data in the target matching queue to quickly complete the settlement of the initial queue. Netting specifically refers to a settlement method in financial business scenarios that uses compliant methods such as offsetting and contract renewal to ultimately obtain a net claim or net debt of one party to another. For example, between market participants, there may be multiple transactions with identical content but opposite directions. Upon settlement or closing of the transaction, the claims of each party can be offset within an equal amount, with only the balance paid.
[0136] In some embodiments, if it is determined that the initial queue does not meet the preset first processing conditions, it can be preliminarily judged that there is transaction data in the current initial queue that cannot be matched. At this time, preprocessing can be performed according to the preset preprocessing rules so as to find the target matching queue with better performance more quickly and accurately.
[0137] In some embodiments, if it is determined that the initial queue does not meet the preset first processing condition, data objects whose resource data in the first ending state is less than the preset lower limit of resource data are selected as the first data objects.
[0138] Specifically, for example, in a financial business scenario, data objects with negative resource data balances in the first termination state can be selected as the aforementioned first data objects. Furthermore, the first transaction data whose initiating object is the aforementioned first data object can be selected from the initial queue as the second transaction data.
[0139] In some embodiments, see Figure 3 As shown, based on the preset pre-processing rules and the second transaction data, the target matching queue of the initial queue is determined through pre-processing. In specific implementation, this may include the following:
[0140] S1: According to the preset preprocessing rules, the second transaction data is arranged according to the first sorting rule to obtain the first sequence group;
[0141] S2: Based on the resource data in the first end state of the data object, and based on the first sequence group, sequentially check whether the second transaction data in the first sequence group meets the first detection requirement; and remove the second transaction data that meets the first detection requirement from the initial queue to obtain the first candidate matching queue;
[0142] S3: Determine the target matching queue of the initial queue based on the first candidate matching queue.
[0143] In some embodiments, the first sorting rule comprises one of the following: a sorting rule based on the resource data from large to small (e.g., amount priority), a sorting rule based on the resource data from small to large (e.g., number priority), a sorting rule based on the initiation time of the transaction data from early to late (e.g., first-in first-out), a sorting rule based on the initiation time of the transaction data from late to early (e.g., last-in first-out), and the like.
[0144] The first sorting rule described above can be flexibly determined according to specific application scenarios and processing requirements. Preferably, a sorting rule based on the resource data from small to large can be used as the first sorting rule.
[0145] In some embodiments, based on the first sequence group and the resource data of the first end state of the data object, the second transaction data in the first sequence group is sequentially detected to determine whether it meets the first detection requirement. In specific implementation, the following method can be used to detect whether the current second transaction data in the first sequence group meets the first detection requirement:
[0146] S1: According to the resource data of the first end state of the data object and the remaining second transaction data in the current first sequence group, it is detected whether the resource data of the end state of the initiation object corresponding to the current second transaction data is changed to be greater than or equal to the lower limit value of the preset resource data without initiating the current second transaction data; and whether the resource data of the end state of the receiving object corresponding to the current second transaction data is greater than or equal to the lower limit value of the preset resource data; (for example, in a financial business scenario, it is detected whether the resource data balance of the initiation object of the current second transaction data is positive; and whether the resource data balance of the receiving object is not negative);
[0147] S2: When it is determined that the resource data of the end state of the initiation object corresponding to the current second transaction data is changed to be greater than or equal to the lower limit value of the preset resource data without initiating the current second transaction data; and the resource data of the end state of the receiving object corresponding to the current second transaction data is greater than or equal to the lower limit value of the preset resource data, it is determined that the current second transaction data meets the first detection requirement.
[0148] Based on the above embodiments, the transaction data that may not be matched and needs to be removed can be screened out as accurately and reasonably as possible based on the first sorting rule while considering the resource data balance of the initiation object and the receiving object.
[0149] In some embodiments, referring to Figure 4 As shown in the figure, the target matching queue of the initial queue can be determined based on the first candidate matching queue. In specific implementation, the following contents can be included:
[0150] S1: Based on the resource data of the data object in its initial state and the third transaction data in the first candidate matching queue, calculate the resource data of the data object in its second final state after the execution of the third transaction data in the first candidate matching queue.
[0151] S2: Based on the resource data in the second end state of the data object, detect whether the first candidate matching queue meets the preset second condition;
[0152] S3: If the first candidate matching queue meets the preset second condition, the first candidate matching queue is determined as the target matching queue.
[0153] Specifically, the second ending state can be understood as the state after the third transaction data contained in the first candidate matching queue has been executed.
[0154] In some embodiments, the above-described method of detecting whether the first candidate matching queue meets a preset second condition based on the resource data in the second end state of the data object may specifically include: detecting whether at least one data object in the second end state has resource data that is less than a preset lower limit of resource data; if it is determined that at least one data object in the second end state has resource data that is less than the preset lower limit of resource data, then the first candidate matching queue is determined not to meet the preset second processing condition. Conversely, if it is determined that the first candidate matching queue meets the preset second processing condition.
[0155] In some embodiments, if it is determined that the first candidate matching queue meets the preset second processing conditions, the first candidate matching queue can be directly determined as the target matching queue of the initial queue; then the target matching queue is processed for transaction data.
[0156] In some embodiments, see Figure 5 As shown, after detecting whether the first candidate matching queue meets the preset second condition based on the resource data in the second end state of the data object, the method may further include the following in its specific implementation:
[0157] S1: If it is determined that the first candidate matching queue does not meet the preset second condition, the data object whose resource data in the second ending state is less than the preset lower limit of resource data is determined as the second data object;
[0158] S2: Select the third transaction data from the first candidate matching queue, where the initiating object is the second data object, and use it as the fourth transaction data;
[0159] S3: Based on the preset preprocessing rules and the fourth transaction data, the target matching queue is obtained by adjusting the first candidate matching queue.
[0160] Based on the above embodiments, further preprocessing can be performed on the first candidate matching queue according to the preset preprocessing rules, so as to obtain a target matching queue that meets the requirements and has a better effect.
[0161] In some embodiments, see Figure 6 As shown, the target matching queue is obtained by adjusting the first candidate matching queue based on the preset preprocessing rules and the fourth transaction data. In specific implementation, it may include the following:
[0162] S1: According to the preset preprocessing rules, the fourth transaction data is arranged according to the second sorting rule to obtain the second sequence group;
[0163] S2: Based on the resource data in the second end state of the data object, and based on the second sequence group, sequentially check whether the fourth transaction data in the second sequence group meets the second detection requirements; and remove the fourth transaction data that meets the second detection requirements to obtain the second candidate matching queue;
[0164] S3: Determine the target matching queue of the initial queue based on the second candidate matching queue.
[0165] The second sorting rule can be flexibly determined based on specific application scenarios and processing requirements. Preferably, a sorting rule based on resource data from largest to smallest can be used as the second sorting rule.
[0166] In some embodiments, the above-described method of detecting whether the fourth transaction data in the second sequence group meets the second detection requirement based on the resource data in the second end state of the data object and the second sequence group can specifically include: detecting whether the current fourth transaction data in the second sequence group meets the second detection requirement in the following manner:
[0167] S1: Based on the resource data in the second end state of the data object and the remaining fourth transaction data in the current second sequence group, detect whether the resource data in the end state of the receiving object corresponding to the current fourth transaction data is greater than or equal to the preset lower limit of the resource data without initiating the current fourth transaction data (for example, in the financial business scenario, detect whether the resource data balance of the receiving object of the current fourth transaction data is not negative).
[0168] S2: If it is determined that the resource data of the receiving object corresponding to the current fourth transaction data is greater than or equal to the preset lower limit of the resource data without initiating the current fourth transaction data, the current fourth transaction data satisfies the second detection requirement.
[0169] Based on the above embodiments, the transaction data that may not be matched and to be removed can be screened as accurately and reasonably as possible based on the second sorting rule while considering the resource data balance of the receiving object.
[0170] In some embodiments, the above determining, from the second candidate matching queue, the target matching queue of the initial queue can include the following content:
[0171] S1: According to the second candidate matching queue, the resource data of the data object in the third end state is calculated under the condition that the fifth transaction data in the second candidate matching queue is executed.
[0172] S2: According to the resource data of the data object in the third end state, it is detected whether the second candidate matching queue meets the preset third condition.
[0173] S3: In the case where it is determined that the second candidate matching queue meets the preset third condition, the second candidate matching queue is determined as the target matching queue.
[0174] Among them, the above-mentioned third end state can be understood as the state after executing the fifth transaction data contained in the second candidate matching queue.
[0175] In some embodiments, the above detecting, according to the resource data of the data object in the third end state, whether the second candidate matching queue meets the preset third condition, can specifically include: detecting whether there is at least one data object in the resource data of the data object in the third end state is less than the lower limit value of the preset resource data; in the case where it is determined that there is at least one data object in the resource data of the data object in the third end state is less than the lower limit value of the preset resource data, it is determined that the second candidate matching queue does not meet the preset third processing condition. On the contrary, it is determined that the second candidate matching queue meets the preset third processing condition.
[0176] In some embodiments, in the case where it is determined that the second candidate matching queue meets the preset third processing condition, the second candidate matching queue can be directly determined as the target matching queue of the initial queue; and then the target matching queue is processed.
[0177] In some embodiments, after detecting, according to the resource data of the data object in the third end state, whether the second candidate matching queue meets the preset third condition, the method can further include the following content in the implementation:
[0178] If the second candidate matching queue does not meet the preset third condition, the target matching queue of the initial queue is determined by processing the second candidate matching queue according to the preset basic processing rules.
[0179] In some embodiments, the above-described determination of the target matching queue of the initial queue by processing the second candidate matching queue according to the preset basic processing rules may specifically include the following: arranging the fifth transaction data in the second candidate matching queue according to a third sorting rule to obtain a third sequence group; deleting the fifth transaction data one by one from back to front according to the third sequence group, and detecting whether the resource data in the data object's end state is less than a preset lower limit of resource data based on the deleted fifth transaction data; until the resource data in the data object's end state is less than the preset lower limit of resource data, determining the remaining fifth transaction data in the third sequence group as the target matching queue.
[0180] Based on the above embodiments, preset pre-processing rules and preset basic processing rules can be used in combination to find a target matching queue with relatively good results by combining multiple matching processing methods.
[0181] In some embodiments, while processing transaction data for the target matching queue of the initial queue, the method may further include the following:
[0182] S1: Check whether the remaining transaction dataset in the initial queue, excluding the target matching queue, is an empty set;
[0183] S2: If it is determined that the remaining transaction dataset is not an empty set, generate an assistance request for the remaining transaction dataset;
[0184] S3: Initiate an assistance request to the relevant data object so that the relevant data object can complete the transaction data processing of the remaining transaction dataset by injecting resource data.
[0185] In some embodiments, if it is determined that the remaining transaction dataset consisting of the remaining transaction data in the initial queue excluding the target matching queue is an empty set, it can be determined that after processing the target matching queue, there is no remaining transaction data to be processed in the initial queue, thereby completing the processing of the transaction data in the initial queue.
[0186] On the contrary, in the case of determining that the remaining transaction data set is not an empty set, it can be judged that there is still remaining transaction data to be processed in the initial queue after the target matching queue is processed, and the remaining transaction data to be processed is in a deadlock state at this time. In order to complete the processing of the above-mentioned remaining transaction data set, the server can first determine the data object related to the transaction data in the remaining transaction data set as a related data object; then generate a corresponding assistance processing request, and send the assistance processing request to the related data object, so that the related data object externally injects resource data to introduce liquidity, to complete the transaction data processing of the remaining transaction data set, and finally complete the processing of the transaction data in the initial queue.
[0187] In specific implementation, the server can first perform a difference rolling processing on the target matching queue in the initial queue except the remaining transaction data set. For the remaining transaction data set in the initial queue except the above-mentioned target matching queue, the server can first estimate a recommended value of the resource data to be injected by the related data object according to the remaining transaction data set and the algorithm model; then send the assistance processing request carrying the recommended value to the related data object, so that the related data object can more accurately assist to inject the necessary data resource to complete the processing of the initial queue.
[0188] In some embodiments, the above-mentioned transaction data processing on the target matching queue of the initial queue can specifically include: performing a one-time difference settlement operation on the transaction data in the target matching queue.
[0189] As can be seen from the above, based on the transaction data processing method provided in the embodiments of this specification, after the server of the payment system obtains the first transaction data in the initial queue to be processed, it can first calculate the resource data of the data object in the first end state after the execution of the first transaction data in the initial queue, based on the resource data of the data object in the initial state and the first transaction data in the initial queue; and based on the resource data in the first end state of the data object, detect whether the initial queue meets the preset first processing condition; if it is determined that the initial queue does not meet the preset first processing condition, filter out the data objects whose resource data in the first end state is less than the preset lower limit of resource data, and use them as the first data objects; then, from the first transaction data in the initial queue, determine the first transaction data whose initiating object is the first data object, and use it as the second transaction data; according to the preset pre-processing rules and the second transaction data, determine the target matching queue of the initial queue through pre-processing; wherein, the transaction data contained in the target matching queue does not have a deadlock state; and process the transaction data of the target matching queue of the initial queue. First, the system checks whether the initial queue meets a preset first processing condition. If the initial queue does not meet the preset first processing condition, it filters out the first data object whose resource data in the first termination state is less than a preset lower limit of resource data, and the second transaction data initiated by the first data object. Then, based on the preset pre-processing rules and the second transaction data, it determines the target matching queue without deadlock through pre-processing. Finally, it processes the transaction data of the target matching queue in the initial queue. This allows for the accurate determination of the target matching queue with better performance, and the efficient and reasonable processing of transaction data in the queue can be completed based on this target matching queue.
[0190] This specification also provides a server, including a processor and a memory for storing processor-executable instructions. Specifically, the processor can perform the following steps according to the instructions: acquiring first transaction data from an initial queue to be processed; wherein the first transaction data at least involves resource data initiated by a data object against other data objects; calculating the resource data of the data object in its first final state after the execution of the first transaction data in the initial queue, based on the resource data in the initial state of the data object and the first transaction data in the initial queue; detecting whether the initial queue meets a preset first processing condition based on the resource data in the first final state of the data object; if the initial queue does not meet the preset first processing condition, selecting data objects whose resource data in the first final state is less than a preset lower limit of resource data as first data objects; determining first transaction data from the first transaction data in the initial queue whose initiating object is the first data object as second transaction data; determining the target matching queue of the initial queue through preprocessing based on preset preprocessing rules and the second transaction data; wherein the transaction data contained in the target matching queue is not in a deadlock state; and processing the transaction data of the target matching queue of the initial queue.
[0191] To execute the above instructions more accurately, please refer to... Figure 7 As shown in the embodiments of this specification, another specific server is also provided, wherein the server includes a network communication port 701, a processor 702, and a memory 703. The above structures are connected by internal cables so that the various structures can perform specific data interaction.
[0192] Specifically, the network communication port 701 can be used to acquire the first transaction data in the initial queue to be processed; wherein the first transaction data involves at least resource data initiated by a data object for other data objects.
[0193] The processor 702 can be specifically configured to calculate, according to resource data in an initial state of a data object and first transaction data in an initial queue, resource data in a first end state of the data object when the first transaction data in the initial queue is executed; detect, according to the resource data in the first end state of the data object, whether the initial queue meets a preset first processing condition; in a case where it is determined that the initial queue does not meet the preset first processing condition, filter out the data object whose resource data in the first end state is less than a lower limit value of preset resource data as a first data object; determine, from the first transaction data in the initial queue, first transaction data whose initiating object is the first data object as second transaction data; determine, according to a preset pre-processing rule and the second transaction data, a target matching queue of the initial queue through pre-processing; wherein the target matching queue contains no transaction data in a deadlock state; and perform transaction data processing on the target matching queue of the initial queue.
[0194] The memory 703 can be specifically configured to store corresponding instruction programs.
[0195] In this embodiment, the network communication port 701 can be a virtual port that is bound with different communication protocols, so as to send or receive different data. For example, the network communication port can be a port responsible for web data communication, a port responsible for FTP data communication, or a port responsible for mail data communication. In addition, the network communication port can also be an entity communication interface or a communication chip. For example, it can be a wireless mobile network communication chip such as GSM, CDMA, etc.; it can also be a Wifi chip; and it can also be a Bluetooth chip.
[0196] In this embodiment, the processor 702 can be implemented in any appropriate manner. For example, the processor can take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, etc. The present specification is not limited thereto.
[0197] In this embodiment, the memory 703 can include multiple levels, and in a digital system, as long as it can save binary data, it can be a memory; in an integrated circuit, a circuit without a physical form and with a storage function is also called a memory, such as RAM, FIFO, etc.; in a system, a storage device with a physical form is also called a memory, such as a memory stick, a TF card, etc.
[0198] This specification also provides a computer-readable storage medium based on the above-described transaction data processing method. The computer-readable storage medium stores computer program instructions that, when executed, implement the following: acquiring first transaction data from an initial queue to be processed; wherein the first transaction data at least involves resource data initiated by a data object against other data objects; calculating, based on the resource data in the initial state of the data object and the first transaction data in the initial queue, the resource data in the first final state of the data object after the first transaction data in the initial queue has been executed; detecting, based on the resource data in the first final state of the data object, whether the initial queue meets a preset first processing condition; if it is determined that the initial queue does not meet the preset first processing condition, selecting data objects whose resource data in the first final state is less than a preset lower limit of resource data as first data objects; determining, from the first transaction data in the initial queue, the first transaction data whose initiating object is the first data object as second transaction data; determining, through preprocessing, a target matching queue of the initial queue based on preset preprocessing rules and the second transaction data; wherein the transaction data contained in the target matching queue does not exhibit a deadlock state; and processing the transaction data of the target matching queue of the initial queue.
[0199] In this embodiment, the storage medium includes, but is not limited to, Random Access Memory (RAM), Read-Only Memory (ROM), cache, hard disk drive (HDD), or memory card. The memory can be used to store computer program instructions. The network communication unit can be an interface configured according to standards specified in the communication protocol for network connection communication.
[0200] In this embodiment, the specific functions and effects implemented by the program instructions stored in the computer-readable storage medium can be explained in comparison with other embodiments, and will not be repeated here.
[0201] This specification also provides a computer program product comprising a computer program that, when executed by a processor, performs the following steps: acquiring first transaction data in an initial queue to be processed; wherein the first transaction data at least involves resource data initiated by a data object against other data objects; calculating, based on the resource data in the initial state of the data object and the first transaction data in the initial queue, the resource data in the first final state of the data object after the first transaction data in the initial queue has been executed; detecting, based on the resource data in the first final state of the data object, whether the initial queue meets a preset first processing condition; if it is determined that the initial queue does not meet the preset first processing condition, selecting data objects whose resource data in the first final state is less than a preset lower limit of resource data as first data objects; determining, from the first transaction data in the initial queue, the first transaction data whose initiating object is the first data object as second transaction data; determining, through preprocessing, a target matching queue of the initial queue based on preset preprocessing rules and the second transaction data; wherein the transaction data contained in the target matching queue does not have a deadlock state; and processing the transaction data of the target matching queue of the initial queue.
[0202] See Figure 8 As shown, at the software level, this specification also provides a transaction data processing apparatus, which may specifically include the following structural modules:
[0203] The acquisition module 801 can be specifically used to acquire the first transaction data in the initial queue to be processed; wherein, the first transaction data involves at least resource data initiated by a data object for other data objects;
[0204] The calculation module 802 can be used to calculate the resource data of the data object in the first end state after the execution of the first transaction data in the initial queue, based on the resource data in the initial state of the data object and the first transaction data in the initial queue.
[0205] The detection module 803 can be used to detect whether the initial queue meets the preset first processing condition based on the resource data in the first end state of the data object.
[0206] The filtering module 804 can be used to filter out data objects whose resource data in the first ending state is less than the preset lower limit of resource data when it is determined that the initial queue does not meet the preset first processing condition, and use them as the first data objects.
[0207] The determination module 805 can be specifically used to determine the first transaction data from the first transaction data in the initial queue, where the initiating object is the first data object, and use it as the second transaction data;
[0208] The pre-processing module 806 is specifically used to determine the target matching queue of the initial queue through pre-processing based on preset pre-processing rules and second transaction data; wherein the transaction data contained in the target matching queue is not in a deadlock state.
[0209] The transaction processing module 807 is specifically used to process transaction data for the target matching queue of the initial queue.
[0210] In some embodiments, when the detection module 803 is specifically implemented, it can detect whether the initial queue meets the preset first processing condition based on the resource data in the first end state of the data object: detect whether there is at least one data object whose resource data in the first end state is less than the preset lower limit of resource data; if it is determined that there is at least one data object whose resource data in the first end state is less than the preset lower limit of resource data, it is determined that the initial queue does not meet the preset first processing condition.
[0211] In some embodiments, when the preprocessing module 806 is specifically implemented, it can determine the target matching queue of the initial queue through preprocessing based on the preset preprocessing rules and the second transaction data in the following manner: according to the preset preprocessing rules, the second transaction data is arranged according to the first sorting rule to obtain a first sequence group; based on the resource data in the first end state of the data object, and based on the first sequence group, whether the second transaction data in the first sequence group meets the first detection requirement is detected sequentially; and the second transaction data that meets the first detection requirement is removed from the initial queue to obtain a first candidate matching queue; and the target matching queue of the initial queue is determined based on the first candidate matching queue.
[0212] In some embodiments, the first sorting rule may specifically include one of the following: a sorting rule based on resource data from largest to smallest, a sorting rule based on resource data from smallest to largest, a sorting rule based on the initiation time of transaction data from first to last, a sorting rule based on the initiation time of transaction data from last to first, etc.
[0213] In some embodiments, when the preprocessing module 806 is specifically implemented, it can detect whether the second transaction data in the first sequence group meets the first detection requirement based on the resource data in the first end state of the data object and the first sequence group in the following manner: It detects whether the current second transaction data in the first sequence group meets the first detection requirement in the following manner: based on the resource data in the first end state of the data object and the remaining second transaction data in the current first sequence group, it detects whether the resource data in the end state of the initiating object corresponding to the current second transaction data has changed to a value greater than or equal to a preset lower limit of resource data without initiating the current second transaction data; and whether the resource data in the end state of the receiving object corresponding to the current second transaction data is greater than or equal to a preset lower limit of resource data; when it is determined that the resource data in the end state of the initiating object corresponding to the current second transaction data has changed to a value greater than or equal to a preset lower limit of resource data without initiating the current second transaction data; and the resource data in the end state of the receiving object corresponding to the current second transaction data is greater than or equal to a preset lower limit of resource data, it is determined that the current second transaction data meets the first detection requirement.
[0214] In some embodiments, when the preprocessing module 806 is specifically implemented, the target matching queue of the initial queue can be determined according to the first candidate matching queue in the following manner: based on the resource data of the data object in the initial state and the third transaction data in the first candidate matching queue, the resource data of the data object in the second end state after the third transaction data in the first candidate matching queue is executed; based on the resource data of the data object in the second end state, whether the first candidate matching queue meets the preset second condition; if it is determined that the first candidate matching queue meets the preset second condition, the first candidate matching queue is determined as the target matching queue.
[0215] In some embodiments, after detecting whether the first candidate matching queue meets the preset second condition based on the resource data of the data object in the second end state, the device can also be used to determine, in the case that the first candidate matching queue does not meet the preset second condition, a data object whose resource data in the second end state is less than a preset lower limit of resource data, as the second data object; filter out the third transaction data whose initiating object is the second data object from the first candidate matching queue, as the fourth transaction data; and obtain the target matching queue by adjusting the first candidate matching queue according to the preset preprocessing rules and the fourth transaction data.
[0216] In some embodiments, when the preprocessing module 806 is specifically implemented, it can obtain a target matching queue by adjusting the first candidate matching queue according to the preset preprocessing rules and the fourth transaction data in the following manner: According to the preset preprocessing rules, the fourth transaction data is arranged according to the second sorting rule to obtain a second sequence group; based on the resource data in the second end state of the data object, and based on the second sequence group, the fourth transaction data in the second sequence group is sequentially checked to see if it meets the second detection requirement; and the fourth transaction data that meets the second detection requirement is removed to obtain a second candidate matching queue; based on the second candidate matching queue, the target matching queue of the initial queue is determined.
[0217] In some embodiments, when the detection module 803 is specifically implemented, it can detect whether the current fourth transaction data in the second sequence group meets the second detection requirement in the following manner: based on the resource data in the second end state of the data object and the remaining fourth transaction data in the current second sequence group, it is detected whether the resource data in the end state of the receiving object corresponding to the current fourth transaction data is greater than or equal to a preset lower limit of resource data without initiating the current fourth transaction data; when it is determined that the resource data in the end state of the receiving object corresponding to the current fourth transaction data is greater than or equal to the preset lower limit of resource data without initiating the current fourth transaction data, it is determined that the current fourth transaction data meets the second detection requirement.
[0218] In some embodiments, when the preprocessing module 806 is specifically implemented, the target matching queue of the initial queue can be determined according to the second candidate matching queue in the following manner: based on the second candidate matching queue, calculate the resource data of the data object in the third end state after the fifth transaction data in the second candidate matching queue has been executed; based on the resource data in the third end state of the data object, detect whether the second candidate matching queue meets the preset third condition; if it is determined that the second candidate matching queue meets the preset third condition, determine the second candidate matching queue as the target matching queue.
[0219] In some embodiments, the apparatus may further include a basic processing module. After detecting whether the second candidate matching queue meets a preset third condition based on the resource data in the third end state of the data object, the basic processing module may be used to determine the target matching queue of the initial queue by processing the second candidate matching queue according to preset basic processing rules when it is determined that the second candidate matching queue does not meet the preset third condition.
[0220] In some embodiments, the apparatus further comprises a request module. The request module can be specifically configured to detect whether a remaining transaction data set in the initial queue except the target matching queue is an empty set while the transaction data in the target matching queue of the initial queue is processed; generate an assisted processing request about the remaining transaction data set in a case where it is determined that the remaining transaction data set is not an empty set; and initiate the assisted processing request to a related data object, so that the related data object completes the transaction data processing about the remaining transaction data set by injecting resource data.
[0221] It should be noted that the units, apparatuses or modules and the like illustrated in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. For the convenience of description, the above apparatuses are described as various modules respectively described in terms of functions. Of course, in the implementation of the present specification, the functions of each module can be implemented in the same or multiple software and / or hardware, or the modules implementing the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. The above-described apparatus embodiment is only illustrative, for example, the division of the units is only a logical function division, and in actual implementation, another division mode can be used, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the coupling or direct coupling or communication connection between the units or components shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0222] As can be seen from the above, the transaction data processing apparatus provided based on the embodiments of the present specification can accurately determine a target matching queue with better effect, and can more efficiently and reasonably complete the processing of transaction data in the queue based on the target matching queue.
[0223] In a specific scenario example, the transaction data processing method provided in the present specification can be applied to effectively process the queuing business (e.g., the first transaction data in the initial queue) in the payment system.
[0224] Before implementation, the basic model (corresponding to the preset basic processing rule) and the pre-processing model (corresponding to the preset pre-processing rule) can be constructed respectively.
[0225] When the basic matching model is specifically constructed, the following four constraint conditions can be added to design the matching algorithm rules according to the business processing habits and time experience of the payment system, which are: a first-in-first-out matching algorithm, a last-in-first-out matching algorithm, a pen number priority matching algorithm, and an amount priority matching algorithm. The processing steps of each algorithm are basically the same, and the main difference lies in the initial business sequence.
[0226] Specifically, for the first-in first-out matching algorithm, an initial business sequence can be constructed in order of the time of entering the system for all queued businesses, i.e., the business entering the queue earliest is recorded as No. 1, and so on (e.g., the third sorting rule).
[0227] Referring to Figure 9 As shown in the figure, the specific processing steps of the basic model are as follows:
[0228] Step 1: Assuming that all queued businesses can be matched at one time, the account balances of all participants are calculated.
[0229] Step 2: If the balances of all participants are positive, all businesses can be matched at one time at this time.
[0230] Step 3: If there is a participant with a negative balance, the last business sent by the participant is deleted from the queue, and step 1 is repeated.
[0231] Step 4: If all businesses are deleted, the matching is completed.
[0232] Through verification, it can be found that when the basic model is used for processing alone, the following situation may exist: due to the need to comply with the first-in first-out rule, there may be un-matched business amount initiated by A row less than the final state balance of A row after the matching is completed, and the business is not realized as much as possible. Therefore, a pre-processing model also needs to be constructed.
[0233] Similarly, for the last-in first-out matching algorithm, all businesses are processed in reverse order according to the time of entering the system to construct an initial business sequence, i.e., the business entering the queue latest is recorded as No. 1, and so on, and the matching is performed according to the steps of the above model.
[0234] For the number-of-pen priority-based matching algorithm, all businesses are first sorted in ascending order of amount, and then the matching is performed according to the steps of the above basic model. In this case, the business with smaller amount is matched first, and the possibility of the balance of a certain row being greater than the amount of any pending business after matching is small, but the total settlement amount may be lower than the original scheme.
[0235] For the amount priority-based matching algorithm, from the perspective of completing as much business amount as possible, all businesses are sorted in descending order of amount, and then the matching is performed according to the steps of the above basic model. In this case, the large amount business that has a greater impact on the system is matched first, which can increase the matched business amount in some cases, but there may be a situation that multiple small amount businesses are not matched.
[0236] When constructing the pre-processing model, it is considered that in some cases, the algorithm based on the basic model alone in a certain order may result in a zero-matching service. At this time, increasing and using the pre-processing model first can improve the matching efficiency to a certain extent and solve the problem of all services being unmatched.
[0237] Referring to Figure 10 As shown in the figure, the specific processing steps of the pre-processing model are as follows:
[0238] Step 1: First, assume that all queued services can be completed at one time, and then calculate the balance of all participant accounts.
[0239] Step 2: For participants with negative balances at this time, find all services initiated by them, sort the services by amount from small to large, and try not to initiate the current service in the new order. Whether it meets the following two conditions: (a) the balance becomes positive; (b) the receiver's balance is not negative (for example, detect whether it meets the first detection requirement). If both conditions are met, delete it from the matching queue.
[0240] Step 3: Recalculate the balance of all participant accounts, if positive, the pre-processing is complete, if negative, further processing.
[0241] Step 4: For participants with negative balances at this time, find all services initiated by them, sort the services by amount from large to small, and try not to initiate the current service in the new order. Whether it meets the following condition: (a) the receiver's balance is not negative (for example, detect whether it meets the second detection requirement). If this condition is met, delete it from the matching queue.
[0242] Different matching algorithm models are summarized. In some cases, the pre-processing model alone can complete the matching. If the pre-processing model alone cannot complete the matching, it can be combined with the original basic model. When only the pre-processing model is used. Considering the combination of the basic model and the pre-processing model, referring to Table 2, there are 9 ways to actually choose the model usage.
[0243] Table 2
[0244] Serial number Pre-processing Base model 1 No First-in first-out 2 No Last-in first-out 3 Yes Number priority 4 Yes Amount priority 5 Yes No 6 Yes First-in first-out 7 Yes Last-in first-out 8 Yes Number priority 9 Yes Amount priority
[0245] In this scenario example, three indicators can be selected to evaluate the matching effect. The first indicator is the proportion of the amount of matched business, which reflects the rescue of funds by calculating the proportion of the total amount of matched business in the total amount of queuing. The second indicator is the proportion of the number of matched business, which reflects the rescue efficiency by calculating the proportion of the total number of matched business in the total number of queuing. The third indicator is the number of remaining matchable businesses after one round of matching, which compares how many of the unsuccessfully matched businesses are less than their current balance after the completion of matching.
[0246] Through test verification, based on the above index evaluation, it can be known that: because the algorithm calculation complexity of the preposition model is significantly higher than that of the model with only the basic matching algorithm, the calculation time is longer than that of the basic model, therefore, when considering the model effect, it is expected that the matching effect of the preposition model is better than that of the basic model. In summary, the nine models can be divided into two categories for comparison, the first category only uses the basic matching model, i.e. models 1-4. The second category is the matching model with pre-processing, i.e. models 5-9.
[0247] When performing test verification, it can be assumed that when the matching function is started, there are 6 participants (e.g. data objects) in the system, and there are 50 pieces of queuing business (e.g. the first transaction data in the initial queue), and the account balance (e.g. the resource data of the initial state of the data object) is 50 yuan (a kind of resource data), and the queuing business amount is evenly distributed between 50 and 100 yuan. According to this, the queuing business table is randomly generated.
[0248] Firstly, the results of the basic model are analyzed, referring to Table 3, the balance status of each participant when there is no matching algorithm (i.e. the system has an overdraft function, and the balance of the participant can be negative) is compared, it can be seen that participants 3, 4 and 5 are negative at this time, and need to be further processed.
[0249] Table 3
[0250]
[0251] After using models 1-4, the balance status of each participant is shown in Table 4.
[0252] Table 4
[0253]
[0254] Then the matching evaluation is performed, wherein Table 5 lists the matching evaluation indicators of four different matching algorithms, from the data in the table, it can be known that the matching effect of model 3 is the best at this time.
[0255] Table 5
[0256]
[0257] Furthermore, repeated verification can be performed. Since the performance of the matching algorithm largely depends on the transaction patterns and amount distribution of the queuing business, the above simulation process can be repeated 50 times to further compare the matching effects of the four models. The results are as follows.
[0258] Specifically, Figure 11 The table below shows the percentage of transactions matched by the four models, and further statistical analysis of the results.
[0259] Table 6
[0260] Optimal number of times Mean Standard deviation Model 1 11 0.60 0.15 Model 2 12 0.57 0.17 Model 3 30 0.66 0.13 Model 4 4 0.55 0.17
[0261] Statistical results show that Model 3 significantly outperforms the other three in terms of optimal frequency, mean, and variance. Overall, Model 3 performs better.
[0262] Figure 12 The table below shows the percentage of transactions matched by the three models.
[0263] Table 7
[0264] Optimal number of times Mean Standard deviation Model 1 11 0.60 0.15 Model 2 10 0.57 0.17 Model 3 14 0.60 0.14 Model 4 15 0.59 0.17
[0265] Statistical results show that Model 3 and Model 4 have more optimal iterations, Model 1 and Model 3 have the highest mean, Model 3 has the smallest variance, and better stability. Overall, Model 3 performs better.
[0266] Next, the results of the pre-processing model can be analyzed. Taking the first business case above as an example, the pre-processing model (Model 5) was used for processing, and the matching results and effects are shown in Tables 8 and 9 below.
[0267] Table 8
[0268]
[0269] Table 9
[0270] Model 5 Total amount of matched business 2693(74.56%) Total number of matched business 38(76.00%) Total amount of unmatched business 919 Total number of unmatched business 12
[0271] Based on the above results, it can be concluded that when matching is completed using Model 5, if it is not possible to ensure that all participants have positive balances, the current balance and the remaining unmatched transactions can be used to further match according to the previous four basic models.
[0272] To compare the effectiveness of the pre-processing model, the simulation process was repeated 50 times to further compare whether adding the pre-processing model could improve the matching effect of the original model. The results are as follows. By comparing the optimal matching effects of models 1, 2, 3, 4 and 5, 6, 7, 8, 9, it can be seen that in most cases, adding the pre-processing model will significantly optimize the matching effect. However, in some cases, it may also lead to a decrease in overall matching efficiency. (See below for improvement details.) Figure 13 (Comparison of the number of matched transactions between the basic model and the optimized model) and Figure 14 (Comparison of the transaction amounts matched between the basic model and the optimized model).
[0273] To compare the optimization models, further comparison of the matching efficiency of models 5-9 reveals that if model 5 can complete the matching process independently, the solution at this point is the optimal solution in the vast majority of cases. If matching cannot be completed, model 6 performs best overall, with model 6 having the second highest probability of being the optimal solution, while model 5 does not produce an optimal solution.
[0274] Based on the above test results, the following matching strategies can be summarized:
[0275] 1. Try matching using Model 5. If the matching is successful, the matching process ends.
[0276] 2. If the matching cannot be completed using only the previous model, use Model 6 and Model 8, and take the better matching scheme as the final result, and the matching ends.
[0277] In a specific financial business scenario, the matching strategy described above can be used to accurately achieve matching using relevant models. Specifically, assume there are 6 participants, labeled 1-6, with an initial balance of 60 for each. There are a total of 50 transactions, with the transaction amounts randomly and evenly distributed between 50 and 100.
[0278] S1: Assuming that all queued transactions can be matched in one go, calculate the account balances of all participants (e.g., resource data in the first end state of the data object), as shown in Table 10.
[0279] Table 10
[0280] Initial balance Total amount of initiation Total amount of reception Balance without matching algorithm Participant 1 50 225 487 312 Participant 2 50 726 721 45 Participant 3 50 828 602 -176 Participant 4 50 605 376 -179 Participant 5 50 706 491 -165 Participant 6 50 522 935 463
[0281] S2: Based on comprehensive judgment, try to use Model 5 for matching.
[0282] Specifically, this may include the following steps:
[0283] S2-1: In this case, for the transactions initiated by participants 3, 4, and 5, find their initiated transactions, sort the transactions by amount from smallest to largest, and then try each transaction in the new order without initiating the current transaction. Check if the following conditions are met: (a) the participant's own balance becomes positive; (b) the recipient's balance is not negative. (See also...) Figure 15 As shown, taking the business initiated by participant 3 as an example, its current balance is -176, and the amount of all its initiated businesses is less than 176. Therefore, there are no businesses that meet the above assumptions. Similarly, after analyzing the original business transactions, there are also no businesses that meet the above conditions among the businesses initiated by participants 4 and 5. The analysis continues.
[0284] S2-2: For participants 3, 4, and 5, find the transactions they initiated, sort the transactions by amount from largest to smallest, and then try each transaction in the new order without initiating the current transaction. Check if the following condition is met: (a) The recipient's balance is not negative. See also... Figure 16 As shown, taking the business initiated by participant 3 as an example, since the current balances of participants 4 and 5 are both negative, only the businesses with recipients 1, 2, and 6 are filtered.
[0285] Participant 2's initial balance is 45, and 45 < 53, 45 < 55, 45 < 67, 45 < 72. Therefore, transactions with serial numbers 1, 50, 4, and 9 cannot be eliminated. Participant 6's initial balance is 463, and 463 > 81. Therefore, transaction with serial number 19 can be eliminated. At this point, Participant 3's balance becomes -95, and Participant 6's balance becomes 382. Similarly, transactions with serial numbers 6 and 21 can be eliminated. The balances of each participant at this point are shown in Table 11 below.
[0286] Table 11
[0287] Participant Initial balance Balance after processing Participant 1 312 214 Participant 2 45 45 Participant 3 -176 92 Participant 4 -179 -179 Participant 5 -165 -165 Participant 6 463 293
[0288] Similarly, the transactions initiated by participants 4 and 5 are processed in a similar manner. After completion, all participants have positive balances, and the matching ends. Please refer to Table 12.
[0289] Table 12
[0290] Initial balance Balance after processing Participant 1 312 214 Participant 2 45 45 Participant 3 -176 92 Participant 4 -179 -179 Participant 5 -165 -165 Participant 6 463 293
[0291] In some cases, the above method may not be able to ensure that all participants have positive balances, requiring further matching procedures, such as... Figure 17 and Figure 18 As shown.
[0292] S1: Using the pre-processing algorithm and steps of Model 5 above, the business can be initially matched. However, as can be seen from the data in Table 13, the balance of Participant 6 is still negative at this time, so subsequent matching processing is required.
[0293] Table 13
[0294] Balance without matching algorithm Balance after pre-processing and matching Participant 1 402 39 Participant 2 272 7 Participant 3 322 36 Participant 4 -292 231 Participant 5 -260 240 Participant 6 -344 -253
[0295] S2: Using the approaches from Model 6 and Model 8, perform subsequent matching processes until the balance is positive. Taking Model 6 as an example, filter all transactions initiated by participant 6 sequentially, as shown below.
[0296] Serial number Initiator Recipient Amount 48 6 1 89
[0297] At this point, Participant 6 has a balance of -164 and Participant 1 has a balance of -50. We begin filtering the last transaction initiated by Participant 1, as shown below.
[0298] Serial number Initiator Recipient Amount 50 1 3 62
[0299] At this point, Participant 1 has a balance of 12 and Participant 3 has a balance of -26. We begin filtering the last transaction initiated by Participant 3, as shown below.
[0300] Serial number Initiator Recipient Amount 45 3 4 95
[0301] At this point, Participant 3 has a balance of 69 and Participant 4 has a balance of 240. Continue filtering for the last transaction initiated by Participant 6, as shown below.
[0302] Serial number Initiator Recipient Amount 43 6 2 74
[0303] This process continues until all participants have positive balances, as shown in Table 14 below.
[0304] Table 14
[0305] Balance after pre-processing Model 6 Participant 1 39 12 Participant 2 7 4 Participant 3 36 96 Participant 4 231 84 Participant 5 240 64 Participant 6 -253 40
[0306] Similarly, using the method of Model 8, participants 6 are deleted sequentially according to the order of their business initiation amounts from smallest to largest until all participants have positive balances. The results are shown in Table 15 below.
[0307] Table 15
[0308] Balance after pre-processing Model 8 Participant 1 39 55 Participant 2 7 33 Participant 3 36 43 Participant 4 231 42 Participant 5 240 88 Participant 6 -253 39
[0309] At this point, the processing effects of the two models are calculated. Model 6 accounts for 48% of the total number of matched transactions and 46% of the total amount of matched transactions in the queue; Model 8 accounts for 32% of the total number of matched transactions and 26% of the total amount of matched transactions in the queue. In this case, Model 6 has a higher proportion of matched transactions and a higher proportion of the total amount of matched transactions than Model 8. Therefore, the matching result of Model 6 is regarded as the final result.
[0310] Based on the above scenario example, it is verified that the transaction data processing method provided in the specification can indeed accurately determine the target matching queue with better effect, and can more efficiently and reasonably complete the processing of the transaction data in the queue based on the target matching queue.
[0311] Although the specification provides method operation steps as described in the embodiments or flowcharts, more or fewer operation steps can be included based on conventional or non-inventive means. The order of steps listed in the embodiments is only one of the many step execution orders, and does not represent the only execution order. When the device or client product is executed in practice, the method order shown in the embodiments or the drawings can be executed in sequence or in parallel (for example, in a parallel processor or multi-threaded processing environment, or even in a distributed data processing environment). The terms "include", "contain" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, product or equipment including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or includes elements inherent to such process, method, product or equipment. Without more limitations, it does not exclude the presence of other same or equivalent elements in the process, method, product or equipment including the elements. The terms "first", "second" and the like are used to indicate names, not to represent any particular order.
[0312] Those skilled in the art also know that, in addition to implementing the controller in the form of pure computer readable program code, the controller can also be implemented in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers and embedded microcontrollers by logically programming the method steps to achieve the same function. Therefore, such a controller can be considered as a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.
[0313] The specification can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, classes, and the like that perform particular tasks or implement particular abstract data types. The specification can also be practiced in a distributed computing environment, in which tasks are performed by remote processing devices that are connected through a communication network. In a distributed computing environment, program modules can be located in both local and remote computer-readable storage media, including storage devices.
[0314] Those skilled in the art can clearly understand the present specification can be implemented by means of software and necessary general hardware platforms through the above description of the embodiments. Based on such understanding, the technical solutions of the present specification can essentially be embodied in the form of a software product. The computer software product can be stored in a storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions to make a computer device (which can be a personal computer, a mobile terminal, a server, or a network device, etc.) execute the methods described in the various embodiments or some parts of the embodiments of the present specification.
[0315] The various embodiments in the present specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the difference from other embodiments. The present specification can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable electronic devices, network PCs, small computers, large computers, distributed computing environments including any of the above systems or devices, etc.
[0316] Although the present specification is described through the embodiments, those skilled in the art know that the present specification has many modifications and changes without departing from the spirit of the present specification, and it is intended that the appended claims include these modifications and changes without departing from the spirit of the present specification.
Claims
1. A method of processing transaction data, characterized by, Applied to servers, including: Obtain the first transaction data from the initial queue to be processed; wherein, the first transaction data involves at least resource data initiated by a data object for other data objects; Based on the resource data of the data object in its initial state and the first transaction data in the initial queue, calculate the resource data of the data object in its first final state after the first transaction data in the initial queue has been executed. Based on the resource data in the first end state of the data object, check whether the initial queue meets the preset first processing condition; If the initial queue does not meet the preset first processing condition, select the data objects whose resource data in the first ending state is less than the preset lower limit of resource data as the first data objects; From the first transaction data in the initial queue, identify the first transaction data whose initiating object is the first data object, and use it as the second transaction data; Based on the preset pre-processing rules and the second transaction data, the target matching queue of the initial queue is determined through pre-processing; wherein the transaction data contained in the target matching queue is not in a deadlock state. Process transaction data for the target matching queue of the initial queue.
2. The method of claim 1, wherein, Based on the resource data in the first end state of the data object, check whether the initial queue meets the preset first processing conditions, including: Check whether at least one data object in the first end state has resource data that is less than a preset lower limit value for resource data. If at least one data object in the first end state of the resource data is less than the preset lower limit of the resource data, then the initial queue is determined not to meet the preset first processing condition.
3. The method of claim 1, wherein, Based on the preset pre-processing rules and the second transaction data, the target matching queue of the initial queue is determined through pre-processing, including: According to the preset preprocessing rules, the second transaction data is arranged according to the first sorting rule to obtain the first sequence group; Based on the resource data in the first end state of the data object, and based on the first sequence group, the second transaction data in the first sequence group are sequentially checked to see if they meet the first detection requirements; and the second transaction data that meets the first detection requirements are removed from the initial queue to obtain the first candidate matching queue. Based on the first candidate matching queue, the target matching queue of the initial queue is determined.
4. The method of claim 3, wherein, The first sorting rule includes one of the following: sorting rule based on resource data from largest to smallest, sorting rule based on resource data from smallest to largest, sorting rule based on transaction data initiation time from earliest to latest, and sorting rule based on transaction data initiation time from latest to earliest.
5. The method of claim 3, wherein, Based on the resource data in the first end state of the data object, and based on the first sequence group, sequentially check whether the second transaction data in the first sequence group meets the first detection requirements, including: The following method is used to check whether the current second transaction data in the first sequence group meets the first detection requirement: Based on the resource data in the first end state of the data object and the remaining second transaction data in the current first sequence group, it is detected whether the resource data in the end state of the initiating object corresponding to the current second transaction data has changed to a value greater than or equal to the preset lower limit of resource data without initiating the current second transaction data; and whether the resource data in the end state of the receiving object corresponding to the current second transaction data is greater than or equal to the preset lower limit of resource data. If, without initiating the current second transaction data, the resource data in the end state of the initiating object corresponding to the current second transaction data is transformed to a value greater than or equal to the preset lower limit of resource data; and the resource data in the end state of the receiving object corresponding to the current second transaction data is greater than or equal to the preset lower limit of resource data, then the current second transaction data is determined to meet the first detection requirement.
6. The method of claim 3, wherein, Based on the first candidate matching queue, the target matching queue of the initial queue is determined, including: Based on the resource data of the data object in its initial state and the third transaction data in the first candidate matching queue, calculate the resource data of the data object in its second final state after the execution of the third transaction data in the first candidate matching queue. Based on the resource data of the data object in the second end state, detect whether the first candidate matching queue meets the preset second condition; If the first candidate matching queue meets the preset second condition, the first candidate matching queue is determined as the target matching queue.
7. The method of claim 6, wherein, After detecting whether the first candidate matching queue meets the preset second condition based on the resource data in the second end state of the data object, the method further includes: If it is determined that the first candidate matching queue does not meet the preset second condition, the data object whose resource data in the second ending state is less than the preset lower limit of resource data is determined as the second data object; From the first candidate matching queue, select the third transaction data whose initiating object is the second data object, and use it as the fourth transaction data; Based on the preset preprocessing rules and the fourth transaction data, the target matching queue is obtained by adjusting the first candidate matching queue.
8. The method of claim 7, wherein, Based on the preset pre-processing rules and the fourth transaction data, the target matching queue is obtained by adjusting the first candidate matching queue, including: According to the preset preprocessing rules, the fourth transaction data is arranged according to the second sorting rule to obtain the second sequence group; Based on the resource data in the second end state of the data object, and based on the second sequence group, the fourth transaction data in the second sequence group is sequentially checked to see if it meets the second detection requirements; and the fourth transaction data that meets the second detection requirements is removed to obtain the second candidate matching queue. Based on the second candidate matching queue, determine the target matching queue of the initial queue.
9. The method of claim 8, wherein, Based on the resource data in the second end state of the data object, and based on the second sequence group, sequentially check whether the fourth transaction data in the second sequence group meets the second detection requirements, including: The following method is used to check whether the current fourth transaction data in the second sequence group meets the second detection requirement: Based on the resource data in the second end state of the data object and the remaining fourth transaction data in the current second sequence group, detect whether the resource data in the end state of the receiving object corresponding to the current fourth transaction data is greater than or equal to the preset lower limit of the resource data without initiating the current fourth transaction data. If, without initiating the current fourth transaction data, the resource data in the end state of the receiving object corresponding to the current fourth transaction data is greater than or equal to the preset lower limit of resource data, then the current fourth transaction data is determined to meet the second detection requirement.
10. The method of claim 8, wherein, Based on the second candidate matching queue, the target matching queue of the initial queue is determined, including: Based on the second candidate matching queue, calculate the resource data of the data object in the third final state after the fifth transaction data in the second candidate matching queue has been executed; Based on the resource data in the third end state of the data object, check whether the second candidate matching queue meets the preset third condition; If the second candidate matching queue meets the preset third condition, the second candidate matching queue is determined as the target matching queue.
11. The method of claim 10, wherein, After detecting whether the second candidate matching queue meets the preset third condition based on the resource data of the third end state of the data object, the method further includes: If the second candidate matching queue does not meet the preset third condition, the target matching queue of the initial queue is determined by processing the second candidate matching queue according to the preset basic processing rules.
12. The method of claim 1, wherein, While processing transaction data for the target matching queue of the initial queue, the method also includes: Check whether the remaining transaction dataset in the initial queue, excluding the target matching queue, is an empty set; If it is determined that the remaining transaction dataset is not an empty set, generate an assistance request for the remaining transaction dataset; Initiate an assistance request to the relevant data objects so that they can complete the transaction data processing for the remaining transaction dataset by injecting resource data.
13. A processing apparatus of transaction data, characterized by, Applied to servers, including: The acquisition module is used to acquire the first transaction data in the initial queue to be processed; wherein, the first transaction data involves at least resource data initiated by a data object for other data objects; The calculation module is used to calculate the resource data of the data object in its first final state after the execution of the first transaction data in the initial queue, based on the resource data in the initial state of the data object and the first transaction data in the initial queue. The detection module is used to detect whether the initial queue meets the preset first processing conditions based on the resource data in the first end state of the data object. The filtering module is used to filter out data objects whose resource data in the first ending state is less than the preset lower limit of resource data, and use them as the first data objects, when it is determined that the initial queue does not meet the preset first processing condition. The determination module is used to determine the first transaction data whose initiating object is the first data object from the first transaction data in the initial queue, and use it as the second transaction data; The pre-processing module is used to determine the target matching queue of the initial queue through pre-processing based on preset pre-processing rules and second transaction data; wherein the transaction data contained in the target matching queue is not in a deadlock state. The transaction processing module is used to process transaction data in the target matching queue of the initial queue.
14. A server, characterized by It includes a processor and a memory for storing processor-executable instructions, wherein the processor, when executing the instructions, implements the steps of the method according to any one of claims 1 to 12.
15. A computer-readable storage medium, characterized in that, It stores computer instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1 to 12.
16. A computer program product, characterised in that, It includes a computer program that, when executed by a processor, implements the steps of the method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Clearing business buffer queue matchmaking method and device of inter-bank payment system
CN106127569A
Database processing for resolving resource deadlocks and for efficient resource allocation
WO2021150609A9