Accounting processing method and device, equipment and medium
By identifying the original transaction information of the correct transaction and generating the reverse first sub-accounting entry, and generating the second sub-accounting entry for the compensation entry based on the total resource value of different transaction stages, the problem that the relationship between the correct transaction and the original transaction is difficult to intuitively reflect, and the accuracy of the total resource value of the account and the accuracy of the detailed records that will be recorded are achieved.
Patent Information
- Application Number
- CN202411784734.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-03-28
AI Technical Summary
In the details of the change of resource value that will be recorded, it is difficult to intuitively reflect the relationship between the positive transaction and the original transaction, which makes it difficult to guarantee the correctness of the total resource value of the account.
By identifying the original transaction information carried by the correct transaction, the first sub-accounting entry for the correct transaction is generated, the resource value changes of the original transaction are recorded in reverse, and the second sub-accounting entry for the correct transaction is generated based on the total resource value of the account at different trading stages, and the resource value difference between the original transaction and the correct transaction is compensated.
The correlation relationship between the positive transaction and the original transaction is intuitively reflected in the details of the change of resource value that will be recorded, and the accuracy of the total resource value of the account is ensured.
Smart Images

Figure CN119722356A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to an accounting processing method, apparatus, device and medium. Background Technology
[0002] Taking commercial banks as an example, when a commercial bank opens a resource value account (hereinafter referred to as the account for ease of description) with a financial institution, it usually maintains a corresponding shadow account within its own accounting system. Accounting entries are made based on this shadow account to reflect the actual changes in the account's balances. When the shadow account is an overdraft account, the accounting entries may include details of resource value changes for both the normal principal account and the overdraft principal account.
[0003] It is a common scenario where reversing previous accounting transactions (referred to as the original transaction for ease of description) is necessary due to certain technical or business reasons. In related technologies, such as when other transactions occur between the original transaction and the reversing transaction, reversing the original transaction can usually only guarantee the accuracy of the account's total resource value to a certain extent.
[0004] However, given that the accuracy of the total resource value of the account can be guaranteed, how to intuitively reflect in the details of resource value changes in the accounting entries which the reversal transaction is against which the original transaction is reversed, that is, how to intuitively reflect the relationship between the reversal transaction and the original transaction, is a technical problem that urgently needs to be solved. Summary of the Invention
[0005] This application provides an accounting processing method, apparatus, equipment, and medium that, while ensuring the accuracy of the total resource value of the account, visually reflects the relationship between the reversal transaction and the original transaction in the resource value change details of the accounting entries.
[0006] Firstly, this application provides an accounting processing method, the method comprising:
[0007] If a reversal transaction is received for any account, identify the information of the original transaction carried by the reversal transaction; based on the information of the original transaction, obtain the information of the first resource value of the normal principal account and the overdraft principal account of the original transaction recorded in the accounting entry;
[0008] Based on the information of the first resource value, the information of the first sub-accounting entry of the reversal transaction is generated, wherein the second resource value of the normal principal account and the overdraft principal account in the first sub-accounting entry is the opposite of the resource value of the corresponding account in the first resource value;
[0009] Based on the obtained total resource value of the account before the original transaction, the total resource value after the original transaction, the total resource value before the reversal transaction, and the total resource value after the reversal transaction, information on the resource value of the normal principal account and the overdraft principal account in the second sub-accounting entry of the reversal transaction is generated. The second sub-accounting entry is used to compensate for the difference in resource value between the original transaction and the reversal transaction.
[0010] In one possible implementation, the step of generating information on the resource values of the normal principal account and the overdraft principal account in the second sub-accounting entry of the reversal transaction based on the obtained first total resource value of the account before the original transaction, second total resource value after the original transaction, third total resource value before the reversal transaction, and fourth total resource value after the reversal transaction includes:
[0011] Among the first total resource value, the second total resource value, the third total resource value, and the fourth total resource value, the total resource value with a positive resource value is classified into the normal principal group, and the total resource value with a negative resource value is classified into the overdraft principal group.
[0012] For the normal principal group and the overdraft principal group, the resource weighted cumulative value of the corresponding group is determined according to the total resource value of each group and the preset calculation factor corresponding to each total resource value; and the resource value information of the corresponding account in the second sub-accounting entry is determined according to the resource weighted cumulative value of the corresponding group.
[0013] In one possible implementation, the step of determining the resource value of the corresponding account in the second sub-accounting entry based on the resource weighted cumulative value of the corresponding group includes:
[0014] For each group, if the weighted cumulative value of resources for that group is positive, the debit / credit direction of the corresponding account in the second sub-accounting entry will be determined as debit, and the resource value transaction value of the corresponding account in the second sub-accounting entry will be determined as the weighted cumulative value of resources.
[0015] If the weighted cumulative value of resources in the group is negative, the debit / credit direction of the corresponding account in the second sub-accounting entry will be determined as the credit side, and the resource value transaction value of the corresponding account in the second sub-accounting entry will be determined as the absolute value of the weighted cumulative value of resources.
[0016] In one possible implementation, the preset operation factors for the first total resource value and the third total resource value are both first values, and the preset operation factors for the second total resource value and the fourth total resource value are both second values, wherein the first value is a negative number, the second value is a positive number, and the absolute values of the first value and the second value are the same.
[0017] In one possible implementation, after generating the information for the first sub-accounting entry of the reversal transaction and before generating the information for the resource values of the normal principal account and the overdraft principal account in the second sub-accounting entry of the reversal transaction, the method further includes:
[0018] The process involves determining whether the total value of the third resource is the same as the total value of the second resource. If not, the next step is to generate information on the resource values of the normal principal account and the overdraft principal account in the second sub-accounting entry for the reversal transaction.
[0019] In one possible implementation, after generating the information for the first sub-accounting entry of the reversal transaction and before generating the information for the resource values of the normal principal account and the overdraft principal account in the second sub-accounting entry of the reversal transaction, the method further includes:
[0020] Determine whether there are both positive and negative numbers among the first total resource value, the second total resource value, the third total resource value, and the fourth total resource value. If so, proceed to the step of generating the resource value information of the normal principal account and the overdraft principal account in the second sub-accounting entry of the reversal transaction.
[0021] Secondly, this application provides an accounting processing apparatus, the apparatus comprising:
[0022] The acquisition module is used to identify the information of the original transaction carried by the reversal transaction if a reversal transaction for any account is received; and to obtain the information of the first resource value of the normal principal account and the overdraft principal account of the original transaction recorded in the accounting entries based on the information of the original transaction.
[0023] The first generation module is used to generate information of the first sub-accounting entry of the reversal transaction based on the information of the first resource value, wherein the second resource value of the normal principal account and the overdraft principal account in the first sub-accounting entry is the opposite of the resource value of the corresponding account in the first resource value;
[0024] The second generation module is used to generate information on the resource values of the normal principal account and the overdraft principal account in the second sub-accounting entry of the reversal transaction based on the first total resource value of the account before the original transaction, the second total resource value after the original transaction, the third total resource value before the reversal transaction, and the fourth total resource value after the reversal transaction. The second sub-accounting entry is used to compensate for the difference in resource values between the original transaction and the reversal transaction.
[0025] In one possible implementation, the second generation module is specifically used for:
[0026] Among the first total resource value, the second total resource value, the third total resource value, and the fourth total resource value, the total resource value with a positive resource value is classified into the normal principal group, and the total resource value with a negative resource value is classified into the overdraft principal group.
[0027] For the normal principal group and the overdraft principal group, the resource weighted cumulative value of the corresponding group is determined according to the total resource value of each group and the preset calculation factor corresponding to each total resource value; and the resource value information of the corresponding account in the second sub-accounting entry is determined according to the resource weighted cumulative value of the corresponding group.
[0028] In one possible implementation, the second generation module is specifically used for:
[0029] For each group, if the weighted cumulative value of resources for that group is positive, the debit / credit direction of the corresponding account in the second sub-accounting entry will be determined as debit, and the resource value transaction value of the corresponding account in the second sub-accounting entry will be determined as the weighted cumulative value of resources.
[0030] If the weighted cumulative value of resources in the group is negative, the debit / credit direction of the corresponding account in the second sub-accounting entry will be determined as the credit side, and the resource value transaction value of the corresponding account in the second sub-accounting entry will be determined as the absolute value of the weighted cumulative value of resources.
[0031] In one possible implementation, the preset operation factors for the first total resource value and the third total resource value are both first values, and the preset operation factors for the second total resource value and the fourth total resource value are both second values, wherein the first value is a negative number, the second value is a positive number, and the absolute values of the first value and the second value are the same.
[0032] In one possible implementation, the second generation module is further configured to:
[0033] The process involves determining whether the total value of the third resource is the same as the total value of the second resource. If not, the next step is to generate information on the resource values of the normal principal account and the overdraft principal account in the second sub-accounting entry for the reversal transaction.
[0034] In one possible implementation, the second generation module is further configured to:
[0035] Determine whether there are both positive and negative numbers among the first total resource value, the second total resource value, the third total resource value, and the fourth total resource value. If so, proceed to the step of generating the resource value information of the normal principal account and the overdraft principal account in the second sub-accounting entry of the reversal transaction.
[0036] Thirdly, this application provides an electronic device, comprising:
[0037] Memory, used to store program instructions;
[0038] A processor is configured to invoke program instructions stored in the memory and execute the steps of the method described in any one of the first aspects according to the obtained program instructions.
[0039] Fourthly, this application provides a computer-readable storage medium storing a computer program, the computer program including program instructions that, when executed by a computer, cause the computer to perform the method as described in any one of the first aspects.
[0040] Fifthly, this application provides a computer program product comprising: computer program code, which, when run on a computer, causes the computer to perform the method described in any one of the first aspects.
[0041] In this embodiment, when reversing the original transaction, the information of the first sub-accounting entry for the reversal transaction can be generated based on the first resource value information of the normal principal account and overdraft principal account of the original transaction recorded in the accounting entry. The second resource value of the normal principal account and overdraft principal account in the first sub-accounting entry is the opposite of the resource value of the corresponding account in the first resource value. Thus, the relationship between the reversal transaction and the original transaction can be intuitively reflected in the resource value change details of the accounting entry. In addition, the information of the resource value of the normal principal account and overdraft principal account in the second sub-accounting entry for the reversal transaction, which is used to compensate for the difference in resource value between the original transaction and the reversal transaction, can be generated based on the first total resource value of the account before the original transaction, the second total resource value after the original transaction, the third total resource value before the reversal transaction, and the fourth total resource value after the reversal transaction. Thus, not only can the relationship between the reversal transaction and the original transaction be intuitively reflected in the resource value change details of the accounting entry, but the accuracy of the total resource value of the account can also be guaranteed. Attached Figure Description
[0042] To more clearly illustrate the implementation methods in the embodiments of this application or related technologies, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings.
[0043] Figure 1 The diagram illustrates a first type of accounting process provided by some embodiments;
[0044] Figure 2The diagram illustrates a second accounting process provided by some embodiments;
[0045] Figure 3 A schematic diagram of an accounting processing apparatus provided in some embodiments is shown;
[0046] Figure 4 A schematic diagram of an electronic device structure provided by some embodiments is shown. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. 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. Unless otherwise specified, the embodiments and features in the embodiments of this application can be arbitrarily combined with each other. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here.
[0048] The terms "first" and "second" in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the term "comprising" and any variations thereof are intended to cover non-exclusive protection. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices. The term "multiple" in this application can mean at least two, for example, two, three, or more, and the embodiments of this application do not impose limitations.
[0049] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of this application, including various details to aid understanding. These embodiments should be considered merely exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this application. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description. It should be noted that in the embodiments of this application, certain existing industry solutions such as software, components, and models may be mentioned. These should be considered exemplary, intended only to illustrate the feasibility of implementing the technical solutions of this application, and do not imply that the applicant has already used or necessarily used such solutions.
[0050] The acquisition, transmission, storage, and use of data in this application all comply with the requirements of relevant national laws and regulations.
[0051] Before introducing the accounting processing method provided in the embodiments of this application, the technical background of the embodiments of this application will be introduced first for ease of understanding.
[0052] Taking commercial banks as an example, when a commercial bank opens an account with a financial institution, it usually maintains a corresponding shadow account within its own accounting system. Accounting entries are made based on this shadow account to reflect the actual changes in the account's balances. When the shadow account is an overdraft account, the accounting entries may include details of resource value changes for both the normal principal account and the overdraft principal account.
[0053] It is a common scenario where reversing previous accounting transactions (original transactions) is necessary due to certain technical or business reasons. In related technologies, for example, when other transactions occur between the original transaction and the corresponding reversing transaction, reversing the original transaction can usually only guarantee the accuracy of the account's total resource value (also known as total resource value) to a certain extent.
[0054] For example, suppose that before the first accounting transaction (original transaction) occurs, the initial balance of the account is 30 yuan. The information of the normal principal account resource value in the accounting entry is: debit 30 yuan, and the information of the overdraft principal account resource value is: credit 0 yuan.
[0055] Assuming the first accounting transaction (the original transaction) was a credit of 50 yuan (a reduction of 50 yuan), the account balance (the total resource value after the original transaction) changed from 30 yuan to -20 yuan. In the corresponding accounting entry for the original transaction, the information for the normal principal account resource value is: credit 30 yuan, and the information for the overdraft principal account resource value is: credit 20 yuan.
[0056] Suppose that an additional accounting transaction occurs between the original transaction and the reversal transaction: a debit of 30 yuan (an increase of 30 yuan). At this time, the account balance (total resource value) changes from -20 yuan to 10 yuan. In the journal entry corresponding to this additional accounting transaction, the information for the normal principal account resource value is: debit 10 yuan, and the information for the overdraft principal account resource value is: debit 20 yuan. Here, debit (debit side) indicates an increase in resource value, and credit (credit side) indicates a decrease in resource value.
[0057] Suppose a reversal transaction is made against the original transaction: a debit of 50 yuan (an increase of 50 yuan). At this time, the account balance (total resource value) changes from 10 yuan to 60 yuan. This reversal transaction is then treated as a separate new transaction, and the journal entry for this reversal transaction is generated as follows: Debit 50 yuan for the normal principal account and Debit 0 yuan for the overdraft principal account.
[0058] It can be seen that, because the information of the normal principal account resource value in the accounting entry corresponding to the original transaction is: credit 30 yuan, and the information of the overdraft principal account resource value is: credit 20 yuan; while the information of the normal principal account resource value in the accounting entry corresponding to the reversal transaction is: debit 50 yuan, and the information of the overdraft principal account resource value is: debit 0 yuan, when observing the information of the normal principal account resource value and the overdraft principal account resource value in the accounting entries separately, because the amounts of the corresponding account resource values in the accounting entries of the original transaction and the reversal transaction are not equal, it is not possible to intuitively reflect from the resource value change details of the accounting entries which original transaction the reversal transaction is against, that is, it is not possible to intuitively reflect the relationship between the reversal transaction and the original transaction.
[0059] In view of this, in order to ensure the accuracy of the total resource value of the account and to intuitively reflect the relationship between the reversing transaction and the original transaction in the resource value change details of the accounting entries, this application proposes an accounting processing method, apparatus, device, and medium. Some preferred embodiments of this application are described below with reference to the accompanying drawings.
[0060] Example 1:
[0061] Figure 1 The diagram illustrates a first type of accounting process provided by some embodiments, such as Figure 1 As shown, the process includes the following steps:
[0062] S101: If a reversal transaction is received for any account, identify the information of the original transaction carried by the reversal transaction; based on the information of the original transaction, obtain the information of the first resource value of the normal principal account and the overdraft principal account of the original transaction recorded in the accounting entry.
[0063] The accounting processing method provided in this application is applied to electronic devices, such as personal computers (PCs), mobile terminals, servers, etc., and this application does not specifically limit them.
[0064] In one possible implementation, when it is necessary to reverse a certain original transaction in any account, the staff can trigger a reversal transaction (also known as a reversal request) for that original transaction. After receiving the reversal transaction, the electronic device can identify the information of the original transaction carried in the reversal transaction, such as the transaction identifier of the original transaction, and obtain the resource value (for ease of description, the original transaction's resource value is referred to as the first resource value) of the normal principal account and overdraft principal account recorded in the accounting entry. The resource value can also be referred to as funds. In addition to the resource value information of the normal principal account and overdraft principal account, the accounting entry may also include information such as transaction time and transaction identifier. This application does not specifically limit this.
[0065] For example, suppose the initial resource value (funds) in an account (such as our NOSTRO account) is 30 yuan, and the original transaction that needs to be reversed is a credit (reduction) of 50 yuan. After the original transaction, the total resource value of the account changes from 30 yuan to -20 yuan. The information of the first resource value (also referred to as the first resource value) of the normal principal account of the original transaction recorded in the accounting entry is: credit 30 yuan (i.e., reduction of 30 yuan), and the information of the first resource value of the overdraft principal account is: credit 20 yuan.
[0066] S102: Based on the information of the first resource value, generate the information of the first sub-accounting entry for the reversal transaction, wherein the second resource value of the normal principal account and the overdraft principal account in the first sub-accounting entry is the opposite of the resource value of the corresponding account in the first resource value.
[0067] In one possible implementation, to visually represent the relationship (also known as the reverse relationship) between the reversal transaction and the original transaction in the details of resource value changes in the accounting entries, the information of the first sub-accounting entry for the reversal transaction can be generated based on the first resource value information of the normal principal account and overdraft principal account of the original transaction recorded in the accounting entries. That is, the original transaction can be reversed. Specifically, the resource values of the normal principal account and overdraft principal account in this first sub-accounting entry (for ease of description, the resource values of both the normal principal account and overdraft principal account in the first sub-accounting entry are referred to as the second resource values) are the opposite of the first resource values of the corresponding accounts in the original transaction recorded in the accounting entries. For example, the second resource value of the normal principal account in the first sub-accounting entry and the first resource value of the normal principal account in the original transaction may be opposite in amount, but with the same debit / credit direction; similarly, the second resource value of the overdraft principal account in the first sub-accounting entry and the first resource value of the overdraft principal account in the original transaction may be opposite in amount, but with the same debit / credit direction. For example, suppose the first resource value of the normal principal account recorded in the accounting entry is: credit 30 yuan, and the first resource value of the overdraft principal account is: credit 20 yuan. Then the second resource value of the normal principal account in the first sub-accounting entry can be: credit -30 yuan, and the second resource value of the overdraft principal account can be: credit -20 yuan.
[0068] Furthermore, when the second resource value of the normal principal account and the overdraft principal account in the first sub-accounting entry is the opposite of the first resource value of the corresponding account in the original transaction recorded in the accounting entry, it can also be that the second resource value of the normal principal account in the first sub-accounting entry is the same amount as the first resource value of the normal principal account in the original transaction, but the debit and credit directions are opposite; and the second resource value of the overdraft principal account in the first sub-accounting entry is the same amount as the first resource value of the overdraft principal account in the original transaction, but the debit and credit directions are opposite. For example, assuming that the first resource value of the normal principal account in the original transaction recorded in the accounting entry is: credit 30 yuan, and the first resource value of the overdraft principal account is: credit 20 yuan, then the second resource value of the normal principal account in the first sub-accounting entry can be: debit 30 yuan, and the second resource value of the overdraft principal account can be: debit 20 yuan.
[0069] Since the second resource values of the normal principal account and the overdraft principal account in the first sub-accounting entry of the reversal transaction are opposite to the resource values of the corresponding accounts of the original transaction recorded in the accounting entry, the details of resource value changes in the accounting entry can intuitively show which original transaction the reversal transaction is against, that is, intuitively show the relationship (reverse relationship) between the reversal transaction and the original transaction.
[0070] S103: Based on the obtained first total resource value of the account before the original transaction, second total resource value after the original transaction, third total resource value before the reversal transaction, and fourth total resource value after the reversal transaction, generate information on the resource values of the normal principal account and the overdraft principal account in the second sub-accounting entry of the reversal transaction, wherein the second sub-accounting entry is used to compensate for the difference in resource values between the original transaction and the reversal transaction.
[0071] In one possible implementation, considering that other transactions may occur between the original transaction and the reversal transaction, in order to intuitively reflect the relationship between the reversal transaction and the original transaction in the resource value change details of the accounting entries while ensuring the accuracy of the total resource value of the account, the total account balance before the original transaction (referred to as the first total resource value for ease of description), the total account balance after the original transaction (referred to as the second total resource value for ease of description), the total account balance before the reversal transaction (referred to as the third total resource value for ease of description), and the total account balance after the reversal transaction (referred to as the fourth total resource value for ease of description) can be obtained. Based on the above first total resource value, second total resource value, third total resource value, and fourth total resource value, the resource value information of the normal principal account and overdraft principal account in the second sub-accounting entry of the reversal transaction is generated. The second sub-accounting entry is used to compensate (make up) the resource value difference between the original transaction and the reversal transaction, ensuring the accuracy of the total resource value of the account.
[0072] In other words, in order to visually reflect the relationship between the reversal transaction and the original transaction in the details of resource value changes in the accounting entries, while also ensuring the accuracy of the total resource value of the account, the accounting entries for reversal transactions can be decomposed into two parts. One part is the first sub-accounting entry, which is used to visually reflect the relationship between the reversal transaction and the original transaction in the details of resource value changes in the accounting entries. The other part is the second sub-accounting entry, which is used to compensate (make up) the difference in resource value between the original transaction and the reversal transaction, so as to ensure the accuracy of the total resource value of the account.
[0073] In one possible implementation, when generating the resource value information for the normal principal account and overdraft principal account in the second sub-accounting entry for a reversal transaction based on the account's first total resource value before the original transaction, the second total resource value after the original transaction, the third total resource value before the reversal transaction, and the fourth total resource value after the reversal transaction, the resource values (total resource values) with positive resource values among the first, second, third, and fourth total resource values can be first grouped into the normal principal group, and the resource values (total resource values) with negative resource values among the first, second, third, and fourth total resource values can be grouped into the overdraft principal group. Since a resource value of zero does not affect the size of the account's total resource value, the resource values with a resource value of zero among the first, second, third, and fourth total resource values do not need to be grouped.
[0074] After dividing the first total resource value, the second total resource value, the third total resource value, and the fourth total resource value into a normal principal group and an overdraft principal group, the resource weighted cumulative value of the corresponding group can be determined based on each total resource value in the corresponding group and the preset calculation factor corresponding to each total resource value.
[0075] The original transaction resource value is calculated as follows: Original transaction resource value = Post-transaction second total resource value (Original transaction ending balance) - Post-transaction first total resource value (Original transaction beginning balance). The reversed transaction resource value is the opposite of the original transaction resource value, i.e., the reversed transaction resource value (also called the existing reversed resource value) = (-1) × (Post-transaction second total resource value - Post-transaction first total resource value). When recording the resource value difference compensation, two parts can be considered: the first part is the reverse of the existing reversed transaction resource value, and the second part is the resource value before and after the reversed transaction. Specifically, the first part, the reverse of the existing reversed transaction resource value, = (-1) × (-1) × (Post-transaction second total resource value - Post-transaction first total resource value). The second part, the resource value before and after the reversed transaction, = Post-transaction fourth total resource value (Reversed transaction ending balance) - Post-transaction third total resource value (Reversed transaction beginning balance). Based on the above considerations, the preset calculation factors for the first total resource value before the original transaction and the third total resource value before the reverse transaction can be configured as negative numbers (first values) such as -1, and the preset calculation factors for the second total resource value after the original transaction and the fourth total resource value after the reverse transaction can be configured as positive numbers (second values) such as 1. The first value is negative, the second value is positive, and the absolute values of the first and second values are the same.
[0076] For example, assuming the total value of the first resource before the original transaction is 30 yuan, the total value of the second resource after the original transaction is -20 yuan, the total value of the third resource before the reversal transaction is 10 yuan, and the total value of the fourth resource after the reversal transaction is 60 yuan, then the first resource total value of 30 yuan, the third resource total value of 10 yuan, and the fourth resource total value of 60 yuan with positive resource values can be classified into the normal principal group, and the second resource total value of -20 yuan with negative resource value can be classified into the overdraft principal group. Assuming that the preset operation factor for the first and third resource total values is -1, and the preset operation factor for the second and fourth resource total values is 1, then in the normal principal group, the resource weighted sum of each resource total value and its corresponding preset operation factor is: first resource total value 30 yuan × (-1) + third resource total value 10 yuan × (-1) + fourth resource total value 60 yuan × 1 = 20 yuan. In the overdraft principal group, the resource weighted sum of each total resource value and its corresponding preset calculation factor is: Second total resource value (-20) yuan × 1 = -20 yuan.
[0077] After determining the resource-weighted cumulative value for the normal principal group and the overdraft principal group, the resource value information for the normal principal account and the overdraft principal account in the second sub-accounting entry can be determined based on the resource-weighted cumulative value for the normal principal group and the overdraft principal group. The resource value information for the normal principal account and the overdraft principal account in the accounting entry can include two parts: the debit / credit direction and the resource value transaction value. For example, when determining the resource value information for the normal principal account and the overdraft principal account in the second sub-accounting entry, regardless of whether it is for the normal principal group or the overdraft principal group, if the resource-weighted cumulative value of that group is positive, then the debit / credit direction of the corresponding account in the second sub-accounting entry can be determined as debit (also referred to as a debit), and the resource value transaction value of the corresponding account can be determined as the resource-weighted cumulative value of that group. If the weighted cumulative value of resources for a group is negative, then the debit / credit direction of that group in the second sub-accounting entry can be determined as a credit (also known as a loan), and the transaction value of the resource value of that group can be determined as the absolute value of the weighted cumulative value of resources for that group.
[0078] For example, when the weighted cumulative value of resources in the normal principal group is 20 yuan, the debit and credit direction of the normal principal account in the second sub-accounting entry can be debit, and the resource transaction value of the normal principal account in the second sub-accounting entry can be 20 yuan. In other words, the resource value information of the normal principal account in the second sub-accounting entry can be: debit 20 yuan (debit 20 yuan).
[0079] When the weighted cumulative value of resources in the overdraft principal group is -20 yuan, the debit / credit direction of the overdraft principal account in the second sub-accounting entry can be credit, and the resource transaction value of the overdraft principal account in the second sub-accounting entry can be 20 yuan. In other words, the resource value information of the overdraft principal account in the second sub-accounting entry can be: credit 20 yuan (credit 20 yuan).
[0080] For another example, when the weighted cumulative value of resources in the normal principal group is -50 yuan, the debit and credit direction of the normal principal account in the second sub-accounting entry can be credit, and the resource transaction value of the normal principal account in the second sub-accounting entry can be 50 yuan. In other words, the resource value information of the normal principal account in the second sub-accounting entry can be: credit 50 yuan (credit 50 yuan).
[0081] When the weighted cumulative value of resources in the overdraft principal group is 30 yuan, the debit and credit direction of the overdraft principal account in the second sub-accounting entry can be debit, and the resource transaction value of the overdraft principal account in the second sub-accounting entry can be 30 yuan. In other words, the resource value information of the overdraft principal account in the second sub-accounting entry can be: debit 30 yuan (debit 30 yuan).
[0082] To facilitate understanding, the accounting process provided in this application will be explained below through a specific embodiment.
[0083] Assume that before the first accounting transaction (original transaction) occurs, the initial balance of the account is 30 yuan. The information of the normal principal account resource value in the accounting entry (for ease of description, this accounting entry will be referred to as the first accounting entry) is: debit 30 yuan, and the information of the overdraft principal account resource value is: credit 0 yuan.
[0084] Assuming the first accounting transaction (the original transaction) was a credit of 50 yuan (a reduction of 50 yuan), the account balance (the total resource value after the original transaction) changed from 30 yuan to -20 yuan. The corresponding accounting entry for the original transaction (hereinafter referred to as the second accounting entry for ease of description) shows the following information for the normal principal account resource value: credit 30 yuan, and the overdraft principal account resource value: credit 20 yuan.
[0085] Suppose that an additional accounting transaction occurs between the original transaction and the reversal transaction: a debit of 30 yuan (an increase of 30 yuan). At this time, the account balance (total resource value) changes from -20 yuan to 10 yuan. The information of the normal principal account resource value in the corresponding accounting entry for this additional accounting transaction (for ease of description, this accounting entry will be referred to as the third accounting entry below) is: debit 10 yuan, and the information of the overdraft principal account resource value is: debit 20 yuan.
[0086] Suppose a reversal transaction is made against the original transaction: a debit of 50 yuan (an increase of 50 yuan). At this time, the account balance (total resource value) changes from 10 yuan to 60 yuan. Since the information of the normal principal account resource value in the accounting entry corresponding to the original transaction is: credit 30 yuan, and the information of the overdraft principal account resource value is: credit 20 yuan, in order to intuitively reflect the relationship between the reversal transaction and the original transaction in the resource value change details of the accounting entries, the original transaction is reversed, generating the first sub-accounting entry for the reversal transaction. The information of the normal principal account resource value in this first sub-accounting entry can be: credit -30 yuan, and the information of the overdraft principal account resource value can be: credit -20 yuan.
[0087] Afterwards, the total value of the first resource before the original transaction is 30 yuan, the total value of the second resource after the original transaction is -20 yuan, the total value of the third resource before the reversal transaction is 10 yuan, and the total value of the fourth resource after the reversal transaction is 60 yuan. At this point, the process of generating the second sub-accounting entry for the reversal transaction can be performed as described above.
[0088] Specifically, the first resource total of 30 yuan, the third resource total of 10 yuan, and the fourth resource total of 60 yuan (all with positive values) can be assigned to the normal principal group, while the second resource total of -20 yuan (with a negative value) can be assigned to the overdraft principal group. Assuming the preset operation factors for the first and third resource totals are -1, and the preset operation factors for the second and fourth resource totals are 1, then in the normal principal group, the weighted cumulative value of each resource total with its corresponding preset operation factor is: 30 yuan × (-1) + 10 yuan × (-1) + 60 yuan × 1 = 20 yuan. In the overdraft principal group, the weighted cumulative value of each resource total with its corresponding preset operation factor is: (-20) yuan × 1 = -20 yuan.
[0089] Then, based on the weighted cumulative value of resources for the corresponding groups, the resource value information for the corresponding accounts in the second sub-accounting entry can be determined. Specifically, the resource value information for the normal principal account in the second sub-accounting entry can be: debit 20 yuan (debit 20 yuan), and the resource value information for the overdraft principal account in the second sub-accounting entry can be: credit 20 yuan (credit 20 yuan).
[0090] In other words, the reversal transaction corresponds to two sub-accounting entries: the first and the second. In the first sub-accounting entry, the resource value for the normal principal account is: credit -30 yuan, and the resource value for the overdraft principal account is: credit -20 yuan. In the second sub-accounting entry, the resource value for the normal principal account is: debit 20 yuan, and the resource value for the overdraft principal account is: credit 20 yuan. Summing the resource values of the corresponding accounts in these two sub-accounting entries yields the total accounting entry for the reversal transaction (hereinafter referred to as the fourth accounting entry for ease of description). In this entry, the resource value for the normal principal account is: debit 50 yuan, and the resource value for the overdraft principal account is: credit 0 yuan. This aligns with actual circumstances. Furthermore, the first sub-accounting entry clearly shows the relationship (reverse relationship) between the reversal transaction and the original transaction, while the second sub-accounting entry clearly shows the difference adjustment caused by other transactions between the original and reversal transactions.
[0091] Furthermore, by summing the resource values of the corresponding accounts in the first, second, third, and fourth accounting entries mentioned above, we can obtain the resource value (resource value information) for the normal principal account as: debit 30 yuan + credit 30 yuan + debit 10 yuan + debit 50 yuan = debit 60 yuan, and the resource value for the overdraft principal account as: 0 yuan + credit 20 yuan + debit 20 yuan + credit 0 yuan = credit 0 yuan. The total resource value (balance) of the account is 60 yuan. Both the total resource value of the account and the total sub-resource values of the normal principal account and the overdraft principal account in the accounting entries are consistent with reality. As can be seen, the accounting processing method provided in this application embodiment can not only intuitively show which original transaction the reversal transaction is against in the resource value change details of the accounting entries, but also ensure the accuracy of the total resource value of the account, as well as the accuracy of the total resource value of the sub-resources of the normal principal account and the total resource value of the overdraft principal account in the accounting entries.
[0092] Additionally, it's worth noting that for reversal transactions, if only the original transaction is reversed in the accounting entry without considering compensating for the resource value difference caused by other transactions between the original and reversal transactions, the accuracy of the total resource value of the account may be guaranteed to some extent. However, the accuracy of the total resource value of the sub-resources in the normal principal account and the total resource value of the overdraft principal account in the accounting entry may not be guaranteed. For example, using the above embodiment, assuming the accounting entry for the reversal transaction only includes the first sub-accounting entry and not the second, then the information for the resource value of the normal principal account in the accounting entry for the reversal transaction (hereinafter referred to as the 4'th accounting entry for ease of description) is: Debit 30 yuan, and the information for the resource value of the overdraft principal account is: Debit 20 yuan.
[0093] By summing the resource values of the corresponding accounts in the first, second, third, and fourth accounting entries above, we can obtain the resource value (resource value information) for the normal principal account as: debit 30 yuan + credit 30 yuan + debit 10 yuan + debit 30 yuan = debit 40 yuan, and the resource value for the overdraft principal account as: 0 yuan + credit 20 yuan + debit 20 yuan + debit 20 yuan = credit -20 yuan. However, the actual resource value for the normal principal account should be: debit 60 yuan, and the resource value for the overdraft principal account should be: credit 0 yuan. It can be seen that the total sub-resource value of both the normal principal account and the overdraft principal account obtained in this way has a discrepancy of -20 yuan compared to the actual total sub-resource value of the corresponding accounts. This also shows that if the difference in resource value caused by other transactions between the original transaction and the reversal transaction is not compensated in the accounting entries, the total resource value of the sub-resources of the normal principal account and the total resource value of the overdraft principal account in the accounting entries may be inaccurate.
[0094] In this embodiment, when reversing the original transaction, the information of the first sub-accounting entry for the reversal transaction can be generated based on the first resource value information of the normal principal account and overdraft principal account of the original transaction recorded in the accounting entry. The second resource value of the normal principal account and overdraft principal account in the first sub-accounting entry is the opposite of the resource value of the corresponding account in the first resource value. Thus, the relationship between the reversal transaction and the original transaction can be intuitively reflected in the resource value change details of the accounting entry. In addition, the information of the resource value of the normal principal account and overdraft principal account in the second sub-accounting entry for the reversal transaction, which is used to compensate for the difference in resource value between the original transaction and the reversal transaction, can be generated based on the first total resource value of the account before the original transaction, the second total resource value after the original transaction, the third total resource value before the reversal transaction, and the fourth total resource value after the reversal transaction. Thus, not only can the relationship between the reversal transaction and the original transaction be intuitively reflected in the resource value change details of the accounting entry, but the accuracy of the total resource value of the account can also be guaranteed.
[0095] Example 2:
[0096] Considering situations where no other transactions occur between the original transaction and the reversal transaction, it might be sufficient to reverse the original transaction based on the first sub-accounting entry. This ensures the accuracy of the account's total resource value, as well as the accuracy of the sub-resource total value of the normal principal account and the overdraft principal account. There's no need to generate a second sub-accounting entry to compensate for the resource value difference between the original transaction and the reversal transaction (other transactions). To improve efficiency, after generating the first sub-accounting entry for the reversal transaction, it's possible to first determine if the third total resource value before the reversal transaction is the same as the second total resource value after the original transaction. If the third total resource value is different from the second total resource value, then the subsequent steps of generating the resource value information for the normal principal account and the overdraft principal account in the second sub-accounting entry for the reversal transaction can proceed.
[0097] In one possible implementation, when the total value of the third resource is the same as the total value of the second resource, the step of generating information on the resource values of the normal principal account and the overdraft principal account in the second sub-accounting entry for the reversal transaction can be omitted.
[0098] In one possible implementation, when the third total resource value is different from the second total resource value, before generating the resource value information for the normal principal account and the overdraft principal account in the second sub-accounting entry for the reversal transaction, it can be determined whether there are both positive and negative values among the first, second, third, and fourth total resource values. If there are both positive and negative values among the first, second, third, and fourth total resource values, that is, when, apart from the resource value that is zero, some resource values (total resource values) are positive and some resource values (total resource values) are negative, it can be considered that at this time, it is necessary to generate a second sub-accounting entry to compensate for the difference in resource values between the original transaction and the reversal transaction (other transactions).
[0099] In one possible implementation, if all of the total resource values, except for the one that is zero, are either positive or negative, or if all of the total resource values are zero, then it can be considered that there is no need to generate a second sub-accounting entry to compensate for the difference in resource value between the original transaction and the reversing transaction (other transactions).
[0100] To facilitate understanding, the accounting process provided in this application will be explained below through a specific embodiment. (See reference...) Figure 2 , Figure 2The diagram illustrates a second accounting process provided by some embodiments, which includes the following steps:
[0101] S201: If a reversal transaction is received for any account, identify the information of the original transaction carried by the reversal transaction; based on the information of the original transaction, obtain the information of the first resource value of the normal principal account and the overdraft principal account of the original transaction recorded in the accounting entry; based on the information of the first resource value, generate the information of the first sub-accounting entry of the reversal transaction, wherein the second resource value of the normal principal account and the overdraft principal account in the first sub-accounting entry is the opposite of the resource value of the corresponding account in the first resource value.
[0102] S202: If the total third resource value of an account before the reversal transaction is different from the total second resource value after the original transaction, and there are both positive and negative values among the total first, second, and third resource values before the original transaction and the total fourth resource value after the reversal transaction, then the total resource value with a positive value among the total first, second, third, and fourth resource values will be classified into the normal principal group, and the total resource value with a negative value will be classified into the overdraft principal group.
[0103] S203: For the normal principal group and the overdraft principal group, determine the resource-weighted cumulative value of the corresponding group based on the total resource value of each group and the preset calculation factor corresponding to each total resource value. Among them, the preset calculation factor of the first total resource value and the third total resource value is -1, and the preset calculation factor of the second total resource value and the fourth total resource value is 1.
[0104] S204: For each group, if the weighted cumulative value of resources for that group is positive, then the debit / credit direction of the corresponding account in the second sub-accounting entry is determined to be debit, and the resource value transaction value of the corresponding account in the second sub-accounting entry is determined to be the weighted cumulative value of resources; if the weighted cumulative value of resources for that group is negative, then the debit / credit direction of the corresponding account in the second sub-accounting entry is determined to be credit, and the resource value transaction value of the corresponding account in the second sub-accounting entry is determined to be the absolute value of the weighted cumulative value of resources.
[0105] Example 3:
[0106] Based on the same inventive concept, this application provides an accounting processing device, see reference. Figure 3 , Figure 3 The diagram illustrates an accounting processing apparatus according to some embodiments, the apparatus comprising:
[0107] The module 301 is used to identify the information of the original transaction carried by the reversal transaction if a reversal transaction for any account is received; and to obtain the information of the first resource value of the normal principal account and the overdraft principal account of the original transaction recorded in the accounting entries based on the information of the original transaction.
[0108] The first generation module 302 is used to generate information of the first sub-accounting entry of the reversal transaction based on the information of the first resource value, wherein the second resource value of the normal principal account and the overdraft principal account in the first sub-accounting entry is the opposite of the resource value of the corresponding account in the first resource value;
[0109] The second generation module 303 is used to generate information on the resource values of the normal principal account and the overdraft principal account in the second sub-accounting entry of the reversal transaction based on the first total resource value of the account before the original transaction, the second total resource value after the original transaction, the third total resource value before the reversal transaction, and the fourth total resource value after the reversal transaction. The second sub-accounting entry is used to compensate for the difference in resource values between the original transaction and the reversal transaction.
[0110] In one possible implementation, the second generation module 303 is specifically used for:
[0111] Among the first total resource value, the second total resource value, the third total resource value, and the fourth total resource value, the total resource value with a positive resource value is classified into the normal principal group, and the total resource value with a negative resource value is classified into the overdraft principal group.
[0112] For the normal principal group and the overdraft principal group, the resource weighted cumulative value of the corresponding group is determined according to the total resource value of each group and the preset calculation factor corresponding to each total resource value; and the resource value information of the corresponding account in the second sub-accounting entry is determined according to the resource weighted cumulative value of the corresponding group.
[0113] In one possible implementation, the second generation module 303 is specifically used for:
[0114] For each group, if the weighted cumulative value of resources for that group is positive, the debit / credit direction of the corresponding account in the second sub-accounting entry will be determined as debit, and the resource value transaction value of the corresponding account in the second sub-accounting entry will be determined as the weighted cumulative value of resources.
[0115] If the weighted cumulative value of resources in the group is negative, the debit / credit direction of the corresponding account in the second sub-accounting entry will be determined as the credit side, and the resource value transaction value of the corresponding account in the second sub-accounting entry will be determined as the absolute value of the weighted cumulative value of resources.
[0116] In one possible implementation, the preset operation factors for the first total resource value and the third total resource value are both first values, and the preset operation factors for the second total resource value and the fourth total resource value are both second values, wherein the first value is a negative number, the second value is a positive number, and the absolute values of the first value and the second value are the same.
[0117] In one possible implementation, the second generation module 303 is further configured to:
[0118] The process involves determining whether the total value of the third resource is the same as the total value of the second resource. If not, the next step is to generate information on the resource values of the normal principal account and the overdraft principal account in the second sub-accounting entry for the reversal transaction.
[0119] In one possible implementation, the second generation module 303 is further configured to:
[0120] Determine whether there are both positive and negative numbers among the first total resource value, the second total resource value, the third total resource value, and the fourth total resource value. If so, proceed to the step of generating the resource value information of the normal principal account and the overdraft principal account in the second sub-accounting entry of the reversal transaction.
[0121] Example 4:
[0122] Based on the same inventive concept, and building upon the above embodiments, this application also provides an electronic device that can perform the functions of the accounting processing device described above. Please refer to [link to relevant documentation]. Figure 4 , Figure 4 The diagram illustrates the structure of an electronic device according to some embodiments. The electronic device includes a processor 401, a communication interface 402, a memory 403, and a communication bus 404, wherein the processor 401, the communication interface 402, and the memory 403 communicate with each other through the communication bus 404.
[0123] The memory 403 stores a computer program, which, when executed by the processor 401, causes the processor 401 to perform the following steps:
[0124] If a reversal transaction is received for any account, identify the information of the original transaction carried by the reversal transaction; based on the information of the original transaction, obtain the information of the first resource value of the normal principal account and the overdraft principal account of the original transaction recorded in the accounting entry;
[0125] Based on the information of the first resource value, the information of the first sub-accounting entry of the reversal transaction is generated, wherein the second resource value of the normal principal account and the overdraft principal account in the first sub-accounting entry is the opposite of the resource value of the corresponding account in the first resource value;
[0126] Based on the obtained total resource value of the account before the original transaction, the total resource value after the original transaction, the total resource value before the reversal transaction, and the total resource value after the reversal transaction, information on the resource value of the normal principal account and the overdraft principal account in the second sub-accounting entry of the reversal transaction is generated. The second sub-accounting entry is used to compensate for the difference in resource value between the original transaction and the reversal transaction.
[0127] In one possible implementation, the processor 401 is specifically used for:
[0128] Among the first total resource value, the second total resource value, the third total resource value, and the fourth total resource value, the total resource value with a positive resource value is classified into the normal principal group, and the total resource value with a negative resource value is classified into the overdraft principal group.
[0129] For the normal principal group and the overdraft principal group, the resource weighted cumulative value of the corresponding group is determined according to the total resource value of each group and the preset calculation factor corresponding to each total resource value; and the resource value information of the corresponding account in the second sub-accounting entry is determined according to the resource weighted cumulative value of the corresponding group.
[0130] In one possible implementation, the processor 401 is specifically used for:
[0131] For each group, if the weighted cumulative value of resources for that group is positive, the debit / credit direction of the corresponding account in the second sub-accounting entry will be determined as debit, and the resource value transaction value of the corresponding account in the second sub-accounting entry will be determined as the weighted cumulative value of resources.
[0132] If the weighted cumulative value of resources in the group is negative, the debit / credit direction of the corresponding account in the second sub-accounting entry will be determined as the credit side, and the resource value transaction value of the corresponding account in the second sub-accounting entry will be determined as the absolute value of the weighted cumulative value of resources.
[0133] In one possible implementation, the preset operation factors for the first total resource value and the third total resource value are both first values, and the preset operation factors for the second total resource value and the fourth total resource value are both second values, wherein the first value is a negative number, the second value is a positive number, and the absolute values of the first value and the second value are the same.
[0134] In one possible implementation, the processor 401 is further configured to:
[0135] The process involves determining whether the total value of the third resource is the same as the total value of the second resource. If not, the next step is to generate information on the resource values of the normal principal account and the overdraft principal account in the second sub-accounting entry for the reversal transaction.
[0136] In one possible implementation, the processor 401 is further configured to:
[0137] Determine whether there are both positive and negative numbers among the first total resource value, the second total resource value, the third total resource value, and the fourth total resource value. If so, proceed to the step of generating the resource value information of the normal principal account and the overdraft principal account in the second sub-accounting entry of the reversal transaction.
[0138] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0139] Communication interface 402 is used for communication between the above-mentioned electronic device and other devices.
[0140] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0141] The processors mentioned above can be general-purpose processors, including central processing units, network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits, field-programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0142] Based on the same inventive concept, embodiments of this application provide a computer-readable storage medium, the computer program product including: computer program code, which, when run on a computer, causes the computer to perform the following steps:
[0143] If a reversal transaction is received for any account, identify the information of the original transaction carried by the reversal transaction; based on the information of the original transaction, obtain the information of the first resource value of the normal principal account and the overdraft principal account of the original transaction recorded in the accounting entry;
[0144] Based on the information of the first resource value, the information of the first sub-accounting entry of the reversal transaction is generated, wherein the second resource value of the normal principal account and the overdraft principal account in the first sub-accounting entry is the opposite of the resource value of the corresponding account in the first resource value;
[0145] Based on the obtained total resource value of the account before the original transaction, the total resource value after the original transaction, the total resource value before the reversal transaction, and the total resource value after the reversal transaction, information on the resource value of the normal principal account and the overdraft principal account in the second sub-accounting entry of the reversal transaction is generated. The second sub-accounting entry is used to compensate for the difference in resource value between the original transaction and the reversal transaction.
[0146] In one possible implementation, the step of generating information on the resource values of the normal principal account and the overdraft principal account in the second sub-accounting entry of the reversal transaction based on the obtained first total resource value of the account before the original transaction, second total resource value after the original transaction, third total resource value before the reversal transaction, and fourth total resource value after the reversal transaction includes:
[0147] Among the first total resource value, the second total resource value, the third total resource value, and the fourth total resource value, the total resource value with a positive resource value is classified into the normal principal group, and the total resource value with a negative resource value is classified into the overdraft principal group.
[0148] For the normal principal group and the overdraft principal group, the resource weighted cumulative value of the corresponding group is determined according to the total resource value of each group and the preset calculation factor corresponding to each total resource value; and the resource value information of the corresponding account in the second sub-accounting entry is determined according to the resource weighted cumulative value of the corresponding group.
[0149] In one possible implementation, the step of determining the resource value of the corresponding account in the second sub-accounting entry based on the resource weighted cumulative value of the corresponding group includes:
[0150] For each group, if the weighted cumulative value of resources for that group is positive, the debit / credit direction of the corresponding account in the second sub-accounting entry will be determined as debit, and the resource value transaction value of the corresponding account in the second sub-accounting entry will be determined as the weighted cumulative value of resources.
[0151] If the weighted cumulative value of resources in the group is negative, the debit / credit direction of the corresponding account in the second sub-accounting entry will be determined as the credit side, and the resource value transaction value of the corresponding account in the second sub-accounting entry will be determined as the absolute value of the weighted cumulative value of resources.
[0152] In one possible implementation, the preset operation factors for the first total resource value and the third total resource value are both first values, and the preset operation factors for the second total resource value and the fourth total resource value are both second values, wherein the first value is a negative number, the second value is a positive number, and the absolute values of the first value and the second value are the same.
[0153] In one possible implementation, after generating the information for the first sub-accounting entry of the reversal transaction and before generating the information for the resource values of the normal principal account and the overdraft principal account in the second sub-accounting entry of the reversal transaction, the method further includes:
[0154] The process involves determining whether the total value of the third resource is the same as the total value of the second resource. If not, the next step is to generate information on the resource values of the normal principal account and the overdraft principal account in the second sub-accounting entry for the reversal transaction.
[0155] In one possible implementation, after generating the information for the first sub-accounting entry of the reversal transaction and before generating the information for the resource values of the normal principal account and the overdraft principal account in the second sub-accounting entry of the reversal transaction, the method further includes:
[0156] Determine whether there are both positive and negative numbers among the first total resource value, the second total resource value, the third total resource value, and the fourth total resource value. If so, proceed to the step of generating the resource value information of the normal principal account and the overdraft principal account in the second sub-accounting entry of the reversal transaction.
[0157] The aforementioned computer-readable storage medium can be any available medium or data storage device that can be accessed by the processor in an electronic device, including but not limited to magnetic storage such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), optical storage such as CDs, DVDs, BDs, HVDs, etc., and semiconductor storage such as ROMs, EPROMs, EEPROMs, non-volatile memory (NAND flash), solid-state drives (SSDs), etc.
[0158] Based on the same inventive concept, this application also provides a computer program product, which includes computer program code. When the computer program code is run on a computer, it causes the computer to execute any of the accounting processing methods described above. Since the principle by which the above-described computer program product solves the problem is similar to that of the accounting processing method, the implementation of the above-described computer program product can be referred to the implementation of the method, and repeated details will not be described again.
[0159] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0160] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0161] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0162] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0163] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. An accounting processing method, characterized in that: The method comprises: If a reversal transaction for any account is received, the information of the original transaction carried by the reversal transaction is identified; based on the information of the original transaction, the information of the first resource value of the normal principal account and the overdraft principal account of the original transaction recorded in the accounting entry is obtained; Generate information of a first sub-accounting entry for the reversal transaction based on information of the first resource value, wherein the second resource values of the normal principal account and the overdraft principal account in the first sub-accounting entry are opposite to the resource values of the corresponding accounts in the first resource value; Based on the obtained first total resource value of the account before the original transaction, the second total resource value after the original transaction, the third total resource value before the reversal transaction, and the fourth total resource value after the reversal transaction, the resource value information of the normal principal account and the overdraft principal account in the second sub-accounting entry of the reversal transaction is generated, wherein the second sub-accounting entry is used to compensate for the difference in resource value between the original transaction and the reversal transaction.
2. The method according to claim 1, characterized in that The information of resource values of the normal principal account and the overdraft principal account in the second sub-accounting entry of the reversal transaction is generated based on the first total resource value of the account before the original transaction, the second total resource value after the original transaction, the third total resource value before the reversal transaction, and the fourth total resource value after the reversal transaction, including: Among the first total resource value, the second total resource value, the third total resource value, and the fourth total resource value, the total resource value with a positive value is divided into a normal principal group, and the total resource value with a negative value is divided into an overdraft principal group; For the normal principal grouping and the overdraft principal grouping, the weighted cumulative value of the resources of the corresponding grouping is determined according to the total value of each resource in the corresponding grouping and the preset operation factor corresponding to each total resource value; and according to the weighted cumulative value of the resources of the corresponding grouping, the information of the resource value of the corresponding account in the second sub-accounting entry is determined.
3. The method according to claim 2, characterized in that The information of determining the resource value of the corresponding account in the second sub-accounting entry according to the weighted cumulative value of the resources of the corresponding grouping includes: For each group, if the weighted cumulative value of the resources of the group is a positive number, the debit and credit direction of the corresponding account in the second sub-accounting entry is determined as the debit side, and the resource value transaction value of the corresponding account in the second sub-accounting entry is determined as the weighted cumulative value of the resources; If the weighted cumulative value of the resources of the group is a negative number, the debit and credit direction of the corresponding account in the second sub-accounting entry is determined as the credit side, and the resource value transaction value of the corresponding account in the second sub-accounting entry is determined as the absolute value of the weighted cumulative value of the resources.
4. The method according to claim 2, characterized in that: The preset operation factors of the first total resource value and the third total resource value are both first values, and the preset operation factors of the second total resource value and the fourth total resource value are both second values, wherein the first value is a negative number, the second value is a positive number, and the absolute values of the first value and the second value are the same.
5. The method according to any one of claims 1 to 4, characterized in that: After generating the information of the first sub-accounting entry of the reversal transaction and before generating the information of the resource value of the normal principal account and the overdraft principal account in the second sub-accounting entry of the reversal transaction, the method further includes: Determine whether the third resource total value is the same as the second resource total value. If not, perform a step of subsequently generating resource value information for the normal principal account and the overdraft principal account in the second sub-accounting entry of the reversal transaction.
6. The method according to claim 5, characterized in that After generating the information of the first sub-accounting entry of the reversal transaction and before generating the information of the resource value of the normal principal account and the overdraft principal account in the second sub-accounting entry of the reversal transaction, the method further includes: Determine whether there are both positive and negative numbers in the first total resource value, the second total resource value, the third total resource value and the fourth total resource value. If so, proceed to generate the resource value information of the normal principal account and the overdraft principal account in the second sub-accounting entry of the reversal transaction.
7. An accounting processing device, characterized in that: The device comprises: An acquisition module, for, if a reversal transaction for any account is received, identifying the information of the original transaction carried by the reversal transaction; and obtaining the information of the first resource value of the normal principal account and the overdraft principal account of the original transaction recorded in the accounting entry according to the information of the original transaction; A first generating module is used to generate information of a first sub-accounting entry of the reversal transaction according to information of the first resource value, wherein the second resource values of the normal principal account and the overdraft principal account in the first sub-accounting entry are opposite to the resource values of the corresponding accounts in the first resource value; The second generating module is used to generate the resource value information of the normal principal account and the overdraft principal account in the second sub-accounting entry of the reversing transaction based on the first total resource value of the account before the original transaction, the second total resource value after the original transaction, the third total resource value before the reversing transaction, and the fourth total resource value after the reversing transaction, wherein the second sub-accounting entry is used to compensate for the resource value difference between the original transaction and the reversing transaction.
8. The device according to claim 7, characterized in that The second generating module is specifically used for: Among the first total resource value, the second total resource value, the third total resource value, and the fourth total resource value, the total resource value with a positive value is divided into a normal principal group, and the total resource value with a negative value is divided into an overdraft principal group; For the normal principal group and the overdraft principal group, determine the weighted cumulative value of the resources of the corresponding group according to the total value of each resource in the corresponding group and the preset operation factor corresponding to each total value of the resource; And according to the weighted cumulative value of the resources of the corresponding group, the information of the resource value of the corresponding account in the second sub-accounting entry is determined.
9. The device according to claim 8, characterized in that The second generating module is specifically used for: For each group, if the weighted cumulative value of the resources of the group is a positive number, the debit and credit direction of the corresponding account in the second sub-accounting entry is determined as the debit side, and the resource value transaction value of the corresponding account in the second sub-accounting entry is determined as the weighted cumulative value of the resources; If the weighted cumulative value of the resources of the group is a negative number, the debit and credit direction of the corresponding account in the second sub-accounting entry is determined as the credit side, and the resource value transaction value of the corresponding account in the second sub-accounting entry is determined as the absolute value of the weighted cumulative value of the resources.
10. The device according to claim 8, characterized in that The preset operation factors of the first total resource value and the third total resource value are both first values, and the preset operation factors of the second total resource value and the fourth total resource value are both second values, wherein the first value is a negative number, the second value is a positive number, and the absolute values of the first value and the second value are the same.
11. The device according to any one of claims 7 to 10, characterized in that: The second generating module is further used for: Determine whether the third resource total value is the same as the second resource total value. If not, perform a step of subsequently generating resource value information for the normal principal account and the overdraft principal account in the second sub-accounting entry of the reversal transaction.
12. The device according to claim 11, characterized in that The second generating module is further used for: Determine whether there are both positive and negative numbers in the first total resource value, the second total resource value, the third total resource value and the fourth total resource value. If so, proceed to generate the resource value information of the normal principal account and the overdraft principal account in the second sub-accounting entry of the reversal transaction.
13. An electronic device, characterized in that: include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute the steps included in any one of claims 1-6 according to the obtained program instructions.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the method according to any one of claims 1 to 6.
15. A computer program product, characterized in that The computer program product comprises: a computer program code, and when the computer program code is run on a computer, the computer is enabled to execute the method according to any one of claims 1 to 6.