Accounting transaction processing method and device, electronic equipment and storage medium
By obtaining transaction information and identifying transaction relationships, performing corresponding transaction operations and handling failures, the problem of low efficiency in accounting transactions in the prior art is solved, and more efficient and accurate processing results are achieved.
Patent Information
- Application Number
- CN202411603341.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-03-04
AI Technical Summary
The existing accounting transaction processing methods have problems with inefficiency during the processing process.
By obtaining transaction information, the paired transaction relationship and transaction sequence between transactions are determined, the corresponding transaction operations are performed according to the operation stage, and the related transactions are automatically identified and the processing plan is determined when the operation fails.
Improves the efficiency and accuracy of accounting transactions, reduces the risks of manual intervention and errors, and ensures data consistency and integrity.
Smart Images

Figure CN119558847A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of distributed technology, and in particular to a method, device, electronic device and storage medium for processing accounting transactions. Background Art
[0002] In the financial payment industry, with the continuous expansion of business and the growing user demand, extremely high requirements are placed on the system's high concurrent processing capabilities, real-time performance, and data accuracy. Distributed architecture has been widely used in the field of financial payment and has become one of the key technologies for achieving efficient and reliable financial services. In the transaction processing of financial payment systems, it mainly involves how to ensure the consistency and timeliness of accounting transactions in a distributed environment to ensure the security and accurate recording of funds.
[0003] When implementing accounting transaction processing under a distributed architecture, the common methods currently include TCC (Try-Confirm-Cancel) and SAGA. The TCC method includes: Try phase - try to execute some operations of the accounting transaction on each node of the distributed system, such as checking whether the account balance is sufficient, freezing some funds, etc., to prepare for the subsequent confirmation operation. At the same time, this phase will reserve the required resources to ensure that the transaction can be processed smoothly in the subsequent phase; Confirm phase - if the Try phase is successful, each node confirms the final operation of executing the accounting transaction, performs actual accounting operations on the frozen funds, completes the transfer of funds or records update, etc.; Cancel phase - if the Try phase fails or an abnormal situation occurs during the transaction execution, each node performs a cancellation operation, releases the reserved resources, and restores to the state before the transaction execution.
[0004] However, the existing accounting transaction processing method has the problem of low efficiency in the processing process. Summary of the invention
[0005] The embodiments of the present application provide an accounting transaction processing method, device, electronic device and storage medium to solve the problem of low efficiency in the processing process of the existing accounting transaction processing method.
[0006] In a first aspect, an embodiment of the present application provides a method for processing accounting transactions, including:
[0007] Obtain transaction information, which is transaction-related information extracted from the accounting request message;
[0008] Determine the paired transaction relationship in each transaction in the transaction information, and the transaction sequence of each transaction, wherein the paired transaction relationship indicates that there is a correlation between the lending and borrowing directions of two transactions;
[0009] Determine the operation stage corresponding to each transaction based on the transaction information;
[0010] For each transaction, according to the operation phase, transaction information and transaction sequence corresponding to the transaction, the corresponding transaction operation is executed to obtain the operation result;
[0011] If the operation result indicates that the operation has failed, then an associated transaction having a paired transaction relationship with the transaction is determined;
[0012] Determine the corresponding processing plan for transactions and related transactions based on the transaction sequence, related transactions and preset operation stage failure processing requirements.
[0013] In a possible implementation, determining the operation phase corresponding to each transaction according to the transaction information includes:
[0014] Determine the transaction type of each transaction based on the transaction information;
[0015] According to the transaction type of each transaction, the corresponding operation stage of each transaction is determined. The operation stage includes the account processing stage, the account entry processing stage, the transfer processing stage, the reverse transfer processing stage, the foreign exchange refund processing stage and the reverse account entry processing stage.
[0016] In a possible implementation, according to the transaction sequence, related transactions and preset operation stage failure processing requirements of the transaction, a processing solution corresponding to the transaction and the related transactions is determined, including:
[0017] Determine whether the transaction sequence of the transaction meets the preset numerical requirements;
[0018] If the transaction sequence of the transaction meets the preset numerical requirements, the processing scheme corresponding to the transaction and the associated transactions is determined according to the operation phase corresponding to the transaction and the preset operation phase failure processing requirements;
[0019] If the transaction sequence of a transaction does not meet the preset numerical requirements, the associated transactions will be reversed.
[0020] In a possible implementation, the target operation stage includes: an account entry processing stage, a remittance return processing stage, or a reverse account entry processing stage;
[0021] Determine the corresponding processing solutions for transactions and related transactions based on the corresponding operation stages of the transaction and the preset operation stage failure processing requirements, including:
[0022] If the operation phase corresponding to the transaction is the target operation phase, error compensation processing is performed on the transaction, and the transaction operation of the associated transaction is executed after the processing;
[0023] or,
[0024] If the operation phase corresponding to the transaction is the target operation phase, the transaction operation of the transaction is executed again based on the preset transaction call times.
[0025] In a possible implementation, reversing the related-party transaction includes:
[0026] Reverse the related-party transactions and obtain the reversal results;
[0027] If the reversal processing result does not meet the preset reversal processing requirements, then traverse other transactions in the transaction information from the transaction sequence in descending order to obtain the reversal transaction that meets the reversal and resend conditions;
[0028] Reverse the hedging transaction.
[0029] In a possible implementation, the method further includes:
[0030] If the operation result represents an operation that is not clear, determine the processing plan corresponding to the transaction and related transactions based on the scenario requirements of the accounting request;
[0031] If the operation result indicates that the operation is successful, the corresponding transaction operation is completed.
[0032] In a possible implementation, obtaining transaction information includes:
[0033] receiving a billing request, the billing request including billing information;
[0034] Based on the preset data table structure requirements, the accounting information is parsed to generate transactions and corresponding transaction information.
[0035] In a second aspect, an embodiment of the present application provides an accounting transaction processing device, including:
[0036] An acquisition module is used to acquire transaction information, where the transaction information is transaction-related information extracted from the accounting request message;
[0037] An analysis module is used to determine the paired transaction relationship among each transaction in the transaction information and the transaction sequence of each transaction, wherein the paired transaction relationship indicates that there is a correlation between the lending and borrowing directions of two transactions;
[0038] A first determination module, used to determine the operation phase corresponding to each transaction according to the transaction information;
[0039] The processing module is used to execute corresponding transaction operations for each transaction according to the operation phase, transaction information and transaction sequence corresponding to the transaction, and obtain the operation result;
[0040] A judgment module, configured to determine an associated transaction having a paired transaction relationship with the transaction if the operation result indicates that the operation has failed;
[0041] The second determination module is used to determine the processing solutions corresponding to the transaction and the related transactions according to the transaction sequence, the related transactions and the preset operation stage failure processing requirements.
[0042] In a third aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor;
[0043] Memory stores computer-executable instructions;
[0044] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementations of the first aspect.
[0045] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect above and / or various possible implementations of the first aspect.
[0046] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above first aspect and / or various possible implementation methods of the first aspect.
[0047] The accounting transaction processing method, device, electronic device and storage medium provided by the embodiment of the present application obtain transaction information, which is information related to the transaction extracted from the accounting request message; determine the paired transaction relationship in each transaction in the transaction information, and the transaction sequence of each transaction, the paired transaction relationship represents the existence of an associated relationship between the two transactions in the lending direction; determine the operation stage corresponding to each transaction according to the transaction information; for each transaction, according to the operation stage, transaction information and transaction sequence corresponding to the transaction, perform the corresponding transaction operation to obtain the operation result; if the operation result represents the failure of the operation, determine the associated transaction with the transaction having a paired transaction relationship; according to the transaction sequence, associated transactions and preset operation stage failure processing requirements of the transaction, determine the means of processing solutions corresponding to the transaction and the associated transactions. Extract key transaction information from the accounting request message, identify the lending association relationship and processing sequence between transactions, then perform corresponding operations according to the operation stage of each transaction, and when the operation fails, automatically identify the paired transactions related to the failed transaction, and determine the appropriate processing solution through the preset failure processing requirements to ensure the consistency and integrity of the data. The method can reduce manual intervention and reduce the risk of errors, and improve the processing efficiency of complex accounting transactions. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0049] Figure 1 A schematic diagram of a distributed transaction processing method provided in this application;
[0050] Figure 2 A flowchart of a method for processing accounting transactions provided for this application;
[0051] Figure 3 A schematic diagram of the interaction between modules during accounting transaction processing provided by this application;
[0052] Figure 4 A schematic diagram of the structure of the accounting transaction processing device provided for this application;
[0053] Figure 5 A schematic diagram of the structure of the electronic device provided in this application.
[0054] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0055] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0056] It should be noted that the accounting information (including but not limited to transaction information, user personal information, user accounts, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0057] Figure 1 A schematic diagram of a distributed transaction processing method provided in this application, such as Figure 1As shown, the specific application scenarios of the present application include: transaction coordinator, participants, and databases corresponding to participants. Among them, the transaction coordinator is responsible for coordinating the various stages of distributed transactions, collecting the execution results of transactions by communicating with participants, monitoring the execution status of participants' transactions, and deciding whether to commit transactions or roll back transactions. Participants can refer to subsystems or services involved in the execution of distributed transactions, such as different applications, microservices or modules, which are used to execute specific business logic, and there can be multiple participants. For example, when a distributed transaction starts, the transaction coordinator sends a transaction start message to participants A and B; participants A and B respectively execute their own business logic and operate on the corresponding database; participants A and B return the transaction execution results to the transaction coordinator; the transaction coordinator decides whether to commit or roll back the transaction based on the execution results of each participant. If all participants execute successfully, the transaction coordinator sends a message to commit the transaction, and if any participant fails to execute, the transaction coordinator sends a message to roll back the transaction; participants A and B perform corresponding commit or rollback operations on the database according to the instructions of the transaction coordinator.
[0058] Combined with the above scenario, it can be seen that in the prior art, the distributed accounting data processing method adopts the TCC method, which can be specifically divided into three stages: the Try stage (trial calculation stage), the Confirm stage (confirmation stage), and the Cancel stage (release stage). Specifically: Try stage: try to execute some operations of the accounting transaction on each node of the distributed system, such as checking whether the account balance is sufficient, freezing part of the funds, etc., to prepare for the subsequent confirmation operation; Confirm stage: if the Try stage is successful, each node confirms the final operation of executing the accounting transaction, performs actual accounting operations on the frozen funds, completes the transfer of funds or record updates, etc.; Cancel stage: if the Try stage fails or an abnormal situation occurs during the transaction execution, each node performs a cancellation operation, releases the reserved resources, and restores to the state before the transaction execution. However, although the TCC method does not generate dirty data, the TCC method needs to implement the logic of the three stages of Try, Confirm and Cancel on each node during development, which increases the complexity of development, and the TCC method has a relatively conservative strategy in the distributed accounting transaction processing, assuming that the probability of transaction failure is high, and the reverse processing after failure is difficult. Therefore, this method has the problem of low efficiency in processing.
[0059] The accounting transaction processing method provided by the present application obtains transaction information, where the transaction information is information related to the transaction extracted from the accounting request message; determines the paired transaction relationship in each transaction in the transaction information, and the transaction sequence of each transaction, where the paired transaction relationship indicates that there is an associated relationship between the debit and credit directions of two transactions; determines the operation phase corresponding to each transaction according to the transaction information; performs the corresponding transaction operation for each transaction according to the operation phase, transaction information and transaction sequence corresponding to the transaction, and obtains the operation result; if the operation result indicates that the operation fails, determines the associated transaction with the transaction having a paired transaction relationship; and determines the associated transaction according to the transaction sequence, associated transaction and preset operation sequence. The technical means to determine the processing solutions for transactions and related transactions based on the requirements for handling failures in the operation stage can extract key transaction information from the accounting request message, and identify the loan relationship and processing sequence between transactions. Then, the corresponding operations are performed according to the operation stage of each transaction. Different rules and strategies can be applied in different stages to improve the accuracy and efficiency of transaction processing; and when the operation fails, the paired transactions related to the failed transaction are automatically identified, and the appropriate processing solutions are determined through the preset failure handling requirements to ensure the consistency and integrity of the data. This method can reduce manual intervention and reduce the risk of errors, and improve the processing efficiency of complex accounting transactions.
[0060] It should be noted that the accounting transaction processing method, device, electronic device and storage medium provided by the present application can be used in the field of distributed technology, and can also be used in any field other than the field of distributed technology. The application field of the accounting transaction processing method, device, electronic device and storage medium provided by the present application is not limited.
[0061] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0062] The execution subject of the accounting transaction processing method provided in the embodiment of the present application can be a server. Among them, the server can be a mobile phone, a computer, a tablet and other devices. The embodiment of the present application does not impose any special restrictions on the implementation method of the execution subject, as long as the execution subject can obtain transaction information, and the transaction information is information related to the transaction extracted from the accounting request message; determine the paired transaction relationship in each transaction in the transaction information, and the transaction sequence of each transaction, and the paired transaction relationship represents that there is an association relationship between the lending and borrowing directions of the two transactions; according to the transaction information, determine the operation stage corresponding to each transaction; for each transaction, according to the operation stage, transaction information and transaction sequence corresponding to the transaction, perform the corresponding transaction operation to obtain the operation result; if the operation result represents that the operation fails, determine the associated transaction with the transaction that has a paired transaction relationship; according to the transaction sequence, associated transactions and preset operation stage failure processing requirements of the transaction, determine the processing scheme corresponding to the transaction and the associated transaction.
[0063] Figure 2 A flowchart of a bookkeeping transaction processing method provided for this application, such as Figure 2 As shown, the method includes:
[0064] S201. Acquire transaction information, where the transaction information is transaction-related information extracted from the accounting request message.
[0065] Among them, transaction information may refer to all data related to a specific transaction extracted from an accounting request, including but not limited to transaction amount, transaction date, account information, transaction type, debit and credit direction, account information, etc.
[0066] The accounting request message may refer to an electronic data packet or message containing transaction information obtained from a peripheral system.
[0067] For example, a batch accounting request containing multiple transactions is received from a bank's transaction system, a single transaction accounting request is obtained from an e-commerce platform's payment gateway, and end-of-day settlement transaction information is extracted from an enterprise's internal financial system.
[0068] S202: Determine the paired transaction relationship in each transaction in the transaction information and the transaction sequence of each transaction, wherein the paired transaction relationship indicates that there is an association relationship between the lending and borrowing directions of two transactions.
[0069] Among them, a paired transaction relationship may refer to a debit-credit relationship between two transactions, such as a debit transaction of one account and a credit transaction of another account. A transaction sequence may refer to the order in which transactions are processed, which may be determined according to business rules or time sequence.
[0070] Optionally, loan pairs can be automatically matched based on the account information and amount of the transaction; transactions can also be sorted by transaction timestamp to form a processing sequence; and a business rule engine can be used to identify pairwise relationships in complex multi-step transaction processes.
[0071] In one example, since the bank has customer accounts and BGL (Bank General Ledger) accounts in different systems, the accounting of customer accounts and BGL accounts is communicated through the system current account. Therefore, there are two transactions: A1 transaction: debiting the customer account and crediting the system current account; and A2 transaction: debiting the system current account and crediting the BGL account. There is a paired transaction relationship between A1 transaction and A2 transaction. The transaction sequence of A1 transaction can be 1, and the transaction sequence of A2 transaction can be 2.
[0072] S203: Determine the operation phase corresponding to each transaction according to the transaction information.
[0073] The operation stage may refer to the specific steps or stages in the transaction processing flow, such as posting, recording, and transferring.
[0074] Optionally, the operation stage can be determined based on the transaction type (such as transfer, payment, refund); a rule engine can be used to assign different operation stages based on transaction amount and account type; and the operation stage can be dynamically adjusted based on historical transaction data and risk assessment results.
[0075] S204. For each transaction, according to the operation phase, transaction information and transaction sequence corresponding to the transaction, the corresponding transaction operation is executed to obtain the operation result.
[0076] In this step, the transaction operation may refer to the specific processing actions performed on the transaction at a specific operation stage, such as verification, execution, recording, etc. The operation result may be used to indicate the success or failure status of the transaction operation, as well as the situation where the status is unclear.
[0077] For example, in the entry stage, verify whether the account balance is sufficient and perform accounting operations; in the transfer stage, check the validity of the counterparty's account and perform fund transfers; in the pending stage, temporarily record transaction information for subsequent confirmation.
[0078] S205: If the operation result indicates that the operation has failed, then determine an associated transaction that has a paired transaction relationship with the transaction.
[0079] The operation failure may refer to the failure of the transaction operation to be successfully completed, which may be due to verification failure, system error, etc. The associated transaction may be a transaction that has a paired relationship with the current transaction.
[0080] Optionally, when an operation fails, loan-lending transactions related to the failed transaction can be automatically found and marked; other transactions that are business-related to the failed transaction can also be identified through log analysis; and related transactions can also be dynamically identified using predefined rules or algorithms.
[0081] S206: Determine processing solutions corresponding to the transaction and the related transactions according to the transaction sequence, related transactions and preset operation stage failure processing requirements.
[0082] In this step, the preset operation stage failure processing requirements may be pre-set processing measures or strategies to be taken when the operation fails, such as transaction retransmission and transaction reversal. The processing plan may be a specific processing step or plan for the failed transaction and its associated transactions. Furthermore, when determining the processing plan, it also includes executing corresponding operations according to the processing plan to complete the accounting processing task and ensure data consistency.
[0083] For example, when the transaction sequence meets specific conditions, retries, rollbacks, or corrections can be performed according to failure processing requirements; for key transactions, manual review can be triggered to determine the next processing plan; when the system detects abnormal patterns, predefined emergency processing procedures can be automatically executed; and retries or compensation operations can be performed according to failure processing requirements at specific operation stages.
[0084] The accounting transaction processing method provided in the embodiment of the present application can automatically identify transaction relationships and transaction sequences, so that the execution subject can more accurately understand the dependencies between transactions, thereby reducing the need for manual intervention and the possibility of human error; determine the operation stage (such as pending account, account entry, transfer, etc.) according to the transaction type, so that the execution subject can apply different processing rules and strategies at different stages, which helps to improve the efficiency and accuracy of transaction processing; intelligently handle operation failures, and provide error compensation and retry mechanisms, which significantly improves the accuracy and efficiency of transaction processing and ensures the consistency and integrity of data. In addition, when it is necessary to correct the related transactions, the system not only performs the correction operation, but also can traverse other transactions to find transactions that meet the conditions for correction when the initial correction fails, as well as scenario-based responses to unclear operation results, which can enhance the recovery ability and stability of the execution subject when handling exceptions, and at the same time, through standardized data analysis and information extraction, lay a solid foundation for efficient processing.
[0085] On the basis of the above-mentioned embodiments, the method described in S203 for determining the operation stage corresponding to each transaction according to the transaction information may include: determining the transaction type of each transaction according to the transaction information; determining the operation stage corresponding to each transaction according to the transaction type of each transaction, the operation stage including the account suspension processing stage, the account entry processing stage, the transfer processing stage, the return transfer processing stage, the remittance return processing stage and the reverse account entry processing stage.
[0086] In this step, the transaction type may refer to the specific category or nature of the transaction, such as transfer, payment, refund, etc. Optionally, the transaction type may be automatically identified based on keywords in the transaction description field (such as "transfer" or "payment"); the transaction type may also be inferred using a combination rule of transaction amount and account type; or the type of the current transaction may be predicted by analyzing historical transaction data through a machine learning model.
[0087] The operation stage can determine the processing path and rules of the transaction. For example, for a transfer transaction, it is assigned to the transfer processing stage; for a refund transaction, it is assigned to the remittance processing stage; for complex transaction types (such as international payments), a combination of multiple operation stages may be required, such as the pending account processing stage and the reverse entry processing stage. Optionally, in addition to the processing stages described above, the operation stage may also include other stages related to transaction accounting, which are not particularly limited here.
[0088] In one example, the pending account processing stage can be used to temporarily record transaction information for subsequent confirmation or processing. The entry processing stage can be used to formally record the transaction amount into the corresponding account. The transfer processing stage can be used to perform the transfer of funds from one account to another. The reversal processing stage can be used to handle the reversal operation after the failure of the fund transfer. The remittance processing stage can be used to process the refund transaction and return the funds to the original payer. The reverse entry processing stage can be used to cancel or adjust the previous entry operation, such as revoking the previous entry record according to the error correction request and adjusting the account balance.
[0089] By defining multiple operation stages (such as pending account, crediting, transfer, etc.), this method can flexibly respond to various transaction scenarios and abnormal situations to adapt to different business needs and changes; by assigning specific operation stages according to transaction types, each transaction can be processed more accurately, ensuring that the transaction is processed according to its specific needs and rules, thereby improving the accuracy of processing; at the same time, by dividing transactions into different operation stages, different types of transactions can be processed in parallel or in stages, improving overall processing efficiency and reducing processing time.
[0090] On the basis of the above-mentioned embodiments, the method described in S206 for determining the processing scheme corresponding to a transaction and related transactions according to the transaction sequence of the transaction, related transactions and preset operation stage failure processing requirements may include: determining whether the transaction sequence of the transaction meets the preset numerical requirements; if the transaction sequence of the transaction meets the preset numerical requirements, determining the processing scheme corresponding to the transaction and related transactions according to the operation stage corresponding to the transaction and the preset operation stage failure processing requirements; if the transaction sequence of the transaction does not meet the preset numerical requirements, reversing the related transactions.
[0091] The preset numerical requirement may refer to a specific threshold or condition set during the transaction processing process, which is used to determine whether the transaction sequence meets the requirement. Reversal processing may refer to canceling or reversing an executed transaction to restore it to the state before the transaction.
[0092] In one example, a method for determining whether a transaction sequence of a transaction meets a preset numerical requirement may be to set the transaction sequence to a single value or a double value, respectively, based on a debit or a credit operation.
[0093] It is also possible to determine whether the preset priority requirement is met based on the priority tag of the transaction; it is also possible to check whether the transaction sequence number is within the allowed range, for example, the sequence number must be greater than a certain threshold.
[0094] If the transaction sequence of a transaction meets the preset numerical requirements, then according to the operation stage corresponding to the transaction and the preset operation stage failure processing requirements, the method for determining the processing scheme corresponding to the transaction and the related transactions can be to select an appropriate transaction retransmission strategy or error compensation mechanism according to the operation stage; it can also be to use predefined business rules to determine whether manual intervention or review is required; it can also be to automatically trigger the subsequent processing steps of the related transactions when the conditions are met.
[0095] If the transaction sequence of a transaction does not meet the preset numerical requirements, the method for reversing the related transactions can be to automatically generate a reversal transaction to undo the impact of the original transaction; it can also be to notify the relevant account holder or business department before the reversal; it can also be to use logging and audit tracking to ensure the transparency and traceability of the reversal process.
[0096] By checking transaction sequences and related transactions, the impact scope of transaction failures can be determined more accurately, and appropriate processing plans can be formulated. Different processing strategies can be flexibly selected according to different operation stages and failure processing requirements to adapt to diverse business scenarios and abnormal situations. By presetting numerical requirements and reversal processing mechanisms, the risks and errors caused by transaction failures can be effectively reduced, and the reliability of overall transaction processing can be improved. When a transaction fails, through appropriate processing plans and reversal operations, the system can maintain data consistency and integrity, and avoid data inconsistency caused by erroneous processing.
[0097] On the basis of the above embodiments, when the target operation stage includes an accounting processing stage, a remittance refund processing stage or a reverse accounting processing stage, the method for determining the processing scheme corresponding to the transaction and the related transactions according to the operation stage corresponding to the transaction and the preset operation stage failure processing requirements may include: if the operation stage corresponding to the transaction is the target operation stage, performing error compensation processing on the transaction, and executing the transaction operation of the related transaction after processing; or, if the operation stage corresponding to the transaction is the target operation stage, executing the transaction operation of the transaction again based on the preset transaction call number.
[0098] In one example, if the operation phase corresponding to the transaction is the target operation phase, error compensation processing is performed on the transaction, and the transaction operation of the associated transaction is executed after the processing.
[0099] In another example, if the operation phase corresponding to the transaction is the target operation phase, the transaction operation of the transaction is executed again based on a preset number of transaction calls.
[0100] In another example, if the operation stage corresponding to the transaction is the target operation stage, the transaction operation of the transaction is executed again based on the preset transaction call number; the target transaction state and transaction call number after the transaction operation is executed again are determined; if the transaction call number is greater than the threshold and the target transaction state represents an operation failure, the transaction is error compensated, and the transaction operation of the related transaction is executed after processing.
[0101] The target operation stage may refer to a specific transaction processing stage. Error compensation processing may refer to measures taken after a transaction operation fails to correct or compensate for the error and ensure the correctness of the transaction. For example, in the account entry processing stage, if an amount error is found, the amount is automatically adjusted and re-entered; in the reverse account entry processing stage, if duplicate entries are found, the redundant entry records are revoked and the associated accounts are notified.
[0102] The preset transaction call number may refer to the maximum number of retries allowed after a transaction fails to ensure that the transaction is successful. For example, a bookkeeping requires the funds in account A to be transferred to account D, and the intermediate transactions include from A to B, then from B to C, and then from C to D. At this time, if the first two transactions are successful, but the transaction from C to D fails, in order to improve the efficiency of transaction processing, the transaction call number (such as 3 times) can be set. Within this number, the transaction information from C to D is called for operation retries. When the number is exceeded, error compensation or other processing methods are decided to reduce the possibility of manual participation and improve efficiency.
[0103] In one example, during the entry processing stage, if a network failure causes a failure, the system will automatically retry up to three times. During the remittance return processing stage, if the bank interface times out, the interface will be re-called according to the preset number of times. During the reverse entry processing stage, if a system error causes an operation failure, the system will automatically retry in the background.
[0104] The accuracy and integrity of transactions are ensured through error compensation and retry mechanisms. In the target operation phase, abnormal situations can be automatically identified and handled, reducing manual intervention and improving processing efficiency. Errors and failed transactions can be reduced through preset call times and intelligent retries, thereby improving user trust and satisfaction.
[0105] Based on the above embodiment, the method for reversing related transactions may include: reversing the related transactions to obtain a reversal result; if the reversal result does not meet the preset reversal requirements, traversing other transactions in the transaction information from the transaction sequence from large to small to obtain a reversal transaction that meets the reversal and resend conditions; and reversing the reversal transaction.
[0106] The reversal result may indicate a status or feedback of whether the reversal operation is successfully completed. The preset reversal requirement may refer to a specific condition or standard set during the reversal process to determine whether the reversal is successful.
[0107] The reversal retransmission condition may refer to a transaction that meets a specific condition and can be re-performed. Optionally, the condition may be obtained from the accounting request.
[0108] For example, the method of reversing the related transactions to obtain the reversal result may be to cancel the recorded debit and credit transactions in the case of a failed fund transfer. It may also be to adjust the account balance in the opposite direction for an erroneous bill payment. It may also be to cancel the erroneous entry and exit records in inventory management.
[0109] If the result of the reversal process does not meet the preset reversal process requirements, then the other transactions in the transaction information are traversed in order from the transaction sequence of the transaction, and the method for obtaining the reversal transactions that meet the reversal and resend conditions can be to start from the transaction with the largest sequence number, traverse backwards, select the conditions that clearly need to be reversed, and re-reverse these transactions. For example, there are transactions a, b, c, d, and e. When transaction d fails and needs to be reversed, the reversal and resend conditions can refer to reversal to the end of transaction a or reversal to the end of transaction b. It is also possible to check the log records of the reversal transactions to identify unsuccessful reversal operations. It is also possible to use business rules to identify transactions that need to be re-rectified.
[0110] The method for reversing a hedging transaction can be to re-initiate the cancellation operation of the unsuccessful reversal transaction; it can also be to mark the failed reversal transaction in the system and trigger manual review or intervention; it can also be to use automated tools to re-execute the reversal operation and record the results for auditing.
[0111] Through effective reversal processing, the consistency and integrity of transaction data can be ensured, and data inconsistencies caused by erroneous transactions can be reduced. In the event of a reversal failure, the preset reversal processing requirements and resend mechanism can be used to effectively reduce operational risks caused by transaction errors, reduce manual intervention, and improve processing efficiency and accuracy.
[0112] Based on the above embodiment, the accounting transaction processing method may further include: if the operation result represents that the operation is not clear, then according to the scenario requirements of the accounting request, determining the processing plan corresponding to the transaction and the related transaction; if the operation result represents that the operation is successful, then the corresponding transaction operation ends.
[0113] In this step, the operation result characterization operation is unclear, which may mean that the result of the transaction operation is unclear or uncertain, which may be caused by network delays, system errors or incomplete data.
[0114] The scenario requirements of accounting requests can refer to processing rules or policies set according to specific business scenarios or specific accounts, which are used to guide processing decisions in the case of unclear results. For example, the account requirements in a certain region are unclear and require re-entry or manual processing.
[0115] Optionally, when network delays cause unclear results, choose a waiting or retry strategy based on the business scenario; in the case of incomplete data, trigger the data completion process or request manual review; based on the transaction amount or priority, decide whether to execute the associated transaction immediately or postpone processing.
[0116] The result of the operation indicates that the operation is successful and can refer to the successful completion of the transaction operation and the satisfaction of all processing requirements and conditions. The end of the transaction operation can refer to the termination of the transaction processing flow, indicating that the transaction has been successfully processed and recorded. For example, after the transaction is successful, the account balance is updated and the transaction log is recorded; the user is notified that the transaction is completed and a transaction confirmation message is sent; other transaction processing or subsequent business processes are triggered, such as generating reports or updating statistical data.
[0117] By handling unclear results according to scenario requirements, we can flexibly respond to various abnormal situations and ensure business continuity. At the same time, through scenario-based processing solutions, more accurate decisions can be made, reducing user waiting time during manual operations and improving user satisfaction.
[0118] Based on the above embodiment, the method for obtaining transaction information described in S201 may include: receiving an accounting request, the accounting request including accounting information; parsing the accounting information based on preset data table structure requirements, generating a transaction, and transaction information corresponding to the transaction.
[0119] Among them, accounting information may refer to amount, interest accrual date, borrowing and lending direction, account number, account type, account institution number, customer number, customer name, customer's public or private attributes, home address information (or unit registration address) and other accounting related information.
[0120] The preset data table structure requirement may refer to a data format or structure pre-defined by the system for parsing and storing transaction information in order to ensure data consistency and integrity.
[0121] Optionally, the method for receiving the accounting request may be to receive a real-time transaction request from a bank's payment gateway, or to receive a batch of end-of-day settlement requests from an enterprise's internal ERP system, or to receive a transaction request from an order system of an e-commerce platform.
[0122] In one example, the received JSON, XML, and fixed-length messages are parsed into a unified JSON message, in which key information is extracted as logical fields, and the logical fields are used in subsequent processing; then, the message is inserted into a data table, and a connection is obtained from a connection pool, and the original message and the updated message are written to REDIS. Each stage of subsequent processing operations shares the same data table to ensure data consistency.
[0123] Through analysis based on the preset data table structure, the accuracy and consistency of transaction information is ensured, and data errors are reduced; through the automated analysis process, a large number of accounting requests can be quickly processed, improving overall processing efficiency
[0124] Figure 3 A schematic diagram of the interaction between modules during accounting transaction processing provided by this application, such as Figure 3 As shown, each module includes the main engine for import accounting, the main engine for export accounting, the public financial class library, the core external connection module, REDIS, the core system, various operation stages (pending, entering, transferring, reversing, remittance, reverse entry), resending of positive transactions, reversing transactions, resending of reversing transactions, and unclear adjustments.
[0125] Among them, the core module of the entire accounting processing of the main engine of the import accounting is responsible for receiving accounting requests from the outside. It classifies and processes accounting requests according to different conditions, and divides them into different stages such as pending accounts, entry, transfer, remittance, remittance, and reverse entry. At the same time, when processing key stages such as entry, remittance, and reverse entry, a daemon thread will be started to ensure the reliability of the transaction. In addition, it also coordinates operations such as resending positive transactions and reversing transactions, as well as handling unclear adjustments, and decides whether to make error compensation or retry multiple times to ensure the accuracy and stability of the entire accounting process.
[0126] The messages received by the main accounting engine may be JSON, XML, or fixed-length messages, which must be parsed into a unified JSON message. The key information in the message is extracted as logical fields, and the subsequent modules all use the logical fields. If the content is not included in the logical field, the main engine will insert the message into the data table after receiving the file, and obtain the connection from the connection pool, and write the original message and the updated message to REDIS. Among them, the operation of exporting the main accounting engine is similar to that of importing the main accounting engine, so it will not be described here.
[0127] After being imported into the main accounting engine, different microservice modules will be called according to the specific operation status. These modules share the same data table and operate on the same record. Multiple users may operate on the same record together. The latest version of the record is saved in REDIS. The optimistic locking method can be used. Only when the current user's version number is greater than the maximum version saved in REDIS (that is, when there are operations such as retransmission and reversal, the data will be greater than the data saved at the previous time), the table record is allowed to be operated. Otherwise, the transaction will be discarded.
[0128] When processing accounting requests, the main engine of import accounting may call functions and data in the public financial library. The public financial library can provide some common financial processing methods, rules and data models for the main engine of import accounting to ensure the accuracy and consistency of accounting. For example, the rules in the public financial library will be referred to when determining the amount of entry and performing financial accounting.
[0129] The core external connection module is mainly responsible for interacting with external systems, receiving accounting requests from the outside, and passing them to the main accounting engine for processing, acting as a bridge connecting external systems and internal accounting systems.
[0130] REDIS can be used as a cache layer for the main engine of the imported accounting. The main engine of the imported accounting can store some frequently accessed data, such as some accounting status information, commonly used configuration parameters, etc. in REDIS to improve the data reading speed. For example, when reissuing positive transactions and reversing transactions, the main engine of the imported accounting may use REDIS to quickly query previous transaction records and status in order to determine which transactions need to be resent or reversed.
[0131] The core system can provide underlying data storage, business logic support and system-level services for the main engine of bookkeeping, such as implementing simple and basic bookkeeping logic. The bookkeeping scenarios are standardized according to the amount, interest date, debit and credit direction, account number, account type, account institution number, customer number, customer name, customer public and private attributes, home address information (or unit registration address) and other bookkeeping related information, and are stored in the same structure (same data table). When calling the core system's transactions based on the bookkeeping information, the type of bookkeeping information needs to be extracted according to the interface through the configuration rules and sent to the core system.
[0132] When accounting requests are imported into the main accounting engine and classified into the account suspension stage, this stage mainly performs preliminary processing on these requests. Since the probability of failure in the account suspension stage is extremely low, an alarm will be generated in case of failure, and the business can intervene quickly, and the processing logic is relatively simple.
[0133] For the processing of the entry, return and reverse entry stages, it is necessary to start the daemon thread while the main engine of the entry accounting is suspended. If the transaction fails at this stage, error compensation is performed based on the daemon thread; the core accounting transaction can also be called multiple times within a specified number of times. If it fails more than the specified number of times, the status is set to failure.
[0134] The transfer stage can be responsible for handling fund transfer operations, transferring funds from one account to another or allocating funds between different accounts. The specific operation process and processing method are controlled by the main engine of the remittance accounting according to specific conditions.
[0135] When it is necessary to cancel a transfer operation that has already been carried out, the de-transfer stage is entered. The processing method can be similar to other stages. It is also necessary to consider the handling of failure situations. Error compensation or multiple retries can be performed according to different scenarios. The specific operations are coordinated by the main accounting engine.
[0136] Resending of positive transactions can refer to starting from the accounting entry with serial number 1, skipping the transactions that have been successfully recorded and resending them according to certain conditions. It is mainly used to reprocess positive transactions when some transactions fail or the status is unclear, so as to ensure the completeness and accuracy of the accounting. Among them, certain conditions can refer to the current status of each transaction (successful, failed, in progress, unconfirmed, etc.); error type (only certain types of errors can be resent); maximum number of resends (transactions exceeding the number need to be manually reviewed); business rules (certain high-priority transactions must be resent when they fail).
[0137] For example, during the account entry phase, if there is a failed or unclear transaction, a positive transaction resend will be called.
[0138] Among them, accounting entries can refer to records that indicate the accounts to be debited and credited and their amounts for a certain economic business, at least including the direction of the debit and credit, the name of the corresponding account (subject) and the amount to be recorded. According to accounting principles, accounting entries for bookkeeping always appear in pairs, and for the case of 1 debit and 1 credit, if the debit transaction is successful and the credit transaction clearly fails, the debit transaction must be reversed. This process must be orchestrated by services. Optionally, to deal with accounting entries of different numbers, a loop orchestration method is used instead of the original loop hard-coding method. It is necessary to make a lot of modifications to the Spring Cloud transaction management module and write multiple custom functions to achieve the balance of accounts.
[0139] Reversal of a transaction can refer to using the original transaction information and the original transaction number to logically clear the transaction, so that the customer cannot perceive the existence of the transaction. It should be noted that because the core system has certain entry restrictions (such as some accounts have interest value date restrictions and cannot be reversed), when the reversal transaction cannot be successful, you can choose to re-enter the account for accounting processing, but with the re-entry method, the customer can see two opposite transaction information in his account on the bill or system, which may cause the customer to receive two text messages, causing customer complaints.
[0140] Reversal transaction resending can refer to starting from the accounting entry with the largest serial number, traversing backwards, selecting the conditions that need to be reversed, and reversing these accounting entries. It is used to correct the erroneous transactions that have occurred and ensure the consistency of system data. Among them, the conditions that need to be reversed can refer to the reversal resending conditions.
[0141] Unclear adjustment refers to when a transaction is in an unclear state, it is judged according to different scenarios (account entry, remittance, reversal transaction resend, etc.), and whether to make error compensation or retry multiple times. This requires the coordinated processing of the main accounting engine and the daemon thread to ensure that the transaction in the unclear state can be properly processed as soon as possible. Among them, different scenarios can refer to the scenario requirements of the accounting request.
[0142] Optionally, the process orchestration of each module is implemented through a third-party interface provided by SAGA transactions.
[0143] It should be noted that for the case where the current account from the peripheral system is a CGL (general ledger) account, there may be a half-side account, that is, the core system is called only once. If an unclear situation occurs, the actual transaction result is obtained according to the number generated by the business, and after the table status is updated, it is further determined whether to continue execution forward or to compensate for errors backward. Whether it is imported into the main accounting engine or exported from the main accounting engine, it is necessary to send paired transaction relationships to the core external connection module after parsing the message and extracting key information to determine which transactions are a pair. When there is a system current account that is a CGL account, it is also necessary to clearly tell the CGL account that is paired with it. The peripheral system is used to accept transaction requests, extract the information required for accounting, and send the request message to the core system.
[0144] For example, each stage of bookkeeping has a post-processor, and for different failures or unknown scenarios, it is necessary to consider whether to roll back. Since the bank system has different systems for customer accounts and BGL accounts, the bookkeeping of customer accounts and BGL accounts is communicated through the system current account, and the bookkeeping requires the amount to be checked at the end of the day, and the money cannot be left in the system current account. Therefore, for paired transactions A1 and A2 with paired transaction relationships:
[0145] A1 transaction: debit the customer account and credit the system current account;
[0146] A2 transaction: debit the system current account and credit the BGL account.
[0147] If the A1 transaction fails, the entire transaction is terminated; if the A2 transaction fails, the A1 transaction needs to be reversed, i.e., compensated. The A1 transaction in the loop body represents the transaction at the odd position; the A2 transaction in the loop body represents the transaction at the even position.
[0148] However, in some special scenarios, it is necessary to skip certain transactions that will not be recorded. For example:
[0149] A3 transaction: third-party system transition account;
[0150] A4 transaction: Debit the third-party system transition account and credit the BGL account number.
[0151] In this case, A3 is actually an empty transaction; even if A4 fails to execute, since the compensation transaction of A3 is also an empty transaction, there is actually no execution action.
[0152] As another example, for scenarios where automatic payment cannot be made, there are four ways to achieve final payment:
[0153] Solution 1: The most commonly used solution, in which business personnel process the transaction in the core system, such as making a correction, changing the account status, and then re-initiating the entry.
[0154] Solution 2: This is also a commonly used solution, in which business personnel manually operate the peripheral system to enter the account.
[0155] Solution 3: The system automatically enters the account and specifies the maximum number of retries, usually 3 times, with an interval of 1 hour. This part is implemented in the requester module of the system.
[0156] Solution 4: This is basically the same as Solution 3, except that the implementation code is placed in the module that directly interacts with the core system. This solution may conflict with manual account adjustments, causing duplicate accounting and other serious consequences. This solution should not be used unless timeliness is extremely important.
[0157] Through the interaction between modules, the maximum extraction of accounting information is achieved, and all data items are stored in a unified structure, so that no matter what the scenario is, a data table is used for storage, so that all accounting has a set of logic, which improves the efficiency of accounting transaction processing; for positive transactions, it is processed from front to back polling; for reversing transactions, it is processed from back to front polling, which can efficiently process new business and easily skip successful transactions, and quickly correct errors, giving priority to erroneous transactions that may need to be corrected urgently recently, reducing the time affected by errors, ensuring data consistency, and avoiding subsequent transactions from being affected by unreversed transactions; building an accounting platform, each module implements the processing of distributed accounting transactions based on SAGA's service orchestration, improves processing efficiency, and facilitates the performance improvement of the entire accounting process, which is of great help in solving development manpower and taking over new and old functions of the system.
[0158] Figure 4 A schematic diagram of the structure of the accounting transaction processing device provided by this application, such as Figure 4 As shown, the accounting transaction processing device 40 provided in this embodiment includes:
[0159] The acquisition module 401 is used to acquire transaction information, where the transaction information is information related to the transaction extracted from the accounting request message;
[0160] The analysis module 402 is used to determine the paired transaction relationship in each transaction in the transaction information and the transaction sequence of each transaction, wherein the paired transaction relationship indicates that there is a correlation relationship between the lending and borrowing directions of two transactions;
[0161] A first determination module 403, used to determine the operation phase corresponding to each transaction according to the transaction information;
[0162] The processing module 404 is used to execute corresponding transaction operations for each transaction according to the operation phase, transaction information and transaction sequence corresponding to the transaction, and obtain the operation result;
[0163] A judgment module 405 is used to determine an associated transaction having a paired transaction relationship with the transaction if the operation result indicates that the operation has failed;
[0164] The second determination module 406 is used to determine the processing solutions corresponding to the transaction and the related transactions according to the transaction sequence, the related transactions and the preset operation stage failure processing requirements.
[0165] In a possible implementation, the first determining module 403 may also be used to:
[0166] Determine the transaction type of each transaction based on the transaction information;
[0167] According to the transaction type of each transaction, the corresponding operation stage of each transaction is determined. The operation stage includes the account processing stage, the account entry processing stage, the transfer processing stage, the reverse transfer processing stage, the foreign exchange refund processing stage and the reverse account entry processing stage.
[0168] In a possible implementation, the second determining module 406 may also be used to:
[0169] Determine whether the transaction sequence of the transaction meets the preset numerical requirements;
[0170] If the transaction sequence of the transaction meets the preset numerical requirements, the processing scheme corresponding to the transaction and the associated transactions is determined according to the operation phase corresponding to the transaction and the preset operation phase failure processing requirements;
[0171] If the transaction sequence of a transaction does not meet the preset numerical requirements, the associated transactions will be reversed.
[0172] In a possible implementation, the target operation stage includes: an account entry processing stage, a remittance return processing stage, or a reverse account entry processing stage;
[0173] The second determining module 406 may also be used to:
[0174] If the operation phase corresponding to the transaction is the target operation phase, error compensation processing is performed on the transaction, and the transaction operation of the associated transaction is executed after the processing;
[0175] or,
[0176] If the operation phase corresponding to the transaction is the target operation phase, the transaction operation of the transaction is executed again based on the preset transaction call times.
[0177] In a possible implementation, the second determining module 406 may also be used to:
[0178] Reverse the related-party transactions and obtain the reversal results;
[0179] If the reversal processing result does not meet the preset reversal processing requirements, then traverse other transactions in the transaction information from the transaction sequence in descending order to obtain the reversal transaction that meets the reversal and resend conditions;
[0180] Reverse the hedging transaction.
[0181] In a possible implementation, the determination module 405 may also be used to:
[0182] If the operation result represents an operation that is not clear, determine the processing plan corresponding to the transaction and related transactions based on the scenario requirements of the accounting request;
[0183] If the operation result indicates that the operation is successful, the corresponding transaction operation is completed.
[0184] In a possible implementation, the acquisition module 401 may also be used to:
[0185] receiving a billing request, the billing request including billing information;
[0186] Based on the preset data table structure requirements, the accounting information is parsed to generate transactions and corresponding transaction information.
[0187] The accounting transaction processing device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be described in detail here.
[0188] Figure 5 This is a schematic diagram of the structure of the electronic device provided in this application. Figure 5 As shown, the electronic device 50 provided in this embodiment includes: at least one processor 501 and a memory 502. Optionally, the device 50 also includes a communication component 503. The processor 501, the memory 502 and the communication component 503 are connected via a bus 504.
[0189] In a specific implementation process, at least one processor 501 executes the computer-executable instructions stored in the memory 502, so that at least one processor 501 executes the above method.
[0190] The specific implementation process of the processor 501 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0191] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0192] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.
[0193] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0194] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.
[0195] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.
[0196] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0197] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.
[0198] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as 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 mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0199] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0200] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0201] If the function is implemented in the form of 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, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0202] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0203] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A method for processing accounting transactions, characterized in that: include: Acquire transaction information, where the transaction information is information related to the transaction extracted from the accounting request message; Determine a paired transaction relationship in each transaction in the transaction information and a transaction sequence of each transaction, wherein the paired transaction relationship indicates that there is an association relationship between the lending and borrowing directions of two transactions; Determine, based on the transaction information, the operation phase corresponding to each transaction; For each transaction, according to the operation phase, transaction information and transaction sequence corresponding to the transaction, the corresponding transaction operation is performed to obtain the operation result; If the operation result indicates that the operation fails, determining an associated transaction having a paired transaction relationship with the transaction; According to the transaction sequence of the transaction, the related transactions and preset operation stage failure processing requirements, processing solutions corresponding to the transaction and the related transactions are determined.
2. The method according to claim 1, characterized in that Determining the operation phase corresponding to each transaction according to the transaction information includes: Determine the transaction type of each transaction based on the transaction information; According to the transaction type of each transaction, the operation stage corresponding to each transaction is determined, and the operation stage includes the account suspension processing stage, the account entry processing stage, the transfer processing stage, the reverse transfer processing stage, the foreign exchange refund processing stage and the reverse account entry processing stage.
3. The method according to claim 1, characterized in that The determining, according to the transaction sequence of the transaction, the related transaction and the preset operation phase failure processing requirement, a processing scheme corresponding to the transaction and the related transaction comprises: Determining whether the transaction sequence of the transaction meets a preset numerical requirement; If the transaction sequence of the transaction meets the preset numerical requirement, then according to the operation stage corresponding to the transaction and the preset operation stage failure processing requirement, determine the processing scheme corresponding to the transaction and the associated transaction; If the transaction sequence of the transaction does not meet the preset value requirement, the associated transaction is reversed.
4. The method according to claim 3, characterized in that The target operation stages include: accounting processing stage, remittance processing stage or reverse accounting processing stage; The determining, according to the operation stage corresponding to the transaction and the preset operation stage failure processing requirements, the processing scheme corresponding to the transaction and the associated transaction includes: If the operation phase corresponding to the transaction is the target operation phase, error compensation processing is performed on the transaction, and after the processing, the transaction operation of the associated transaction is executed; or, If the operation phase corresponding to the transaction is the target operation phase, the transaction operation of the transaction is executed again based on a preset transaction call number.
5. The method according to claim 3, characterized in that: The reversal of the related transaction includes: Performing reversal processing on the related-party transaction to obtain a reversal processing result; If the reversal processing result does not meet the preset reversal processing requirements, traverse the other transactions in the transaction information in order from the transaction sequence of the transaction from large to small, and obtain the reversal transaction that meets the reversal and reissue conditions; The reversal transaction is reversal processed.
6. The method according to claim 1, characterized in that The method further comprises: If the operation result represents an operation that is not clear, determining a processing solution corresponding to the transaction and the associated transaction according to the scenario requirements of the accounting request; If the operation result indicates that the operation is successful, the corresponding transaction operation ends.
7. The method according to claim 1, characterized in that The obtaining of transaction information includes: receiving a billing request, wherein the billing request includes billing information; Based on the preset data table structure requirements, the accounting information is parsed to generate transactions and transaction information corresponding to the transactions.
8. An accounting transaction processing device, characterized in that: include: An acquisition module, used to acquire transaction information, wherein the transaction information is transaction-related information extracted from the accounting request message; An analysis module, used to determine a paired transaction relationship in each transaction in the transaction information and a transaction sequence of each transaction, wherein the paired transaction relationship indicates that there is a correlation between the lending and borrowing directions of two transactions; A first determination module, configured to determine an operation phase corresponding to each transaction according to the transaction information; A processing module, configured to execute corresponding transaction operations for each transaction according to the operation phase, transaction information and transaction sequence corresponding to the transaction, and obtain operation results; A judgment module, configured to determine an associated transaction having a paired transaction relationship with the transaction if the operation result indicates that the operation has failed; The second determination module is used to determine the processing solutions corresponding to the transaction and the related transactions according to the transaction sequence of the transaction, the related transactions and the preset operation stage failure processing requirements.
9. An electronic device, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.