Batch transaction processing method and apparatus, computer device, and storage medium
By suspending subsequent transactions when the abnormal transaction count in the payment platform exceeds a threshold, the problem of large-volume user payment transactions failing due to the influence of the bank's transaction module is solved, thereby improving the success rate of batch transaction processing and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- PING AN PAY ELECTRONIC PAYMENT CO LTD
- Filing Date
- 2021-12-21
- Publication Date
- 2026-05-29
AI Technical Summary
In existing technologies, a large number of user payment transactions may fail due to the influence of a certain transaction module of a bank, resulting in a complete failure of the entire transaction batch, a reduced success rate, and a negative impact on user experience.
By sending transaction requests to the corresponding transaction processing terminal according to the batch transactions of the transaction request terminal, obtaining the return value and extracting transaction information data for anomaly counting, and suspending subsequent transactions when the anomaly count exceeds the threshold until the anomaly count is within the set range, the transaction circuit breaker mechanism is implemented.
This improves the processing efficiency of batch transactions, ensures that the normal processing of other transactions is not affected, and increases the success rate of batch transaction processing and user experience.
Smart Images

Figure CN114219486B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of data processing technology, and in particular relates to a batch transaction processing method, apparatus, computer equipment and storage medium. Background Technology
[0002] With the development of electronic finance, payment platforms are playing an increasingly important role, providing great convenience and security for payment transactions between users, merchants and banks.
[0003] Besides ordinary users, payment platforms also face the need to process transactions from users with large transaction volumes, such as batch processing of insurance premium renewal payments and batch processing of investment renewals. When providing payment channel capabilities, payment platforms may encounter situations where a bank's interface is undergoing intermittent maintenance or system failures. In such cases, during the maintenance period of the existing bank channels, a large number of user payment transactions may be affected by a particular transaction module, leading to the complete failure of the entire transaction batch. This reduces the success rate of transaction batch processing and significantly impacts the user experience of the payment product. Summary of the Invention
[0004] This application provides a batch transaction processing method, apparatus, computer equipment, and storage medium to solve the problem in the prior art where a large number of user payment transactions are affected by a bank's transaction module, resulting in the complete failure of the entire transaction batch, a reduced success rate of transaction batch processing, and a significant impact on the user experience of payment products.
[0005] A first aspect of this application provides a batch transaction processing method, including:
[0006] According to the batch transaction requested by the transaction requester, a first transaction request is sent to the first transaction processing terminal corresponding to the first transaction in the batch transaction;
[0007] Obtain the first return value sent by the first transaction processing terminal based on the first transaction request;
[0008] When the first return value is determined to be a transaction anomaly return value, the first transaction information data associated with the first transaction is extracted, and the first transaction anomaly count is performed based on the first transaction information data;
[0009] Based on the first transaction information data, the second transaction in the batch of transactions is judged to have a data hit. When it is determined that the second transaction hits the first transaction information data and the first transaction abnormal count exceeds the threshold, the second transaction is suspended until the first transaction abnormal count is within a set number of times.
[0010] Optionally, after determining the information data match of the second transaction in the batch of transactions based on the first transaction information data, the method further includes:
[0011] When it is determined that the second transaction does not match the first transaction information data, a second transaction request is sent to the second transaction processing terminal corresponding to the second transaction.
[0012] Obtain the second return value sent by the second transaction processing terminal based on the second transaction request;
[0013] When the second return value is determined to be a transaction exception return value, the transaction information data associated with the second transaction is extracted, and a second transaction exception count is performed based on the second transaction information data; or, when the second return value is determined to be a transaction success return value, the second transaction is marked as a successful transaction.
[0014] Optionally, after determining the information data match of the second transaction in the batch of transactions based on the first transaction information data, the method further includes:
[0015] When it is determined that the second transaction hits the first transaction information data and the first transaction anomaly count has not exceeded the threshold, a third transaction request is sent to the first transaction processing terminal.
[0016] Obtain the third return value sent by the first transaction processing terminal based on the third transaction request;
[0017] When the third return value is determined to be a transaction exception return value, the first transaction exception count is incremented by one.
[0018] Optionally, when determining that the first return value is a transaction anomaly return value, extracting the first transaction information data associated with the first transaction includes:
[0019] When the first return value is determined to be a transaction exception return value, it is determined whether the first transaction corresponds to a set transaction exception reason based on the set flag bit in the transaction exception return value.
[0020] When it is determined that the first transaction corresponds to the set transaction anomaly reason, the first transaction processing terminal, transaction type and / or batch number of the batch transaction corresponding to the first transaction are extracted as the first transaction information data associated with the first transaction.
[0021] Optionally, after suspending the second transaction when it is determined that the second transaction matches the first transaction information data and the first transaction anomaly count exceeds the threshold, the method further includes:
[0022] At a set frequency, trigger retransmission attempts for suspended transactions in the batch of transactions;
[0023] If the resentment of the first suspended transaction results in a successful transaction, the transaction anomaly count corresponding to the first suspended transaction is adjusted to the set number of times.
[0024] Re-execute the suspended transactions in the batch that match the first suspended transaction in the same transaction information data.
[0025] Optionally, after suspending the second transaction when it is determined that the second transaction matches the first transaction information data and the first transaction anomaly count exceeds the threshold, the method further includes:
[0026] Obtain the troubleshooting notification message sent by the first transaction processing terminal;
[0027] Based on the troubleshooting notification message, select the second suspended transaction corresponding to the first transaction processing terminal from the suspended transactions;
[0028] Adjust the transaction anomaly count corresponding to the second suspended transaction to the set number of times, and re-execute the suspended transactions in the batch that match the second suspended transaction in the same transaction information data.
[0029] Optionally, the step of suspending the second transaction when it is determined that the second transaction hits the first transaction information data and the first transaction anomaly count exceeds the threshold, until the first transaction anomaly count is within a set number of times, further includes:
[0030] When it is detected that all transactions in the batch have been processed by the corresponding transaction processing terminal, the transaction results corresponding to each transaction are integrated to obtain transaction feedback information;
[0031] The transaction feedback information is output to the transaction request terminal.
[0032] A second aspect of this application provides a batch transaction processing apparatus, comprising:
[0033] The sending module is used to send a first transaction request to the first transaction processing terminal corresponding to the first transaction in the batch of transactions, according to the batch of transactions requested by the transaction request terminal;
[0034] The acquisition module is used to acquire the first return value sent by the first transaction processing terminal based on the first transaction request;
[0035] The counting module is used to extract the first transaction information data associated with the first transaction when the first return value is determined to be a transaction abnormal return value, and to count the first transaction abnormality based on the first transaction information data.
[0036] The transaction control module is used to determine the information data hit of the second transaction in the batch of transactions based on the first transaction information data. When it is determined that the second transaction hits the first transaction information data and the first transaction abnormal count exceeds the threshold, the second transaction is suspended until the first transaction abnormal count is within a set number of times.
[0037] A third aspect of this application provides a terminal including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method described in the first aspect.
[0038] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described in the first aspect.
[0039] The fifth aspect of this application provides a computer program product that, when run on a terminal, causes the terminal to perform the steps of the method described in the first aspect.
[0040] As can be seen from the above, in this embodiment, according to the batch transactions requested by the transaction requesting end, a transaction request is sent to the corresponding transaction processing end. Based on the transaction exception return value sent by the transaction request, the transaction information data associated with the transaction is extracted and a transaction exception count is performed. Then, based on the transaction information data, the subsequent transactions in the batch are judged for information data hit. When the subsequent transaction hits the transaction information data and the transaction exception count exceeds the threshold, the subsequent transaction needs to be suspended. This ensures that a circuit breaker can be initiated when certain maintenance or faults are encountered. On the one hand, it avoids the duplicate submission of the same type of abnormal transactions, allocates a waiting time for fault resolution for the suspended transactions with transaction exceptions, and avoids occupying the processing resources of the transaction processing end. On the other hand, it frees up processing space for other transactions in the batch, improves the processing efficiency of the batch transactions, ensures that the normal processing of other transactions is not affected, improves the success rate of batch transaction processing, and improves the user experience. Attached Figure Description
[0041] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0042] Figure 1 This is a flowchart of a batch transaction processing method provided in an embodiment of this application. Figure 1;
[0043] Figure 2 This is a flowchart of a batch transaction processing method provided in an embodiment of this application. Figure 2 ;
[0044] Figure 3 This is a structural diagram of a batch transaction processing device provided in an embodiment of this application;
[0045] Figure 4 This is a structural diagram of a computer device provided in an embodiment of this application. Detailed Implementation
[0046] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0047] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0048] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0049] It should also be further understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0050] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrases "if determined" or "if [described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [described condition or event] is detected," or "in response to detection of [described condition or event]."
[0051] In specific implementations, the terminals described in the embodiments of this application include, but are not limited to, other portable devices such as mobile phones, laptop computers, or tablet computers with touch-sensitive surfaces (e.g., touchscreen displays and / or touchpads). It should also be understood that in some embodiments, the device is not a portable communication device, but a desktop computer with touch-sensitive surfaces (e.g., touchscreen displays and / or touchpads).
[0052] The following discussion describes terminals that include displays and touch-sensitive surfaces. However, it should be understood that terminals may include one or more other physical user interface devices such as physical keyboards, mice, and / or joysticks.
[0053] The terminal supports a variety of applications, such as one or more of the following: drawing applications, presentation applications, word processing applications, website creation applications, disc burning applications, spreadsheet applications, game applications, telephone applications, video conferencing applications, email applications, instant messaging applications, exercise support applications, photo management applications, digital camera applications, digital camcorder applications, web browsing applications, digital music player applications, and / or digital video player applications.
[0054] Various applications that can run on a terminal can use at least one common physical user interface device, such as a touch-sensitive surface. One or more functions of the touch-sensitive surface and the corresponding information displayed on the terminal can be adjusted and / or changed between and / or within applications. In this way, the terminal's common physical architecture (e.g., the touch-sensitive surface) can support various applications with user interfaces that are intuitive and transparent to the user.
[0055] It should be understood that the sequence number of each step in this embodiment does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of this application embodiment.
[0056] To illustrate the technical solution described in this application, specific embodiments are provided below.
[0057] See Figure 1 , Figure 1 This is a flowchart of a batch transaction processing method provided in an embodiment of this application. Figure 1 .like Figure 1 As shown, a batch transaction processing method includes the following steps:
[0058] Step 101: In accordance with the batch transaction requested by the transaction requesting end, send the first transaction request to the first transaction processing end corresponding to the first transaction in the batch transaction.
[0059] The transaction request client is either a client that can initiate transaction requests, or another third-party platform with the function of initiating transaction requests.
[0060] The transaction processing end is specifically a bank or other institution or platform with transaction processing functions.
[0061] A batch transaction contains multiple transactions to be executed. After receiving a batch transaction request from the transaction requester, each transaction needs to be processed sequentially.
[0062] Within a batch of transactions, different transactions may correspond to the same transaction request end, but may correspond to different transaction processing ends. For example, some transactions may need to be processed by the Agricultural Bank of China, while others may need to be processed by a commercial bank.
[0063] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.
[0064] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0065] Step 102: Obtain the first return value sent by the first transaction processing terminal based on the first transaction request.
[0066] After receiving a transaction request, the transaction processing terminal will process the transaction based on the request. Once processing is complete, it will send feedback information to the batch transaction processing system.
[0067] The return value included in the feedback information is specifically used to indicate whether the transaction processing result is successful or abnormal. If the transaction is abnormal, the return value can also include an exception reason code to inform the reason for the transaction processing error.
[0068] Step 103: When the first return value is determined to be a transaction anomaly return value, the first transaction information data associated with the first transaction is extracted, and the first transaction anomaly count is performed based on the first transaction information data.
[0069] Specifically, if the first return value is determined to be a successful transaction return value, then the first transaction is marked as a successful transaction.
[0070] Here, when a return value indicating a transaction error is received, it is necessary to extract information about the transaction corresponding to that return value. This information extraction is used to determine the characteristics of the current transaction and form transaction information data.
[0071] The transaction information data includes, for example, the transaction processing terminal corresponding to the current transaction, the batch number of the batch of transactions to which the transaction belongs, the business interface of the transaction in the corresponding transaction processing terminal, and the transaction type of the transaction.
[0072] The transaction type can be, for example, a payment transaction or a receipt transaction.
[0073] In this step, after extracting the transaction information data associated with the current transaction, it is necessary to count transaction anomalies based on this transaction information data.
[0074] When counting transaction anomalies, it is necessary to follow the transaction information data extracted from the transactions, meaning each set of transaction information data corresponds to one transaction anomaly count. This is to determine which bank the transaction anomaly occurred in, which business interface of the bank, the transaction batch number, the payment type, and other information, and to accumulate the number of transaction anomalies under the corresponding information, thereby achieving the monitoring and information statistics of abnormal transactions and preparing preliminary information for subsequent transaction processing.
[0075] As an optional implementation, when the first return value is determined to be a transaction anomaly return value, the first transaction information data associated with the first transaction is extracted, including:
[0076] When the first return value is determined to be a transaction exception return value, the system determines whether the first transaction corresponds to the set transaction exception reason based on the set flag bit in the transaction exception return value.
[0077] When determining that the first transaction corresponds to a set transaction exception reason, the first transaction processing terminal, transaction type and / or batch number of the batch transaction corresponding to the first transaction are extracted as the first transaction information data associated with the first transaction.
[0078] There are many reasons that can lead to abnormal transactions. Different reasons for abnormal transactions need to be identified in order to eliminate transactions caused by factors other than the channel.
[0079] For example, transaction anomalies may occur due to reasons such as an incorrect transaction account number, an incorrect transaction password, or a transaction amount exceeding the account balance.
[0080] In this case, if it is determined that the first transaction does not correspond to the target abnormality cause, then transaction abnormality counting will not be performed based on the first transaction.
[0081] Furthermore, optionally but not limited, the specific reason for the transaction anomaly can be a transaction channel failure, such as a bank system maintenance failure, a bank transaction processing failure, or a bank business interface failure.
[0082] In this scenario, transaction information data is extracted from the current transaction that exhibits anomalies to perform accurate transaction anomaly statistics. This helps determine the number and frequency of related transaction processing failures under the same anomaly, guiding the processing strategies for subsequent transactions in the batch.
[0083] Step 104: Based on the first transaction information data, perform information data hit judgment on the second transaction in the batch of transactions. When it is determined that the second transaction hits the first transaction information data and the first transaction abnormal count exceeds the threshold, suspend the second transaction until the first transaction abnormal count is within the set number of times.
[0084] When processing multiple transactions in a batch, the transactions that are processed later in the batch need to be determined based on the exception handling results of the transactions that were processed earlier in the batch.
[0085] This match detection is specifically used to determine whether the current transaction matches the transaction information data of a previous abnormal transaction. If the two match and the transaction anomaly count exceeds the threshold, it is considered that the transaction processing terminal currently does not support processing transactions that match the transaction information data. In this case, the transaction that matches the transaction information data will not be sent to the corresponding transaction processing terminal, but will be suspended and not processed. Instead, other transactions that are prioritized later will be processed.
[0086] In this process, it is equivalent to triggering the transaction circuit breaker mechanism when it is determined that the second transaction hits the first transaction information data and the first transaction anomaly count exceeds the threshold. The circuit breaker targets subsequent transactions that hit the first transaction information data when the first transaction anomaly count exceeds the threshold.
[0087] This process avoids duplicate submissions of the same type of abnormal transactions, thus preventing the consumption of processing resources on the transaction processing end. It suspends transactions that are currently likely to experience abnormalities, allocating time for them to resolve the issues. On the other hand, it frees up processing space for other transactions in the batch, improving the processing efficiency of the batch and ensuring that the normal processing of other transactions is not affected. This increases the success rate of batch transaction processing and enhances the user experience.
[0088] As an optional implementation, after determining the information data match of the second transaction in the batch of transactions based on the first transaction information data, the method further includes:
[0089] When it is determined that the second transaction does not match the first transaction information data, a second transaction request is sent to the second transaction processing terminal corresponding to the second transaction;
[0090] Obtain the second return value sent by the second transaction processing terminal based on the second transaction request;
[0091] When the second return value is determined to be a transaction exception return value, extract the transaction information data associated with the second transaction and count the second transaction exceptions based on the second transaction information data; or, when the second return value is determined to be a transaction success return value, mark the second transaction as a successful transaction.
[0092] When it is determined that the second transaction does not match the information data of the first transaction, it indicates that the characteristics of the current second transaction are different from those of the first transaction. A transaction request can be sent directly to the corresponding transaction processing terminal based on the second transaction to achieve normal processing of different transactions.
[0093] Similarly, for the second transaction, it is also necessary to perform corresponding processing operations based on the return value from the transaction processing terminal, monitor and statistically analyze different transaction anomalies under different transaction characteristics, and ensure the effective execution of batch transactions.
[0094] As another optional implementation, after determining the information data match of the second transaction in the batch of transactions based on the first transaction information data, the method further includes:
[0095] When it is determined that the second transaction hits the first transaction information data and the first transaction anomaly count has not exceeded the threshold, a third transaction request is sent to the first transaction processing terminal.
[0096] Obtain the third return value sent by the first transaction processing end based on the third transaction request;
[0097] When the third return value is determined to be a transaction exception return value, the first transaction exception count is incremented by one.
[0098] This process enables effective statistics on the number of abnormal transactions under the same transaction characteristics. The threshold is a set value, such as an empirical value like 2, 3, 4, or 5.
[0099] Furthermore, after suspending transactions with abnormal counts exceeding the threshold, it is also necessary to set up a corresponding mechanism to ensure that the suspended transactions are executed at the appropriate time.
[0100] Correspondingly, in an optional implementation, after suspending the second transaction when it is determined that the second transaction matches the first transaction information data and the first transaction anomaly count exceeds the threshold, the method further includes:
[0101] At a set frequency, trigger resend attempts for suspended transactions in a batch of transactions;
[0102] If the resentment of the first suspended transaction results in a successful transaction, the transaction anomaly count corresponding to the first suspended transaction will be adjusted to the set number of times.
[0103] Re-execute the pending transactions in the batch that have the same transaction information data as the first pending transaction.
[0104] This resend probe corresponds to the liveness detection function of suspended transactions. That is, the transaction request of the suspended transaction is tentatively resent at a set frequency. When the transaction request is resent, if the corresponding transaction processing terminal sends a return value indicating that the transaction was successful, it is assumed that other transactions with the same transaction characteristics as the successfully liveness detection transaction can also be successfully executed. At this time, the corresponding transaction exception count is adjusted to a set number of times so that these other transactions can be executed normally.
[0105] Specifically, the set number range is a range of values less than the threshold, or the transaction anomaly count can be cleared directly, i.e., the set number range is a range of values of 0.
[0106] In a different alternative implementation, after suspending the second transaction when it is determined that the second transaction matches the first transaction information data and the first transaction anomaly count exceeds the threshold, the method further includes:
[0107] Get the troubleshooting notification message sent by the first transaction processing terminal;
[0108] Based on the troubleshooting notification message, select the second suspended transaction corresponding to the first transaction processing terminal from the suspended transactions;
[0109] Adjust the transaction anomaly count corresponding to the second suspended transaction to the set number of times, and re-execute the suspended transactions in the batch that match the second suspended transaction in the same transaction information data.
[0110] Besides using a reactivation mechanism to ensure the effective execution of suspended transactions, the transaction processing end can also be configured to send a fault-resolving notification message to the batch transaction processing platform after the fault is resolved. The batch transaction processing platform can then use this fault-resolving notification message to schedule the re-execution of suspended transactions.
[0111] Furthermore, it is also possible to count the suspension time of suspended transactions that match the same transaction information data, and mark the target suspended transaction as a failed transaction based on the suspension time.
[0112] The suspension time can be the individual time of each suspended transaction, or the average time or weighted average time of suspended transactions that match the same transaction information data.
[0113] Alternatively, count the number of times suspended transactions that match the same transaction information data are suspended, and mark the target suspended transaction as a failed transaction based on the number of suspensions.
[0114] The number of times the device is suspended can be, for example, the total number of times, or the sum of the number of times within a set time period, etc.
[0115] Alternatively, the number of times a suspended transaction has been suspended and the duration of the suspension can be combined to select the target suspended transaction and mark it as a failed transaction.
[0116] In this embodiment, according to the batch transactions requested by the transaction requester, a transaction request is sent to the corresponding transaction processing terminal. Based on the transaction exception return value sent by the transaction request, transaction information data associated with the transaction is extracted and a transaction exception count is performed. Then, based on the transaction information data, the subsequent transactions in the batch are judged for information data hit. When a subsequent transaction hits the transaction information data and the transaction exception count exceeds the threshold, the subsequent transaction needs to be suspended. This ensures that a circuit breaker can be initiated when certain maintenance or faults occur. On the one hand, it avoids the duplicate submission of the same type of abnormal transactions, allocates a waiting time for fault resolution for the suspended transactions with transaction exceptions, and avoids occupying the processing resources of the transaction processing terminal. On the other hand, it frees up processing space for other transactions in the batch, improves the processing efficiency of the batch transactions, ensures that the normal processing of other transactions is not affected, improves the success rate of batch transaction processing, and improves the user experience.
[0117] This application also provides different implementations of the batch transaction processing method.
[0118] See Figure 2 , Figure 2 This is a flowchart of a batch transaction processing method provided in an embodiment of this application. Figure 2 .like Figure 2 As shown, a batch transaction processing method includes the following steps:
[0119] Step 201: In accordance with the batch transaction requested by the transaction requesting end, send the first transaction request to the first transaction processing end corresponding to the first transaction in the batch transaction;
[0120] The implementation process of this step is the same as that of step 101 in the aforementioned embodiments, and will not be repeated here.
[0121] Step 202: Obtain the first return value sent by the first transaction processing terminal based on the first transaction request;
[0122] The implementation process of this step is the same as that of step 102 in the aforementioned embodiments, and will not be repeated here.
[0123] Step 203: When the first return value is determined to be a transaction anomaly return value, extract the first transaction information data associated with the first transaction, and count the first transaction anomalies based on the first transaction information data;
[0124] The implementation process of this step is the same as that of step 103 in the aforementioned embodiments, and will not be repeated here.
[0125] Step 204: Based on the first transaction information data, perform information data hit judgment on the second transaction in the batch of transactions. When it is determined that the second transaction hits the first transaction information data and the first transaction abnormal count exceeds the threshold, suspend the second transaction until the first transaction abnormal count is within the set number of times.
[0126] The implementation process of this step is the same as that of step 104 in the aforementioned embodiments, and will not be repeated here.
[0127] Furthermore, when it is determined that the second transaction matches the first transaction information data and the first transaction anomaly count exceeds a threshold, the second transaction is suspended until the first transaction anomaly count falls within a set number of times. The method also includes:
[0128] Step 205: When it is detected that all transactions in the batch have been processed by the corresponding transaction processing terminal, the transaction results corresponding to each transaction are integrated to obtain transaction feedback information.
[0129] The determination of whether all transactions in a batch have been processed by their respective transaction processing terminals can be as follows:
[0130] All transactions in a batch have had their transaction requests sent to the corresponding transaction processing terminal for processing. The processing result can be either transaction success or transaction failure.
[0131] A successful transaction is marked as a successful transaction, and a failed transaction is marked as a failed transaction.
[0132] It can read the transaction result flags assigned to different transactions in a batch of transactions. When all transactions have transaction result flags, it indicates that all transactions have been executed.
[0133] The transaction results corresponding to each transaction are integrated, either by combining the transaction results of each transaction into a table or by combining them into a single string, to form transaction feedback information, so as to respond to the batch transactions requested by the transaction requesting end.
[0134] Step 206: Output the transaction feedback information to the transaction requester.
[0135] In this embodiment, according to the batch transactions requested by the transaction requester, a transaction request is sent to the corresponding transaction processing terminal. Based on the transaction exception return value sent by the transaction request, transaction information data associated with the transaction is extracted and a transaction exception count is performed. Then, based on the transaction information data, the subsequent transactions in the batch are judged for information data hit. When a subsequent transaction hits the transaction information data and the transaction exception count exceeds the threshold, the subsequent transaction needs to be suspended. After all transactions are completed, the result is fed back to the transaction requester to ensure that a circuit breaker can be initiated when certain maintenance or faults are encountered. On the one hand, this avoids the duplicate submission of the same type of abnormal transactions, allocates a waiting time for fault resolution for suspended transactions with abnormal transactions, avoids occupying the processing resources of the transaction processing terminal, and on the other hand, frees up processing space for other transactions in the batch, improves the processing efficiency of the batch transactions, ensures that the normal processing of other transactions is not affected, improves the success rate of batch transaction processing, and improves the user experience.
[0136] See Figure 3 , Figure 3 This is a structural diagram of a batch transaction processing device provided in an embodiment of this application. For ease of explanation, only the parts related to the embodiment of this application are shown.
[0137] This batch of transaction processing units 300 includes:
[0138] Sending module 301 is used to send a first transaction request to the first transaction processing terminal corresponding to the first transaction in the batch of transactions according to the batch transaction requested by the transaction request terminal;
[0139] The acquisition module 302 is used to acquire the first return value sent by the first transaction processing terminal based on the first transaction request;
[0140] The counting module 303 is used to extract the first transaction information data associated with the first transaction when the first return value is determined to be a transaction abnormal return value, and to count the first transaction abnormality based on the first transaction information data.
[0141] The transaction control module 304 is used to determine the information data hit of the second transaction in the batch of transactions based on the first transaction information data. When it is determined that the second transaction hits the first transaction information data and the first transaction abnormal count exceeds the threshold, the second transaction is suspended until the first transaction abnormal count is within a set number of times.
[0142] The transaction control module 304 is also used for:
[0143] When it is determined that the second transaction does not match the first transaction information data, a second transaction request is sent to the second transaction processing terminal corresponding to the second transaction.
[0144] Obtain the second return value sent by the second transaction processing terminal based on the second transaction request;
[0145] When the second return value is determined to be a transaction exception return value, the transaction information data associated with the second transaction is extracted, and a second transaction exception count is performed based on the second transaction information data; or, when the second return value is determined to be a transaction success return value, the second transaction is marked as a successful transaction.
[0146] The transaction control module 304 is also used for:
[0147] When it is determined that the second transaction hits the first transaction information data and the first transaction anomaly count has not exceeded the threshold, a third transaction request is sent to the first transaction processing terminal.
[0148] Obtain the third return value sent by the first transaction processing terminal based on the third transaction request;
[0149] When the third return value is determined to be a transaction exception return value, the first transaction exception count is incremented by one.
[0150] The counting module 303 is specifically used for:
[0151] When the first return value is determined to be a transaction exception return value, it is determined whether the first transaction corresponds to a set transaction exception reason based on the set flag bit in the transaction exception return value.
[0152] When it is determined that the first transaction corresponds to the set transaction anomaly reason, the first transaction processing terminal, transaction type and / or batch number of the batch transaction corresponding to the first transaction are extracted as the first transaction information data associated with the first transaction.
[0153] The device also includes a liveness detection module, used for:
[0154] At a set frequency, trigger retransmission attempts for suspended transactions in the batch of transactions;
[0155] If the resentment of the first suspended transaction results in a successful transaction, the transaction anomaly count corresponding to the first suspended transaction is adjusted to the set number of times.
[0156] Re-execute the suspended transactions in the batch that match the first suspended transaction in the same transaction information data.
[0157] The device also includes a transaction retransmission module, used for:
[0158] Obtain the troubleshooting notification message sent by the first transaction processing terminal;
[0159] Based on the troubleshooting notification message, select the second suspended transaction corresponding to the first transaction processing terminal from the suspended transactions;
[0160] Adjust the transaction anomaly count corresponding to the second suspended transaction to the set number of times, and re-execute the suspended transactions in the batch that match the second suspended transaction in the same transaction information data.
[0161] The device also includes a feedback module, used for:
[0162] When it is detected that all transactions in the batch have been processed by the corresponding transaction processing terminal, the transaction results corresponding to each transaction are integrated to obtain transaction feedback information;
[0163] The transaction feedback information is output to the transaction request terminal.
[0164] The batch transaction processing apparatus provided in this application can implement all the processes of the above-described batch transaction processing method embodiments and achieve the same technical effect. To avoid repetition, it will not be described again here.
[0165] Figure 4 This is a structural diagram of a computer device provided in an embodiment of this application. As shown in the figure, the computer device 4 of this embodiment includes: at least one processor 40 ( Figure 4 (Only one is shown in the diagram), memory 41, and computer program 42 stored in said memory 41 and executable on said at least one processor 40, which, when executed, implements the steps in any of the above method embodiments.
[0166] The computer device 4 may be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device 4 may include, but is not limited to, a processor 40 and a memory 41. Those skilled in the art will understand that... Figure 4 This is merely an example of computer device 4 and does not constitute a limitation on computer device 4. It may include more or fewer components than shown, or combine certain components, or different components. For example, the computer device may also include input / output devices, network access devices, buses, etc.
[0167] The processor 40 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0168] The memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. The memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the computer device 4. Furthermore, the memory 41 can include both internal and external storage units of the computer device 4. The memory 41 is used to store the computer program and other programs and data required by the computer device. The memory 41 can also be used to temporarily store data that has been output or will be output.
[0169] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0170] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0171] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0172] In the embodiments provided in this application, it should be understood that the disclosed devices / terminals and methods can be implemented in other ways. For example, the device / terminal embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling or direct coupling or communication connection may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0173] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0174] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0175] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0176] The methods described in this application can be implemented in whole or in part by a computer program product. When the computer program product is run on a terminal, the terminal executes the steps in the various method embodiments described above.
[0177] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A batch transaction processing method, characterized in that, include: According to the batch transaction requested by the transaction requesting end, a first transaction request is sent to the first transaction processing end corresponding to the first transaction in the batch transaction; wherein, after receiving the batch transaction requested by the transaction requesting end, each transaction in the batch transaction is processed sequentially; Obtain the first return value sent by the first transaction processing terminal based on the first transaction request; When the first return value is determined to be a transaction anomaly return value, the first transaction information data associated with the first transaction is extracted, and the first transaction anomaly count is performed based on the first transaction information data; Based on the first transaction information data, a data hit determination is performed on the second transaction in the batch of transactions. When it is determined that the second transaction hits the first transaction information data and the first transaction anomaly count exceeds a threshold, the second transaction is suspended until the first transaction anomaly count is within a set number of times. The second transaction and the first transaction are different transactions in the batch of transactions, and the second transaction is a transaction in the batch of transactions that is ordered after the first transaction. The set number of times is used to ensure that suspended transactions in the batch of transactions that hit the same transaction information data as the first suspended transaction can be executed normally. The transaction anomaly count is adjusted to the set number of times when the resend attempt result of the corresponding suspended transaction is a successful transaction, or the transaction anomaly count is adjusted to the set number of times when a fault troubleshooting notification message of the corresponding suspended transaction is obtained.
2. The method according to claim 1, characterized in that, After determining the information data match of the second transaction in the batch of transactions based on the first transaction information data, the process further includes: When it is determined that the second transaction does not match the first transaction information data, a second transaction request is sent to the second transaction processing terminal corresponding to the second transaction. Obtain the second return value sent by the second transaction processing terminal based on the second transaction request; When the second return value is determined to be a transaction exception return value, the transaction information data associated with the second transaction is extracted, and a second transaction exception count is performed based on the second transaction information data; or, when the second return value is determined to be a transaction success return value, the second transaction is marked as a successful transaction.
3. The method according to claim 1, characterized in that, After determining the information data match of the second transaction in the batch of transactions based on the first transaction information data, the process further includes: When it is determined that the second transaction hits the first transaction information data and the first transaction anomaly count has not exceeded the threshold, a third transaction request is sent to the first transaction processing terminal. Obtain the third return value sent by the first transaction processing terminal based on the third transaction request; When the third return value is determined to be a transaction exception return value, the first transaction exception count is incremented by one.
4. The method according to claim 1, characterized in that, When the first return value is determined to be a transaction anomaly return value, the step of extracting the first transaction information data associated with the first transaction includes: When the first return value is determined to be a transaction exception return value, it is determined whether the first transaction corresponds to a set transaction exception reason based on the set flag bit in the transaction exception return value. When it is determined that the first transaction corresponds to the set transaction anomaly reason, the first transaction processing terminal, transaction type and / or batch number of the batch transaction corresponding to the first transaction are extracted as the first transaction information data associated with the first transaction.
5. The method according to claim 1, characterized in that, After suspending the second transaction when it is determined that the second transaction matches the first transaction information data and the first transaction anomaly count exceeds the threshold, the method further includes: At a set frequency, trigger retransmission attempts for suspended transactions in the batch of transactions; If the resentment of the first suspended transaction results in a successful transaction, the transaction anomaly count corresponding to the first suspended transaction is adjusted to the set number of times. Re-execute the suspended transactions in the batch that match the first suspended transaction in the same transaction information data.
6. The method according to claim 1, characterized in that, After suspending the second transaction when it is determined that the second transaction matches the first transaction information data and the first transaction anomaly count exceeds the threshold, the method further includes: Obtain the troubleshooting notification message sent by the first transaction processing terminal; Based on the troubleshooting notification message, select the second suspended transaction corresponding to the first transaction processing terminal from the suspended transactions; Adjust the transaction anomaly count corresponding to the second suspended transaction to the set number of times, and re-execute the suspended transactions in the batch that match the second suspended transaction in the same transaction information data.
7. The method according to claim 1, characterized in that, When it is determined that the second transaction matches the first transaction information data and the first transaction anomaly count exceeds the threshold, the second transaction is suspended until the first transaction anomaly count is within a set number of times. This further includes: When it is detected that all transactions in the batch have been processed by the corresponding transaction processing terminal, the transaction results corresponding to each transaction are integrated to obtain transaction feedback information; The transaction feedback information is output to the transaction request terminal.
8. A batch transaction processing device, characterized in that, include: The sending module is used to send a first transaction request to a first transaction processing terminal corresponding to the first transaction in the batch of transactions according to the batch of transactions requested by the transaction requesting terminal; wherein, after receiving the batch of transactions requested by the transaction requesting terminal, each transaction in the batch of transactions is processed sequentially; The acquisition module is used to acquire the first return value sent by the first transaction processing terminal based on the first transaction request; The counting module is used to extract the first transaction information data associated with the first transaction when the first return value is determined to be a transaction abnormal return value, and to count the first transaction abnormality based on the first transaction information data. The transaction control module is used to determine the information data match of the second transaction in the batch of transactions based on the first transaction information data. When it is determined that the second transaction matches the first transaction information data and the first transaction anomaly count exceeds a threshold, the second transaction is suspended until the first transaction anomaly count is within a set number of times. The second transaction and the first transaction are different transactions in the batch of transactions, and the second transaction is a transaction in the batch of transactions that is ordered after the first transaction. The set number of times is used to ensure that suspended transactions in the batch of transactions that match the same transaction information data as the first suspended transaction can be executed normally. The transaction anomaly count is adjusted to the set number of times when the resend attempt result of the corresponding suspended transaction is successful, or the transaction anomaly count is adjusted to the set number of times when the fault troubleshooting notification message of the corresponding suspended transaction is obtained.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 7.