Accounting data processing method and system, electronic equipment and storage medium
By using wide-table vector forced validation and real-time debit-credit balance validation in the accounting system, combined with microservices and transaction patterns, the problems of real-time accuracy and dynamic resource adjustment in the accounting system were solved, and efficient accounting data processing was achieved.
Patent Information
- Application Number
- CN202511727781.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-24
- Publication Date
- 2026-02-10
AI Technical Summary
Existing accounting systems are inadequate in terms of real-time accuracy and dynamic resource adjustment. Traditional methods are highly coupled and complex to maintain, while distributed methods have low real-time performance and high risk, failing to meet the high requirements for real-time accuracy.
Forced validation is performed using wide table vectors, accounting information is obtained in real time and debit/credit balance is checked. Microservice RPC remote procedure calls and TCC or Saga transaction modes are used in combination with account-level validation to decouple the total and branch reconciliation process and reduce program complexity.
It effectively ensures the accuracy of accounting data under high real-time and accuracy requirements, reduces program complexity, avoids accounting discrepancies caused by aggregation errors, and improves the reliability of data processing.
Smart Images

Figure CN121504645A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, in particular to an accounting data processing method and system, an electronic device and a storage medium. BACKGROUND
[0002] An accounting system is a system for recording, processing and reporting financial transactions, which plays a key role in an enterprise. The accounting system ensures that each transaction is accurately recorded through strict verification mechanisms, thereby monitoring the flow of funds in the enterprise and helping to identify potential financial risks. Financial enterprises such as banks usually conduct multiple transaction confirmations and fund transfers in the same account within a very short period of time, so their accounting systems have very strict requirements for real-time accuracy.
[0003] The traditional method mainly uses a large machine to deploy all core systems on the same machine, and each module is coupled to each other and can be directly called. At the end of each transaction, the accounting module is called directly, and the database is updated only after the debit and credit verification of the accounting module. Since it is in the same local transaction, the modules are highly coupled, the processing efficiency is greatly improved, and the real-time accuracy is very high. The latest method is to use a distributed architecture and use a real-time data transmission tool to transmit transaction data to the accounting system for real-time debit and credit balance verification and batch processing at the end of the day.
[0004] However, the traditional method has a high degree of coupling, is complex to maintain, has a single fault risk, and cannot dynamically adjust resources according to business needs, so its performance is easily limited. Although the distributed method can dynamically adjust resources, its real-time degree is relatively low. Moreover, the existing method completely relies on the accuracy of the data after the application transaction, and there is a risk of misupdating non-accounting transactions, so it has a high risk. Therefore, the existing method cannot effectively meet the high requirements for real-time accuracy. SUMMARY
[0005] Based on the deficiencies of the prior art, the present application provides an accounting data processing method and system, an electronic device and a storage medium to solve the problem that the prior art cannot meet the real-time accuracy requirements.
[0006] To achieve the above object, the present application provides the following technical solutions:
[0007] The first aspect of the present application provides an accounting data processing method, comprising:
[0008] When performing a current transaction, based on the characteristic information of the current transaction, the update field of the current transaction is forcibly verified using a wide table vector; wherein the wide table vector is constructed based on the characteristic information and its label of multiple transactions in advance; the characteristic information at least includes transaction type and update field;
[0009] If the update field of the current transaction fails the mandatory check, the current transaction is blocked;
[0010] If the update field of the current transaction passes the mandatory check, the transaction of the current transaction is processed;
[0011] The account information of the current transaction is obtained in real time, and based on the account information of the current transaction, it is checked whether the current transaction is balanced; wherein, when the transaction of the current transaction is a distributed transaction, the account information of the current transaction is obtained in real time based on the rpc remote procedure call between microservices;
[0012] If it is checked that the current transaction is not balanced, the current transaction is blocked and the transaction of the current transaction is rolled back;
[0013] If it is checked that the current transaction is balanced, the transaction of the current transaction is completed, and the data of the current transaction is returned to the account platform;
[0014] Based on the details of the current transaction, the target account corresponding to the current transaction is subjected to account-level check; wherein, the account-level check at least includes continuity check and account-level total check;
[0015] If the target account passes the account-level check, the total reconciliation is performed at the end of the current period.
[0016] Optionally, in the above-mentioned account data processing method, further comprising:
[0017] The feature information of multiple transactions is obtained from the application service by the wide table data processing microservice, and the feature information of each transaction is labeled based on the feature information of each transaction to obtain the label of the feature information of each transaction;
[0018] The feature information of each transaction and its label are integrated to construct a wide table vector;
[0019] The wide table vector is subjected to vector embedding processing, and the wide table vector after processing is used to train the field check model.
[0020] Optionally, in the above-mentioned account data processing method, further comprising:
[0021] Based on the feature information of the current transaction, the update field of the current transaction is subjected to risk check by the field check model;
[0022] If the update field of the current transaction fails the risk check, a risk reminder is given.
[0023] Optionally, in the above-mentioned account data processing method, the real-time acquisition of the account information of the current transaction comprises:
[0024] If the transaction of the current transaction is completed on the application side microservice, the account information of the current transaction is acquired locally;
[0025] If the transaction of the current transaction is a distributed transaction based on the rpc remote procedure call between microservices, a message in which the account information of the current transaction is placed is transmitted to acquire the account information of the current transaction; wherein the account information of the current transaction is placed in the message header.
[0026] Optionally, in the above-mentioned account data processing method, the real-time acquisition of the account information of the current transaction and the verification of whether the current transaction is balanced based on the account information of the current transaction comprise:
[0027] Initiating a global transaction of the current transaction through a Tcc transaction mode to acquire an account of the current transaction through a one-phase transaction of the Tcc transaction mode, and verifying whether the current transaction is balanced based on the account information of the current transaction;
[0028] The blocking of the current transaction and the rollback of the transaction of the current transaction comprise:
[0029] Initiating a global transaction rollback through a two-phase of the Tcc transaction mode to block the current transaction and rollback the transaction of the current transaction.
[0030] Optionally, in the above-mentioned account data processing method, the real-time acquisition of the account information of the current transaction and the verification of whether the current transaction is balanced based on the account information of the current transaction comprise:
[0031] Based on a Saga transaction mode, the account information of the current transaction is transmitted through a transaction tree of the current transaction;
[0032] Each sub-node of the transaction tree of the current transaction sequentially performs a balance verification of a sub-node of the current transaction based on account information of the sub-node;
[0033] According to a balance verification result of a root node of the transaction tree of the current transaction, it is determined whether the current transaction is balanced.
[0034] The second aspect of the present application provides an account data processing system, comprising:
[0035] A field validation unit is used to perform mandatory validation on the updated fields of the current transaction based on the feature information of the current transaction and using a wide table vector when executing the current transaction; wherein, the wide table vector is pre-constructed based on the feature information and labels of multiple transactions; the feature information includes at least the transaction type and the updated field;
[0036] The first blocking unit is used to block the current transaction when the updated field of the current transaction fails the mandatory verification.
[0037] A transaction processing unit is used to process the transaction of the current transaction when the updated field of the current transaction passes the mandatory validation.
[0038] The balance verification unit is used to obtain the accounting information of the current transaction in real time, and verify whether the lending and borrowing of the current transaction are balanced based on the accounting information of the current transaction; wherein, when the transaction of the current transaction is a distributed transaction, the accounting information of the current transaction is obtained in real time based on RPC remote procedure calls between microservices.
[0039] The second blocking unit is used to block the current transaction and roll back the current transaction when the current transaction is found to be unbalanced in terms of borrowing and lending.
[0040] The transaction completion unit is used to complete the transaction of the current transaction when the current transaction loan balance is verified, and to send the data of the current transaction back to the accounting platform;
[0041] The account verification unit is used to perform account-level verification on the target account corresponding to the current transaction based on the details of the current transaction; wherein the account-level verification includes at least continuity verification and account-level total score verification.
[0042] The reconciliation unit is used to perform total and sub-reconciliation at the end of the current period when the target account passes the account-level verification.
[0043] Optionally, the above-mentioned accounting data processing system may also include:
[0044] The labeling unit is used to obtain feature information of multiple transactions from the application service through the wide table data processing microservice, and to label each transaction based on its feature information to obtain the label of each transaction's feature information.
[0045] The building unit is used to integrate the feature information and labels of each transaction to construct a wide table vector;
[0046] The feature processing unit is used to perform vector embedding processing on the wide table vector and to train the field validation model using the processed wide table vector.
[0047] Optionally, the above-mentioned accounting data processing system may also include:
[0048] The risk verification unit is used to perform risk verification on the updated fields of the current transaction based on the feature information of the current transaction and through the field verification model.
[0049] The alert unit is used to issue a risk alert when the updated field of the current transaction fails the risk verification.
[0050] Optionally, in the above-described accounting data processing system, when the balancing verification unit performs the real-time acquisition of the accounting information of the current transaction, it is used to:
[0051] If the current transaction is completed entirely within the application-side microservice, then the accounting information for the current transaction is retrieved locally.
[0052] If the current transaction is a distributed transaction, a message containing the current transaction's accounting information is transmitted based on RPC remote procedure calls between microservices to obtain the current transaction's accounting information; wherein, the current transaction's accounting information is placed in the message header.
[0053] Optionally, in the above-mentioned accounting data processing system, the balance verification unit includes:
[0054] The first balance verification unit initiates a global transaction for the current transaction through the Tcc transaction mode, obtains the account of the current transaction through the one-phase transaction of the Tcc transaction mode, and verifies whether the current transaction's borrowing and lending are balanced based on the accounting information of the current transaction.
[0055] The second blocking unit includes:
[0056] The second blocking subunit is used to initiate a global transaction rollback through the two-phase Tcc transaction mode to block the current transaction and roll back the current transaction.
[0057] Optionally, in the above-mentioned accounting data processing system, the balance verification unit includes:
[0058] The message passing unit is used to pass the accounting information of the current transaction through the transaction tree of the current transaction based on the Saga transaction mode;
[0059] The node verification unit is used to perform loan balance verification of its own child nodes in turn based on its own accounting information through each child node of the transaction tree of the current transaction.
[0060] The result determination unit is used to determine whether the lending and borrowing of the current transaction are balanced based on the lending and borrowing balance verification result of the root node of the transaction tree of the current transaction.
[0061] A third aspect of this application provides an electronic device, comprising:
[0062] Memory and processor;
[0063] The memory is used to store programs;
[0064] The processor is used to execute the program, which, when executed, is specifically used to implement the accounting data processing method as described in any of the above.
[0065] A fourth aspect of this application provides a computer storage medium for storing a computer program, which, when executed by a processor, is used to implement the accounting data processing method as described in any of the preceding claims.
[0066] This application provides a method for processing accounting data, which constructs a wide table vector based on the feature information and labels of multiple transactions. The feature information includes at least the transaction type and update fields. When executing the current transaction, the update fields of the current transaction are forcibly validated using the wide table vector based on the transaction's feature information. If the update fields fail the forced validation, the current transaction is blocked. If the update fields pass the forced validation, the transaction is processed, thereby validating the update fields using the constructed wide table vector to ensure the correctness of the accounting data. The accounting information of the current transaction is obtained in real time, and the balance of debits and credits in the current transaction is verified based on this information. When the current transaction is a distributed transaction, accounting information is obtained through RPC remote procedure calls between microservices, thereby improving data transmission speed and real-time verification. If an imbalance in debits and credits is detected in the current transaction, the current transaction is blocked and rolled back. If the debits and credits are balanced, the current transaction is completed, and the data is sent back to the accounting platform. Finally, based on the details of the current transaction, account-level verification is performed on the target account corresponding to the current transaction. This account-level verification includes at least continuity verification and account-level total score verification. If the target account fails the account-level verification, an alert is issued for that account. If the target account passes the account-level verification, a total score reconciliation is performed at the end of the current period. This process of verification before aggregation decouples the two steps, reducing program complexity and preventing account imbalances due to aggregation errors, effectively ensuring data accuracy. Therefore, it effectively meets the high requirements of real-time performance and accuracy. Attached Figure Description
[0067] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, 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 embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0068] Figure 1 A flowchart illustrating an accounting data processing method provided in this application embodiment;
[0069] Figure 2 A flowchart illustrating a method for preprocessing transaction feature information provided in this application embodiment;
[0070] Figure 3 A flowchart illustrating a method for obtaining real-time accounting information of current transactions, provided for the implementation of this application;
[0071] Figure 4 A flowchart illustrating a method for performing a loan balance check on the current transaction, provided in an embodiment of this application;
[0072] Figure 5 A flowchart illustrating another method for performing a loan balance check on the current transaction, provided in an embodiment of this application;
[0073] Figure 6 This application provides a schematic diagram of the architecture of an accounting data processing system.
[0074] Figure 7 This is a schematic diagram of the architecture of an electronic device provided in an embodiment of this application. Detailed Implementation
[0075] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0076] In this application, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0077] This application provides a method for processing accounting data, such as... Figure 1 As shown, it includes the following steps:
[0078] S101. When executing the current transaction, based on the feature information of the current transaction, use a wide table vector to perform mandatory validation on the updated fields of the current transaction.
[0079] The wide table vector is pre-constructed based on the feature information and labels of multiple transactions. The feature information includes at least the transaction type and the update field.
[0080] It should be noted that during business processing, a discrepancy may occur when the previous day's accounts are balanced, but the total and sub-accounts are not. After investigation, it was found that this was due to erroneous updates of accounting-related fields, such as the next closing date, by non-active transactions. In other words, erroneous updates by non-active transactions are currently prone to occur. To address this issue, this embodiment pre-labels the database fields that need updating based on the characteristic information of a large number of transactions involved, and constructs a wide table vector using the transaction characteristic information and labels to record the fields that can be updated for each type of transaction. Therefore, each time the application executes a transaction, based on the current transaction's characteristic information, the wide table vector is used to perform mandatory validation on the updated fields of the current transaction, i.e., to verify whether the current transaction can update its updated fields.
[0081] Optionally, in order to construct a wide table vector, another embodiment of this application further includes a preprocessing method for transaction feature information, such as... Figure 2 As shown, it includes:
[0082] S201. Obtain feature information of multiple transactions from the application service through the wide table data processing microservice, and label each transaction based on its feature information to obtain the label of each transaction's feature information.
[0083] Optionally, the wide table data processing microservice can obtain characteristic information from the application service, including but not limited to the name, type, and database fields to be updated of the transaction, and then label them, such as fixed deposit freeze (management transaction, authorization level, freeze type) and next last transaction date (accounting attribute, last transaction date migration).
[0084] S202. Integrate the feature information and labels of each transaction to construct a wide vector table.
[0085] Specifically, the processed features and labels are integrated to form a wide table structure. In this wide table, each row represents a transaction sample, and each column represents a feature or label, ultimately forming a standardized set of feature vectors. This is equivalent to obtaining some rules, such as that management transactions should not modify accounting attributes, and the last transaction date should be the same as the last transaction date before the transaction.
[0086] S203. Perform vector embedding processing on the wide table vector, and use the processed wide table vector to train the field validation model.
[0087] It's important to note that different applications have inconsistent and numerous fields, resulting in sparse label features. Furthermore, many fields possess semantic multiplicity, applicable to both administrative and passive account transactions. Therefore, labeling existing data only considers a subset of cases. Consequently, for the high-dimensional sparse features, vector embedding is employed to map them to a low-dimensional dense vector space while preserving their semantic information. The embedded vectors can then be used as model input, allowing machine learning techniques to autonomously improve the expressive power and predictive performance of the field validation model, thus validating all cases.
[0088] Therefore, optionally, in another embodiment of this application, it further includes:
[0089] Based on the characteristic information of the current transaction, a field validation model is used to perform risk validation on the updated fields of the current transaction.
[0090] If the updated field of the current transaction fails the risk verification, a risk warning will be issued.
[0091] It should be noted that due to the inherent uncertainties of artificial intelligence, the rules for obtaining information through this channel are not mandatory; they are merely used as a risk control reminder. Of course, it can also be used as a method to quickly pinpoint the source of accounting problems after they have occurred.
[0092] S102. Determine whether the updated fields of the current transaction have passed the mandatory validation.
[0093] If the updated field of the current transaction fails the mandatory validation, then step S103 is executed. If the updated field of the current transaction passes the mandatory validation, then step S104 is executed.
[0094] S103, Block the current transaction.
[0095] S104. Process the transaction of the current transaction.
[0096] S105. Obtain the current transaction's accounting information in real time, and verify whether the current transaction's lending and borrowing are balanced based on the current transaction's accounting information.
[0097] It should be noted that the key to real-time verification of loan and credit balance in transactions is to obtain the station information generated by the transaction as soon as possible. Therefore, during the processing of the current transaction, the accounting information of the current transaction is obtained in real time, and the loan and credit balance of the current transaction is verified based on the accounting information of the current transaction. If the current transaction is found to be unbalanced, step S106 is executed. If the current transaction is found to be balanced, step S107 is executed.
[0098] If the current transaction is a distributed transaction, that is, it involves multiple nodes, then it relies on RPC remote procedure calls between microservices to obtain real-time accounting information, and uses the real-time accounting information to determine whether the loan and credit balance of the transaction is balanced, thus achieving real-time verification.
[0099] Optionally, in another embodiment of this application, a specific implementation method for obtaining the current transaction's accounting information in real time is as follows: Figure 3 As shown, it includes:
[0100] S301. Determine whether the current transaction is a distributed transaction.
[0101] If the current transaction is not a distributed transaction, meaning it is completed entirely within a single application-side microservice, and all accounting information can be obtained locally in a timely manner, then step S302 is executed directly. If the current transaction is a distributed transaction, then step S303 is executed.
[0102] S302. Obtain the accounting information for the current transaction from the local machine.
[0103] S303. Based on RPC remote procedure calls between microservices, transmit a message containing the accounting information of the current transaction to obtain the accounting information of the current transaction.
[0104] The accounting information for the current transaction is placed in the message header.
[0105] For distributed transactions, in order to obtain accounting information from various distributed nodes in real time, we directly rely on the original RPC remote procedure calls between microservices. This not only allows us to obtain accounting information in real time, but also reduces the communication overhead between microservices.
[0106] Optionally, parsing the accounting information as a fixed field in the message header is faster; while placing it in the message body requires calling an interface for parsing, but allows for encryption, making it more secure. Considering that both are core applications that directly call the information, this embodiment chooses to place it in the message header in exchange for speed.
[0107] Optionally, in another embodiment of this application, one specific implementation of step S105 includes:
[0108] Initiate a global transaction for the current transaction using the TCC transaction mode, obtain the account for the current transaction through a one-phase transaction of the TCC transaction mode, and verify whether the current transaction's lending and borrowing are balanced based on the current transaction's accounting information.
[0109] It's important to note that TCC (Transaction Conformity Control) is a mode for resolving data consistency issues between multiple services. To ensure simultaneous commit or rollback of data, TCC divides distributed transactions into two phases: the first phase handles resource reservation, and the second phase ensures simultaneous commit or rollback. Therefore, TCC transmits the accounting information of each node participating in the current transaction.
[0110] Specifically, the application system initiates a global transaction, requesting the transaction coordinator. The transaction coordinator accepts the request and assigns a global transaction code to the initiator. The initiator processes branch transactions, and each part of the current transaction sends requests to the participating systems for their processing. Based on the return results of the transaction, the initiating application notifies the transaction coordinator to commit or rollback the global transaction and waits for the transaction coordinator to complete the second phase of processing all branch transactions. The TCC transaction mode has only one layer of depth. In the first phase, all accounting information can be obtained by receiving the return results of the participating systems' transactions and is validated in the same way as local transactions. Correspondingly, if the validation fails, the second phase initiates a global transaction rollback.
[0111] Therefore, in this embodiment of the application, one specific implementation of step S106 is as follows:
[0112] A global transaction rollback is initiated through the second phase of the Tcc transaction mode to block the current transaction and roll back the current transaction.
[0113] Optionally, in another embodiment of this application, the borrow-save balance check is performed using the Saga transaction mode. Therefore, correspondingly, another specific implementation of step S105 is as follows: Figure 4 As shown, it includes:
[0114] S401, based on the Saga transaction mode, transmits the accounting information of the current transaction through the transaction tree of the current transaction.
[0115] Saga transaction pattern is a model for solving data consistency among multiple services, and it is a type of compensatory distributed transaction. The core idea of Saga distributed transaction is to break down the overall distributed global transaction into multiple microservice branch transactions with atomicity, which are coordinated by the Saga transaction coordinator. If all branch transactions complete normally, the global transaction can be completed normally. If a step fails, the compensation operation is called in reverse order.
[0116] However, the Saga transaction pattern exhibits multiple nested behaviors. For example... Figure 5 As shown, in a nested transaction scenario, application A is both the initiator of a branch transaction of the outer global transaction initiated by initiator O (O initiates three branch transactions: L, A, and D) and the initiator of the inner global transaction (A initiates two branch transactions: B and C). Therefore, it cannot directly communicate with all the branch transaction modules, or direct communication would be too costly. The current approach typically involves retrieving the lending information from microservices B and C from service A, thereby obtaining all the accounting information from L, A, D, B, and C from initiator O for lending verification. While this approach works well for simple transactions, complex transactions increase the number of branches, drastically increasing the amount of data that RPC messages need to carry, even to the point of requiring network packet splitting. This increases the likelihood of network jitter compensation, leading to decreased availability, which is unacceptable for a distributed system. Therefore, this architecture adopts a tree structure to organize the transmission of accounting information, thereby avoiding excessive message volume.
[0117] S402. Each child node of the transaction tree of the current transaction performs a loan balance check on its own child node based on its own accounting information.
[0118] Accordingly, during the loan balance verification, each sub-node sequentially performs its own loan balance verification based on its own accounting information, forming a result as follows: Figure 5 The structure shown is: {Depth, Lending Information, Lending Summary of Child Nodes}. This way, each node only needs to process the accounting information of its own child nodes. If the lending balance is not balanced at the root node, it indicates an imbalance in the lending balance of previous transactions, requiring the transaction to be blocked and a rollback compensation performed.
[0119] S403. Based on the loan balance verification result of the root node of the transaction tree of the current transaction, determine whether the loan balance of the current transaction is balanced.
[0120] S106. Block the current transaction and roll back the current transaction.
[0121] S107. Complete the current transaction and send the data of the current transaction back to the accounting platform.
[0122] S108. Based on the details of the current transaction, perform account-level verification on the target account corresponding to the current transaction.
[0123] Account-level verification includes at least continuity verification and account-level total score verification.
[0124] It should be noted that general ledger reconciliation involves comparing the total number of transactions, total balance, and total transaction amount to see if they match. Sub-ledger reconciliation involves comparing the detailed data to see if they match. Total-sub-ledger reconciliation involves comparing the total ledger calculated from the detailed data to see if they match, for example, calculating whether the balance for the current day equals yesterday's balance + recharges - consumption. Assuming the summary program is functioning correctly, account-level balance is a necessary and sufficient condition for overall ledger balance. Therefore, in this embodiment, pre-checking account balance and separating the balancing and summary processes into two separate procedures helps decouple accounting operations and reduces the complexity of troubleshooting accounting problems.
[0125] Specifically, every transaction will modify the account balance and daily transaction details, so obtaining this information does not require additional table reading overhead. The newly added details include the "pre-transaction balance" and "post-transaction balance" fields, along with the existing transaction amount and account balance. The "previous day's last transaction date balance" field can then be used for continuity verification and account-level total score verification. Continuity verification is as follows: Post-transaction balance for each transaction on the current day = Pre-transaction balance + Net transaction amount for that sub-account. Account-level total score verification is as follows: Daily transaction amount = Account balance - Previous day's last transaction date balance = Daily transaction amount.
[0126] For batch transactions, the following can be further verified: Checking the balance of the general ledger before the transaction: General ledger balance before transaction = Sum of individual ledger balances before transaction. Checking the balance of the general ledger after the transaction: General ledger balance after transaction = Sum of individual ledger balances after transaction. Checking the continuity of the general ledger: General ledger balance after transaction = General ledger balance before transaction + General ledger changes.
[0127] By performing account-level verification on the target account corresponding to the current transaction, if the verification fails (i.e., an imbalance or error is detected), an alert is promptly generated for investigation, reducing financial risk. If the target account passes the account-level verification, a total reconciliation can be performed at the end of the current period.
[0128] S109. Determine whether the target account corresponding to the current transaction has passed the account-level verification.
[0129] If the target account corresponding to the previous transaction passes the account-level verification, then step S110 is executed.
[0130] S110. Perform a total reconciliation at the end of the current period.
[0131] The system typically operates on a daily cycle, so the balances are aggregated at the end of each day to reconcile the total and individual accounts and transmit the data to the accounting platform.
[0132] This application provides an accounting data processing method that constructs a wide table vector based on the feature information and labels of multiple transactions. The feature information includes at least the transaction type and update fields. When executing the current transaction, the update fields of the current transaction are forcibly validated using the wide table vector based on the transaction's feature information. If the update fields fail the forced validation, the current transaction is blocked. If the update fields pass the forced validation, the transaction is processed, thereby validating the update fields using the constructed wide table vector to ensure the correctness of the accounting data. The accounting information of the current transaction is acquired in real time, and the balance of debits and credits in the current transaction is verified based on this information. When the current transaction is a distributed transaction, accounting information is obtained through RPC remote procedure calls between microservices, thereby improving data transmission speed and real-time verification. If an imbalance in debits and credits is detected in the current transaction, the current transaction is blocked and rolled back. If the debits and credits are balanced, the current transaction is completed, and the data is sent back to the accounting platform. Finally, based on the details of the current transaction, account-level verification is performed on the target account corresponding to the current transaction. This account-level verification includes at least continuity verification and account-level total score verification. If the target account fails the account-level verification, an alert is issued for that account. If the target account passes the account-level verification, a total score reconciliation is performed at the end of the current period. This process of verification before aggregation decouples the two steps, reducing program complexity and preventing account imbalances due to aggregation errors, effectively ensuring data accuracy. Therefore, it effectively meets the high requirements of real-time performance and accuracy.
[0133] Another embodiment of this application provides an accounting data processing system, such as... Figure 6 As shown, it includes:
[0134] The field validation unit 601 is used to perform mandatory validation on the updated fields of the current transaction based on the feature information of the current transaction and using a wide table vector when executing the current transaction. The wide table vector is pre-constructed based on the feature information and labels of multiple transactions. The feature information includes at least the transaction type and the updated fields.
[0135] The first blocking unit 602 is used to block the current transaction when the updated field of the current transaction fails the mandatory validation.
[0136] The transaction processing unit 603 is used to process the transaction of the current transaction when the updated field of the current transaction passes the mandatory validation.
[0137] The balance verification unit 604 is used to obtain the accounting information of the current transaction in real time and verify whether the current transaction's borrowing and lending are balanced based on the accounting information. Specifically, when the current transaction is a distributed transaction, the accounting information of the current transaction is obtained in real time based on RPC remote procedure calls between microservices.
[0138] The second blocking unit 605 is used to block the current transaction and roll back the current transaction when an imbalance between lending and borrowing is detected.
[0139] The transaction completion unit 606 is used to complete the transaction of the current transaction when the current transaction loan balance is verified, and to send the data of the current transaction back to the accounting platform.
[0140] The account verification unit 607 is used to perform account-level verification on the target account corresponding to the current transaction based on the details of the current transaction. The account-level verification includes at least continuity verification and account-level total score verification.
[0141] Reconciliation unit 608 is used to perform total and sub-reconciliation at the end of the current period when the target account passes the account-level verification.
[0142] Optionally, in another embodiment of the accounting data processing system provided in this application, the system further includes:
[0143] The labeling unit is used to obtain feature information of multiple transactions from application services through the wide table data processing microservice, and to label each transaction based on its feature information to obtain the label of each transaction's feature information.
[0144] The building unit is used to integrate the feature information and labels of each transaction to construct a wide table vector.
[0145] The feature processing unit is used to perform vector embedding on the wide table vector and to train the field validation model using the processed wide table vector.
[0146] Optionally, in another embodiment of the accounting data processing system provided in this application, the system further includes:
[0147] The risk verification unit is used to perform risk verification on the updated fields of the current transaction based on the characteristic information of the current transaction and through the field verification model.
[0148] The alert unit is used to issue a risk alert when the updated field of the current transaction fails the risk validation.
[0149] Optionally, in the accounting data processing system provided in another embodiment of this application, when the balancing verification unit performs real-time acquisition of the accounting information of the current transaction, it is used for:
[0150] If the current transaction is completed entirely within the application-side microservice, then the accounting information for the current transaction is retrieved locally.
[0151] If the current transaction is a distributed transaction, a message containing the current transaction's accounting information is transmitted via RPC remote procedure calls between microservices to retrieve the current transaction's accounting information. The accounting information for the current transaction is placed in the message header.
[0152] Optionally, in another embodiment of the accounting data processing system provided in this application, the balance verification unit includes:
[0153] The first balance verification unit initiates a global transaction for the current transaction through the Tcc transaction mode, obtains the account of the current transaction through the first-phase transaction of the Tcc transaction mode, and verifies whether the current transaction's borrowing and lending are balanced based on the current transaction's accounting information.
[0154] The second blocking unit in this embodiment includes:
[0155] The second blocking subunit is used to initiate a global transaction rollback through the two-phase Tcc transaction mode to block the current transaction and roll back the current transaction.
[0156] Optionally, in another embodiment of the accounting data processing system provided in this application, the balance verification unit includes:
[0157] The message passing unit is used to pass the accounting information of the current transaction through the transaction tree of the current transaction, based on the Saga transaction pattern.
[0158] The node verification unit is used to perform borrowing and lending balance verification on each child node of the transaction tree of the current transaction based on its own accounting information.
[0159] The result determination unit is used to determine whether the lending and borrowing of the current transaction are balanced based on the lending and borrowing balance verification result of the root node of the transaction tree of the current transaction.
[0160] It should be noted that the specific working process of each unit provided in the above embodiments of this application can be referred to the implementation process of the corresponding steps in the above method embodiments, and will not be repeated here.
[0161] Another embodiment of this application provides an electronic device, such as... Figure 7 As shown, it includes:
[0162] Memory 701 and processor 702.
[0163] The memory 701 is used to store the program.
[0164] The processor 702 is used to execute the program stored in the memory 701. When the program is executed, it is specifically used to implement the accounting data processing method provided in any of the above embodiments.
[0165] Another embodiment of this application provides a computer storage medium for storing a computer program, which, when executed by a processor, is used to implement the accounting data processing method provided in any of the above embodiments.
[0166] Computer storage media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0167] Those skilled in the art will further 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, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. 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.
[0168] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for processing accounting data, characterized in that, include: When executing the current transaction, based on the feature information of the current transaction, a wide table vector is used to perform mandatory validation on the update field of the current transaction; wherein, the wide table vector is pre-constructed based on the feature information and labels of multiple transactions; the feature information includes at least the transaction type and the update field; If the updated field of the current transaction fails the mandatory validation, the current transaction will be blocked. If the updated field of the current transaction passes the mandatory validation, then the transaction of the current transaction will be processed. The system obtains the accounting information of the current transaction in real time and verifies whether the current transaction's borrowing and lending are balanced based on the accounting information. When the current transaction is a distributed transaction, the system obtains the accounting information of the current transaction in real time based on RPC remote procedure calls between microservices. If the current transaction is found to be unbalanced in terms of borrowing and lending, then the current transaction is blocked and rolled back. If the current transaction is found to be in a balanced state, the transaction is completed and the data of the current transaction is sent back to the accounting platform. Based on the details of the current transaction, an account-level verification is performed on the target account corresponding to the current transaction; wherein, the account-level verification includes at least continuity verification and account-level total score verification; If the target account passes the account-level verification, a total reconciliation will be performed at the end of the current period.
2. The method according to claim 1, characterized in that, Also includes: The microservice for wide table data processing obtains feature information of multiple transactions from the application service, and tags each transaction based on its feature information to obtain the label of each transaction's feature information. The feature information and labels of each transaction are integrated to construct a wide vector table; The wide table vector is subjected to vector embedding processing, and the processed wide table vector is used to train the field validation model.
3. The method according to claim 2, characterized in that, Also includes: Based on the feature information of the current transaction, the updated fields of the current transaction are subjected to risk verification through the field verification model; If the updated field of the current transaction fails the risk verification, a risk warning will be issued.
4. The method according to claim 1, characterized in that, The real-time acquisition of the current transaction's accounting information includes: If the current transaction is completed entirely within the application-side microservice, then the accounting information for the current transaction is retrieved locally. If the current transaction is a distributed transaction, a message containing the current transaction's accounting information is transmitted based on RPC remote procedure calls between microservices to obtain the current transaction's accounting information; wherein, the current transaction's accounting information is placed in the message header.
5. The method according to claim 1, characterized in that, The step of acquiring the accounting information of the current transaction in real time and verifying whether the loan balance of the current transaction is balanced based on the accounting information of the current transaction includes: Initiate a global transaction for the current transaction using the TCC transaction mode, obtain the account for the current transaction through a one-phase transaction of the TCC transaction mode, and verify whether the current transaction's borrowing and lending are balanced based on the current transaction's accounting information; The transaction that blocks and rolls back the current transaction includes: A global transaction rollback is initiated through the two-phase Tcc transaction mode to block the current transaction and roll back the current transaction.
6. The method according to claim 1, characterized in that, The step of acquiring the accounting information of the current transaction in real time and verifying whether the loan balance of the current transaction is balanced based on the accounting information of the current transaction includes: Based on the Saga transaction pattern, the accounting information of the current transaction is transmitted through the transaction tree of the current transaction; Each child node of the transaction tree of the current transaction performs a loan balance check on its own child node based on its own accounting information in turn. Based on the loan balance verification result of the root node of the transaction tree of the current transaction, determine whether the loan balance of the current transaction is balanced.
7. An accounting data processing system, characterized in that, include: A field validation unit is used to perform mandatory validation on the updated fields of the current transaction based on the feature information of the current transaction and using a wide table vector when executing the current transaction; wherein, the wide table vector is pre-constructed based on the feature information and labels of multiple transactions; the feature information includes at least the transaction type and the updated field; The first blocking unit is used to block the current transaction when the updated field of the current transaction fails the mandatory verification. A transaction processing unit is used to process the transaction of the current transaction when the updated field of the current transaction passes the mandatory validation. The balance verification unit is used to obtain the accounting information of the current transaction in real time, and verify whether the lending and borrowing of the current transaction are balanced based on the accounting information of the current transaction; wherein, when the transaction of the current transaction is a distributed transaction, the accounting information of the current transaction is obtained in real time based on RPC remote procedure calls between microservices. The second blocking unit is used to block the current transaction and roll back the current transaction when the current transaction is found to be unbalanced in terms of borrowing and lending. The transaction completion unit is used to complete the transaction of the current transaction when the current transaction loan balance is verified, and to send the data of the current transaction back to the accounting platform; The account verification unit is used to perform account-level verification on the target account corresponding to the current transaction based on the details of the current transaction; wherein the account-level verification includes at least continuity verification and account-level total score verification. The reconciliation unit is used to perform total and sub-reconciliation at the end of the current period when the target account passes the account-level verification.
8. The system according to claim 7, characterized in that, Also includes: The labeling unit is used to obtain feature information of multiple transactions from the application service through the wide table data processing microservice, and to label each transaction based on its feature information to obtain the label of each transaction's feature information. The building unit is used to integrate the feature information and labels of each transaction to construct a wide table vector; The feature processing unit is used to perform vector embedding processing on the wide table vector and to train the field validation model using the processed wide table vector.
9. An electronic device, characterized in that, include: Memory and processor; The memory is used to store programs; The processor is used to execute the program, which, when executed, is specifically used to implement the accounting data processing method as described in any one of claims 1 to 6.
10. A computer storage medium, characterized in that, Used to store a computer program, which, when executed by a processor, is used to implement the accounting data processing method as described in any one of claims 1 to 6.