Interest calculation method, electronic device, storage medium, and program product
By introducing the fund transfer date as the basis for interest calculation in the financial system, the problem of interest calculation errors caused by inaccurate hardware clocks in existing technologies is solved, and the accuracy of interest calculation and the continuity of interest calculation cycles between systems are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- INDUSTRIAL AND COMMERCIAL BANK OF CHINA
- Filing Date
- 2026-01-06
- Publication Date
- 2026-06-02
AI Technical Summary
How can existing technologies effectively solve technical problems? How can existing technologies effectively solve technical problems? How can existing technologies effectively solve technical problems? How can existing technologies effectively solve technical problems? How can existing technologies effectively solve technical challenges or needs? How can existing technologies effectively solve technical problems? How can existing technologies effectively solve technical problems?
By introducing the fund transfer date as the core basis for interest calculation, the interest calculation logic is freed from its strong dependence on the system hardware clock, ensuring the continuity and accuracy of the interest calculation cycle and avoiding systemic interest calculation errors caused by the inaccuracy of a single node clock.
It significantly improves the robustness and fault tolerance of distributed systems under non-ideal clock environments, ensures the accuracy of interest calculation, and avoids problems such as interest calculation gaps or duplicate interest calculations.
Smart Images

Figure CN122134443A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to an interest calculation method, electronic device, storage medium, and program product. Background Technology
[0002] In the daily operations of financial institutions, daily account balance processing and interest calculation are core business processes. Typically, after completing the daily balance shift (from day T to day T+1), financial institutions calculate interest based on a snapshot of the account balance on day T and pay the corresponding interest to the customer on the agreed interest settlement date. However, due to the complex and diverse internal system architectures of financial institutions, significant differences exist between different institutions and even within the same institution. Ledger management and interest calculation functions often employ a distributed deployment model, running across multiple independent physical systems. This distributed architecture presents a technical challenge when funds flow between multiple systems, making it difficult to accurately coordinate interest calculation periods, thus affecting the accuracy of interest calculations.
[0003] To address these challenges, existing technologies primarily achieve cycle continuity by standardizing the daily switching time at the system level. Specifically, this solution mandates that all relevant systems adopt a consistent date switching time and synchronizes the daily switching operations of each system through a unified time synchronization mechanism. By ensuring complete consistency across multiple systems at the date switching point, the duration of funds within the system can be seamlessly connected, avoiding interest calculation errors caused by date discrepancies.
[0004] While existing solutions address the cycle continuity issue to some extent by standardizing daily switching times, they heavily rely on the clock accuracy of individual system hardware. Hardware clocks can experience delays due to factors such as equipment aging and unstable operating environments, leading to slight deviations in the actual switching times across systems. Furthermore, system clocks are vulnerable to cybersecurity threats, such as tampering or infiltration by malicious attackers. If the clocks of core system computer equipment deviate, it will directly cause misalignments in the time cycles of fund transfers between different systems, resulting in errors in interest calculation and ultimately, poor interest rate accuracy. Summary of the Invention
[0005] This application provides an interest calculation method, electronic device, storage medium, and program product to improve the accuracy of interest calculation.
[0006] In a first aspect, embodiments of this application provide an interest calculation method, including:
[0007] Obtain a fund transfer instruction and extract the fund transfer date and transfer amount from the fund transfer instruction, wherein the initiator is used to instruct the party initiating the fund transfer;
[0008] Based on the difference between the current date in the recipient's system and the date of fund transfer, determine whether the transferred amount accrues interest on the current date in the recipient's system.
[0009] Interest is calculated on the transferred amount based on whether interest is accrued in the recipient's system on the current date.
[0010] Optionally, the fund transfer instruction is a credit fund transfer instruction or a debit fund transfer instruction;
[0011] The fund transfer date of the initiator of the credit-type fund transfer instruction is the debit fund transfer date;
[0012] The fund transfer date of the initiator of the debit fund transfer instruction is the same as the fund transfer date of the creditor.
[0013] Optionally, the fund transfer instruction is a credit-type fund transfer instruction. Based on the difference between the current date in the recipient's system and the fund transfer date, it is determined whether the transferred amount accrues interest on the current date in the recipient's system, including:
[0014] If the fund transfer date is later than the current date of the recipient's system, then the transferred amount will not accrue interest on the current date of the recipient's system.
[0015] If the fund transfer date is equal to or earlier than the current date of the recipient's system, then the transferred amount is determined to accrue interest on the current date of the recipient's system.
[0016] Optionally, the method further includes:
[0017] If the fund transfer date is earlier than the current date of the receiving system, then the interest on the transferred amount within the interest supplement period is calculated, wherein the interest supplement period is used to indicate the number of days between the current date of the receiving system and the fund transfer date.
[0018] Optionally, the fund transfer instruction is a debit fund transfer instruction. Based on the difference between the current date in the recipient's system and the fund transfer date, determining whether the transferred amount accrues interest on the current date in the recipient's system includes:
[0019] If the fund transfer date is later than the current date of the recipient's system, then the transferred amount will accrue interest on the current date of the recipient's system.
[0020] If the fund transfer date is equal to or earlier than the current date of the recipient's system, then the transferred amount will not accrue interest on the current date of the recipient's system.
[0021] Optionally, the method further includes:
[0022] If the fund transfer date is earlier than the current date of the receiving system, then the interest on the transferred amount within the interest supplement period is subtracted, wherein the interest supplement period is used to indicate the number of days between the current date of the receiving system and the fund transfer date.
[0023] Optionally, obtain funds transfer instructions, including:
[0024] Verify the hardware clock status of the initiating system;
[0025] Obtain a funds transfer instruction when a hardware clock anomaly is detected.
[0026] Secondly, embodiments of this application provide an electronic device, including: a memory and a processor;
[0027] The memory stores computer-executed instructions;
[0028] The processor executes computer execution instructions stored in the memory, causing the processor to perform various possible implementations as described above.
[0029] Thirdly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement various possible implementations as described in any of the above aspects.
[0030] Fourthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements various possible implementations as described in any of the above aspects.
[0031] The interest calculation method, electronic device, storage medium, and program product provided in this application include: obtaining a fund transfer instruction and extracting the fund transfer date and transfer amount of the initiator from the fund transfer instruction, wherein the initiator is used to indicate the party initiating the fund transfer; determining whether the transfer amount accrues interest on the current date of the receiving system based on the difference between the current date of the receiving system and the fund transfer date; and calculating interest on the transfer amount based on whether the transfer amount accrues interest on the current date of the receiving system. This solution introduces the fund transfer date as the core basis for interest calculation, freeing the interest calculation logic from strong dependence on the system hardware clock. Even if there is a deviation between the local clock of the receiving system and the initiator system, the system can still accurately determine the interest calculation period based on the initiator date carried in the fund transfer instruction, fundamentally eliminating the risk of systemic interest calculation errors caused by the inaccuracy of a single node clock, and significantly improving the robustness and fault tolerance of the distributed system in non-ideal clock environments. Furthermore, by comparing the recipient's current date with the fund transfer date, it determines whether the transferred amount is subject to interest, ensuring the continuity of the interest calculation period when funds are transferred between systems. This effectively avoids interest calculation gaps or duplicate interest calculations caused by minor differences in the date cut-off time, fundamentally guaranteeing the accuracy of interest calculation. Attached Figure Description
[0032] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0033] Figure 1 A graph showing the balance changes of borrowers and lenders, provided as an embodiment of this application;
[0034] Figure 2 An application scenario diagram provided for an embodiment of this application;
[0035] Figure 3 A flowchart illustrating an interest calculation method provided in an embodiment of this application;
[0036] Figure 4 Another balance change graph for borrowers and lenders provided in this application embodiment;
[0037] Figure 5 This application provides yet another graph showing the balance changes of the lending and borrowing parties.
[0038] Figure 6 This is a schematic diagram of the structure of an interest calculation device provided in an embodiment of this application;
[0039] Figure 7 A schematic diagram of the structure of the electronic device provided in this application.
[0040] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0041] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0042] In the daily operations of financial institutions, the processing of interest on account funds is a fundamental and core business. Its standard process typically involves three key steps: First, at the end of each business day, the system performs a day-switching operation, switching the business date from day T to day T+1; then, the system calculates interest based on a snapshot of the account balance at the end of day T; finally, on the pre-agreed interest settlement date, the accumulated interest is paid to the customer. The accuracy of this process directly affects the financial institution's financial accounting precision, operational cost control, and customer trust.
[0043] However, with the continuous expansion of financial business and the increasing complexity of product types, the information system architecture of financial institutions has also exhibited a high degree of heterogeneity and distributed characteristics. Not only do the systems of different financial institutions vary greatly, but even within the same institution, there are often multiple independent core business systems, credit systems, wealth management systems, etc. These systems, based on functional and performance requirements, adopt a distributed deployment model, distributing functions such as customer ledger management, transaction processing, and interest calculation across different physical servers or virtual environments. While this architecture improves the system's processing power and flexibility, it also brings new technical challenges: when funds flow between different physical systems, for example, from a current account to a wealth management account, or undergo a cross-system loan issuance and repayment, ensuring that the interest calculation period of these funds is seamlessly and accurately recorded and connected in each existing system becomes a critical pain point that urgently needs to be addressed. Any overlap or gap in the interest calculation period at any stage will lead to deviations in the final interest calculation result.
[0044] To address the challenge of aligning interest calculation cycles in a distributed environment, existing technologies generally employ a time synchronization-based solution. The core idea of this solution is to enforce a unified daily cutoff time at the system level. Specifically, by deploying a unified time server, all business systems involved in interest calculation within the network are forced to synchronize their clocks with it. At the preset daily cutoff time, all systems are required to switch dates almost simultaneously. Theoretically, this synchronized approach ensures that funds ending on day T in system A will begin accruing interest precisely on day T+1 in system B, thus achieving a natural continuity of the fund's time cycle and avoiding interest calculation gaps or duplicate interest calculations caused by inconsistencies in dates between systems.
[0045] While the proposed solution is intuitive and effective in ideal conditions, it relies excessively on the absolute accuracy and security of the underlying hardware clock. First, hardware clocks inherently have errors. Different servers have slightly different crystal oscillator frequencies, and these frequencies drift and experience latency due to factors such as equipment aging and environmental temperature changes. In large distributed systems, even millisecond-level clock deviations can accumulate over time, potentially causing some nodes to slightly lead or lag in their daily clock operations. Second, the solution faces significant cybersecurity challenges. The system clock is a vulnerable target. Malicious attackers could use network penetration techniques to tamper with the clock of a non-core system, thereby affecting the core interest calculation system through dependencies. If the clock of a critical system is successfully modified or significantly deviates, it will directly disrupt global time consistency. The consequence is misalignment of fund retention periods across multiple systems. For example, funds recorded as day T+1 in system A might still be incorrectly recorded as day T in system B, leading to under- or over-calculation of interest. Such errors can be amplified dramatically in the context of massive transactions, causing not only financial losses or customer disputes for financial institutions, but also potentially triggering serious compliance risks and reputational crises.
[0046] For example, if there is a time difference between the interest calculation system of account A (e.g., daily cut-off 0:00) and the interest calculation system of account B (daily cut-off 0:01), the customer can initiate a transfer from account A to account B on the new date. Because account B has not completed the daily cut-off, the funds are still credited to account B on the original date and accrue interest. After the daily cut-off, account B will enter a new cycle for interest calculation again, resulting in the same funds accruing interest twice in two accounts within the same time period.
[0047] Figure 1 A graph showing the balance changes of borrowers and lenders is provided as an embodiment of this application. Figure 1As shown, the daily cutoff point for debits is 00:00, and the daily cutoff point for credits is 00:01. If a remittance occurs between 00:00 and 00:01, the daily cutoff is completed for the debit side, which is day T+1. The original amount in the debit account is A, and the remittance amount is m. After the remittance, the account balance on day T+1 is A-m. For the credit side, the daily cutoff is not yet completed, which is day T. The account balance on day T is B+m, and the account balance on day T+1 is B+m.
[0048] Table 1 is a loan interest calculation table provided in an embodiment of this application. As can be seen from Table 1, when transferring funds between two systems with different daily cut-off points, over-calculation of interest may occur.
[0049]
[0050] In view of this, this application provides an interest calculation method. The server of the receiving system can obtain a fund transfer instruction and extract the fund transfer date and transfer amount from the instruction. Then, based on the difference between the current date of the receiving system and the fund transfer date, it determines whether the transfer amount accrues interest on the current date of the receiving system. Based on whether the transfer amount accrues interest on the current date of the receiving system, interest is calculated on the transfer amount. This solution introduces the fund transfer date as the core basis for interest calculation, freeing the interest calculation logic from strong dependence on the system hardware clock. Even if there is a deviation between the local clock of the receiving system and the initiating system, the system can still accurately determine the interest period based on the initiating date carried in the fund transfer instruction. This fundamentally eliminates the risk of systemic interest calculation errors caused by the inaccuracy of a single node's clock, significantly improving the robustness and fault tolerance of the distributed system in non-ideal clock environments. Furthermore, by comparing the recipient's current date with the fund transfer date, it determines whether the transferred amount is subject to interest, ensuring the continuity of the interest calculation period when funds are transferred between systems. This effectively avoids interest calculation gaps or duplicate interest calculations caused by minor differences in the date cut-off time, fundamentally guaranteeing the accuracy of interest calculation.
[0051] Figure 2 An application scenario diagram provided for an embodiment of this application, such as... Figure 2 As shown, the server of the receiving system first obtains the fund transfer instruction, extracts the fund transfer date and transfer amount from the fund transfer instruction, determines the current date of the receiving system, and determines whether the transfer amount accrues interest on the current date of the receiving system based on the difference between the current date of the receiving system and the fund transfer date. Based on whether the transfer amount accrues interest on the current date of the receiving system, interest is calculated on the transfer amount.
[0052] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0053] Figure 3 This is a flowchart illustrating an interest calculation method provided in an embodiment of this application. The executing entity in this embodiment can be any device with data processing capabilities. This application uses the receiver's server as an example for specific illustration. Figure 3 As shown in the embodiment of this application, an interest calculation method is provided, the method comprising:
[0054] Step 301: Obtain the fund transfer instruction and extract the fund transfer date and transfer amount from the fund transfer instruction. The initiator is used to instruct the party that initiates the fund transfer.
[0055] Among them, a funds transfer instruction is a standardized electronic data message transmitted between distributed financial systems, which carries all the business information required to transfer funds from one system (initiator) to another system (recipient).
[0056] The initiator is used to instruct the party that initiates the transfer of funds.
[0057] Fund transfer instructions can be either credit or debit. For credit instructions (such as bank transfers), the fund transfer date corresponding to the initiator is the debit transfer date. For credit instructions, the recipient is the party receiving the funds, and the initiator is the party transferring the funds.
[0058] For debit transactions (such as utility bill payments), the fund transfer date corresponding to the initiator is the same as the credit fund transfer date. In debit fund transfer instructions, the recipient is the party transferring the funds, and the initiator is the party receiving the funds.
[0059] The fund transfer date refers to the business date on which the funds are successfully deducted and recorded in the initiating system, and the ownership of the funds is transferred in a legal and accounting sense. This date is determined and marked by the initiating system when generating the fund transfer instruction, based on its own completed business logic and daily status.
[0060] Specifically, the receiving server will start one or more network listening services to continuously listen for requests from specific network addresses or message queues in order to obtain fund transfer instructions.
[0061] Upon receiving a fund transfer instruction, the message parsing module is used to parse the instruction and extract the initiator's fund transfer date and amount.
[0062] Optionally, obtain funds transfer instructions, including:
[0063] Verify the hardware clock status of the initiating system;
[0064] Obtain a funds transfer instruction when a hardware clock anomaly is detected.
[0065] Specifically, the receiving server can check the hardware clock status of the initiating system. If a hardware clock anomaly is detected, it will obtain a funds transfer instruction. If the hardware clock is detected to be in a normal state, the existing standard process based on a unified daily time-switching mechanism can be used for processing.
[0066] In this way, when the clock is normal, the system can continue using the existing, potentially more lightweight and efficient synchronization-based process, optimizing computing resources and processing performance. The core method of this application, while more robust, is only activated when the specific risk of clock anomalies is detected. This ensures efficient system operation for the vast majority of normal uptime, while simultaneously guaranteeing absolute business reliability at critical moments, achieving a perfect trade-off between the two.
[0067] Optionally, obtain funds transfer instructions, including:
[0068] Verify the hardware clock status of the initiating and receiving systems;
[0069] Obtain funds transfer instructions when the hardware clock of either the initiator system or the receiver system malfunctions.
[0070] When the hardware clocks of both the initiating and receiving systems are in normal working order, the existing standard process based on a unified daily cutoff time can be used for processing.
[0071] Step 302: Based on the difference between the current date in the recipient's system and the date of fund transfer, determine whether the transferred amount accrues interest on the current date in the recipient's system.
[0072] Specifically, the receiving server first determines the recipient's current date, and then determines whether the transferred amount accrues interest in the receiving system based on the difference between the recipient's current system date and the fund transfer date.
[0073] Optionally, the funds transfer instruction is a credit-type funds transfer instruction. Based on the difference between the current date in the recipient's system and the funds transfer date, it is determined whether the transferred amount accrues interest on the current date in the recipient's system, including:
[0074] If the fund transfer date is later than the current date in the recipient's system, then the transferred amount will not accrue interest on the current date in the recipient's system.
[0075] If the fund transfer date is equal to or earlier than the current date in the recipient's system, then the transferred amount will accrue interest on the current date in the recipient's system.
[0076] In this way, by adopting the rule of "no interest accrual if later than the effective date", this method clearly places such funds that will take effect in the future in a "frozen" or "pending confirmation" state before the effective date, avoiding the early payment of interest, protecting the interests of financial institutions, and achieving refined coverage of complex business scenarios.
[0077] Specifically, when the fund transfer instruction is a credit-type fund transfer instruction, if the fund transfer date is later than the current date of the recipient's system, the receiving server determines that the transferred amount will not accrue interest on the current date of the recipient's system, that is, the transferred amount will be recorded in the non-interest-bearing ledger.
[0078] When the receiving server determines that the transferred amount will accrue interest on the current date of the receiving system if the fund transfer date is equal to or earlier than the current date of the receiving system, the transferred amount will be recorded in the interest-bearing ledger.
[0079] Optionally, the method also includes:
[0080] If the fund transfer date is earlier than the current date in the recipient's system, interest on the transferred amount is calculated within the interest supplement period, where the interest supplement period indicates the number of days between the current date in the recipient's system and the fund transfer date.
[0081] Specifically, when the receiving server's fund transfer date is earlier than the current date of the receiving system, in addition to calculating the interest on the transferred amount on the current date of the receiving system, it also calculates the interest on the transferred amount within the interest supplement period.
[0082] In one example, the current date on the receiving system is October 26th, and the fund transfer date is October 24th. Therefore, the interest payment period is two days, meaning that interest must be calculated not only for October 26th but also for October 25th and October 24th. Assuming the transferred amount is m and the original amount on the receiving system is B, the formula for calculating interest on the receiving system is: Total Interest = (B + m) * Daily Interest Rate + Interest within the Interest Payment Period, and Interest within the Interest Payment Period = (B + m) * Daily Interest Rate * 2.
[0083] In another example, the receiving server distinguishes three types of ledgers based on the sender's fund transfer date when it receives the transferred funds:
[0084] Category 1: When the sender's fund transfer date is later than the recipient's current date, the transferred amount is recorded in the non-interest-bearing ledger, and no interest needs to be calculated in the recipient's non-interest-bearing ledger after the transfer date; see reference. Figure 1 As can be seen, the fund transfer date is T+1 day. The transfer amount is received in the recipient's system on day T, but the transfer amount is recorded in the non-interest-bearing ledger. Interest is calculated normally on day T+1 and after day T+1 in the recipient's system.
[0085] Table 2 is another loan interest calculation table provided in the embodiments of this application. As can be seen from Table 2, the calculation method in this application will not result in over-calculation or under-calculation of interest.
[0086]
[0087] Category 2: When the sender's fund transfer date is equal to the receiver's current date, the transferred amount is recorded in the interest-bearing ledger, and the interest-bearing ledger calculates the interest for that day normally after the receiver's date.
[0088] Figure 4 Another balance change graph for borrowers provided in this application embodiment, such as Figure 4 As shown, the debit day cutoff point is 00:00, and the credit day cutoff point is 00:01. If a remittance occurs before 00:00, the day cutoff is not yet complete for the debit side, and it is day T. The original amount in the debit account is A, and the remittance amount is m. After the remittance, the account balance on day T is A - m. For the credit side, the day cutoff is also not yet complete, and it is also day T. The account balance on day T is B + m. When the fund transfer date of the sender is equal to the current date of the receiver, the transferred amount is recorded in the interest-bearing ledger, and interest is calculated normally on day T+1 and after day T+1 in the receiver's system.
[0089] Table 3 is another loan interest calculation table provided in the embodiments of this application. As can be seen from Table 3, the calculation method in this application will not result in over-calculation or under-calculation of interest.
[0090]
[0091] Category 3: When the sender's fund transfer date is earlier than the recipient's current date, the transfer amount is recorded in the interest supplement book. The interest supplement period is the number of days between the recipient's current date and the sender's fund transfer date. After the recipient's date is cut off, the interest supplement book needs to calculate the interest for that day normally and add the interest for the interest supplement period.
[0092] Figure 5 Another type of balance change graph for borrowers and lenders provided in this application embodiment, such as Figure 5As shown, the daily cutoff point for the credit side is 00:00, and the daily cutoff point for the debit side is 00:01. If a remittance occurs between 00:00 and 00:01, the daily cutoff is not yet completed for the debit side, which is day T. The original amount in the debit account is A, and the remittance amount is m. After the remittance, the account balance on day T is Am. For the credit side, the daily cutoff is completed, which is day T+1. The account balance on day T+1 is B+m. When the fund transfer date of the sender is earlier than the current date of the receiver, the transferred amount is recorded in the interest-bearing ledger, and the interest on the transferred amount on day T is supplemented. Interest is also calculated normally after day T+1 in the receiver's system.
[0093] Table 4 is another loan interest calculation table provided in the embodiments of this application. As can be seen from Table 4, the calculation method in this application will not result in over-calculation or under-calculation of interest.
[0094]
[0095] This ensures that no interest is missed throughout the entire lifecycle of funds, from the moment ownership is transferred from the originator until the recipient begins accruing interest. This is crucial for maintaining financial fairness between financial institutions and their customers, preventing interest losses due to technical reasons.
[0096] Optionally, the funds transfer instruction is a debit-type funds transfer instruction. Based on the difference between the current date in the recipient's system and the funds transfer date, it is determined whether the transferred amount accrues interest on the current date in the recipient's system, including:
[0097] If the fund transfer date is later than the current date in the recipient's system, the transferred amount will accrue interest from the current date in the recipient's system.
[0098] If the fund transfer date is equal to or earlier than the current date in the recipient's system, then the transferred amount will not accrue interest on the current date in the recipient's system.
[0099] Specifically, when the fund transfer instruction is a debit fund transfer instruction, if the fund transfer date is later than the current date of the recipient's system, the receiving server determines that the transferred amount will accrue interest on the current date of the recipient's system, that is, the transferred amount will be recorded in the interest-bearing ledger.
[0100] If the receiving server determines that the transferred amount will not accrue interest on the current date of the receiving system when the fund transfer date is equal to or earlier than the current date of the receiving system, the transferred amount will be recorded in the non-interest-bearing ledger.
[0101] In this way, in debit scenarios, determining whether interest should be calculated by comparing the fund transfer date with the current date and time in the recipient's system can improve the accuracy of interest calculation.
[0102] Optionally, the method also includes:
[0103] If the fund transfer date is earlier than the current date in the recipient's system, the interest accrued on the transferred amount during the interest recovery period will be subtracted. The interest recovery period indicates the number of days between the current date in the recipient's system and the fund transfer date.
[0104] Specifically, if the fund transfer date is earlier than the current date in the recipient's system, not only will no interest be calculated on the current date in the recipient's system, but the interest on the transferred amount during the interest supplementation period will also be deducted.
[0105] For example, if the current date of the receiving system is October 26th and the fund transfer date is October 24th, then the interest supplement period is two days. That is, not only is the interest on October 26th not calculated, but the interest already calculated on October 25th and October 24th is also subtracted.
[0106] In this way, if the fund transfer date is earlier than the current date in the recipient's system, subtracting the interest generated within the interest calculation period can ensure that the interest is not overcharged, thus further improving the accuracy of interest calculation.
[0107] Step 303: Calculate interest on the transferred amount based on whether interest is accrued in the recipient's system on the current date.
[0108] Specifically, the receiving server can calculate interest on the transferred amount based on whether interest is accrued on the current date in the receiving system.
[0109] The interest calculation method provided in this application obtains a fund transfer instruction and extracts the fund transfer date and transfer amount from the instruction. The initiator is used to instruct the party initiating the fund transfer. Based on the difference between the current date of the receiving system and the fund transfer date, it determines whether the transfer amount accrues interest on the current date of the receiving system. Based on whether the transfer amount accrues interest on the current date of the receiving system, interest is calculated on the transfer amount. This solution introduces the fund transfer date as the core basis for interest calculation, freeing the interest calculation logic from strong dependence on the system hardware clock. Even if there is a deviation between the local clock of the receiving system and the initiator system, the system can still accurately determine the interest period based on the initiator date carried in the fund transfer instruction. This fundamentally eliminates the risk of systemic interest calculation errors caused by the inaccuracy of a single node clock, and significantly improves the robustness and fault tolerance of the distributed system in non-ideal clock environments. Furthermore, by comparing the recipient's current date with the fund transfer date, it determines whether the transferred amount is subject to interest, ensuring the continuity of the interest calculation period when funds are transferred between systems. This effectively avoids interest calculation gaps or duplicate interest calculations caused by minor differences in the date cut-off time, fundamentally guaranteeing the accuracy of interest calculation.
[0110] Corresponding to the above-described interest calculation method, this application also provides an interest calculation device. Figure 6 This is a schematic diagram of the structure of an interest calculation device provided in an embodiment of this application, as shown below. Figure 6 As shown, this embodiment provides an interest calculation device, which includes:
[0111] Acquisition device 601 is used to acquire funds transfer instructions and extract the fund transfer date and transfer amount of the initiator from the fund transfer instructions, wherein the initiator is used to instruct the party that initiates the fund transfer;
[0112] The determining device 602 is used to determine whether the transferred amount accrues interest on the current date of the recipient's system based on the difference between the current date of the recipient's system and the date of fund transfer;
[0113] The computing device 603 is used to calculate interest on the transferred amount based on whether interest is accrued on the current date in the recipient's system.
[0114] Optionally, the funds transfer instruction can be a credit fund transfer instruction or a debit fund transfer instruction;
[0115] The fund transfer date for the initiator of a credit-type fund transfer instruction is the debit fund transfer date;
[0116] The fund transfer date for the initiator of a debit fund transfer instruction is the same as the fund transfer date for the credit instruction.
[0117] Optionally, the funds transfer instruction is a credit-type funds transfer instruction, and the determining device 602 is specifically used for:
[0118] If the fund transfer date is later than the current date in the recipient's system, then the transferred amount will not accrue interest on the current date in the recipient's system.
[0119] If the fund transfer date is equal to or earlier than the current date in the recipient's system, the transferred amount will accrue interest on the current date in the recipient's system.
[0120] Optionally, the determining device 602 is also used for:
[0121] If the fund transfer date is earlier than the current date in the recipient's system, interest on the transferred amount is calculated within the interest supplement period, where the interest supplement period indicates the number of days between the current date in the recipient's system and the fund transfer date.
[0122] Optionally, the funds transfer instruction is a debit-type funds transfer instruction, and the determining device 602 is specifically used for:
[0123] If the fund transfer date is later than the current date in the recipient's system, the transferred amount will accrue interest from the current date in the recipient's system.
[0124] If the fund transfer date is equal to or earlier than the current date in the recipient's system, then the transferred amount will not accrue interest on the current date in the recipient's system.
[0125] Optionally, the determining device 602 is also used for:
[0126] If the fund transfer date is earlier than the current date in the recipient's system, the interest accrued on the transferred amount during the interest recovery period will be subtracted. The interest recovery period indicates the number of days between the current date in the recipient's system and the fund transfer date.
[0127] Optionally, when acquiring a funds transfer instruction, the acquiring device 601 is specifically used for:
[0128] Verify the hardware clock status of the initiating system;
[0129] Obtain a funds transfer instruction when a hardware clock anomaly is detected.
[0130] The interest calculation device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0131] Figure 7 A schematic diagram of the structure of the electronic device provided in this application. Figure 7 As shown, the electronic device 70 provided in this embodiment includes at least one processor 701 and a memory 702. Optionally, the device 70 further includes a communication component 703. The processor 701, memory 702, and communication component 703 are connected via a bus 704.
[0132] In a specific implementation, at least one processor 701 executes computer execution instructions stored in memory 702, causing at least one processor 701 to perform the above-described method.
[0133] The specific implementation process of processor 701 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0134] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0135] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0136] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0137] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0138] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.
[0139] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0140] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0141] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0142] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0143] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0144] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0145] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0146] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A method for calculating interest, characterized in that, include: Obtain a fund transfer instruction and extract the fund transfer date and transfer amount from the fund transfer instruction, wherein the initiator is used to instruct the party initiating the fund transfer; Based on the difference between the current date in the recipient's system and the date of fund transfer, determine whether the transferred amount accrues interest on the current date in the recipient's system. Interest is calculated on the transferred amount based on whether interest is accrued in the recipient's system on the current date.
2. The method according to claim 1, characterized in that, The fund transfer instruction is a credit fund transfer instruction or a debit fund transfer instruction; The fund transfer date of the initiator of the credit-type fund transfer instruction is the debit fund transfer date; The fund transfer date of the initiator of the debit fund transfer instruction is the same as the fund transfer date of the credit.
3. The method according to claim 2, characterized in that, The fund transfer instruction is a credit-type fund transfer instruction. Based on the difference between the current date in the recipient's system and the fund transfer date, it is determined whether the transferred amount accrues interest on the current date in the recipient's system, including: If the fund transfer date is later than the current date of the recipient's system, then the transferred amount will not accrue interest on the current date of the recipient's system. If the fund transfer date is equal to or earlier than the current date of the recipient's system, then the transferred amount is determined to accrue interest on the current date of the recipient's system.
4. The method according to claim 3, characterized in that, The method further includes: If the fund transfer date is earlier than the current date of the receiving system, then the interest on the transferred amount within the interest supplement period is calculated, wherein the interest supplement period is used to indicate the number of days between the current date of the receiving system and the fund transfer date.
5. The method according to claim 2, characterized in that, The fund transfer instruction is a debit-type fund transfer instruction. Based on the difference between the current date in the recipient's system and the fund transfer date, it is determined whether the transferred amount accrues interest on the current date in the recipient's system, including: If the fund transfer date is later than the current date of the recipient's system, then the transferred amount will accrue interest on the current date of the recipient's system. If the fund transfer date is equal to or earlier than the current date of the recipient's system, then the transferred amount will not accrue interest on the current date of the recipient's system.
6. The method according to claim 5, characterized in that, The method further includes: If the fund transfer date is earlier than the current date of the receiving system, then the interest on the transferred amount within the interest supplement period is subtracted, wherein the interest supplement period is used to indicate the number of days between the current date of the receiving system and the fund transfer date.
7. The method according to any one of claims 1-6, characterized in that, Obtaining fund transfer instructions includes: Verify the hardware clock status of the initiating system; Obtain funds transfer instructions when a hardware clock anomaly is detected.
8. An electronic device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-6.
10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method described in any one of claims 1-6.