Business document account age query method and related product
By using the aging query method of business documents, the target business documents are deducted to determine the date of the verification of the write-off, the problem of requiring a large number of business documents to be written off when querying the aging in the existing technology is solved, and the effect of shortening the query time is achieved.
Patent Information
- Application Number
- CN202411937612.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-04-25
AI Technical Summary
When querying the account age of business documents, the existing technology requires the verification of a large number of business documents, resulting in the query time being too long.
By determining the fund balance corresponding to the amount of funds in the business documents and using the balance of funds to deduct the amount of funds flowing to the same target business documents, the date of write-off is determined to avoid writing off a large number of business documents.
It effectively shortens the time for account age query and avoids the problems of large CPU consumption and high memory usage caused by large-scale write-offs.
Smart Images

Figure CN119884209A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the technical field of document processing, and in particular to a method for querying the age of business documents and related products. Background Art
[0002] At present, when enterprises carry out daily business activities, they often use business documents in the business system as accounting documents to record the flow of funds in the production transaction process. Business documents contain the amount of funds and the business date. The process of querying the aging of generated business documents by enterprises is to query multiple business documents before a certain business date in the business system, and then cancel the fund amounts of multiple business documents against each other. After the cancellation, the remaining uncancelled business documents are the business documents that need to determine the aging.
[0003] Each time the account age is queried, all business documents before a certain business date need to be written off first. As the business system is used for a longer time, the number of business documents that need to be written off also increases. At this time, a large number of business documents need to be written off when the account age is queried, resulting in a long query time for the account age. Summary of the invention
[0004] The embodiment of the present application provides a method for querying the age of a business document and related products, which eliminates the need to write off a large number of business documents and effectively shortens the query time for the age of the account.
[0005] The present application embodiment provides a method for querying the aging of a business document, including:
[0006] Acquire multiple business documents in a business database whose business dates are less than or equal to a preset date, wherein the business documents record the amount of funds in the process of fund transactions;
[0007] Based on the fund flow direction corresponding to the business document, determine the fund balance corresponding to the fund amount of the plurality of business documents;
[0008] Determine a target business document having the same fund flow direction as the fund balance from the multiple business documents, use the fund balance to deduct the fund amount of the target business document, and determine the write-off origin date of the multiple business documents during the deduction process; the write-off origin date indicates that the business documents with a business date less than or equal to the write-off origin date have been written off;
[0009] Get the query date of the account age;
[0010] Based on the comparison result between the query date and the write-off origin date, unwritten-off business documents with a business date less than or equal to the query date are determined, and the account age of the unwritten-off business documents is determined.
[0011] Further, the using the fund balance to deduct the fund amount of the target business document includes:
[0012] sorting the plurality of business documents based on the order of business date from largest to smallest;
[0013] The business documents in the sorting sequence are traversed one by one. If the traversed business document is the target business document, the fund balance is used for deduction; if the traversed business document is not the target business document, the fund balance is not used for deduction; until the fund balance is zero.
[0014] Further, the using the fund balance to deduct the fund amount of the target business document includes:
[0015] The target business documents are sorted in descending order based on the business date, and the fund amount is used to deduct the target business documents in the sorting sequence one by one in the sorting sequence until the fund balance is deducted to zero.
[0016] Furthermore, determining the write-off origin dates of the plurality of business documents during the deduction process includes:
[0017] During the deduction process, if there is a business document with a capital flow direction opposite to that of the capital balance, and the maximum business date is greater than or equal to the business date of the target business document to be deducted, the maximum business date is used as the write-off origin date;
[0018] If it does not exist, the business date of the target business document corresponding to the time when the fund balance is deducted to zero will be used as the write-off origin date.
[0019] Furthermore, the determining, based on the comparison result between the query date and the write-off origin date, the unwritten-off business documents whose business date is less than or equal to the query date includes:
[0020] If the query date is less than the write-off origin date, determining the first business document whose business date is less than or equal to the query date from the multiple business documents;
[0021] Determine a target fund balance for the fund amount of the first business document based on the fund flow corresponding to the first business document;
[0022] A second business document having the same fund flow direction as the target fund balance is determined from the first business document, the target fund balance is used to deduct the fund amount of the second business document, and the deducted second business document is used as the unwritten-off business document.
[0023] Furthermore, the determining, based on the comparison result between the query date and the write-off origin date, the unwritten-off business documents whose business date is less than or equal to the query date includes:
[0024] If the query date is greater than or equal to the write-off origin date, the target business document to be deducted is regarded as an unwritten-off business document, the amount of funds to be deducted is regarded as an unwritten-off amount, and a record table of unwritten-off business documents is obtained;
[0025] Find out the unwritten-off business documents whose business date is less than or equal to the query date from the record table of the unwritten-off business documents.
[0026] Furthermore, after determining the write-off origin dates of the plurality of business documents during the deduction process, the method further comprises:
[0027] When the business date of a newly entered business document in the business database is greater than or equal to the write-off origin date, and the funds flow direction of the newly entered business document is the same as that of the fund balance, the newly entered business document is regarded as an unwritten-off business document.
[0028] Furthermore, after determining the write-off origin dates of the plurality of business documents during the deduction process, the method further comprises:
[0029] When the business date of the newly entered business document in the business database is less than the write-off origin date, or the business date of the newly entered business document is greater than or equal to the write-off origin date and the fund flow direction of the newly entered business document is opposite to that of the fund balance, then based on the newly entered business document, return to execute the above steps: based on the fund flow direction corresponding to the business document, determine the fund balance for the fund amount of multiple business documents until the write-off origin date is re-determined.
[0030] Furthermore, the step of obtaining a plurality of business documents in the business database whose business dates are less than or equal to a preset date includes:
[0031] Determining a business document group from the business documents in the business database based on a preset grouping rule;
[0032] A plurality of business documents having a business date less than or equal to a preset date are obtained from the business document group.
[0033] Furthermore, the determining of the fund balances corresponding to the fund amounts of the plurality of business documents based on the fund flows corresponding to the business documents includes:
[0034] The plurality of business documents are divided into income documents whose fund flow is fund income and expenditure documents whose fund flow is fund expenditure; the total income amount of the income documents and the total expenditure amount of the expenditure documents are counted, and the total income amount is subtracted from the total expenditure amount to determine the fund balance;
[0035] Alternatively, based on the fund flow corresponding to the business document, the fund balance after each business document is entered into the business database is determined and recorded as the daily balance corresponding to the business date of the entered business document; the daily balance corresponding to the largest business date among the multiple business documents is used as the fund balance.
[0036] The embodiment of the present application also provides a business document aging query system, including:
[0037] An acquisition unit, used to acquire a plurality of business documents whose business dates are less than or equal to a preset date from a business database, wherein the business documents record the amount of funds in the process of fund transactions;
[0038] A determination unit, configured to determine the fund balance corresponding to the fund amount of the plurality of business documents based on the fund flow corresponding to the business document;
[0039] a deduction unit, configured to determine a target business document having the same fund flow direction as the fund balance from the plurality of business documents, deduct the fund amount of the target business document using the fund balance, and determine the write-off origin date of the plurality of business documents during the deduction process; the write-off origin date indicates that the business documents having a business date less than or equal to the write-off origin date have been written off;
[0040] A receiving unit, used to obtain the query date of the account age;
[0041] The execution unit is used to determine the unwritten-off business documents whose business date is less than or equal to the query date based on the comparison result between the query date and the write-off origin date, and determine the account age of the unwritten-off business documents.
[0042] The embodiment of the present application also provides an electronic device, including: a processor and a memory;
[0043] The processor is configured to communicate with the memory and execute instructions in the memory to implement the above method.
[0044] An embodiment of the present application further provides a readable storage medium, wherein the readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the method described above is implemented.
[0045] An embodiment of the present application further provides a computer program product, which includes computer instructions, and when the computer instructions are executed by a processor, the method described above is implemented.
[0046] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0047] It can be seen that in the embodiment of the present application, by determining the fund balance corresponding to the fund amount of multiple business documents, the fund balance is used to deduct the fund amount of the target business document with the same fund flow, and the cancellation origin date of multiple business documents is determined in the process of deduction. The cancellation origin date indicates that the business documents whose business date is less than or equal to the cancellation origin date have been cancelled; based on the comparison result of the query date and the cancellation origin date, the uncancelled business documents whose business date is less than or equal to the query date are determined, and the account age of the uncancelled business documents is determined.
[0048] When checking the age of accounts, there is no need to write off a large number of business documents. Instead, the amount of funds in the target business documents with the same fund flow can be deducted from the fund balance to obtain the write-off origin date. By comparing the query date with the write-off origin date, the unwritten business documents can be determined, effectively shortening the query time for the age of accounts. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0050] Figure 1 A schematic diagram of a communication architecture disclosed in an embodiment of the present application;
[0051] Figure 2 A flowchart of an aging query of a business document disclosed in an embodiment of the present application;
[0052] Figure 3 A flowchart of an age query of another business document disclosed in an embodiment of the present application;
[0053] Figure 4 A processing flow chart of a newly stored business document disclosed in an embodiment of the present application;
[0054] Figure 5 A schematic diagram of sorting a business document disclosed in an embodiment of the present application;
[0055] Figure 6 A schematic diagram of the structure of an account age query system disclosed in an embodiment of the present application;
[0056] Figure 7 A schematic diagram of the structure of an electronic device disclosed in an embodiment of the present application. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.
[0058] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims and drawings of the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0059] In the following description, similar expressions such as "a specific implementation" or "a specific example" are involved, which describe a subset of all possible embodiments, but it is understood that "a specific implementation" or "a specific example" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict. In the following description, the term multiple refers to at least two. The numerical value mentioned in this application reaches a threshold value (if any), which may include the case where the former is greater than the latter in some specific examples.
[0060] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0061] For ease of understanding and explanation, before further describing the embodiments of the present application in detail, the communication architecture of the present application will be briefly described.
[0062] like Figure 1As shown, the communication architecture includes: an account age query system 101 and a business database 102. The business database 102 stores business documents of capital transactions of enterprises during production transactions. Different enterprises use different business databases. The account age query system 101 is connected to one or more business databases 102 to query the account age of business documents in the business database 102.
[0063] The process of querying the aging of accounts is as follows: group the income documents with an amount greater than zero in the business documents in the business database into the pending account group, and group the expenditure documents with an amount less than zero into the write-off group; sort the business documents in the pending account group and the write-off group based on the first-in-first-out principle, that is, the business documents with a smaller business date are sorted higher. The amounts of the documents in the pending account group and the write-off group are taken in the order of business dates from small to large for amount write-off; the write-off process has one-to-many, many-to-many, and many-to-one write-off relationships. After the write-off is completed, the aging of the unwritten-off business documents is calculated.
[0064] Currently, each time the account age is queried, all business documents before the current business date are taken for write-off processing. As the usage time of the business system increases, the business documents that need to be written off also increase. At this time, a large number of business documents need to be written off when the account age is queried, resulting in a long account age query time. Therefore, an account age query method and related products for business documents are provided in an embodiment of the present application, which does not require the write-off of a large number of business documents, and effectively shortens the account age query time; the account age query system corresponding to the method in the embodiment of the present application can be in various business systems, such as Enterprise Resource Planning (ERP), enterprise management system, financial system, etc. The account age query method for business documents is as follows: Figure 2 As shown, the specific steps are as follows:
[0065] 201. Obtain multiple business documents in a business database whose business dates are less than or equal to a preset date.
[0066] In an embodiment of the present application, the aging query system can obtain multiple business documents in the business database whose business date is less than or equal to the preset date; wherein, the business database can be a relational database or a non-relational database, and the business database stores business documents of the enterprise in the process of fund transactions, and the business document can be a detailed account for accounting. The business document records the amount of funds in the process of fund transactions, and the business date is the corresponding fund transaction date, that is, the date when the business document is generated. There can be multiple business documents on the same business date. The preset date can be the time point when the user queries the aging of the account, or the time point when the business document is put into the warehouse, or the time point set by the user, and the specific details are not limited here. Multiple business documents with business dates before (including the preset date) can be found from the business database to find out the unwritten-off business documents with business dates before the preset date from multiple business documents.
[0067] It is understandable that the larger the date, the later it will arrive in the time sequence, and the smaller the date, the earlier it will arrive in the time sequence, such as the date 2024.11.02 is greater than the date 2024.11.01; the date can refer not only to a specific day, but also to a certain time in a day, or a certain month, which is not limited here. That is, the queried account age can be not only days, but also months.
[0068] 202. Based on the fund flow corresponding to the business document, determine the fund balance corresponding to the fund amount of multiple business documents.
[0069] After obtaining multiple business documents, the fund balance corresponding to the fund amount of multiple business documents can be determined based on the fund flow corresponding to the business documents. The fund flow corresponding to the business document is the fund flow of the enterprise during the fund transaction process, which includes: fund income (such as loan income, repayment income, etc.), and fund expenditure (such as loan repayment expenditure, borrowing expenditure, etc.). In multiple business documents, the income amount corresponding to the fund income can be deducted from the expenditure amount corresponding to the fund expenditure to obtain the corresponding fund balance.
[0070] Specifically, multiple business documents can be divided into income documents with fund flow as fund income, and expenditure documents with fund flow as fund expenditure; the total income amount of the income documents and the total expenditure amount of the expenditure documents are counted, and the total income amount is subtracted from the total expenditure amount to determine the fund balance; it can be understood that when subtracting the total income amount from the total expenditure amount, the larger one is subtracted from the smaller one to obtain the fund balance corresponding to the larger one.
[0071] Alternatively, the fund balance after each business document is stored in the business database can be determined based on the fund flow direction corresponding to the business document, and recorded as the daily balance corresponding to the business date of the stored business document; that is, after each business document is stored, the fund balance before storage is compared to obtain the fund balance after storage. The daily balance corresponding to the largest business date among multiple business documents is used as the fund balance.
[0072] If the preset date is set to 2024.11.05, the record table corresponding to multiple business documents is obtained from the business database as shown in Table 1:
[0073] Table 1
[0074] Business document ID Business Date Income amount Amount of expenditure Daily balance 1 2024.11.01 100 100 2 2024.11.01 40 60 3 2024.11.02 70 -10 4 2024.11.03 20 10 5 2024.11.04 20 -10 6 2024.11.05 20 -30
[0075] At this time, the total amount of income is 120, the total amount of expenditure is 150, and the fund balance that can be obtained is the expenditure balance of 30. Alternatively, from the perspective of income amount, the corresponding daily balance can be determined and recorded on the corresponding business date when each business document is entered into the warehouse. At this time, the largest business date among multiple business documents is 2024.11.05, and the daily balance is the expenditure balance of 30.
[0076] It is understandable that when multiple business documents do not have fund balances, that is, multiple business documents can be written off, at this time, there are no unwritten-off business documents that need to be queried for aging.
[0077] 203. Use the fund balance to deduct the fund amount of the target business documents with the same fund flow, and determine the write-off origin date of multiple business documents during the deduction process.
[0078] After determining the fund balances corresponding to the fund amounts of multiple business documents, you can determine the target business document with the same fund flow direction as the fund balance from the multiple business documents. If the fund balance is an income balance, the target business document is the income document; if the fund balance is an expenditure balance, the target business document is the expenditure document. That is, there are unwritten-off business documents among the target business documents, and the business documents with the opposite fund flow direction to the fund balance are all written-off business documents.
[0079] Next, the balance deduction method can be used: use the fund balance to deduct the fund amount of the target business document with the same fund flow, and determine the write-off origin date of multiple business documents during the deduction process. The write-off origin date indicates that the business documents with a business date less than or equal to the write-off origin date have been written off, that is, the write-off origin date is the maximum business date of the business documents written off among the multiple business documents, and the write-off origin date is less than or equal to the preset date.
[0080] The deduction process is: deduct the target business document from the maximum business date to the minimum business date one by one until the fund balance is reduced to zero. For example, the deduction process of the above Table 1 is: use the expenditure balance 30 to deduct the expenditure document, first completely deduct the expenditure amount 30 of the expenditure document with a business date of 2024.11.05, and the remaining expenditure balance after the deduction is 10. Then, deduct 10 from the expenditure amount of the expenditure document with a business date of 2024.11.04. At this time, the expenditure balance is reduced to zero. When the fund balance is deducted to zero, the corresponding target business document is the written-off business document with the maximum business date among the target business documents. At this time, if there is no business date greater than the maximum business date in the business document with the opposite fund flow (that is, all the written-off business documents), the maximum business date can be used as the write-off origin date. For example, the business date of 2024.11.04 in the above Table 1 is used as the write-off origin date.
[0081] 204. Obtain the query date for account age.
[0082] In an embodiment of the present application, when querying the age of a business document, the query date of the age can be obtained, wherein the query date of the age indicates querying the age of business documents before the query date (including the query date), wherein the query date of the age is less than or equal to a preset date, that is, the business documents before the preset date are first written off by balance deduction, and then the age of the business documents that have not been written off before the preset date is queried.
[0083] Among them, an account age query request with a query date input by a user can be received to obtain the account age query date, or the current date on the system can be used as the account age query date, and the specifics are not limited here.
[0084] It should be noted that the execution sequence of step 204 and the above steps 201 to 203 is not limited here.
[0085] 205. Based on the comparison result between the query date and the write-off origin date, determine the unwritten-off business documents whose business date is less than or equal to the query date, and determine the account age of the unwritten-off business documents.
[0086] Next, the query date can be compared with the write-off origin date. Based on the comparison result between the query date and the write-off origin date, the unwritten-off business documents with business dates less than or equal to the query date can be determined, and the aging of the unwritten-off business documents can be determined. The process of determining the aging of the unwritten-off business documents is as follows: setting the query deadline, which is greater than the query date and can be set manually or by system default, and the specific details are not limited here; the length of time between the business date of the unwritten-off business document and the query deadline is the aging of the unwritten-off business document found.
[0087] Specifically, if the query date is greater than or equal to the write-off origin date, and all business documents before the write-off origin date (including the write-off origin date) have been written off, then the business documents after the write-off origin date (including the write-off origin date) can be regarded as unwritten business documents; if the query date is less than the write-off origin date, then it is necessary to re-determine the first business document whose business date is less than or equal to the query date from multiple business documents, and re-determine the unwritten business documents among the first business documents.
[0088] It can be seen that in the embodiment of the present application, when inquiring about the age of an account, there is no need to write off a large number of business documents. The amount of funds of the target business documents with the same fund flow is deducted by the fund balance to obtain the write-off origin date. The query date is compared with the write-off origin date to determine the unwritten business documents, thereby effectively shortening the query time of the age of the account; and effectively avoiding the problems of high CPU consumption and high memory usage due to the write-off of a large number of business documents when inquiring about the age of the account.
[0089] Furthermore, the following will combine Figure 3 Describe the aging query process of business documents in detail, including the following steps:
[0090] 301. Acquire multiple business documents in a business database whose business dates are less than or equal to a preset date based on a preset grouping rule.
[0091] In an embodiment of the present application, there may be a large number of business documents in the business database. In order to accurately filter out business documents that meet the account age that the user wants to query from the business database, multiple business documents whose business dates are less than or equal to the preset date can be obtained from the business database based on preset grouping rules.
[0092] Specifically, a business document group can be determined from the business documents in the business database based on a preset grouping rule, and multiple business documents with business dates less than or equal to a preset date can be obtained from the business document group. The preset grouping rule can be: grouping based on accounting subjects, where an accounting subject refers to a basic unit used to record and reflect the economic business of an enterprise, such as an asset subject or a profit and loss subject; or grouping based on a write-off object, where the write-off object can be another enterprise in the process of conducting financial transactions with the enterprise, which is not specifically limited here.
[0093] 302. Based on the fund flow corresponding to the business document, determine the fund balance corresponding to the fund amount of multiple business documents.
[0094] It is understandable that step 302 is similar to the above step 202, and the details are not repeated here.
[0095] 303. Use the fund balance to deduct the fund amount of the target business document with the same fund flow.
[0096] After obtaining the fund balance, the fund balance can be used to deduct the fund amount of the target business document with the same fund flow. Specifically, the deduction can be performed by executing any of the following steps 3031 and 3032.
[0097] 3031. Sort multiple business documents and deduct the fund amount of the target business document in the sorting sequence.
[0098] In the embodiment of the present application, multiple business documents can be sorted, and the amount of funds of the target business document can be deducted in the sorted sequence. Specifically, multiple business documents can be sorted in descending order based on the business date; Figure 5 As shown in the right figure in the figure, A is the target business document with the same fund flow direction, and B is the business document with the opposite fund flow direction (i.e., the remaining business document relative to the target business document). Then, based on the order of the sorting sequence, the business documents in the sorting sequence can be traversed one by one. If the traversed business document is the target business document, the fund balance is used for deduction; if the traversed business document is not the target business document, the fund balance is not used for deduction, that is, the business document with the opposite fund flow direction is skipped until the fund balance is zero.
[0099] 3032. Sort the target business documents and deduct the fund amount of the target business documents in the sorting sequence.
[0100] It is understandable that when sorting multiple business documents, there are many business documents with opposite funds flow in the sorting sequence. When the funds amount of the target business document is deducted by traversing the business documents in the sorting sequence one by one, the deduction speed is slow. Therefore, in the embodiment of the present application, the target business document can be sorted, and the funds amount of the target business document can be deducted in the sorting sequence.
[0101] Specifically, the target business documents are sorted in descending order based on the business date, such as Figure 5 Left figure in the figure; Use the fund amount to deduct the target business documents in the sorted sequence one by one until the fund balance is reduced to zero. At this time, there is no need to traverse the sorted sequences of multiple business documents. You only need to sort and deduct the target business documents, which can make the balance deduction faster.
[0102] 304. Determine the write-off origin date of multiple business documents during the deduction process.
[0103] Determining the write-off origin date of multiple business documents during the deduction process is specifically that during the deduction process, if there is a business document with a maximum business date that is opposite to the fund flow direction of the fund balance and is greater than or equal to the business date of the target business document to be deducted, the maximum business date is used as the write-off origin date. It can be understood that the business document with a fund flow direction opposite to the fund balance can be understood as all the business documents to be written off, and if the business date of the business document with a fund flow direction opposite is greater than or equal to the business date of the target business document to be deducted, the maximum business date of the business document with a fund flow direction opposite can be taken as the write-off origin date.
[0104] As shown in Table 2:
[0105] Table 2
[0106] Business document ID Business Date Income amount Amount of expenditure 1 2024.11.01 100 2 2024.11.01 40 3 2024.11.02 70 4 2024.11.03 20 5 2024.11.04 20 6 2024.11.05 20 7 2024.11.06 5
[0107] The fund balance is the expenditure balance 25. During the process of deducting the expenditure amount of the expenditure document, the business document with the opposite fund flow to the fund balance is the income document. The maximum business date of the income document is 2024.11.06, which is greater than the business date of the expenditure document being deducted. At this time, the maximum business date of the income document, 2024.11.06, can be used as the write-off origin date.
[0108] During the deduction process, if there is no maximum business date of a business document with the opposite fund flow, which is greater than or equal to the business date of the target business document to be deducted, the business date of the target business document corresponding to the fund balance deducted to zero is used as the write-off origin date. As shown in Table 1 above, the business date of the expenditure document corresponding to the fund balance deducted to zero, 2024.11.04, is used as the write-off origin date.
[0109] 305. Get the query date of account age.
[0110] It is understandable that step 305 is similar to the above step 204, and the details are not repeated here.
[0111] 306. Based on the comparison result between the query date and the write-off origin date, determine the unwritten business documents whose business date is less than or equal to the query date.
[0112] Based on the comparison result between the query date and the write-off origin date, determine the unwritten business documents whose business date is less than or equal to the query date; if the query date is less than the write-off origin date, execute steps 3061 to 3062; if the query date is greater than or equal to the write-off origin date, execute steps 3063 to 3064.
[0113] 3061. If the query date is less than the write-off origin date, determine the first business document whose business date is less than or equal to the query date from multiple business documents.
[0114] If the query date is less than the write-off origin date, determine the first business document whose business date is less than or equal to the query date from multiple business documents. For example, in Table 1 above, the write-off origin date is 2024.11.04. If the query date is 2024.11.02, then the first business document is the business document with business document identifiers 1, 2, and 3.
[0115] 3062. In the process of deducting the balance of the first business document, the business document to be deducted shall be regarded as an unwritten-off business document.
[0116] In the process of deducting the balance of the first business document, the business document to be deducted can be used as an unwritten business document. Specifically, the target fund balance can be determined for the fund amount of the first business document based on the fund flow direction corresponding to the first business document, which is similar to the above step 202 and will not be described in detail here. Next, a second business document with the same fund flow direction as the target fund balance is determined from the first business document, and the fund amount of the second business document is deducted using the target fund balance, which is similar to the above step 203 and will not be described in detail here; the second business document to be deducted is used as an unwritten business document.
[0117] For example, the first business document in the above Table 1 is the business document with business document identifications of 1, 2, and 3; at this time, the available fund balance is the expenditure balance of 10. At this time, after deducting 10 from the expenditure document identified as 3 from the expenditure balance, the expenditure balance is zero, and the expenditure document identified as 3 is the unwritten-off business document.
[0118] 3063. If the query date is greater than or equal to the original cancellation date, obtain the record table of uncancelled business documents.
[0119] If the query date is greater than or equal to the original date of write-off, obtain the record table of unwritten business documents. In the process of deducting the balance of the target business document, the remaining balance after each deduction, the target business document to be deducted, and the deducted amount can be recorded; the target business document to be deducted can be used as the unwritten business document, and the amount of funds to be deducted can be used as the unwritten amount to obtain the record table of unwritten business documents.
[0120] For example, in Table 1 above, the write-off origin date is 2024.11.04. If the query date is 2024.11.05, then the record table of unwritten-off business documents can be obtained as shown in Table 3 below:
[0121] Table 3
[0122]
[0123] 3064. Find the unwritten business documents whose business date is less than or equal to the query date from the record table of unwritten business documents.
[0124] Find the unwritten-off business documents whose business date is less than or equal to the query date from the record table of unwritten-off business documents. For example, when the query date is 2024.11.05, the unwritten-off business documents available in Table 3 are the expenditure documents with the business document ID 5 and the expenditure documents with the business document ID 6.
[0125] Furthermore, after determining the write-off origin dates of multiple business documents, there may be new business documents in the business database. In this case, the write-off origin date needs to be processed accordingly based on the business date of the new business document to ensure the accuracy of the write-off origin date. Figure 4 As shown, the specific steps are as follows:
[0126] 401. Obtain the business date of the newly stored business document in the business database.
[0127] In an embodiment of the present application, after determining the cancellation origin dates of multiple business documents, when there are new business documents in the business database, the business date of the new business documents in the business database can be obtained, and the business date of the new business documents in the business database can be queried.
[0128] 402. When the business date is greater than or equal to the write-off origin date and has the same fund flow direction as the fund balance, the newly received business document will be treated as an unwritten-off business document.
[0129] When the business date is greater than or equal to the write-off origin date, and the funds flow direction is the same as the funds balance, the newly entered business document is treated as an unwritten business document. Specifically, when the business date of the newly entered business document in the business database is greater than or equal to the write-off origin date, and the funds flow direction of the newly entered business document is the same as the funds balance, the newly entered business document is treated as an unwritten business document, and at this time, the write-off origin date remains unchanged. It can be understood that the target business document (business document with the same funds flow direction as the funds balance) with a business date less than or equal to the write-off origin date, and the business document with the opposite funds flow direction as the funds balance, are written off; if the newly entered business document is a business document with a business date greater than or equal to the write-off origin date and the same funds flow direction as the funds balance, the newly entered business document can be directly treated as an unwritten business document, and the document data of the newly entered business document is inserted into the record table of unwritten business documents, and the document data includes: business document identification, business date and corresponding funds amount.
[0130] For example, for the newly entered expenditure document in Table 1, the business document ID is 7, the business date is 2024.11.06 (greater than the write-off origin date 2024.11.04), and the corresponding expenditure amount is 5, the document data of the newly entered expenditure document can be inserted into the record table of unwritten-off business documents, and the new record table of unwritten-off business documents is shown in Table 4 below:
[0131] Table 4
[0132] Business document ID Business Date Income amount Amount of expenditure 5 2024.11.04 10 6 2024.11.05 20 7 2024.11.06 5
[0133] 403. When the business date is less than the write-off origin date, or the business date is greater than or equal to the write-off origin date and is opposite to the capital flow direction of the capital balance, the write-off origin date shall be re-determined.
[0134] When the business date is less than the write-off origin date, or the business date is greater than or equal to the write-off origin date and the funds flow direction is opposite to the funds balance, the write-off origin date is re-determined. Specifically, when the business date of a newly entered business document in the business database is less than the write-off origin date, or the business date of a newly entered business document is greater than or equal to the write-off origin date and the funds flow direction of the newly entered business document is opposite to the funds balance, the newly entered business document may be a business document that needs to be written off, then the newly entered business document is added to multiple business documents and the above steps are returned to execute: based on the funds flow direction corresponding to the business document, the funds balance is determined for the funds amount of the multiple business documents until the write-off origin date is re-determined.
[0135] That is, when the business date of a newly received business document is less than the write-off origin date, or the business date of a newly received business document is greater than or equal to the write-off origin date and the funds flow direction of the newly received business document is opposite to that of the fund balance, the newly received business document may be the business document that needs to be written off. In this case, the write-off origin date needs to be re-determined using the newly received business document.
[0136] For example, the newly stored income document in Table 1 is: the business document ID is 7, the business date is 2024.11.06, and the corresponding expenditure amount is 5; at this time, Table 1 is updated to Table 5:
[0137] Table 5
[0138]
[0139] At this time, the fund balance is: expenditure balance 25. In the income document with the opposite data flow to the fund balance, there is a maximum business date of 2024.11.06, which is greater than the business date of the expenditure document being deducted, that is, the write-off origin date is 2024.11.06.
[0140] The present application also provides a system for querying the age of business documents, such as Figure 6 As shown, including:
[0141] An acquisition unit 601 is used to acquire a plurality of business documents whose business dates are less than or equal to a preset date from a business database, wherein the business documents record the amount of funds in the process of fund transactions;
[0142] A determination unit 602, configured to determine the fund balance corresponding to the fund amount of the plurality of business documents based on the fund flow corresponding to the business document;
[0143] The deduction unit 603 is used to determine a target business document having the same fund flow direction as the fund balance from the multiple business documents, deduct the fund amount of the target business document using the fund balance, and determine the write-off origin date of the multiple business documents during the deduction process; the write-off origin date indicates that the business documents with a business date less than or equal to the write-off origin date have been written off;
[0144] A receiving unit 604 is used to obtain a query date of the account age;
[0145] The execution unit 605 is used to determine the unwritten-off business documents whose business date is less than or equal to the query date based on the comparison result between the query date and the write-off origin date, and determine the account age of the unwritten-off business documents.
[0146] Furthermore, the deduction unit 603 is specifically used to sort the multiple business documents in descending order based on the business date; traverse the business documents in the sorted sequence one by one, and if the traversed business document is the target business document, use the fund balance for deduction; if the traversed business document is not the target business document, do not use the fund balance for deduction; until the fund balance is zero.
[0147] Furthermore, the deduction unit 603 is specifically configured to sort the target business documents in descending order based on the business date, and use the fund amount to deduct the target business documents in the sorted sequence one by one in the sorted sequence until the fund balance is reduced to zero.
[0148] Furthermore, the deduction unit 603 is specifically used to, during the deduction process, if there is a maximum business date of a business document with a fund flow direction opposite to that of the fund balance, which is greater than or equal to the business date of the target business document to be deducted, then use the maximum business date as the write-off origin date; if it does not exist, use the business date of the target business document corresponding to the time when the fund balance is deducted to zero as the write-off origin date.
[0149] Furthermore, the execution unit 605 is specifically used to determine, from the multiple business documents, a first business document whose business date is less than or equal to the query date if the query date is less than the write-off origin date; determine a target fund balance for the fund amount of the first business document based on the fund flow direction corresponding to the first business document; determine a second business document from the first business document with the same fund flow direction as the target fund balance, deduct the fund amount of the second business document using the target fund balance, and use the deducted second business document as the unwritten business document.
[0150] Furthermore, the execution unit 605 is specifically used to, if the query date is greater than or equal to the cancellation origin date, treat the target business document to be deducted as an unwritten business document, and the amount of funds to be deducted as the unwritten amount, to obtain a record table of unwritten business documents; and find out the unwritten business documents whose business date is less than or equal to the query date from the record table of unwritten business documents.
[0151] Furthermore, the acquisition unit 601 is specifically configured to determine a business document group from the business documents in the business database based on a preset grouping rule; and acquire a plurality of business documents whose business dates are less than or equal to a preset date from the business document group.
[0152] Further, the determining unit 602 is specifically configured to divide the plurality of business documents into income documents whose fund flow is fund income and expenditure documents whose fund flow is fund expenditure; calculate the total income amount of the income documents and the total expenditure amount of the expenditure documents, and subtract the total income amount from the total expenditure amount to determine the fund balance;
[0153] Alternatively, based on the fund flow corresponding to the business document, the fund balance after each business document is entered into the business database is determined and recorded as the daily balance corresponding to the business date of the entered business document; the daily balance corresponding to the largest business date among the multiple business documents is used as the fund balance.
[0154] The present application also provides an electronic device. Figure 7 The electronic device 700 of the embodiment of the present application may include one or more central processing units (CPU) 701 and a memory 702, in which one or more application programs or data are stored.
[0155] The memory 702 may be a volatile storage or a persistent storage. The program stored in the memory 702 may include one or more modules, each of which may include a series of instruction operations in the electronic device. Furthermore, the central processor 701 may be configured to communicate with the memory 702 and execute a series of instruction operations in the memory 702 on the electronic device 700.
[0156] The electronic device 700 may also include one or more power supplies 705, one or more wired or wireless network interfaces 704, one or more input and output interfaces 703, and / or one or more operating systems, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0157] The central processor 701 can execute the operations performed by the aforementioned first aspect or any specific method embodiment of the first aspect, and the details will not be repeated here.
[0158] The present application provides a computer-readable storage medium, comprising instructions, which, when executed on a computer, enable the computer to execute the method described in the first aspect or any specific implementation of the first aspect.
[0159] The present application provides a computer program product comprising instructions or a computer program. When the computer program product is run on a computer, the computer is enabled to execute the method described in the first aspect or any specific implementation of the first aspect.
[0160] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0161] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0162] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0163] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0164] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.
Claims
1. A method for querying the age of a business document, characterized in that: include: Acquire multiple business documents in a business database whose business dates are less than or equal to a preset date, wherein the business documents record the amount of funds in the process of fund transactions; Based on the fund flow direction corresponding to the business document, determine the fund balance corresponding to the fund amount of the plurality of business documents; Determine a target business document having the same fund flow direction as the fund balance from the multiple business documents, use the fund balance to deduct the fund amount of the target business document, and determine the write-off origin date of the multiple business documents during the deduction process; the write-off origin date indicates that the business documents with a business date less than or equal to the write-off origin date have been written off; Get the query date of the account age; Based on the comparison result between the query date and the write-off origin date, unwritten-off business documents with a business date less than or equal to the query date are determined, and the account age of the unwritten-off business documents is determined.
2. The account age query method according to claim 1, characterized in that: The using the fund balance to deduct the fund amount of the target business document includes: sorting the plurality of business documents based on the order of business date from largest to smallest; The business documents in the sorting sequence are traversed one by one. If the traversed business document is the target business document, the fund balance is used for deduction; if the traversed business document is not the target business document, the fund balance is not used for deduction; until the fund balance is zero.
3. The account age query method according to claim 1, characterized in that: The using the fund balance to deduct the fund amount of the target business document includes: The target business documents are sorted in descending order based on the business date, and the fund amount is used to deduct the target business documents in the sorting sequence one by one in the sorting sequence until the fund balance is deducted to zero.
4. The account age query method according to claim 1, characterized in that: Determining the write-off origin dates of the plurality of business documents during the deduction process includes: During the deduction process, if there is a business document with a capital flow direction opposite to that of the capital balance, and the maximum business date is greater than or equal to the business date of the target business document to be deducted, the maximum business date is used as the write-off origin date; If it does not exist, the business date of the target business document corresponding to the time when the fund balance is deducted to zero will be used as the write-off origin date.
5. The account age query method according to claim 1, characterized in that: The determining, based on the comparison result between the query date and the write-off origin date, of unwritten-off business documents whose business date is less than or equal to the query date includes: If the query date is less than the write-off origin date, determining the first business document whose business date is less than or equal to the query date from the multiple business documents; Determine a target fund balance for the fund amount of the first business document based on the fund flow corresponding to the first business document; A second business document having the same fund flow direction as the target fund balance is determined from the first business document, the target fund balance is used to deduct the fund amount of the second business document, and the deducted second business document is used as the unwritten-off business document.
6. The account age query method according to claim 1, characterized in that: The determining, based on the comparison result between the query date and the write-off origin date, of unwritten-off business documents whose business date is less than or equal to the query date includes: If the query date is greater than or equal to the write-off origin date, the target business document to be deducted is regarded as an unwritten-off business document, the amount of funds to be deducted is regarded as an unwritten-off amount, and a record table of unwritten-off business documents is obtained; Find out the unwritten-off business documents whose business date is less than or equal to the query date from the record table of the unwritten-off business documents.
7. The account age query method according to claim 1, characterized in that: After determining the write-off origin dates of the plurality of business documents during the deduction process, the method further comprises: When the business date of a newly entered business document in the business database is greater than or equal to the write-off origin date, and the funds flow direction of the newly entered business document is the same as that of the fund balance, the newly entered business document is regarded as an unwritten-off business document.
8. The account age query method according to claim 1, characterized in that: After determining the write-off origin dates of the plurality of business documents during the deduction process, the method further comprises: When the business date of a newly entered business document in the business database is less than the write-off origin date, or the business date of the newly entered business document is greater than or equal to the write-off origin date and the fund flow direction of the newly entered business document is opposite to that of the fund balance, the newly entered business document is added to the multiple business documents and returned to execute the above steps: based on the fund flow direction corresponding to the business documents, the fund balance is determined for the fund amount of the multiple business documents until the write-off origin date is re-determined.
9. The account age query method according to claim 1, characterized in that: The step of obtaining a plurality of business documents in a business database whose business dates are less than or equal to a preset date includes: Determining a business document group from the business documents in the business database based on a preset grouping rule; A plurality of business documents having a business date less than or equal to a preset date are obtained from the business document group.
10. The account age query method according to claim 1, characterized in that: The determining, based on the fund flow direction corresponding to the business document, the fund balance corresponding to the fund amount of the plurality of business documents comprises: The plurality of business documents are divided into income documents whose fund flow is fund income and expenditure documents whose fund flow is fund expenditure; the total income amount of the income documents and the total expenditure amount of the expenditure documents are counted, and the total income amount is subtracted from the total expenditure amount to determine the fund balance; Alternatively, based on the fund flow corresponding to the business document, the fund balance after each business document is entered into the business database is determined and recorded as the daily balance corresponding to the business date of the entered business document; the daily balance corresponding to the largest business date among the multiple business documents is used as the fund balance.
11. A business document aging query system, characterized in that: include: An acquisition unit, used to acquire a plurality of business documents whose business dates are less than or equal to a preset date from a business database, wherein the business documents record the amount of funds in the process of fund transactions; A determination unit, configured to determine the fund balance corresponding to the fund amount of the plurality of business documents based on the fund flow corresponding to the business document; a deduction unit, configured to determine a target business document having the same fund flow direction as the fund balance from the plurality of business documents, deduct the fund amount of the target business document using the fund balance, and determine the write-off origin date of the plurality of business documents during the deduction process; the write-off origin date indicates that the business documents having a business date less than or equal to the write-off origin date have been written off; A receiving unit, used to obtain the query date of the account age; The execution unit is used to determine the unwritten-off business documents whose business date is less than or equal to the query date based on the comparison result between the query date and the write-off origin date, and determine the account age of the unwritten-off business documents.
12. An electronic device, characterized in that: include: Processor and memory; The processor is configured to communicate with the memory and execute instructions in the memory to implement the method according to any one of claims 1 to 10.
13. A readable storage medium, characterized in that: The readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the method according to any one of claims 1 to 10 is implemented.
14. A computer program product, characterized in that The computer program product comprises computer instructions, which implement the method according to any one of claims 1 to 10 when executed by a processor.