Bank live deposit account interest settlement optimization processing method
By splitting the current account interest settlement processing into multiple steps in parallel processing and optimizing the data distribution, the problem of low efficiency and stability of bank current account interest settlement processing is solved, and efficient interest settlement operations and system stability improvement is achieved.
Patent Information
- Application Number
- CN202510499748.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-08-15
AI Technical Summary
The interest settlement processing of bank current accounts has problems such as high data processing pressure, high resource usage, slow system response speed, and insufficient scalability and fault tolerance in high concurrency scenarios.
The current account interest settlement processing is divided into six independent steps, and the database stored procedures and parallel processing technology are adopted to optimize data distribution and processing flow through batch concurrent dynamic resource scheduling, support parallel processing within and between steps, and dynamically schedule resources to improve efficiency.
It has achieved 10 million accounts to complete interest settlement processing within 10 minutes, reducing system resource usage, enhancing the stability and scalability of the system, and reducing the work burden of operation and maintenance personnel.
Smart Images

Figure CN120494953A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of IT development technology, and specifically relates to a method for optimizing interest settlement processing for bank current deposit accounts, which can complete interest settlement processing for 10 million accounts within 10 minutes. Background Art
[0002] Banks handle a massive amount of current account data, requiring batch interest settlement at the end of each quarter. This process typically involves complex calculations and extensive data updates, placing extremely high demands on system performance and stability. The system must be able to complete these massive calculations in a short period of time while ensuring the accuracy and integrity of account data.
[0003] The current problems are:
[0004] (1) Data processing pressure is high. When settling interest, a large amount of account data needs to be processed, which places high demands on the system's data processing capabilities and storage capacity. The system must be able to efficiently read, calculate and update account balances and interest information.
[0005] (2) During the interest settlement process, a large number of accounts need to be processed in batches, which may lead to high usage of system resources and affect the response speed of the system.
[0006] (3) In high-concurrency scenarios, such as at the end of the quarter, the system needs to have good scalability and fault tolerance to cope with possible performance bottlenecks.
[0007] Therefore, how to overcome the shortcomings of existing technologies is an urgent problem to be solved in the field of IT development technology. Summary of the Invention
[0008] The purpose of the present invention is to solve the deficiencies of the prior art and to provide a method for optimizing the processing of interest settlement for bank current deposit accounts.
[0009] To achieve the above object, the technical solution adopted by the present invention is as follows:
[0010] A method for optimizing interest settlement of a bank current deposit account, comprising the following steps:
[0011] S101, the batch processing master control program polls the batch processing step table and schedules according to the configured concurrency logic;
[0012] S102: The main control program checks the number H1 of interest calculation sub-steps currently running. If H1 is less than the concurrent number N1 of the step, a new step is called until all interest calculation sub-steps are completed.
[0013] S103: The main control program checks the number of running account interest splitting processing sub-steps, H2. If H2 is less than the concurrent number N2 of the step, a new step is called; otherwise, the main control program continues to check the interest settlement details generation step;
[0014] S104: The main control program checks the number H3 of interest settlement details generation sub-steps currently running. If H3 is less than the concurrent number N3 of the step, a new step is called; otherwise, the program continues to check the unrecorded discount generation step.
[0015] S105: The main control program checks the number H4 of running unregistered discount generation sub-steps. If H4 is less than the concurrent number N4 of the step, a new step is called.
[0016] S106, the main control program checks the three steps S103 to S105 in a cyclic manner until all sub-steps of these three steps are completed;
[0017] S107, the main control program calls the user processing step until the step is completed;
[0018] S108, the main control program calls the unpaid interest account processing step until the step is completed.
[0019] Furthermore, preferably, in S101, the step table is specifically as shown in Table 1.
[0020] Table 1
[0021] Serial number Batch step name Are there sub-steps Concurrency Properties 1 Interest calculation have Normal steps, sub-steps can be parallelized 2 Account interest splitting have Parallel steps, steps can be parallelized 3 Generate interest settlement details have Parallel steps, steps can be parallelized 4 Unregistered discount generation have Parallel steps, steps can be parallelized 5 Account transfer processing none Normal steps, not parallelizable 6 Processing of outstanding interest accounts none Normal steps, not parallelizable .
[0022] Furthermore, preferably, interest calculation only supports parallel processing within steps. One account is hash partitioned according to the account number, with a total of 32 partitions, that is, there are 32 parallel steps.
[0023] Furthermore, it is preferred that the three steps of account interest separation processing, interest settlement details generation, and unrecorded discount generation all support simultaneous parallel processing within and between steps, that is, the number of parallel steps = 32 × 3 = 96 parallel steps
[0024] Furthermore, preferably, the specific method for handling account interest splitting is:
[0025] Traverse each piece of data in parallel according to the partitions of the database table;
[0026] First, check whether the account's last transaction date, account balance, and account total have changed;
[0027] If there is a change, record it in the household information form; if there is no change, do not register it;
[0028] If the account balance is negative, interest cannot be settled. The unsettled interest information table must be recorded, and the record will be skipped to proceed to the next account.
[0029] If the account balance is greater than or equal to 0, the interest will be stored in the current account according to the account deposit model.
[0030] Furthermore, preferably, the specific method of handling account change is:
[0031] Traverse all accounts in the active account table and find the current account details of each account. The details with a serial number greater than the serial number in the interest calculation table are the details after interest settlement. Just add 2 to these serial numbers.
[0032] The present invention divides the interest settlement processing of current accounts into six independent batch processing steps: interest calculation, account interest separation processing, interest settlement details generation, unrecorded discount generation, account activation processing, and unrecorded account processing, as shown in Table 1.
[0033] The batch processing steps of the present invention are described as follows: including ordinary steps (not parallel), parallel steps, and sub-steps (parallel keywords are provided by the steps and dynamically generated during loading; they inherit the parallel properties of the steps, that is, the sub-steps of ordinary steps can only be parallel with each other, and the sub-steps of parallel steps can be parallel with the sub-steps of other steps).
[0034] The present invention supports multiple scheduling modes for batch processing of different steps, including sequential scheduling (for steps that cannot be run in parallel and have no sub-steps), parallelism only within steps (for steps that cannot be run in parallel and have sub-steps), parallelism only between steps (for steps that can be run in parallel but have no sub-steps), and parallelism within and between steps (for steps that can be run in parallel and sub-steps of steps that can be run in parallel).
[0035] Compared with the prior art, the present invention has the following beneficial effects:
[0036] The present invention provides a method for optimizing the processing of interest settlement on bank current deposit accounts, which is used to improve the efficiency of interest settlement on current accounts, shorten the interest settlement time, reduce system resource usage, and enhance the scalability and fault tolerance of the system. Specifically, the method effectively copes with the processing pressure of massive account data by optimizing the distribution of current accounts and related data, optimizing the interest settlement processing process, and using database stored procedures and parallel processing technology, thereby improving the efficiency of batch processing and achieving interest settlement processing for 10 million accounts within 10 minutes. At the same time, through dynamic resource scheduling of batch processing concurrency, the stability and response speed of the system in high-concurrency scenarios are ensured, ensuring the smooth progress of interest settlement tasks and reducing the workload of operation and maintenance personnel. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 This is a flow chart of the method for optimizing the processing of interest settlement for a bank current deposit account according to the present invention; DETAILED DESCRIPTION
[0038] The present invention is described in further detail below with reference to the embodiments.
[0039] Those skilled in the art will understand that the following examples are only intended to illustrate the present invention and should not be construed as limiting the scope of the present invention. Where specific techniques or conditions are not specified in the examples, the techniques or conditions described in the literature in the art or in the product specifications are used. Materials or equipment used without manufacturer indication are conventional products that can be purchased. C language and SQL are used in some places in the examples for explanation, but the present invention is not limited to the specific implementation language.
[0040] Example 1
[0041] like Figure 1 As shown, a method for optimizing interest settlement of a bank current deposit account includes the following steps:
[0042] S101, the batch processing master control program polls the batch processing step table and schedules according to the configured concurrency logic;
[0043] S102: The main control program checks the number H1 of interest calculation sub-steps currently running. If H1 is less than the concurrent number N1 of the step, a new step is called until all interest calculation sub-steps are completed.
[0044] S103: The main control program checks the number of running account interest splitting processing sub-steps, H2. If H2 is less than the concurrent number N2 of the step, a new step is called; otherwise, the main control program continues to check the interest settlement details generation step;
[0045] S104: The main control program checks the number H3 of interest settlement details generation sub-steps currently running. If H3 is less than the concurrent number N3 of the step, a new step is called; otherwise, the program continues to check the unrecorded discount generation step.
[0046] S105: The main control program checks the number H4 of running unregistered discount generation sub-steps. If H4 is less than the concurrent number N4 of the step, a new step is called.
[0047] S106, the main control program checks the three steps S103 to S105 in a cyclic manner until all sub-steps of these three steps are completed;
[0048] S107, the main control program calls the user processing step until the step is completed;
[0049] S108, the main control program calls the unpaid interest account processing step until the step is completed.
[0050] Example 2
[0051] like Figure 1 As shown, a method for optimizing interest settlement of a bank current deposit account includes the following steps:
[0052] S101, the batch processing master control program polls the batch processing step table and schedules according to the configured concurrency logic;
[0053] S102: The main control program checks the number H1 of interest calculation sub-steps currently running. If H1 is less than the concurrent number N1 of the step, a new step is called until all interest calculation sub-steps are completed.
[0054] S103: The main control program checks the number of running account interest splitting processing sub-steps, H2. If H2 is less than the concurrent number N2 of the step, a new step is called; otherwise, the main control program continues to check the interest settlement details generation step;
[0055] S104: The main control program checks the number H3 of interest settlement details generation sub-steps currently running. If H3 is less than the concurrent number N3 of the step, a new step is called; otherwise, the program continues to check the unrecorded discount generation step.
[0056] S105: The main control program checks the number H4 of running unregistered discount generation sub-steps. If H4 is less than the concurrent number N4 of the step, a new step is called.
[0057] S106, the main control program checks the three steps S103 to S105 in a cyclic manner until all sub-steps of these three steps are completed;
[0058] S107, the main control program calls the user processing step until the step is completed;
[0059] S108, the main control program calls the unpaid interest account processing step until the step is completed.
[0060] In S101, the step table is specifically shown in Table 2.
[0061] Table 2
[0062]
[0063]
[0064] Interest calculation only supports parallel processing within a step. One account is hash-partitioned by account number, with a total of 32 partitions, meaning there are 32 parallel steps.
[0065] The three steps of account interest separation processing, interest settlement details generation, and unrecorded discount generation all support parallel processing within and between steps, that is, the number of parallel steps = 32 × 3 = 96 parallel steps
[0066] The specific methods for handling account interest splitting are as follows:
[0067] Traverse each piece of data in parallel according to the partitions of the database table;
[0068] First, check whether the account's last transaction date, account balance, and account total have changed;
[0069] If there is a change, record it in the household information form; if there is no change, do not register it;
[0070] If the account balance is negative, interest cannot be settled. The unsettled interest information table must be recorded, and the record will be skipped to proceed to the next account.
[0071] If the account balance is greater than or equal to 0, the interest will be stored in the current account according to the account deposit model.
[0072] The specific methods for handling account changes are as follows:
[0073] Traverse all accounts in the active account table and find the current account details of each account. The details with a serial number greater than the serial number in the interest calculation table are the details after interest settlement. Just add 2 to these serial numbers.
[0074] Application Examples
[0075] This example is an optimization method for calculating interest on bank current deposit accounts. It includes the following parts:
[0076] 1. Batch processing instructions
[0077] 1. Batch step description: includes normal steps (not parallel), parallel steps, and sub-steps (the parallel keyword is provided by the step and is dynamically generated during loading; it inherits the parallel properties of the step, that is, the sub-steps of a normal step can only be parallel with each other, and the sub-steps of a parallel step can be parallel with the sub-steps of other steps).
[0078] 2. For different steps, batch processing supports multiple scheduling modes, including sequential scheduling (for non-parallel and no sub-steps), parallelism only within steps (for non-parallel and with sub-steps), parallelism only between steps (for parallel but no sub-steps), and parallelism within and between steps (for parallel steps and sub-steps of parallel steps).
[0079] 2. Distribution of interest settlement-related data:
[0080] 1. Optimize account data distribution and use the HASH partition storage function provided by the database to ensure even data distribution.
[0081] 2. Optimize the distribution of account detail data and use the RANGE+HASH partition storage function provided by the database to ensure that account detail data on the same day is evenly distributed in each sub-partition.
[0082] 3. Optimize the distribution of unrecorded account data and use the RANGE+HASH partition storage function provided by the database to ensure that the unrecorded account data on the same day is evenly distributed in each sub-partition.
[0083] 4. Create a new interest calculation table on the interest payment date, and the partitioning rules are the same as those for current accounts.
[0084] 3. Design of interest settlement batch processing steps
[0085] 1. Split the interest settlement process for current accounts into six independent batch processing steps: interest calculation, account interest separation, interest settlement details generation, unrecorded discount generation, account activation processing, and unrecorded account processing. The scheduling attributes of each step are shown in Table 3.
[0086] Table 3
[0087] Serial number Batch step name Are there sub-steps Concurrency Properties 1 Interest calculation have Normal steps, sub-steps can be parallelized 2 Account interest splitting have Parallel steps, steps can be parallelized 3 Generate interest settlement details have Parallel steps, steps can be parallelized 4 Unregistered discount generation have Parallel steps, steps can be parallelized 5 Account transfer processing none Normal steps, not parallelizable 6 Processing of outstanding interest accounts none Normal steps, not parallelizable
[0088] IV. Instructions for interest settlement processing steps
[0089] The main steps and execution sequence involved in the present invention are as follows Figure 1 The following describes in detail how to implement each step:
[0090] 1. In step 1, interest calculation only supports parallel processing within the step (i.e., parallel processing based on the database partition of the current account). 10 million accounts are hash-partitioned by account number, resulting in 32 partitions in total, which means there are 32 parallel steps.
[0091] Step 1: Implementation of interest calculation: Using database stored procedures, the algorithm for calculating interest on current accounts is implemented through stored procedures. Because stored procedures are used, this step is parallelized based on the current account's partitions. Each parallel step ensures that the entire current account interest calculation process is completed in the database (no data is transferred between disk and host memory), resulting in extremely high efficiency. The interest calculation results are directly stored in a new database table, T1, which includes information such as account number, interest payment date, interest, pre-payment balance, and detail sequence number.
[0092] 2. Step 2: Account interest separation processing, step 3: Interest settlement details generation, and step 4: Unrecorded discount generation all support parallel processing within and between steps. That is, the number of parallel steps = 32 × 3 = 96 parallel steps.
[0093] Step 2: Implementation of account interest processing by account: Using C language programming, parallelize and iterate through each data entry according to the partitions of database table T1. First, check whether there are any changes to the account's last transaction date, account balance, and account balance. If so, record it in the account change information table D1; if not, do not record it. If the account balance is negative, interest cannot be calculated. Record it in the unpaid interest information table Q1, skip this record, and proceed to the next account. If the account balance is greater than or equal to 0, deposit the interest into the current account according to the deposit model.
[0094] Step 3: Generate interest settlement details: Use a database stored procedure and, according to the field requirements of the current account details table, use SQL statements to directly insert data from table T1 into the current account details table S1 (this does not involve transferring data between the disk and the host memory, and is extremely efficient). The specific syntax is as follows:
[0095] sql:
[0096] insert into S1(select...from T1 partition T1P01);
[0097] Step 4: Generate unrecorded discounts. Use the database stored procedure and, according to the field requirements of the unrecorded discount table, use SQL statements to directly insert from table T1 into the current account details table S2. The specific syntax is as follows:
[0098] sql:
[0099] insert into S2(select...from T1 partition T1P01);
[0100] Step 2, step 3, and step 4 can all set the parallel quantity independently; the above 96 steps can all be executed in parallel.
[0101] 3. Step 5: User processing is a non-parallel step and is executed sequentially.
[0102] Step 5: Account relocation processing: Retrieve data from the account relocation information table D1 (generally no more than 100 records). These accounts have transactions after interest calculation but before account separation. The order of their transaction details needs to be modified to prevent inconsistent balances on the account details. This process takes about a minute. The specific implementation method is to iterate over all accounts in the account relocation table D1 and search for the current account details for each account. Details with a sequence number greater than the sequence number in the interest calculation table are those after interest calculation. These sequence numbers are incremented by 2.
[0103] 4. Step 6: Processing of outstanding interest accounts is a non-parallel step and is executed sequentially.
[0104] Step 6: Handle unpaid interest accounts: Generate a report from the unpaid interest information table Q1. These accounts contain errors in the active account balance field, making interest payments unavailable. A report will be generated and handled by the bank's corresponding department.
[0105] The existing interest settlement process involves polling the account table, obtaining an account and locking it, calculating the interest amount for that account, modifying the account information (increasing the balance), registering the account details and unrecorded discounts, and then unlocking the account; then processing the next account, and completing the interest settlement process for all accounts. This invention modifies the process, significantly improving the efficiency of account interest settlement.
[0106] The basic principles, main features, and advantages of the present invention are shown and described above. Those skilled in the art should understand that the present invention is not limited to the foregoing embodiments. The foregoing embodiments and descriptions are merely illustrative of the principles of the present invention. Various changes and modifications may be made to the present invention without departing from the spirit and scope of the present invention. Such changes and modifications are intended to fall within the scope of the present invention. The scope of protection claimed in the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for optimizing interest settlement for bank current deposit accounts, characterized in that: The steps include: S101, the batch processing master control program polls the batch processing step table and schedules according to the configured concurrency logic; S102: The main control program checks the number H1 of interest calculation sub-steps currently running. If H1 is less than the concurrent number N1 of the step, a new step is called until all interest calculation sub-steps are completed. S103: The main control program checks the number of running account interest splitting processing sub-steps, H2. If H2 is less than the concurrent number N2 of the step, a new step is called; otherwise, the main control program continues to check the interest settlement details generation step; S104: The main control program checks the number H3 of interest settlement details generation sub-steps currently running. If H3 is less than the concurrent number N3 of the step, a new step is called; otherwise, the program continues to check the unrecorded discount generation step. S105: The main control program checks the number H4 of running unregistered discount generation sub-steps. If H4 is less than the concurrent number N4 of the step, a new step is called. S106, the main control program cyclically checks the three steps S103 to S105 until all sub-steps of these three steps are completed; S107, the main control program calls the user processing step until the step is completed; S108, the main control program calls the unpaid interest account processing step until the step is completed.
2. The method for optimizing interest settlement for bank current deposit accounts according to claim 1, characterized in that: In S101, the steps are as follows: 。 3. The method for optimizing interest settlement for bank current deposit accounts according to claim 1, characterized in that: Interest calculation only supports parallel processing within a step. One account is hash-partitioned by account number, with a total of 32 partitions, meaning there are 32 parallel steps.
4. The method for optimizing interest settlement for bank current deposit accounts according to claim 1, characterized in that: The three steps of account interest separation processing, interest settlement details generation, and unrecorded discount generation all support simultaneous parallel processing within and between steps, that is, the number of parallel steps = 32 × 3 = 96 parallel steps.
5. The method for optimizing interest settlement for bank current deposit accounts according to claim 1, characterized in that: The specific methods for handling account interest splitting are as follows: Traverse each piece of data in parallel according to the partitions of the database table; First, check whether the account's last transaction date, account balance, and account total have changed; If there is any change, record it in the household information form; If there is no change, it will not be registered; If the account balance is negative, interest cannot be settled. You need to record the outstanding interest information table, skip the record, and continue processing the next account. If the account balance is greater than or equal to 0, the interest will be stored in the current account according to the account deposit model.
6. The method for optimizing interest settlement for bank current deposit accounts according to claim 1, characterized in that: The specific methods for handling account changes are as follows: Traverse all accounts in the active account table and find the current account details of each account. The details with a serial number greater than the serial number in the interest calculation table are the details after interest settlement. Just add 2 to these serial numbers.