A hotspot account dynamic routing method, device, equipment, medium and product
By dynamically allocating popular accounts into small, medium, and large tiers, and utilizing a biquantile algorithm and sub-account scoring mechanism, the inefficiency of fixed sub-account splitting schemes when business volume changes is resolved, achieving fast and accurate billing operations and high system efficiency and stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA ZHESHANG BANK
- Filing Date
- 2026-02-12
- Publication Date
- 2026-06-19
Smart Images

Figure CN122243498A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of data processing technology, and more specifically, the embodiments of the present invention relate to a dynamic routing method, apparatus, device, medium and product for hot accounts. Background Technology
[0002] In the field of payment systems, with the continuous expansion of business scale and the sharp increase in transaction frequency, high-concurrency handling of hot accounts has become an extremely challenging technical problem. Hot accounts, due to frequent fund transactions, are prone to performance bottlenecks in concurrent scenarios, thus affecting the stability and efficiency of the entire payment system. Therefore, finding effective solutions for handling hot accounts is urgently needed.
[0003] Currently, hot account processing technology based on fixed sub-account splitting is a common approach to address this challenge. Fixed sub-account splitting schemes pre-define a fixed number of sub-accounts, and during billing operations, the appropriate sub-account is selected to complete the deduction according to preset rules. However, because the number of sub-accounts is fixed, this scheme is difficult to adjust flexibly in the face of rapid changes in business volume, and cannot adapt to the dynamic development needs of business in a timely manner, resulting in low efficiency in billing operations. Summary of the Invention
[0004] In this context, embodiments of the present invention aim to provide a dynamic routing method, apparatus, device, medium, and product for hot accounts, which can improve the efficiency of billing operations.
[0005] In a first aspect of the present invention, a dynamic routing method for hotspot accounts is provided, comprising:
[0006] Based on the total allocated amount and the historical billing data corresponding to the preset sliding time window, the hot accounts are allocated into small-amount accounts, medium-amount accounts and large-amount accounts; wherein, the small-amount accounts contain multiple small-amount sub-accounts, the medium-amount accounts contain multiple medium-amount sub-accounts, and the large-amount accounts contain multiple large-amount sub-accounts.
[0007] Read the current billing amount from the received billing request;
[0008] If the current outflow amount is less than or equal to the current total remaining amount of the hot account, then a target account matching the current outflow amount is determined from the small-amount accounts, the medium-amount accounts, and the large-amount accounts.
[0009] Obtain a set of candidate sub-accounts from the target account that match the current billing amount; wherein the sub-account balance of the candidate sub-accounts in the candidate sub-account set is greater than or equal to the current billing amount, and the usage status of the candidate sub-accounts is idle.
[0010] If the candidate sub-account set is empty, then obtain a candidate merged sub-account set that matches the current billing amount from the target account; perform a balance deduction operation on the candidate merged sub-account set; update the balance of the candidate merged sub-accounts and the current total remaining amount of the hot account; and delete the candidate merged sub-accounts with a balance of 0; wherein, the total balance of the merged sub-accounts of the multiple candidate merged sub-accounts included in the candidate merged sub-account set is greater than or equal to the current billing amount, and the usage status of the candidate merged sub-accounts is idle.
[0011] If the candidate sub-account set is not empty, then determine the sub-account score of each candidate sub-account in the candidate sub-account set; and determine the candidate sub-account with the highest sub-account score as the target sub-account; and perform a balance deduction operation on the target sub-account based on the current billing amount, and update the balance of the target sub-account and the current account remaining total amount of the hot account.
[0012] In one embodiment of this implementation, the process of allocating popular accounts into small-amount, medium-amount, and large-amount tier accounts based on the total allocated amount and historical billing data corresponding to a preset sliding time window specifically includes:
[0013] Retrieve multiple historical billing amounts from the historical billing data corresponding to the preset sliding time window;
[0014] The multiple historical billing amounts are sorted in ascending order to obtain a historical billing amount sequence.
[0015] Based on a first preset percentage and a second preset percentage, a biquantile algorithm is used to determine a first quantile and a second quantile from the historical outgoing amount sequence; wherein the first quantile is less than the second quantile.
[0016] Based on the first quantile and the second quantile, hot accounts are classified into small-amount accounts, medium-amount accounts, and large-amount accounts; wherein, the first quantile is the boundary value between the small-amount accounts and the medium-amount accounts, and the second quantile is the boundary value between the medium-amount accounts and the large-amount accounts.
[0017] Based on the total allocated amount, multiple small-amount sub-accounts, multiple medium-amount sub-accounts, and multiple large-amount sub-accounts are allocated to the small-amount tier account, the medium-amount tier account, and the large-amount tier account, respectively.
[0018] In one embodiment of this implementation, the allocation of multiple small-amount sub-accounts, multiple medium-amount sub-accounts, and multiple large-amount sub-accounts based on the total allocated amount specifically includes:
[0019] Obtain the historical outflow amount of the small-amount tier account, the historical outflow amount of the medium-amount tier account, the historical outflow amount of the large-amount tier account, and the total historical outflow amount;
[0020] The allocation amount for the small tier is determined based on the total allocation amount, the historical outflow amount of the small tier, and the total historical outflow amount.
[0021] The allocation amount for the middle tier is determined based on the total allocation amount, the historical billing amount for the middle tier, and the total historical billing amount.
[0022] The allocation amount for the large tier is determined based on the total allocation amount, the historical outflow amount for the large tier, and the total historical outflow amount.
[0023] Obtain the historical transaction data of the small-amount tier account, the historical transaction data of the medium-amount tier account, and the historical transaction data of the large-amount tier account;
[0024] Based on the allocated amount of the small-amount tier and the historical transaction data of the small-amount tier, determine the allocation quantity and allocation amount of the small-amount tier sub-accounts;
[0025] Based on the allocated amount of the middle tier and the historical transaction data of the middle tier, determine the allocation quantity and allocation amount of the middle tier sub-accounts;
[0026] Based on the large-amount tier allocation amount and the large-amount tier historical transaction data, the allocation quantity and allocation amount for the large-amount tier sub-accounts are determined.
[0027] In one embodiment of this implementation, determining the target account matching the current billing amount from the small-amount tier account, the medium-amount tier account, and the large-amount tier account specifically includes:
[0028] If the current billing amount is less than or equal to the first quantile, then the small-amount account is identified as the target account that matches the current billing amount;
[0029] If the current outflow amount is greater than the first quantile and the current outflow amount is less than or equal to the second quantile, then the middle-tier account is determined as the target account that matches the current outflow amount;
[0030] If the current outflow amount is greater than the second quantile, then the large-amount account is identified as the target account that matches the current outflow amount.
[0031] In one embodiment of this implementation, determining the sub-account score of a target candidate sub-account in the candidate sub-account set specifically includes:
[0032] Obtain the current balance of the target candidate sub-account, the average concurrent account volume within a preset time period, and the average billing processing time;
[0033] Obtain a preset first weight coefficient, a second weight coefficient, and a third weight coefficient; wherein the sum of the first weight coefficient, the second weight coefficient, and the third weight coefficient is 1; and the values of the first weight coefficient, the second weight coefficient, and the third weight coefficient are all between 0 and 1;
[0034] The sub-account score of the target candidate sub-account is calculated based on the current billing amount, the current balance of the sub-account, the average concurrency of the account, the average billing processing time, the first weight coefficient, the second weight coefficient, and the third weight coefficient.
[0035] In one embodiment of this implementation, the formula for calculating the sub-account score of the target candidate sub-account is as follows:
[0036] ;
[0037] in, This indicates the sub-account rating. This represents the first weighting coefficient. This represents the second weighting coefficient. This represents the third weighting coefficient. This indicates the current balance of the sub-account, and M represents the current outflow amount. This represents the average concurrency of the account. This indicates the average billing processing time.
[0038] In a second aspect of the present invention, a dynamic routing device for hotspot accounts is provided, comprising:
[0039] The allocation unit is used to allocate hot accounts into small-amount accounts, medium-amount accounts, and large-amount accounts based on the total allocation amount and the historical billing data corresponding to the preset sliding time window; wherein, the small-amount accounts contain multiple small-amount sub-accounts, the medium-amount accounts contain multiple medium-amount sub-accounts, and the large-amount accounts contain multiple large-amount sub-accounts.
[0040] The reading unit is used to read the current billing amount from the received billing request;
[0041] The determining unit is configured to determine a target account matching the current outflow amount from the small-amount accounts, the medium-amount accounts, and the large-amount accounts if the current outflow amount is less than or equal to the current total remaining amount of the hot account.
[0042] The acquisition unit is used to acquire a set of candidate sub-accounts that match the current billing amount from the target account; wherein the sub-account balance of the candidate sub-accounts in the candidate sub-account set is greater than or equal to the current billing amount, and the usage status of the candidate sub-accounts is idle.
[0043] The first deduction unit is configured to: if the candidate sub-account set is empty, obtain a set of candidate merged sub-accounts matching the current billing amount from the target account; perform a balance deduction operation on the candidate merged sub-account set; update the balance of the candidate merged sub-accounts and the current total remaining amount of the hot account; and delete candidate merged sub-accounts with a balance of 0; wherein the total balance of the merged sub-accounts of the multiple candidate merged sub-accounts included in the candidate merged sub-account set is greater than or equal to the current billing amount, and the usage status of the candidate merged sub-accounts is idle.
[0044] The second deduction unit is used to determine the sub-account score of each candidate sub-account in the candidate sub-account set if the candidate sub-account set is not empty; and to determine the candidate sub-account with the highest sub-account score as the target sub-account; and to perform a balance deduction operation on the target sub-account based on the current billing amount, and to update the balance of the target sub-account and the current account remaining total amount of the hot account.
[0045] In a third aspect of the present invention, a computing device is provided, the computing device comprising: at least one processor, a memory, and an input / output unit; wherein the memory is used to store a computer program, and the processor is used to invoke the computer program stored in the memory to execute the method described in any one aspect.
[0046] In a fourth aspect of the present invention, a computer-readable storage medium is provided, comprising instructions which, when executed on a computer, cause the computer to perform the method described in any one of the first aspects.
[0047] In a fifth aspect of the present invention, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the method described in any one of the first aspects.
[0048] The dynamic routing method, apparatus, device, medium, and product for hotspot accounts according to embodiments of the present invention dynamically stratifies hotspot accounts into small, medium, and large-amount tiers based on total allocated amounts and historical billing data, and sets corresponding sub-accounts, accurately adapting to billing needs of different amounts. When a billing request is received, a set of candidate sub-accounts with sufficient balances and idle usage status can be quickly filtered from the matched target accounts. Then, by determining the sub-account score, the target sub-account with the highest score is selected to perform the balance deduction operation. This series of processes avoids the blind searching and repeated attempts that may occur in traditional methods, reduces unnecessary operation steps, and enables the billing operation to be completed more quickly and accurately, thereby improving the overall efficiency of the billing operation and ensuring the efficient and stable operation of the payment system. Attached Figure Description
[0049] The above and other objects, features, and advantages of exemplary embodiments of the present invention will become readily apparent from the following detailed description taken in conjunction with the accompanying drawings. Several embodiments of the invention are illustrated in the drawings by way of example and not limitation, wherein:
[0050] Figure 1 This is a flowchart illustrating a dynamic routing method for hotspot accounts according to an embodiment of the present invention.
[0051] Figure 2 A schematic diagram of the structure of a dynamic routing device for hotspot accounts provided in an embodiment of the present invention;
[0052] Figure 3 This is a schematic diagram of the structure of a medium provided in an embodiment of the present invention;
[0053] Figure 4 This is a schematic diagram of the structure of a computing device provided in an embodiment of the present invention.
[0054] In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts. Detailed Implementation
[0055] The principles and spirit of the invention will now be described with reference to several exemplary embodiments. It should be understood that these embodiments are given merely to enable those skilled in the art to better understand and implement the invention, and are not intended to limit the scope of the invention in any way. Rather, these embodiments are provided to make this disclosure more thorough and complete, and to fully convey the scope of this disclosure to those skilled in the art.
[0056] Those skilled in the art will recognize that embodiments of the present invention can be implemented as a system, apparatus, device, method, or computer program product. Therefore, this disclosure can be specifically implemented in the following forms: entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
[0057] According to embodiments of the present invention, a dynamic routing method, apparatus, device, medium, and product for hotspot accounts are proposed.
[0058] It should be noted that the number of any elements in the accompanying drawings is for illustrative purposes only and not as a limitation, and any naming is for distinction only and has no limiting meaning.
[0059] The principles and spirit of the present invention will be explained in detail below with reference to several representative embodiments.
[0060] The following is for reference. Figure 1 , Figure 1 This is a flowchart illustrating a dynamic routing method for hotspot accounts according to an embodiment of the present invention. It should be noted that the embodiments of the present invention can be applied to any applicable scenario.
[0061] Figure 1 The flowchart of the dynamic routing method for hotspot accounts provided in an embodiment of the present invention, as shown, includes:
[0062] Step 101: Based on the total allocated amount and the historical billing data corresponding to the preset sliding time window, hot accounts are allocated into small-amount accounts, medium-amount accounts, and large-amount accounts.
[0063] In this embodiment of the application, the small-amount tier account contains multiple small-amount tier sub-accounts, the medium-amount tier account contains multiple medium-amount tier sub-accounts, and the large-amount tier account contains multiple large-amount tier sub-accounts.
[0064] In this embodiment, the acquired historical billing data can also be used for outlier identification, and the identified outliers can be deleted from the historical billing data. Outliers can include transaction data that exceeds three times the standard deviation of the mean, etc.
[0065] In this embodiment, the preset sliding time window can be manually adjusted according to business needs, such as 7 days or 30 days.
[0066] As an optional implementation, step 101, based on the total allocated amount and historical billing data corresponding to the preset sliding time window, may allocate popular accounts into small-amount accounts, medium-amount accounts, and large-amount accounts in the following ways:
[0067] Retrieve multiple historical billing amounts from the historical billing data corresponding to the preset sliding time window;
[0068] The multiple historical billing amounts are sorted in ascending order to obtain a historical billing amount sequence.
[0069] Based on the first preset percentage and the second preset percentage, a quantile algorithm is used to determine the first quantile from the historical billing amount sequence. Second quantile Wherein, the first quantile is less than the second quantile;
[0070] Based on the first quantile and the second quantile, hot accounts are classified into small-amount accounts, medium-amount accounts, and large-amount accounts; wherein, the first quantile is the boundary value between the small-amount accounts and the medium-amount accounts, and the second quantile is the boundary value between the medium-amount accounts and the large-amount accounts.
[0071] Based on the total allocated amount, multiple small-amount sub-accounts, multiple medium-amount sub-accounts, and multiple large-amount sub-accounts are allocated to the small-amount tier account, the medium-amount tier account, and the large-amount tier account, respectively.
[0072] This implementation method involves retrieving and sorting historical billing data from a preset sliding time window. A biquantile algorithm is then used to determine the quantiles as account stratification boundary values. This allows for the scientific division of accounts into small, medium, and large tiers based on actual billing activity, aligning with dynamic business changes. Sub-accounts are then allocated to each tier based on the total allocated amount, ensuring the number of sub-accounts matches business needs. Consequently, when processing billing requests, the appropriate tier of sub-account can be quickly located, reducing search time, effectively improving billing efficiency, and enhancing the system's adaptability to different billing scenarios.
[0073] In this embodiment of the application, the first preset percentage can be 30%, and the second preset percentage can be 85%. This embodiment of the application does not limit the specific percentage. That is, the first quantile can be the largest historical billing amount among the top 30% of historical billing amounts in the historical billing amount sequence, and the second quantile can be the largest historical billing amount among the top 85% of historical billing amounts in the historical billing amount sequence.
[0074] Optionally, based on the total allocated amount, the method of allocating multiple small-amount sub-accounts, multiple medium-amount sub-accounts, and multiple large-amount sub-accounts among the small-amount tier account, the medium-amount tier account, and the large-amount tier account respectively may include:
[0075] Obtain the historical outflow amount of the small-amount tier account, the historical outflow amount of the medium-amount tier account, the historical outflow amount of the large-amount tier account, and the total historical outflow amount;
[0076] The allocation amount for the small tier is determined based on the total allocation amount, the historical outflow amount of the small tier, and the total historical outflow amount.
[0077] The allocation amount for the middle tier is determined based on the total allocation amount, the historical billing amount for the middle tier, and the total historical billing amount.
[0078] The allocation amount for the large tier is determined based on the total allocation amount, the historical outflow amount for the large tier, and the total historical outflow amount.
[0079] Obtain the historical transaction data of the small-amount tier account, the historical transaction data of the medium-amount tier account, and the historical transaction data of the large-amount tier account;
[0080] Based on the allocated amount of the small-amount tier and the historical transaction data of the small-amount tier, determine the allocation quantity and allocation amount of the small-amount tier sub-accounts;
[0081] Based on the allocated amount of the middle tier and the historical transaction data of the middle tier, determine the allocation quantity and allocation amount of the middle tier sub-accounts;
[0082] Based on the large-amount tier allocation amount and the large-amount tier historical transaction data, the allocation quantity and allocation amount for the large-amount tier sub-accounts are determined.
[0083] This implementation method, by comprehensively considering historical outflow amounts and total amounts at each level, scientifically determines the allocation amount for each level, accurately matching the funding needs of accounts at different levels. Furthermore, by combining historical transaction data at each level, it rationally determines the number and amount allocated to sub-accounts, making resource allocation for sub-accounts more closely aligned with actual transaction conditions. This not only avoids resource waste or shortages but also allows outflow operations to quickly locate appropriate sub-accounts, reducing search and judgment time, effectively improving outflow efficiency, and enhancing the system's stability and adaptability to high-concurrency processing of popular accounts.
[0084] In this embodiment of the application, the calculation formulas for the allocation amounts of the small-amount tier, medium-amount tier, and large-amount tier can be:
[0085]
[0086] in, Indicates the first The amount to be allocated to each level (i.e., the amount allocated to the small level, the amount allocated to the medium level, and the amount allocated to the large level). This represents the total amount allocated. Indicates the first Historical billing amount for each tier (i.e., historical billing amount for small tier, historical billing amount for medium tier, and historical billing amount for large tier). This indicates the total amount of historical bills.
[0087] In this embodiment of the application, the first Historical transaction data for each tier (small tier, medium tier, large tier) can include: The historical peak transaction frequency of the tier (the peak concurrency count (unit: transactions / second) statistically derived from the valid samples, i.e., the maximum number of outgoing transactions per second for that tier) and the tier's historical peak transaction frequency (the peak concurrency count (unit: transactions / second) statistically derived from the valid samples, i.e., the maximum number of outgoing transactions per second for that tier) and the tier's peak transaction frequency (the peak concurrency count (unit: transactions / second) statistically derived Total funds for each layer.
[0088] Optionally, the method for determining the allocation quantity and amount of the sub-accounts in the small-amount tier based on the allocated amount and the historical transaction data of the small-amount tier can be as follows:
[0089] Determining the frequency of historical peak small-amount transactions from historical small-amount transaction data ;
[0090] Obtaining peak coefficient (This value is determined manually based on the business scenario, ranging from 0 to 1. It is an adjustable parameter; a larger value may result in more sub-accounts being initialized, and the system can handle a higher level of concurrency.) and average total transaction time. (The total time required for each transaction in the valid sample E from the arrival of the billing request to the completion of the deduction in the database).
[0091] Based on the historical peak transaction frequency, peak coefficient, and average total transaction duration for small transactions, the first reasonable number of sub-accounts based on transaction volume is calculated. The first reasonable number of sub-accounts The calculation formula can be:
[0092]
[0093] Determining the total funds in the small-scale lending segment from historical transaction data of the small-scale segment ;
[0094] Obtain the average balance of each sub-account from historical billing data. ;
[0095] Based on the total funds in the small-amount tier and the average balance of sub-accounts, the second reasonable number of sub-accounts, calculated according to the transaction amount, is obtained. The second reasonable number of sub-accounts The calculation formula can be:
[0096]
[0097] From the first reasonable number of sub-accounts Second reasonable number of sub-accounts Take the larger value and multiply it by the trading volatility coefficient. (The parameter is determined manually based on the business scenario, ranging from 1 to 1.5; the larger the value, the more sub-accounts there are.) Rounding up gives the number of sub-accounts allocated to the small-amount tier. The number of sub-accounts allocated to small-amount tiers The calculation formula can be:
[0098]
[0099] Furthermore, the allocation amount for the small-amount tier will be evenly distributed to the allocation quantity. The allocated amount is obtained from the small-amount sub-account.
[0100] Similarly, the allocation quantity and amount for medium-amount sub-accounts and large-amount sub-accounts can be obtained, which will not be elaborated here.
[0101] In this embodiment of the application, the sub-accounts are flexibly expanded / shrunken: the number of sub-accounts is dynamically adjusted according to the peak concurrent transactions and balance utilization rate of each level—when the concurrency exceeds the preset threshold, the sub-accounts are automatically expanded;
[0102] Threshold Determination Methods: There are many methods for determining thresholds, and you can choose one according to your business requirements. For example, you can count the waiting time of current orders in real time. If the average waiting time exceeds 1 second, you can trigger capacity expansion. Alternatively, you can count the order timeout retry rate over a period of time. If the timeout retry rate reaches 30% or more over a period of time, you can expand capacity.
[0103] Sub-account expansion method: Select k sub-accounts whose balances exceed twice the lower limit of this level. That is, if it's the medium-amount level, the balance > 2. Large-scale balance > 2 The process involves reducing the balance of these sub-accounts in the database by half, creating k new sub-accounts, and then crediting the deducted balances to the new sub-accounts. If the deduction from a sub-account fails or the creation of the corresponding sub-account fails, the balance of that sub-account is rolled back, while the rest proceed normally. Finally, the latest sub-account information is updated in Redis.
[0104] When utilization is too low, sub-account merging is triggered (small sub-account balances are aggregated into other accounts at the same level and then cancelled) to reduce fund fragmentation.
[0105] Redis zset intelligent index construction: Maintain a Redis sorted set (zset) for each level. The zset's score is the sub-account balance, and the member is the sub-account ID. By default, they are sorted in descending order of score. At the same time, the zset embeds the sub-account status identifier (such as idle / occupied) and the most recently used timestamp. It uses Redis's native features to achieve balance sorting and fast status query without the need to maintain additional sorting logic.
[0106] Step 102: Read the current billing amount from the received billing request.
[0107] In this embodiment, core parameters such as the current billing amount M and transaction type can be read from the received billing request. If the current billing amount is greater than the total remaining balance of the hot account, the payment will be rejected and a "Total balance insufficient" message will be returned.
[0108] Step 103: If the current outflow amount is less than or equal to the current total remaining amount of the hot account, then determine the target account that matches the current outflow amount from the small-amount accounts, the medium-amount accounts, and the large-amount accounts.
[0109] As an optional implementation, step 103, which determines the target account matching the current billing amount from the small-amount accounts, the medium-amount accounts, and the large-amount accounts, may include:
[0110] If the current billing amount is less than or equal to the first quantile, then the small-amount account is identified as the target account that matches the current billing amount;
[0111] If the current outflow amount is greater than the first quantile and the current outflow amount is less than or equal to the second quantile, then the middle-tier account is determined as the target account that matches the current outflow amount;
[0112] If the current outflow amount is greater than the second quantile, then the large-amount account is identified as the target account that matches the current outflow amount.
[0113] This implementation method, by pre-setting first and second quantiles as dividing criteria, allows for quick and accurate targeting of outbound requests to the corresponding small, medium, or large quantile accounts based on the relationship between the current outbound amount and the quantile. This explicit matching rule avoids blind searching and complex judgments, significantly shortening the time to determine the target account. This enables the outbound operation to quickly proceed to subsequent processes, effectively improving overall outbound efficiency and enhancing the system's ability and adaptability to outbound transactions of different amounts.
[0114] Step 104: Obtain a set of candidate sub-accounts from the target account that match the current billing amount.
[0115] In this embodiment of the application, the sub-account balance of the candidate sub-account in the candidate sub-account set is greater than or equal to the current billing amount, and the usage status of the candidate sub-account is idle.
[0116] Step 105: If the candidate sub-account set is empty, obtain the candidate merged sub-account set that matches the current billing amount from the target account; perform a balance deduction operation on the candidate merged sub-account set; update the balance of the candidate merged sub-accounts and the current account remaining total amount of the hot account; and delete the candidate merged sub-accounts with a balance of 0.
[0117] In this embodiment of the application, the total balance of the multiple candidate merged sub-accounts included in the candidate merged sub-account set is greater than or equal to the current billing amount, and the usage status of the candidate merged sub-accounts is idle.
[0118] As an optional implementation, if the candidate sub-account set is empty (no sub-account balance is greater than or equal to the current billing amount), the merged payment process is triggered, as shown below:
[0119] 1. Temporarily lock sub-accounts in the target account: Traverse the sub-accounts in the target account in descending order of the scores of the corresponding level zset, and set the occupied sub-accounts to "occupied" in turn to prevent them from being selected by other billing requests;
[0120] 2. Balance Accumulation Verification: Accumulate the balance of sub-accounts in the temporarily locked target account until the accumulated amount is greater than or equal to the current outgoing amount;
[0121] 3. Batch deduction and unlocking: The sub-accounts in the temporarily locked target account are used as a set of candidate merged sub-accounts. Batch deduction operations are performed on multiple candidate merged sub-accounts in the candidate merged sub-account set, the balance and zset score of each candidate merged sub-account are updated, and the candidate merged sub-accounts with a balance of 0 are deleted after the deduction is completed. The sub-account occupancy flag of the target account with a balance of non-zero is reset.
[0122] 4. Merge failure rollback: If an abnormality occurs during the deduction process (such as system failure or network interruption), the temporarily locked sub-accounts will be released and all operations will be rolled back to avoid fund occupancy.
[0123] If a sub-account The balance is less than the minimum deduction amount for that tier (i.e., the minimum deduction amount for small-amount accounts is 0, and the minimum deduction amount for medium-amount accounts is...). The minimum deduction amount for large-amount accounts is If the balance of a sub-account is less than 1, then the balance of that sub-account will be transferred to the sub-account with the smallest balance at that level. In the middle, and delete .
[0124] Step 106: If the candidate sub-account set is not empty, determine the sub-account score of each candidate sub-account in the candidate sub-account set; determine the candidate sub-account with the highest sub-account score as the target sub-account; and perform a balance deduction operation on the target sub-account based on the current billing amount, and update the balance of the target sub-account and the current account remaining total amount of the hot account.
[0125] As an optional implementation, the method for determining the sub-account score of a target candidate sub-account in the candidate sub-account set may include:
[0126] Obtain the current balance of the target candidate sub-account, the average concurrent account volume within a preset time period, and the average billing processing time;
[0127] Obtain a preset first weight coefficient, a second weight coefficient, and a third weight coefficient; wherein the sum of the first weight coefficient, the second weight coefficient, and the third weight coefficient is 1; and the values of the first weight coefficient, the second weight coefficient, and the third weight coefficient are all between 0 and 1;
[0128] The sub-account score of the target candidate sub-account is calculated based on the current billing amount, the current balance of the sub-account, the average concurrency of the account, the average billing processing time, the first weight coefficient, the second weight coefficient, and the third weight coefficient.
[0129] This implementation method comprehensively considers multiple factors, including the current balance of the target candidate sub-account, the average concurrency within a preset time period, and the average withdrawal processing time, and introduces weighted coefficients for scientific calculation to derive a sub-account score. This multi-dimensional evaluation method can comprehensively and objectively reflect the real-time status and performance of sub-accounts, thereby accurately selecting the optimal target sub-account. It ensures sufficient funding for withdrawal operations while also considering the system's concurrency processing capabilities and withdrawal efficiency, effectively improving the stability and efficiency of withdrawal operations and enhancing the system's adaptability to high-concurrency scenarios with popular accounts.
[0130] In this embodiment of the application, the formula for calculating the sub-account score of the target candidate sub-account is as follows:
[0131] ;
[0132] in, This indicates the sub-account rating. This represents the first weighting coefficient. This represents the second weighting coefficient. This represents the third weighting coefficient. This indicates the current balance of the sub-account, and M represents the current outflow amount. This represents the average concurrency of the account. This indicates the average billing processing time. This is the balance adequacy factor, which reflects the degree of balance redundancy; the larger the value, the higher the priority. This is the account idleness factor, which reflects the account's idle status. The larger the value, the higher the priority. This is the historical response efficiency factor, which reflects the account processing speed. The higher the value, the higher the priority.
[0133] The candidate list is sorted in descending order of comprehensive score. The sub-account with the highest score is selected as the target sub-account. If the target sub-account is not occupied, the balance is deducted. If it is occupied, the next candidate account is selected.
[0134] In this embodiment of the application, after each outgoing transaction is completed, the Redis total balance cache is updated immediately to ensure the accuracy and real-time performance of the verification.
[0135] Optionally, reconciliation and handling of anomalies can also be performed, specifically as follows:
[0136] Real-time incremental reconciliation: After each outflow transaction is completed, the consistency between the sub-account balance in the Redis zset and the database record is verified asynchronously, and the Redis data is automatically calibrated.
[0137] Scheduled full reconciliation: Perform a full reconciliation during off-peak business hours (such as 2-4 AM), iterate through all levels of sub-accounts, accumulate the database sub-account balances and compare them with the total Redis balance. If they are inconsistent, use the database data as the benchmark to batch calibrate the Redis zset scores and total values.
[0138] In this embodiment of the application, abnormal situations may include mild abnormalities, moderate abnormalities, and severe abnormalities:
[0139] Minor anomalies (such as single account deduction timeout): Automatic retry of the deduction operation, with the retry interval using an exponential backoff algorithm;
[0140] Moderate anomaly (such as failure to deduct from a sub-account in a combined payment): Triggers a partial rollback, which only rolls back the locked status and balance of the failed sub-account, and then selects another sub-account to lock it before continuing the deduction;
[0141] In case of severe anomalies (such as system crashes or database failures): initiate the disaster recovery process, restore sub-account balances and Redis data based on distributed transaction logs, and ensure the consistency of financial data.
[0142] For example, when the present invention receives an accounting request, it executes the following accounting processing flow:
[0143] 1. Read the current deposit amount from the received deposit request;
[0144] 2. Based on the preset first quantile R1 (the boundary value between small-amount accounts and medium-amount accounts) and second quantile R2 (the boundary value between medium-amount accounts and large-amount accounts), determine the crediting level that matches the current crediting amount:
[0145] (1) If the current amount received is less than or equal to the first quantile R1, then the small-amount account is determined as the target receiving level;
[0146] (2) If the current amount received is greater than the first quantile R1 and less than or equal to the second quantile R2, then the middle-level account is determined as the target receiving level;
[0147] (3) If the current amount received is greater than the second quantile R2, then the large amount account is determined as the target receiving level;
[0148] 3. From the accounts corresponding to the target inflow level, filter out the target inflow sub-accounts with the smallest sub-account balance and an idle status;
[0149] 4. Transfer the full amount of the current incoming funds to the target incoming sub-account, update the balance of the target incoming sub-account, and simultaneously update the total remaining amount of the current account of the hot accounts in the database asynchronously;
[0150] 5. Based on the updated balances of all sub-accounts under this target accounting level, re-sort the sub-accounts at this level according to the descending balance sorting rule to ensure the accuracy of sub-account sorting during subsequent accounting operations.
[0151] This invention enables faster and more accurate billing operations, thereby improving overall billing efficiency and ensuring the efficient and stable operation of the payment system. Furthermore, this invention can quickly locate the appropriate sub-account, reducing search time and effectively improving billing efficiency, enhancing the system's adaptability to different billing scenarios. Additionally, this invention allows billing operations to quickly locate the appropriate sub-account, reducing search and judgment time, effectively improving billing efficiency, and enhancing the system's stability and adaptability to high-concurrency processing of hot accounts. Furthermore, this invention improves overall billing efficiency while enhancing the system's processing capacity and adaptability for billing transactions of different amounts. Moreover, this invention enhances the stability and efficiency of billing operations and strengthens the system's adaptability to high-concurrency scenarios involving hot accounts.
[0152] After introducing the method of exemplary embodiments of the present invention, the following references are made. Figure 2An exemplary embodiment of the present invention will be described using a dynamic routing device for hotspot accounts, the device comprising:
[0153] The allocation unit 201 is used to allocate hot accounts into small-amount accounts, medium-amount accounts and large-amount accounts based on the total allocation amount and the historical billing data corresponding to the preset sliding time window; wherein, the small-amount accounts contain multiple small-amount sub-accounts, the medium-amount accounts contain multiple medium-amount sub-accounts, and the large-amount accounts contain multiple large-amount sub-accounts.
[0154] The reading unit 202 is used to read the current billing amount from the received billing request;
[0155] The determining unit 203 is used to determine a target account that matches the current outflow amount from the small-amount accounts, the medium-amount accounts, and the large-amount accounts if the current outflow amount is less than or equal to the current account balance of the hot account.
[0156] The acquisition unit 204 is used to acquire a set of candidate sub-accounts that match the current billing amount from the target account; wherein the sub-account balance of the candidate sub-accounts in the candidate sub-account set is greater than or equal to the current billing amount, and the usage status of the candidate sub-accounts is idle.
[0157] The first deduction unit 205 is used to: if the candidate sub-account set is empty, obtain a set of candidate merged sub-accounts matching the current billing amount from the target account; perform a balance deduction operation on the candidate merged sub-account set; update the balance of the candidate merged sub-accounts and the current total remaining amount of the hot account; and delete candidate merged sub-accounts with a balance of 0; wherein the total balance of the merged sub-accounts of the multiple candidate merged sub-accounts included in the candidate merged sub-account set is greater than or equal to the current billing amount, and the usage status of the candidate merged sub-accounts is idle.
[0158] The second deduction unit 206 is used to determine the sub-account score of each candidate sub-account in the candidate sub-account set if the candidate sub-account set is not empty; and to determine the candidate sub-account with the highest sub-account score as the target sub-account; and to perform a balance deduction operation on the target sub-account based on the current billing amount, and to update the balance of the target sub-account and the current account remaining total amount of the hot account.
[0159] As an optional implementation, the allocation unit 201 allocates hot accounts into small-amount, medium-amount, and large-amount accounts based on the total allocation amount and historical billing data corresponding to a preset sliding time window. Specifically, this can be achieved by:
[0160] Retrieve multiple historical billing amounts from the historical billing data corresponding to the preset sliding time window;
[0161] The multiple historical billing amounts are sorted in ascending order to obtain a historical billing amount sequence.
[0162] Based on a first preset percentage and a second preset percentage, a biquantile algorithm is used to determine a first quantile and a second quantile from the historical outgoing amount sequence; wherein the first quantile is less than the second quantile.
[0163] Based on the first quantile and the second quantile, hot accounts are classified into small-amount accounts, medium-amount accounts, and large-amount accounts; wherein, the first quantile is the boundary value between the small-amount accounts and the medium-amount accounts, and the second quantile is the boundary value between the medium-amount accounts and the large-amount accounts.
[0164] Based on the total allocated amount, multiple small-amount sub-accounts, multiple medium-amount sub-accounts, and multiple large-amount sub-accounts are allocated to the small-amount tier account, the medium-amount tier account, and the large-amount tier account, respectively.
[0165] This implementation method involves retrieving and sorting historical billing data from a preset sliding time window. A biquantile algorithm is then used to determine the quantiles as account stratification boundary values. This allows for the scientific division of accounts into small, medium, and large tiers based on actual billing activity, aligning with dynamic business changes. Sub-accounts are then allocated to each tier based on the total allocated amount, ensuring the number of sub-accounts matches business needs. Consequently, when processing billing requests, the appropriate tier of sub-account can be quickly located, reducing search time, effectively improving billing efficiency, and enhancing the system's adaptability to different billing scenarios.
[0166] As an optional implementation, the allocation unit 201 allocates multiple small-amount sub-accounts, multiple medium-amount sub-accounts, and multiple large-amount sub-accounts respectively among the small-amount sub-accounts, the medium-amount sub-accounts, and the large-amount sub-accounts based on the total allocation amount. Specifically, this can be achieved by:
[0167] Obtain the historical outflow amount of the small-amount tier account, the historical outflow amount of the medium-amount tier account, the historical outflow amount of the large-amount tier account, and the total historical outflow amount;
[0168] The allocation amount for the small tier is determined based on the total allocation amount, the historical outflow amount of the small tier, and the total historical outflow amount.
[0169] The allocation amount for the middle tier is determined based on the total allocation amount, the historical billing amount for the middle tier, and the total historical billing amount.
[0170] The allocation amount for the large tier is determined based on the total allocation amount, the historical outflow amount for the large tier, and the total historical outflow amount.
[0171] Obtain the historical transaction data of the small-amount tier account, the historical transaction data of the medium-amount tier account, and the historical transaction data of the large-amount tier account;
[0172] Based on the allocated amount of the small-amount tier and the historical transaction data of the small-amount tier, determine the allocation quantity and allocation amount of the small-amount tier sub-accounts;
[0173] Based on the allocated amount of the middle tier and the historical transaction data of the middle tier, determine the allocation quantity and allocation amount of the middle tier sub-accounts;
[0174] Based on the large-amount tier allocation amount and the large-amount tier historical transaction data, the allocation quantity and allocation amount for the large-amount tier sub-accounts are determined.
[0175] This implementation method, by comprehensively considering historical outflow amounts and total amounts at each level, scientifically determines the allocation amount for each level, accurately matching the funding needs of accounts at different levels. Furthermore, by combining historical transaction data at each level, it rationally determines the number and amount allocated to sub-accounts, making resource allocation for sub-accounts more closely aligned with actual transaction conditions. This not only avoids resource waste or shortages but also allows outflow operations to quickly locate appropriate sub-accounts, reducing search and judgment time, effectively improving outflow efficiency, and enhancing the system's stability and adaptability to high-concurrency processing of popular accounts.
[0176] As an optional implementation, the determining unit 203 may determine the target account matching the current billing amount from the small-amount accounts, the medium-amount accounts, and the large-amount accounts in the following specific ways:
[0177] If the current billing amount is less than or equal to the first quantile, then the small-amount account is identified as the target account that matches the current billing amount;
[0178] If the current outflow amount is greater than the first quantile and the current outflow amount is less than or equal to the second quantile, then the middle-tier account is determined as the target account that matches the current outflow amount;
[0179] If the current outflow amount is greater than the second quantile, then the large-amount account is identified as the target account that matches the current outflow amount.
[0180] This implementation method, by pre-setting first and second quantiles as dividing criteria, allows for quick and accurate targeting of outbound requests to the corresponding small, medium, or large quantile accounts based on the relationship between the current outbound amount and the quantile. This explicit matching rule avoids blind searching and complex judgments, significantly shortening the time to determine the target account. This enables the outbound operation to quickly proceed to subsequent processes, effectively improving overall outbound efficiency and enhancing the system's ability and adaptability to outbound transactions of different amounts.
[0181] As an optional implementation, the second deduction unit 206 may determine the sub-account score of a target candidate sub-account in the candidate sub-account set in the following specific ways:
[0182] Obtain the current balance of the target candidate sub-account, the average concurrent account volume within a preset time period, and the average billing processing time;
[0183] Obtain a preset first weight coefficient, a second weight coefficient, and a third weight coefficient; wherein the sum of the first weight coefficient, the second weight coefficient, and the third weight coefficient is 1; and the values of the first weight coefficient, the second weight coefficient, and the third weight coefficient are all between 0 and 1;
[0184] The sub-account score of the target candidate sub-account is calculated based on the current billing amount, the current balance of the sub-account, the average concurrency of the account, the average billing processing time, the first weight coefficient, the second weight coefficient, and the third weight coefficient.
[0185] This implementation method comprehensively considers multiple factors, including the current balance of the target candidate sub-account, the average concurrency within a preset time period, and the average withdrawal processing time, and introduces weighted coefficients for scientific calculation to derive a sub-account score. This multi-dimensional evaluation method can comprehensively and objectively reflect the real-time status and performance of sub-accounts, thereby accurately selecting the optimal target sub-account. It ensures sufficient funding for withdrawal operations while also considering the system's concurrency processing capabilities and withdrawal efficiency, effectively improving the stability and efficiency of withdrawal operations and enhancing the system's adaptability to high-concurrency scenarios with popular accounts.
[0186] In this embodiment of the application, the formula for calculating the sub-account score of the target candidate sub-account is as follows:
[0187] ;
[0188] in, This indicates the sub-account rating. This represents the first weighting coefficient. This represents the second weighting coefficient. This represents the third weighting coefficient. This indicates the current balance of the sub-account, and M represents the current outflow amount. This represents the average concurrency of the account. This indicates the average billing processing time.
[0189] This invention enables faster and more accurate billing operations, thereby improving overall billing efficiency and ensuring the efficient and stable operation of the payment system. Furthermore, this invention can quickly locate the appropriate sub-account, reducing search time and effectively improving billing efficiency, enhancing the system's adaptability to different billing scenarios. Additionally, this invention allows billing operations to quickly locate the appropriate sub-account, reducing search and judgment time, effectively improving billing efficiency, and enhancing the system's stability and adaptability to high-concurrency processing of hot accounts. Furthermore, this invention improves overall billing efficiency while enhancing the system's processing capacity and adaptability for billing transactions of different amounts. Moreover, this invention enhances the stability and efficiency of billing operations and strengthens the system's adaptability to high-concurrency scenarios involving hot accounts.
[0190] After introducing the methods and apparatus of exemplary embodiments of the present invention, the following references are made. Figure 3 A computer-readable storage medium according to exemplary embodiments of the present invention will be described, please refer to... Figure 3The computer-readable storage medium shown is an optical disc 30, on which a computer program (i.e., a program product) is stored. When the computer program is run by a processor, it implements the steps described in the above method implementation, such as: based on the total allocated amount and historical billing data corresponding to a preset sliding time window, allocating hot accounts into small-amount accounts, medium-amount accounts, and large-amount accounts; wherein, the small-amount accounts contain multiple small-amount sub-accounts, the medium-amount accounts contain multiple medium-amount sub-accounts, and the large-amount accounts contain multiple large-amount sub-accounts; reading the current billing amount from the received billing request; if the current billing amount is less than or equal to the current total amount remaining in the hot account, then from the small-amount accounts, From the medium-amount tier accounts and the large-amount tier accounts, a target account matching the current billing amount is determined; from the target account, a set of candidate sub-accounts matching the current billing amount is obtained; wherein, the sub-account balance of the candidate sub-accounts in the candidate sub-account set is greater than or equal to the current billing amount, and the usage status of the candidate sub-accounts is idle; the sub-account score of each candidate sub-account in the candidate sub-account set is determined; the candidate sub-account with the highest sub-account score is determined as the target sub-account; based on the current billing amount, a balance deduction operation is performed on the target sub-account, and the balance of the target sub-account and the current account remaining total amount of the hot account are updated; the specific implementation methods of each step will not be repeated here.
[0191] It should be noted that examples of the computer-readable storage medium may also include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical and magnetic storage media, which will not be elaborated here.
[0192] After introducing the methods, apparatus, and media of exemplary embodiments of the present invention, the following references are made. Figure 4 A computing device for dynamic routing of hotspot accounts according to an exemplary embodiment of the present invention.
[0193] Figure 4 A block diagram is shown of an exemplary computing device 40 suitable for implementing embodiments of the present invention. The computing device 40 may be a computer system or a server. Figure 4 The computing device 40 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.
[0194] like Figure 4As shown, the components of computing device 40 may include, but are not limited to: one or more processors or processing units 401, system memory 402, and bus 403 connecting different system components (including system memory 402 and processing unit 401).
[0195] The computing device 40 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computing device 40, including volatile and non-volatile media, and removable and non-removable media.
[0196] System memory 402 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 4021 and / or cache memory 4022. Computing device 40 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, ROM 4023 may be used to read and write non-removable, non-volatile magnetic media (…). Figure 4 (Not shown in the image, usually referred to as "hard drive"). Although not shown in... Figure 4 The diagram illustrates that disk drives for reading and writing to removable non-volatile disks (e.g., "floppy disks") and optical disc drives for reading and writing to removable non-volatile optical discs (e.g., CD-ROMs, DVD-ROMs, or other optical media) can be provided. In these cases, each drive can be connected to bus 403 via one or more data media interfaces. System memory 402 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0197] A program / utility 4025 having a set (at least one) of program modules 4024 may be stored, for example, in system memory 402, and such program modules 4024 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment. Program modules 4024 typically perform the functions and / or methods described in the embodiments of the present invention.
[0198] The computing device 40 can also communicate with one or more external devices 404 (such as a keyboard, pointing device, display, etc.). This communication can be performed via the input / output (I / O) interface 405. Furthermore, the computing device 40 can also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 406. Figure 4 As shown, network adapter 406 communicates with other modules of computing device 40 (such as processing unit 401) via bus 403. It should be understood that, although... Figure 4 As not shown, it can be used in conjunction with computing device 40 with other hardware and / or software modules.
[0199] The processing unit 401 executes various functional applications and data processing by running programs stored in the system memory 402. For example, based on the total allocated amount and historical billing data corresponding to a preset sliding time window, it allocates hot accounts into small-amount accounts, medium-amount accounts, and large-amount accounts; wherein, the small-amount accounts contain multiple small-amount sub-accounts, the medium-amount accounts contain multiple medium-amount sub-accounts, and the large-amount accounts contain multiple large-amount sub-accounts; it reads the current billing amount from the received billing request; if the current billing amount is less than or equal to the current account balance of the hot account, it then allocates funds from the small-amount accounts, the medium-amount accounts, and the large-amount accounts to the hot account. The process involves: identifying a target account matching the current billing amount from the large-amount accounts; obtaining a set of candidate sub-accounts matching the current billing amount from the target account; wherein the sub-account balance of the candidate sub-accounts in the candidate sub-account set is greater than or equal to the current billing amount, and the usage status of the candidate sub-accounts is idle; determining the sub-account score of each candidate sub-account in the candidate sub-account set; identifying the candidate sub-account with the highest sub-account score as the target sub-account; performing a balance deduction operation on the target sub-account based on the current billing amount, and updating the balance of the target sub-account and the current total remaining amount of the hot account. The specific implementation methods of each step will not be repeated here. It should be noted that although several units / modules or sub-units / sub-modules of the dynamic routing device for hot accounts are mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of the present invention, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into multiple units / modules for embodiment.
[0200] In the description of this invention, it should be noted that the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0201] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0202] In the several embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the coupling or direct coupling or communication connection shown or discussed may be through some communication interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0203] 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.
[0204] 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.
[0205] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion 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 described in 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.
[0206] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
[0207] Furthermore, although the operations of the method of the present invention are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0208] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
Claims
1. A dynamic routing method for popular accounts, characterized in that, The method includes: Based on the total allocated amount and the historical billing data corresponding to the preset sliding time window, the hot accounts are allocated into small-amount accounts, medium-amount accounts and large-amount accounts; wherein, the small-amount accounts contain multiple small-amount sub-accounts, the medium-amount accounts contain multiple medium-amount sub-accounts, and the large-amount accounts contain multiple large-amount sub-accounts. Read the current billing amount from the received billing request; If the current outflow amount is less than or equal to the current total remaining amount of the hot account, then a target account matching the current outflow amount is determined from the small-amount accounts, the medium-amount accounts, and the large-amount accounts. Obtain a set of candidate sub-accounts from the target account that match the current billing amount; wherein the sub-account balance of the candidate sub-accounts in the candidate sub-account set is greater than or equal to the current billing amount, and the usage status of the candidate sub-accounts is idle. If the candidate sub-account set is empty, then obtain a candidate merged sub-account set that matches the current billing amount from the target account; perform a balance deduction operation on the candidate merged sub-account set; update the balance of the candidate merged sub-accounts and the current total remaining amount of the hot account; and delete the candidate merged sub-accounts with a balance of 0; wherein, the total balance of the merged sub-accounts of the multiple candidate merged sub-accounts included in the candidate merged sub-account set is greater than or equal to the current billing amount, and the usage status of the candidate merged sub-accounts is idle. If the candidate sub-account set is not empty, then determine the sub-account score of each candidate sub-account in the candidate sub-account set; and determine the candidate sub-account with the highest sub-account score as the target sub-account; and perform a balance deduction operation on the target sub-account based on the current billing amount, and update the balance of the target sub-account and the current account remaining total amount of the hot account.
2. The dynamic routing method for hotspot accounts according to claim 1, characterized in that, The process of allocating popular accounts into small-amount, medium-amount, and large-amount tiers based on the total allocated amount and historical billing data corresponding to a preset sliding time window specifically includes: Retrieve multiple historical billing amounts from the historical billing data corresponding to the preset sliding time window; The multiple historical billing amounts are sorted in ascending order to obtain a historical billing amount sequence. Based on a first preset percentage and a second preset percentage, a biquantile algorithm is used to determine a first quantile and a second quantile from the historical outgoing amount sequence; wherein the first quantile is less than the second quantile. Based on the first quantile and the second quantile, hot accounts are classified into small-amount accounts, medium-amount accounts, and large-amount accounts; wherein, the first quantile is the boundary value between the small-amount accounts and the medium-amount accounts, and the second quantile is the boundary value between the medium-amount accounts and the large-amount accounts. Based on the total allocated amount, multiple small-amount sub-accounts, multiple medium-amount sub-accounts, and multiple large-amount sub-accounts are allocated to the small-amount tier account, the medium-amount tier account, and the large-amount tier account, respectively.
3. The dynamic routing method for hotspot accounts according to claim 2, characterized in that, The method of allocating multiple small-amount sub-accounts, multiple medium-amount sub-accounts, and multiple large-amount sub-accounts based on the total allocated amount specifically includes: Obtain the historical outflow amount of the small-amount tier account, the historical outflow amount of the medium-amount tier account, the historical outflow amount of the large-amount tier account, and the total historical outflow amount; The allocation amount for the small tier is determined based on the total allocation amount, the historical outflow amount of the small tier, and the total historical outflow amount. The allocation amount for the middle tier is determined based on the total allocation amount, the historical billing amount for the middle tier, and the total historical billing amount. The allocation amount for the large tier is determined based on the total allocation amount, the historical outflow amount for the large tier, and the total historical outflow amount. Obtain the historical transaction data of the small-amount tier account, the historical transaction data of the medium-amount tier account, and the historical transaction data of the large-amount tier account; Based on the allocated amount of the small-amount tier and the historical transaction data of the small-amount tier, determine the allocation quantity and allocation amount of the small-amount tier sub-accounts; Based on the allocated amount of the middle tier and the historical transaction data of the middle tier, determine the allocation quantity and allocation amount of the middle tier sub-accounts; Based on the large-amount tier allocation amount and the large-amount tier historical transaction data, the allocation quantity and allocation amount for the large-amount tier sub-accounts are determined.
4. The dynamic routing method for hotspot accounts according to claim 2, characterized in that, Determining a target account that matches the current billing amount from the small-amount accounts, medium-amount accounts, and large-amount accounts specifically includes: If the current billing amount is less than or equal to the first quantile, then the small-amount account is identified as the target account that matches the current billing amount; If the current outflow amount is greater than the first quantile and the current outflow amount is less than or equal to the second quantile, then the middle-tier account is determined as the target account that matches the current outflow amount; If the current outflow amount is greater than the second quantile, then the large-amount account is identified as the target account that matches the current outflow amount.
5. The dynamic routing method for hotspot accounts according to claim 4, characterized in that, Determining the sub-account score of a target candidate sub-account in the candidate sub-account set specifically includes: Obtain the current balance of the target candidate sub-account, the average concurrent account volume within a preset time period, and the average billing processing time; Obtain a preset first weight coefficient, a second weight coefficient, and a third weight coefficient; wherein the sum of the first weight coefficient, the second weight coefficient, and the third weight coefficient is 1; and the values of the first weight coefficient, the second weight coefficient, and the third weight coefficient are all between 0 and 1; The sub-account score of the target candidate sub-account is calculated based on the current billing amount, the current balance of the sub-account, the average concurrency of the account, the average billing processing time, the first weight coefficient, the second weight coefficient, and the third weight coefficient.
6. The dynamic routing method for hotspot accounts according to claim 5, characterized in that, The formula for calculating the sub-account score of the target candidate sub-account is as follows: ; in, This indicates the sub-account rating. This represents the first weighting coefficient. This represents the second weighting coefficient. This represents the third weighting coefficient. This indicates the current balance of the sub-account, and M represents the current outflow amount. This represents the average concurrency of the account. This indicates the average billing processing time.
7. A dynamic routing device for hotspot accounts, characterized in that, The device includes: The allocation unit is used to allocate hot accounts into small-amount accounts, medium-amount accounts, and large-amount accounts based on the total allocation amount and the historical billing data corresponding to the preset sliding time window; wherein, the small-amount accounts contain multiple small-amount sub-accounts, the medium-amount accounts contain multiple medium-amount sub-accounts, and the large-amount accounts contain multiple large-amount sub-accounts. The reading unit is used to read the current billing amount from the received billing request; The determining unit is configured to determine a target account matching the current outflow amount from the small-amount accounts, the medium-amount accounts, and the large-amount accounts if the current outflow amount is less than or equal to the current total remaining amount of the hot account. The acquisition unit is used to acquire a set of candidate sub-accounts that match the current billing amount from the target account; wherein the sub-account balance of the candidate sub-accounts in the candidate sub-account set is greater than or equal to the current billing amount, and the usage status of the candidate sub-accounts is idle. The first deduction unit is configured to: if the candidate sub-account set is empty, obtain a set of candidate merged sub-accounts matching the current billing amount from the target account; perform a balance deduction operation on the candidate merged sub-account set; update the balance of the candidate merged sub-accounts and the current total remaining amount of the hot account; and delete candidate merged sub-accounts with a balance of 0; wherein the total balance of the merged sub-accounts of the multiple candidate merged sub-accounts included in the candidate merged sub-account set is greater than or equal to the current billing amount, and the usage status of the candidate merged sub-accounts is idle. The second deduction unit is used to determine the sub-account score of each candidate sub-account in the candidate sub-account set if the candidate sub-account set is not empty; and to determine the candidate sub-account with the highest sub-account score as the target sub-account; and to perform a balance deduction operation on the target sub-account based on the current billing amount, and to update the balance of the target sub-account and the current account remaining total amount of the hot account.
8. A computing device, characterized in that, The computing device includes: At least one processor, memory, and input / output unit; The memory is used to store computer programs, and the processor is used to call the computer programs stored in the memory to execute the method as described in any one of claims 1 to 6.
9. A computer-readable storage medium comprising instructions, characterized in that, When it is run on a computer, it causes the computer to perform the method as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1-6.