Method, device and equipment for processing bonus-sharing tail difference under sub-library and readable storage medium
By determining the target tail difference value, target share value and target identification value under the library structure, and indexing the target customer share record from each library data table, the problem of low efficiency in global data statistics processing under the library structure is solved, and more efficient data processing is achieved.
Patent Information
- Application Number
- CN202411525264.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-03-07
AI Technical Summary
Under the library architecture, the statistical processing efficiency of global data is low, mainly due to the large amount of data transmission and the long database connection time.
By obtaining the remaining dividend to be allocated, share record data and the initial value of the split shares of the dividend product, the target tail difference value, the target share value and the target identification value are determined in turn, so as to orderly index the target customer share records from each database data table and directly sort and filter.
The data transmission amount and database connection time during global data statistics under the database structure are reduced, and the statistical processing efficiency of global data is improved.
Smart Images

Figure CN119579321A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of distributed data processing, and in particular to a method, device, computer equipment and computer-readable storage medium for processing dividend and tail differences under sub-database. Background Art
[0002] In order to achieve the scalability and availability of databases, related technologies use a sharded database architecture to achieve sharded storage of global data. The sharded database architecture is to split the database into multiple database instances according to certain rules, and store global data in the form of sharded database data tables to achieve higher scalability and availability. For example, in the financial field, financial dividend business data can be stored in the form of a sharded database architecture, with multiple customer share records stored in each sharded database data table, so that the storage scalability and availability of financial dividend business data are higher.
[0003] However, when it is necessary to perform statistics on the global data of the database (for example, in the financial dividend business scenario, there will be a difference in the amount between the actual total distributed dividends and the total distributable dividends, so it is necessary to perform secondary dividend distribution based on the dividend difference. Therefore, it is necessary to sort all customer share records based on the dividend tail difference, holding share and other information of each customer share record, and give priority to secondary dividends to the customer share records with the highest ranking), it is usually necessary to transfer the data table of each sub-library to the middleware for global sorting of the sub-libraries. This method requires a large amount of network transmission resources and occupies the database connection for a long time. Therefore, the statistical processing efficiency of global data under the sub-library architecture is low. Summary of the invention
[0004] The present application provides a method, device, computer equipment and computer-readable storage medium for processing dividend and tail differences under a distributed database, which can reduce the amount of data transmission during global data statistics under a distributed database architecture, reduce the connection time of distributed database data tables, and improve the statistical processing efficiency of global data under a distributed database architecture.
[0005] In a first aspect, the present application provides a method for processing dividend tail difference under sub-library distribution, the method comprising:
[0006] Obtain the remaining dividends to be distributed of the dividend product, the share record data of the dividend product, and the initial value of the share to be split of the remaining dividends to be distributed, wherein the share record data includes multiple sub-library data tables;
[0007] Based on the tail difference column of each sub-database data table and the initial value of the share to be split, the target tail difference value of the remaining dividends to be distributed and the first remaining value of the share to be split of the target tail difference value are obtained;
[0008] Based on the target tail difference value, the first remaining value of the shares to be split and the share column of each sub-library data table, the target share value of the remaining dividends to be distributed and the second remaining value of the shares to be split of the target share value are obtained;
[0009] Based on the target tail difference value, the target share value, the second remaining value of the share to be split and the identification column of each sub-library data table, the target identification value of the remaining dividend to be distributed is obtained;
[0010] Based on the target tail difference value, the target share value and the target identification value, the target customer share record of the remaining dividends to be distributed is determined from each customer share record in each sub-library data table.
[0011] In a second aspect, the present application provides a device for processing the difference between dividends distributed under a sub-library, and the device for processing the difference between dividends distributed under a sub-library comprises:
[0012] A first acquisition unit is used to acquire the remaining dividends to be distributed of the dividend product, the share record data of the dividend product, and the initial value of the share to be split of the remaining dividends to be distributed, wherein the share record data includes a plurality of sub-library data tables;
[0013] A second acquisition unit is used to acquire the target tail difference value of the remaining dividends to be distributed and the first remaining value of the shares to be split of the target tail difference based on the tail difference column of each sub-library data table and the initial value of the shares to be split;
[0014] The second acquisition unit is further configured to acquire the target share value of the remaining dividends to be distributed and the second remaining value of the shares to be split of the target share value based on the target tail difference value, the first remaining value of the shares to be split and the share column of each sub-library data table;
[0015] The second acquisition unit is further used to acquire the target identification value of the remaining dividends to be distributed based on the target tail difference value, the target share value, the second remaining value of the share to be split, and the identification column of each sub-library data table;
[0016] The processing unit is used to determine the target customer share record of the remaining dividends to be distributed from each customer share record in each sub-library data table based on the target tail difference value, the target share value and the target identification value.
[0017] In a third aspect, the present application also provides a computer device, comprising a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement the method for processing the dividend tail difference under the divided library when executing the computer program.
[0018] In a fourth aspect, the present application also provides a computer-readable storage medium on which a computer program is stored, and the computer program is loaded by a processor to execute the method for processing the dividend tail difference under the sub-library.
[0019] In the present application, on the one hand, by determining the target tail difference value, target share value and target identification value in sequence, the information such as the dividend tail difference, the holding share and the identification can be combined, and the target customer share record can be indexed from the ordered data table of each sub-library, thereby improving the comprehensiveness of the result data coverage of the target customer share record. On the other hand, by determining the target customer share record of the remaining dividends to be distributed from each customer share record in each sub-library data table based on the target tail difference value, target share value and target identification value, the target customer share record can be potentially sorted and screened out directly through the relationship between the customer share record of each sub-library data table and the target tail difference value, target share value and target identification value. Each sub-library data table can independently search for the target customer share record, without the need to sort each sub-library data table and then transmit the sorted data of each sub-library data table to the middleware for merge sorting and search, thereby reducing the amount of data transmission during global data statistics under the sub-library architecture, reducing the connection time of the sub-library data table, and improving the statistical processing efficiency of global data under the sub-library architecture. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0021] Figure 1 It is a flow chart of a method for processing dividend tail difference under sub-library distribution provided in an embodiment of the present application;
[0022] Figure 2 This is a flowchart of an embodiment of step 103 in the embodiment of the present application;
[0023] Figure 3 This is a flowchart of an embodiment of step 104 in the embodiment of the present application;
[0024] Figure 4 This is an example flow chart of a process for processing the difference between dividends and tails in a sub-library according to an embodiment of the present application;
[0025] Figure 5 It is a schematic diagram of the structure of an embodiment of a device for processing the difference between dividends and tails in a sub-library provided in an embodiment of the present application;
[0026] Figure 6 It is a schematic block diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0028] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0029] In the description of the embodiments of the present application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0030] In order to enable any person skilled in the art to implement and use the present application, the following description is provided. In the following description, details are listed for the purpose of explanation. It should be understood that those of ordinary skill in the art can recognize that the present application can also be implemented without using these specific details. In other examples, the known process will not be elaborated in detail to avoid unnecessary details that make the description of the present application embodiment obscure. Therefore, the present application is not intended to be limited to the embodiments shown, but is consistent with the widest range of principles and features disclosed in accordance with the embodiments of the present application.
[0031] The embodiments of the present application provide a method, device, computer equipment and computer-readable storage medium for processing dividend tail differences under sub-library distribution.
[0032] The executor of the method for processing the difference between dividends and tails in divided libraries in the embodiment of the present application may be the device for processing the difference between dividends and tails in divided libraries provided in the embodiment of the present application, or the computer device provided in the embodiment of the present application, wherein the device for processing the difference between dividends and tails in divided libraries may be implemented in hardware or software.
[0033] Some embodiments of the present application are described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0034] See also Figure 1 , Figure 1 101 is a flowchart of a method for processing the difference between dividends and tails of a sub-database provided in an embodiment of the present application. The method for processing the difference between dividends and tails of a sub-database includes steps 101 to 105, wherein:
[0035] 101. Obtain the remaining dividends to be distributed of the dividend product, the share record data of the dividend product, and the initial value of the shares to be split of the remaining dividends to be distributed.
[0036] Among them, dividend products can be financial management dividend products, etc.
[0037] The share record data includes multiple sub-library data tables.
[0038] Among them, the dividend product includes multiple customer share records, and the share record data refers to all customer share records of the dividend product, as shown in Table 1, each customer share record may include but is not limited to the product code (recorded as prod_code), the holding share (recorded as prod_vol), the dividend tail difference (recorded as tail), and the identification (recorded as ta_acct, such as the customer number). In order to improve the scalability and availability of the share record data of the dividend product, in this embodiment, the share record data of the dividend product is stored in a sub-library, that is: the share record data of the dividend product is split and stored in multiple sub-library data tables, and each sub-library data table i can set the number of customer share records to be stored according to actual business needs.
[0039] Among them, each sub-library data table i (denoted as t_bal) is a customer share table for storing multiple customer share records. For example, as shown in Table 1, each sub-library data table i can store multiple customer share records according to the data storage format of the customer share table shown in Table 1.
[0040] Table 1
[0041]
[0042] Among them, the remaining dividends to be distributed are the difference between the total dividends to be distributed and the actual distributed dividends of the dividend products. Since there is a tail difference due to factors such as calculation accuracy and the precision retention method used when distributing customer share proportions, after distributing dividends according to customer share proportions, there will be a difference in the amount between the actual total distributed dividends and the total dividends to be distributed, so it is necessary to make a secondary dividend distribution based on this difference in dividend amount.
[0043] Taking the example of retaining 2 decimal places for the precision of the held shares and 8 decimal places for the precision of the dividend tail difference, the initial value of the shares to be split is equal to the remaining dividends to be distributed*100.
[0044] In order to better understand this embodiment, some names involved in this embodiment are introduced below:
[0045] 1. Share variable (denoted as N): The variable to be solved, used to indicate how many shares the remaining dividends to be distributed should be divided into.
[0046] 2. Tail difference interval variable (denoted as [a, b)): a variable in the solution process, used to determine the order of customer share records to be allocated the remaining dividends to be distributed first.
[0047] 3. Share interval variable (denoted as [c, d)): a variable in the solution process, used to determine the order of customer share records to be allocated the remaining dividends first
[0048] 4. Identification interval variable (denoted as [f, g)): Variable in the solution process, used to determine the order of customer share records to be allocated the remaining dividends first
[0049] 5. Target tail difference (denoted as tl): The value to be solved, used to indicate the order of customer share records according to which the remaining dividends to be distributed should be distributed.
[0050] 6. Target share value (denoted as voll): The variable to be solved, used to indicate the order of customer share records according to which the remaining dividends to be distributed should be distributed.
[0051] 7. Target identification value (denoted as ta1): the value to be solved, used to indicate the order of customer share records according to which the remaining dividends to be distributed should be distributed.
[0052] 102. Based on the tail difference column of each sub-library data table and the initial value of the share to be split, obtain the target tail difference value of the remaining dividends to be distributed and the first remaining value of the share to be split of the target tail difference value.
[0053] Among them, each sub-library data table i includes at least a share column, a tail difference column, and an identification column.
[0054] Exemplarily, step 102 may specifically include the following steps 1021 to 1023:
[0055] 1021. Based on the tail difference column of each sub-database data table, obtain the initial tail difference interval of the remaining dividends to be distributed.
[0056] Exemplarily, first, for the tail difference column of each sub-library data table i, the maximum tail difference value of each sub-library data table i and the minimum tail difference value of each sub-library data table i can be found; then, by comparing the maximum tail difference value and the minimum tail difference value of all sub-library data tables, the maximum tail difference value of the share record data and the minimum tail difference value of the share record data can be determined. Finally, the minimum tail difference value of the share record data (such as a') can be used as the left interval value of the tail difference interval variable, and the sum of the maximum tail difference value of the share record data (such as b') and the preset tail difference precision (for example, as shown in Table 1, assuming that the preset tail difference precision retains 8 decimal places, and the preset tail difference precision is 0.00000001) can be used as the right interval value of the tail difference interval variable, thereby obtaining a tail difference interval (such as: [a', b'+0.00000001)) as the initial tail difference interval.
[0057] 1022. Check whether the accuracy of the initial tail difference interval meets the preset tail difference accuracy.
[0058] Exemplarily, first, the absolute value of the difference between the left value of the initial tail difference interval (such as a') and the right value of the initial tail difference interval (such as b'+0.00000001) can be used as the precision indication value of the initial tail difference interval (i.e., |a'-(b'+0.00000001)|). Then, the precision indication value of the initial tail difference interval is compared to see whether it is less than or equal to the preset tail difference precision (such as 0.00000001). If the precision indication value of the initial tail difference interval (such as |a'-(b'+0.00000001)|) is less than or equal to the preset tail difference precision (such as 0.00000001), it is determined that the precision of the initial tail difference interval meets the preset tail difference precision. Otherwise, if the precision indication value of the initial tail difference interval (such as |a'-(b'+0.00000001)|) is greater than the preset tail difference precision (such as 0.00000001), it is determined that the precision of the initial tail difference interval does not meet the preset tail difference precision.
[0059] 1023. Based on the accuracy detection result of the initial tail difference interval, the initial tail difference interval and the initial value of the share to be split, determine the target tail difference value and the first remaining value of the share to be split.
[0060] Among them, step 102 is equivalent to sorting the tail difference column. The target tail difference value is used to indicate that the customer share records whose dividend tail difference is greater than the target tail difference value (i.e., tail>t1) can redistribute the remaining dividends to be distributed (such as +0.01 dividends). The first remaining value of the share to be split is used to indicate how many shares are left to be redistributed when the dividend tail difference is equal to the target tail difference value.
[0061] In some embodiments, the first tail difference column sorting iteration obtains the target tail difference value and the first remaining value of the share to be split, that is, the accuracy of the initial tail difference interval meets the preset tail difference accuracy. At this time, step 1023 can specifically include the following steps A1-A2:
[0062] A1. If the accuracy of the initial tail difference interval meets the preset tail difference accuracy, the maximum value or the minimum value of the initial tail difference interval is used as the target tail difference value.
[0063] A2. If the accuracy of the initial tail difference interval meets the preset tail difference accuracy, the initial value of the share to be split will be used as the first remaining value of the share to be split.
[0064] In some embodiments, the n≥2th tail difference column sorting iteration obtains the target tail difference value and the first remaining value of the share to be split, that is, the accuracy of the initial tail difference interval does not meet the preset tail difference accuracy. At this time, step 1023 may specifically include the following steps B1 to B6:
[0065] B1. If the accuracy of the initial tail difference interval does not meet the preset tail difference accuracy, the current assignment of the tail difference interval variable of the remaining dividends to be distributed is set to the initial tail difference interval, and the current assignment of the share variable of the remaining dividends to be distributed is set to the initial value of the share to be split.
[0066] B2. Divide the current value of the tail difference interval variable according to the preset number of tail difference division intervals to obtain the tail difference sub-intervals of the current value of the tail difference interval variable.
[0067] For example, when the current assignment of the tail difference interval variable [a,b) is the initial tail difference interval [0,10), assuming that the preset number of tail difference division intervals is 10, the initial tail difference interval [0,10) can be divided into 10 equal tail difference sub-intervals (such as the 10 tail difference sub-intervals are [0,1), [1,2), [2,3), …, [9,10)) according to the preset number of tail difference division intervals (such as 10), which are used as the tail difference sub-intervals [a1,b1), [a2,b2), …, [a10,b10) of the current assignment of the tail difference interval variable.
[0068] B3. Determine a target tail difference sub-interval of the tail difference interval variable from the tail difference sub-intervals.
[0069] Exemplarily, step B3 may specifically include B31-B32:
[0070] B31, based on the first number m of records in each tail difference sub-interval j of each sub-library data table i ij , obtain the first total number of records M of each tail difference sub-interval j ;
[0071] Among them, the first record number m ij It refers to the total number of customer share records whose dividend tail difference values are in the tail difference sub-interval j among the customer share records in the sub-database data table i.
[0072] Among them, the first total number of records is M j It refers to the total number of customer share records whose dividend tail difference is in the tail difference sub-interval j in each customer share record of the share record data. Specifically, the number of first records m in each tail difference sub-interval j of each sub-database data table i can be calculated. ij Sum up and get the first total number of records M for each tail difference sub-interval j j .
[0073] For example, first, the number of first records m in each tail difference sub-interval j of each sub-database data table i is counted respectively. ij . For example, taking "each tail difference sub-interval j is [a1, b1), [a2, b2), ..., [a10, b10), and the sub-library data table i includes sub-library data tables 1, 2 and 3" as an example, in the sub-library data table i=1, the number of records of the dividend tail difference tail in the tail difference sub-intervals [a1, b1), [a2, b2), ..., [a10, b10) is counted, in the sub-library data table i=2, the number of records of the dividend tail difference tail in the tail difference sub-intervals [a1, b1), [a2, b2), ..., [a10, b10) is counted, in the sub-library data table i=3, the number of records of the dividend tail difference tail in the tail difference sub-intervals [a1, b1), [a2, b2), ..., [a10, b10) is counted, and so on. Then, according to each tail difference sub-interval j, the first number of records m of each sub-library data table i is merged. ij , get the first total number of records M for each tail difference sub-interval j j . For example, taking "the number of first records of sub-database data table 1 in the tail difference sub-interval [a1, b1), [a2, b2), ..., [a10, b10) is 1, the number of first records of sub-database data table 2 in the tail difference sub-interval [a1, b1), [a2, b2), ..., [a10, b10) is 2, and the number of first records of sub-database data table 3 in the tail difference sub-interval [a1, b1), [a2, b2), ..., [a10, b10) is 3" as an example, it can be statistically obtained that the total number of first records in the tail difference sub-interval [a1, b1), [a2, b2), ..., [a10, b10) is: 1+2+3=6.
[0074] B32, according to the first total number of records M of each tail difference sub-interval j and the current assignment of the share variable to be distributed, to obtain the target tail difference sub-interval of the tail difference interval variable.
[0075] There are many ways to implement step B32, illustratively including the following ways ① and ②:
[0076] ① If the remaining dividends to be distributed are positive, they are processed in descending order. At this time, step B32 can be specifically shown in steps a1 to a4 as follows:
[0077] a1. Traverse the tail difference sub-intervals j in order from large to small, and use the first total number of records in the currently traversed tail difference sub-interval to update the number of accumulated shares currently assigned to the tail difference interval variable.
[0078] Among them, after each traversal, the number of accumulated shares of the current assignment of the tail difference interval variable is equal to the sum of the first total number of records of the traversed tail difference sub-interval.
[0079] a2. Check whether the updated accumulated number of shares is greater than or equal to the current value of the share variable N (such as the initial value of the share to be split). If so, proceed to step a3; if not, proceed to step a4.
[0080] a3. If the updated accumulated number of shares is greater than or equal to the current value of the share variable N (such as the initial value of the share to be split), the current traversal tail difference sub-interval is used as the target tail difference sub-interval [s, e).
[0081] a4. If the updated number of accumulated shares is less than the current value of the share variable N (such as the initial value of the share to be split), re-enter step a1.
[0082] For example, assuming that each tail difference sub-interval [a1, b1), [a2, b2), ..., [a10, b10) increases in sequence, then the tail difference sub-intervals [a10, b10), [a9, b9), [a8, b8), ..., [a2, b2), [a1, b1)) can be traversed in sequence, and the first total number of records M of each tail difference sub-interval j can be accumulated one by one j , until the accumulated number of shares is just greater than or equal to the current value of the share variable N to be distributed (such as the initial value of the share to be split), the tail difference sub-interval traversed when the accumulated number of shares is just greater than or equal to the current value of the share variable N to be distributed (such as the initial value of the share to be split) is taken as the target tail difference sub-interval [s, e).
[0083] ② If the remaining dividends to be distributed are negative, they are processed in ascending order. At this time, step B32 may be specifically as shown in steps b1 to b4:
[0084] b1. Traverse the tail difference sub-intervals j in order from small to large, and use the first total number of records in the currently traversed tail difference sub-interval to update the number of accumulated shares currently assigned to the tail difference interval variable.
[0085] b2. Check whether the updated accumulated number of shares is greater than or equal to the current assigned value of the share variable N (such as the initial value of the share to be split). If so, proceed to step b3; if not, proceed to step b4.
[0086] b3. If the updated accumulated number of shares is greater than or equal to the current value of the share variable N (such as the initial value of the share to be split), the currently traversed tail difference sub-interval will be used as the target tail difference sub-interval [s, e).
[0087] b4. If the updated number of accumulated shares is less than the current value of the share variable N (such as the initial value of the share to be split), re-enter step b1.
[0088] B4, detecting whether the accuracy of the target tail difference sub-interval meets the preset tail difference accuracy; if the accuracy of the target tail difference sub-interval meets the preset tail difference accuracy, executing step B5; if the accuracy of the target tail difference sub-interval does not meet the preset tail difference accuracy, executing step B6.
[0089] Exemplarily, first, the absolute value of the difference between the left value (such as s) of the target tail difference subinterval and the right value (such as e) of the target tail difference subinterval can be used as the precision indicator value (i.e., |se|) of the target tail difference subinterval. Then, the precision indicator value (such as |se|) of the target tail difference subinterval is compared to see whether it is less than or equal to the preset tail difference precision (such as 0.00000001). If the precision indicator value (such as |se|) of the target tail difference subinterval is less than or equal to the preset tail difference precision (such as 0.00000001), it is determined that the precision of the target tail difference subinterval meets the preset tail difference precision. Otherwise, if the precision indicator value (such as |se|) of the target tail difference subinterval is greater than the preset tail difference precision (such as 0.00000001), it is determined that the precision of the target tail difference subinterval does not meet the preset tail difference precision.
[0090] B5. If the accuracy of the target tail difference sub-interval meets the preset tail difference accuracy, the maximum value or minimum value of the target tail difference sub-interval is used as the target tail difference value, and the difference between the current assignment of the share variable and the target cumulative number of records is used as the first remaining value of the share to be divided, wherein the target cumulative number of records is equal to the sum of the total number of shares of the preceding sorted sub-intervals of the target tail difference sub-interval, and the preceding sorted sub-interval is the tail difference sub-interval sorted before the target tail difference sub-interval.
[0091] Among them, when the remaining dividends to be distributed are positive, the minimum value of the target tail difference sub-interval [s, e) is used as the target tail difference value (such as s). When the remaining dividends to be distributed are negative, the maximum value of the target tail difference sub-interval [s, e) is used as the target tail difference value (such as e).
[0092] B6. If the precision of the target tail difference sub-interval does not meet the preset tail difference precision, the current assignment of the share variable is updated to the difference between the current assignment of the share variable and the target number of accumulated records, and the current assignment of the tail difference interval variable is updated to the target tail difference sub-interval, and steps B2 to B6 are re-executed;
[0093] In this way, by repeatedly iterating and executing steps B2 to B6, until the accuracy of the target tail difference sub-interval after update meets the preset tail difference accuracy, the maximum or minimum value of the target tail difference sub-interval obtained in the most recent iteration can be used as the target tail difference value; and the difference between the current assignment of the share variable obtained in the most recent iteration and the target accumulated number of records obtained in the most recent iteration can be used as the first remaining value of the share to be split.
[0094] 103. Based on the target tail difference, the first remaining value of the shares to be split and the share column of each sub-library data table, obtain the target share value of the remaining dividends to be distributed and the second remaining value of the shares to be split of the target share value.
[0095] like Figure 2 As shown, similar to step 102, illustratively, step 103 may specifically include the following steps 1031 to 1033:
[0096] Therefore, by determining the target tail difference and the first updated value of the share to be split, on the first hand, the target tail difference can be used to perform a binary search on the customer share records based on the dividend tail difference, thereby potentially sorting and screening out the target customer share records, and improving the search efficiency of the customer share records used to prioritize the allocation of the remaining dividends to be distributed; on the second hand, the target tail difference and the first remaining value of the share to be split are used to determine the target share value, so that when the share column is used for indexing, the maximum number of index entries belonging to the target customer share record does not exceed the first remaining value of the share to be split, thereby reducing the amount of data that needs to be processed in the process of determining the target share value and improving the efficiency of determining the target share value.
[0097] 1031. When the tail difference column meets the target tail difference value, the initial share range of the remaining dividends to be distributed is obtained based on the share column of each sub-library data table.
[0098] Exemplarily, when the tail difference column is equal to the target tail difference value, the maximum share value of each sub-library data table i and the minimum share value of each sub-library data table i can be found for the share column of each sub-library data table i; then, by comparing the maximum share value and the minimum share value of all sub-library data tables, the maximum share value of the share record data and the minimum share value of the share record data can be determined. In some embodiments, the minimum share value of the share record data (such as c') can be used as the left interval value of the share interval variable, and the sum of the maximum share value of the share record data (such as d') and the preset share precision (for example, as shown in Table 1, assuming that the preset share precision retains 2 decimal places and the preset share precision is 0.01) can be used as the right interval value of the share interval variable, thereby obtaining a share interval (such as: [c', d'+0.01)) as the initial share interval of the share interval variable.
[0099] 1032. Detect whether the accuracy of the initial share interval meets the preset share accuracy.
[0100] 1033. Determine the target share value and the second remaining value of the share to be split based on the accuracy detection result of the initial share interval, the initial share interval and the first remaining value of the share to be split.
[0101] In some embodiments, the first share column sorting iteration obtains the target share value and the second remaining value of the share to be split, that is, the accuracy of the initial share interval meets the preset share accuracy. At this time, step 1033 may specifically include the following steps C1 to C2:
[0102] C1. If the accuracy of the initial share interval meets the preset share accuracy, the maximum value or the minimum value of the initial share interval is used as the target share value.
[0103] C2. If the accuracy of the initial share interval meets the preset share accuracy, the first remaining value of the share to be split is used as the second remaining value of the share to be split.
[0104] In some embodiments, the target share value and the second remaining value of the share to be split are obtained by iterating the order of the share column n≥2 times, that is, the accuracy of the initial share interval does not meet the preset share accuracy. At this time, step 1033 may specifically include the following steps D1 to D6:
[0105] D1. If the accuracy of the initial share interval does not meet the preset share accuracy, the current assignment of the share interval variable of the remaining dividends to be distributed is set to the initial share interval, and the current assignment of the share variable of the remaining dividends to be distributed is set to the first remaining value of the share to be split.
[0106] D2. Divide the current value of the share interval variable according to the preset number of share division intervals to obtain the share sub-intervals of the current value of the share interval variable.
[0107] For example, when the current assignment of the share interval variable [c, d) is the initial share interval [1, 10), assuming that the preset number of share division intervals is 10, the initial share interval [1, 10) can be divided into 10 equal share sub-intervals according to the preset number of share division intervals (such as 10) (such as the 10 share sub-intervals are [c1, d1), [c2, d2), ..., [c10, d10)).
[0108] D3. Determine a target share sub-interval of the share interval variable from the share sub-intervals.
[0109] D4. Detect whether the accuracy of the target share sub-interval meets the preset share accuracy; if the accuracy of the target share sub-interval meets the preset share accuracy, execute step D5; if the accuracy of the target share sub-interval does not meet the preset share accuracy, execute step D6.
[0110] D5. If the accuracy of the target share sub-interval meets the preset share accuracy, the maximum value or minimum value of the target share sub-interval is used as the target share value, and the difference between the current assignment of the share variable and the target cumulative number of records is used as the second remaining value of the share to be split, wherein the target cumulative number of records is equal to the sum of the total number of shares of the preceding sorted sub-intervals of the target share sub-interval, and the preceding sorted sub-interval is the share sub-interval sorted before the target share sub-interval.
[0111] D6. If the precision of the target share sub-interval does not meet the preset share precision, the current assignment of the share variable is updated to the difference between the current assignment of the share variable and the target number of accumulated records, and the current assignment of the share interval variable is updated to the target share sub-interval, and steps D2 to D6 are re-executed;
[0112] In this way, by repeatedly iterating and executing steps D2 to D6, until the accuracy of the target share sub-interval after update meets the preset share accuracy, the maximum or minimum value of the target share sub-interval obtained in the most recent iteration can be used as the target share value; and the difference between the current assignment of the share variable obtained in the most recent iteration and the target accumulated number of records obtained in the most recent iteration can be used as the second remaining value of the share to be split.
[0113] The implementation of steps 1031 to 1033 is similar to that of steps 1021 to 1023. For details of the parts not described in detail, please refer to the relevant description in the previous text.
[0114] Therefore, on the first aspect, in steps 1031 to 1033, after fixing the dividend tail difference to the target tail difference value, the target share value is determined based on the share column of each sub-library data table, so that the customer share records whose dividend tail difference is not equal to the target tail difference value do not need to be counted again, thereby reducing the amount of data statistics when determining the target share value, improving the efficiency of determining the target share value, and then improving the dividend distribution efficiency.
[0115] On the second aspect, by determining the target share value and the second updated value of the share to be divided, firstly, the target share value can be used to perform a binary search on the customer share records based on the shares held, thereby potentially sorting and screening out the target customer share records, and improving the search efficiency of the customer share records used to prioritize the distribution of the remaining dividends to be distributed; secondly, the target share value and the second remaining value of the share to be divided are used to determine the target identification value, so that when the identification column is used for indexing, the maximum number of index entries belonging to the target customer share record does not exceed the second remaining value of the share to be divided, thereby reducing the amount of data that needs to be processed in the process of determining the target identification value, and improving the efficiency of determining the target identification value.
[0116] 104. Based on the target tail difference value, the target share value, the second remaining value of the share to be split and the identification column of each sub-library data table, obtain the target identification value of the remaining dividends to be distributed.
[0117] like Figure 3 As shown, similar to step 102, illustratively, step 104 may specifically include the following steps 1041 to 1043:
[0118] 1041. When the tail difference column meets the target tail difference value and the share column meets the target share value, the initial identification interval of the remaining dividends to be distributed is obtained based on the identification column of each sub-library data table.
[0119] Exemplarily, when the tail difference column is equal to the target tail difference value and the share column is equal to the target share value, the maximum value of the identification of each sub-library data table i and the minimum value of the identification of each sub-library data table i can be found for the identification column of each sub-library data table i; then, by comparing the maximum value of the identification and the minimum value of the identification of all sub-library data tables, the maximum value of the identification of the share record data and the minimum value of the identification of the share record data can be determined. In some embodiments, the minimum value of the identification of the share record data (such as e') can be used as the left interval value of the identification interval variable, and the sum of the maximum value of the identification of the share record data (such as f') and the preset identification precision (for example, as shown in Table 1, assuming that the preset identification precision is 1) can be used as the right interval value of the identification interval variable, thereby obtaining an identification interval (such as: [e', f'+1)) as the initial identification interval of the identification interval variable.
[0120] 1042. Detect whether the accuracy of the initial identification interval meets the preset identification accuracy.
[0121] 1043. Determine the target identification value based on the accuracy detection result of the initial identification interval, the initial identification interval and the second remaining value of the portion to be split.
[0122] In some embodiments, the first iteration of sorting the identification column obtains the target identification value, that is, the accuracy of the initial identification interval meets the preset identification accuracy. At this time, step 1043 may specifically include the following step E1:
[0123] E1. If the accuracy of the initial identification interval meets the preset identification accuracy, the maximum value or the minimum value of the initial identification interval is used as the target identification value.
[0124] In some embodiments, the target identification value is obtained by iterating the identification column sorting for n≥2 times, that is, the accuracy of the initial identification interval does not meet the preset identification accuracy. At this time, step 1043 may specifically include the following steps F1 to F6:
[0125] F1. If the accuracy of the initial identification interval does not meet the preset identification accuracy, the current assignment of the identification interval variable of the remaining dividends to be distributed is set to the initial identification interval, and the current assignment of the share variable of the remaining dividends to be distributed is set to the second remaining value of the share to be split.
[0126] F2. Divide the current value of the identification interval variable according to the preset number of identification division intervals to obtain identification sub-intervals of the current value of the identification interval variable.
[0127] For example, when the current assignment of the identification interval variable [f,g) is the initial identification interval [1,10), assuming that the preset number of identification division intervals is 10, the initial identification interval [1,10) can be divided into 10 equal identification sub-intervals according to the preset number of identification division intervals (such as 10) (such as the 10 identification sub-intervals are [f1,g1), [f2,g2), ..., [f10,g10)).
[0128] F3. Determine a target identification sub-interval of the identification interval variable from the identification sub-intervals.
[0129] F4, detecting whether the accuracy of the target identification sub-interval meets the preset identification accuracy; if the accuracy of the target identification sub-interval meets the preset identification accuracy, executing step F5; if the accuracy of the target identification sub-interval does not meet the preset identification accuracy, executing step F6.
[0130] F5. If the precision of the target identification sub-interval meets the preset identification precision, the maximum value or the minimum value of the target identification sub-interval is used as the target identification value.
[0131] F6. If the precision of the target identification sub-interval does not meet the preset identification precision, the current assignment of the share variable is updated to the difference between the current assignment of the share variable and the target number of accumulated records, and the current assignment of the identification interval variable is updated to the target identification sub-interval, and steps F2 to F6 are re-executed;
[0132] In this way, by repeatedly iterating and executing steps F2 to F6 until the accuracy of the updated target identification sub-interval meets the preset identification accuracy, the maximum value or minimum value of the target identification sub-interval obtained in the most recent iteration can be used as the target identification value.
[0133] The implementation of steps 1041 to 1043 is similar to that of steps 1021 to 1023. For details of the parts not described in detail, please refer to the relevant description in the previous text.
[0134] Therefore, in steps 1041 to 1043, after fixing the dividend tail difference to the target tail difference value and fixing the held share to the target share value, the target identification value is determined based on the identification column of each sub-library data table, so that the customer share records whose dividend tail difference is not equal to the target tail difference value / or the customer share records whose held share is not equal to the target share value do not need to be counted again, thereby reducing the amount of data statistics when determining the target identification value, improving the efficiency of determining the target identification value, and further improving the efficiency of dividend distribution.
[0135] 105. Based on the target tail difference value, the target share value and the target identification value, the remaining dividends to be distributed are distributed.
[0136] Therefore, in the share record data, the customer share records that meet one of the following three conditions can be allocated the remaining dividends to be distributed. At this time, the total number of customer share records that meet one of the following three conditions is exactly equal to the initial value of the shares to be split. The customer dividends corresponding to the customer share records that meet one of the following three conditions plus the preset dividend value (such as +0.01) can be used to realize the distribution of the remaining dividends to be distributed.
[0137] Condition 1: Dividend tail difference tail>target tail difference value t1;
[0138] Condition 2: Dividend tail difference tail = target tail difference value t1, and the holding shares prod_vol> target share value vol1;
[0139] Condition 3: dividend tail difference tail = target tail difference value t1, holding share prod_vol = target share value vol1, and flag ta_acct> target flag value ta1.
[0140] Therefore, in step 105, from each customer share record in each sub-library data table, a customer share record whose dividend tail difference is greater than the target tail difference value can be obtained as the target customer share record; each customer share record in each sub-library data table obtains a customer share record whose dividend tail difference is equal to the target tail difference value and whose share is greater than the target share value as the target customer share record; each customer share record in each sub-library data table obtains a customer share record whose dividend tail difference is equal to the target tail difference value, whose share is equal to the target share value, and whose identification value is greater than or equal to the target identification value as the target customer share record. Finally, each target customer share record is increased by a preset dividend value to realize the distribution of the remaining dividends to be distributed.
[0141] Among them, the preset dividend value is determined according to the customer's dividend accuracy. For example, if the customer's dividend accuracy is 0.01 (that is, the calculation result of the customer's dividend retains 2 decimal places), the preset dividend value is 0.01.
[0142] Furthermore, in order to improve the efficiency of dividend distribution, the target customer share records in the target record set can also be sharded to complete the dividend distribution process, for example, each shard has a maximum of 2,000 target customer share records, so that the dividends of the target customer share records are concurrently updated through different processing nodes plus a preset dividend value (such as +0.01). The target record set includes customer share records that meet condition 1, customer share records that meet condition 2, and customer share records that meet condition 3.
[0143] In order to better understand this embodiment, Figure 4 Taking the case where the precision of the dividend tail difference is retained to 8 digits, the precision of the holding share is retained to 2 digits, and the precision of the identifier is an integer as an example, the processing process of the dividend tail difference under the sub-database is explained through a specific example, as follows:
[0144] 1. Initial distribution of income: Calculate the customer dividend for each customer share record according to the proportion, record the dividend tail difference, and store it in the tail difference column of the sub-database data table i.
[0145] Among them, customer dividend = (holding share / total product share) * total dividend, and the calculation result is processed according to the specified precision retention method and retains 2 decimal places.
[0146] Among them, high-precision customer dividends = (held shares / total product shares) * total dividends, and the calculation result is processed according to the specified precision retention method and retains 8 decimal places.
[0147] Among them, the tail difference = high-precision customer dividends - customer dividends. If the tail difference is a positive number, the customer dividends are less than the actual amount. If the tail difference is a negative number, the customer dividends are more than the actual amount.
[0148] 2. Calculate the remaining dividends to be distributed due to the tail difference. For simplicity, this article only discusses the case where the remaining dividends to be distributed are positive.
[0149] Among them, the remaining dividends to be distributed = total dividends - total customer dividends.
[0150] 3. Calculate the initial value of the shares to be split for the remaining dividends to be distributed.
[0151] Among them, the initial value of the shares to be split is the preliminarily determined number of customer shares that should be allocated 0.01 dividends.
[0152] 4. Calculate the initial tail difference range of the remaining dividends to be distributed.
[0153] Sort the tail differences, and count the maximum value b'+0.00000001 and the minimum value a' when the tail difference is greater than or equal to 0, as the initial tail difference interval [a', b'+0.00000001). According to the above definition, the precision of the tail difference column is 0.00000001.
[0154] 5. Obtain the target tail difference value t1. This includes the following steps 5.1 to 5.20:
[0155] 5.1. Check whether the accuracy of the initial tail difference interval meets the preset tail difference accuracy. If yes, proceed to step 5.2; if not, proceed to step 5.3;
[0156] 5.2. If the accuracy of the initial tail difference interval meets the preset tail difference accuracy of 0.00000001, the minimum value of the initial tail difference interval is used as the target tail difference value t1, and the initial value of the share to be split is used as the first remaining value of the share to be split, and the process goes to step 6;
[0157] 5.3. If the accuracy of the initial tail difference interval does not meet the preset tail difference accuracy of 0.00000001, the current value of the variable N of the remaining dividends to be distributed shall be set to the initial value of the shares to be split, and the current value of the tail difference interval variable [a, b) of the remaining dividends to be distributed shall be set to the initial tail difference interval;
[0158] 5.4. Divide the tail difference interval variable [a,b) into 10 equally divided tail difference sub-intervals [a1,b1), [a2,b2)...[a10,b10), and proceed to step 5.5;
[0159] 5.5. For each sub-library data table i, obtain the number of first records mij of sub-library data table i in each tail difference sub-interval j, and proceed to step 5.6.
[0160] Among them, the first record numbers of the sub-database data table i in each tail difference sub-interval [a1, b1), [a2, b2) ... [a10, b10) are mi1, mi2 ..., mi10 respectively.
[0161] 5.6. According to the first number of records mij of each sub-database data table i in each tail difference sub-interval j, count the first total number of records Mj of each tail difference sub-interval j, and proceed to step 5.7;
[0162] 5.7. According to the first total number of records Mj of each tail difference sub-interval j and the current value of the share variable N, obtain the target tail difference sub-interval [s1, e1) of the tail difference interval variable and the first remaining value of the share to be split, and proceed to step 5.8;
[0163] 5.8. Check whether the precision of the target tail difference subinterval [s1, e1) is equal to the preset tail difference precision 0.00000001. If so, proceed to step 5.9; if not, proceed to step 5.20;
[0164] 5.9. If the accuracy of the target tail difference sub-interval [s1, e1) meets the preset tail difference accuracy of 0.00000001, obtain the maximum value of the target tail difference sub-interval [s1, e1) as the target tail difference value t1 and go to step 6.
[0165] 5.20. If the precision of the target tail difference sub-interval [s1, e1) does not meet the preset tail difference precision of 0.00000001, update the current value of the variable N of the remaining dividends to be distributed to the difference between the current value of the variable of the remaining dividends to be distributed and the target number of accumulated records, and update the current value of the variable [a, b) of the tail difference interval of the remaining dividends to be distributed to the target tail difference sub-interval [s1, e1), and go to step 5.4;
[0166] 6. When the dividend tail difference tail is equal to the target tail difference value t1, the target share value voll is obtained, including the following steps 6.1 to 6.20:
[0167] 6.1. Check whether the accuracy of the initial share interval meets the preset share accuracy. If yes, proceed to step 6.2; if no, proceed to step 6.3;
[0168] 6.2. If the accuracy of the initial share interval meets the preset share accuracy of 0.01, the minimum value of the initial share interval is used as the target share value vol1, and the first remaining value of the share to be split is used as the second remaining value of the share to be split, and the process goes to step 7;
[0169] 6.3. If the accuracy of the initial share interval does not meet the preset share accuracy of 0.01, the current value of the variable N of the remaining dividends to be distributed is set to the first remaining value of the shares to be split, and the current value of the share interval variable [c, d) of the remaining dividends to be distributed is set to the initial share interval;
[0170] 6.4. Divide the share interval variable [c, d) into 10 equal share sub-intervals [c1, d1), [c2, d2) ... [c10, d10), and proceed to step 6.5;
[0171] 6.5. For each sub-library data table i, obtain the second number of records pij of the sub-library data table i in each share sub-interval j, and go to step 6.6.
[0172] Among them, the number of second records of the sub-database data table i in each share sub-interval [c1, d1), [c2, d2)...[c10, d10) is pi1, pi2..., pi10 respectively.
[0173] 6.6. According to the first number of records pij of each sub-database data table i in each share sub-interval j, the second total number of records Pj of each share sub-interval j is counted, and the process goes to step 6.7;
[0174] 6.7. According to the second total number of records Pj of each share sub-interval j and the current value of the share variable N, obtain the target share sub-interval [s2, e2) of the share interval variable and the second remaining value of the share to be split, and proceed to step 6.8;
[0175] 6.8. Check whether the precision of the target share sub-interval [s, e) is equal to the preset share precision 0.01. If so, proceed to step 6.9; if not, proceed to step 6.20;
[0176] 6.9. If the precision of the target share sub-interval [s2, e2) meets the preset share precision of 0.01, obtain the maximum value of the target share sub-interval [s, e) as the target share value vol1 and proceed to step 7.
[0177] 6.20. If the precision of the target share sub-interval [s2, e2) does not meet the preset share precision of 0.01, update the current value of the variable N of the remaining dividends to be distributed to the difference between the current value of the variable of the remaining dividends to be distributed and the target number of accumulated records, and update the current value of the variable [c, d) of the share interval of the remaining dividends to be distributed to the target share sub-interval [s2, e2), and go to step 6.4;
[0178] 7. When the dividend tail difference tail is equal to the target tail difference value t1 and the holding share is equal to the target share value voll, obtain the target identification value ta1. This includes the following steps 7.1 to 7.20:
[0179] 7.1. Check whether the accuracy of the initial identification interval meets the preset identification accuracy. If yes, proceed to step 7.2; if no, proceed to step 7.3;
[0180] 7.2. If the accuracy of the initial identification interval meets the preset identification accuracy 1, the minimum value of the initial identification interval is used as the target identification value t1, and the process proceeds to step 8;
[0181] 7.3. If the precision of the initial identification interval does not meet the preset identification precision 1, the current value of the variable N of the remaining dividends to be distributed is set to the second updated value of the shares to be split, and the current value of the identification interval variable [f, g) of the remaining dividends to be distributed is set to the initial identification interval;
[0182] 7.4. Divide the identification interval variable [f,g) into 10 equally divided identification subintervals [f1,g1), [f2,g2) ... [e10,f10), and proceed to step 7.5;
[0183] 7.5. For each sub-library data table i, obtain the third number of records qij of the sub-library data table i in each identification sub-interval j, and proceed to step 7.6.
[0184] Among them, the number of third records of the sub-database data table i in each identification sub-interval [f1,g1), [f2,g2)...[e10,f10) is qi1, qi2..., qi10 respectively.
[0185] 7.6. According to the first number of records qij of each sub-database data table i in each identification sub-interval j, count the third total number of records Qj of each identification sub-interval j, and proceed to step 7.7;
[0186] 7.7. According to the third total number of records Qj of each identification sub-interval j and the current value of the share variable N, obtain the target identification sub-interval [s3, e3) of the identification interval variable, and proceed to step 7.8;
[0187] 7.8. Check whether the precision of the target identification subinterval [s3, e3) is equal to the preset identification precision 1. If so, proceed to step 7.9; if not, proceed to step 7.20;
[0188] 7.9. If the precision of the target identification sub-interval [s3, e3) meets the preset identification precision 1, obtain the maximum value of the target identification sub-interval [s3, e3) as the target identification value t1, and go to step 8.
[0189] 7.20. If the precision of the target identification sub-interval [s3, e3) does not meet the preset identification precision 1, update the current value of the variable N of the remaining dividends to be distributed to the difference between the current value of the variable of the remaining dividends to be distributed and the target number of accumulated records, and update the current value of the identification interval variable [f, g) of the remaining dividends to be distributed to the target identification sub-interval [s3, e3), and go to step 7.4;
[0190] 8. According to the target tail difference value t1, the target share value vol1 and the target identification value ta1, determine the target customer share record for the priority allocation of the remaining dividends to be distributed from each customer share record in each sub-library data table i, and go to step 9.
[0191] 9. Distribute the remaining dividends according to the target customer share records until the remaining dividends are exhausted.
[0192] From the above content, it can be seen that, on the one hand, by determining the target tail difference value, target share value and target identification value in sequence, the information such as the dividend tail difference, the holding share and the identification can be combined to index the target customer share record from the ordered data table of each sub-library, thereby improving the comprehensiveness of the result data coverage of the target customer share record. On the other hand, by determining the target customer share record of the remaining dividends to be distributed from each customer share record in each sub-library data table based on the target tail difference value, target share value and target identification value, the target customer share record can be potentially sorted and screened out directly through the relationship between the customer share record of each sub-library data table and the target tail difference value, target share value and target identification value. Each sub-library data table can independently search for the target customer share record, without the need to sort each sub-library data table and then transmit the sorted data of each sub-library data table to the middleware for merge sorting and searching, thereby reducing the amount of data transmission during global data statistics under the sub-library architecture, reducing the connection time of the sub-library data table, and improving the data statistics processing efficiency of global data under the sub-library architecture.
[0193] It can be seen that compared with the streaming merge sorting method provided by the middleware, in this embodiment, 1) network transmission data can be reduced; 2) database connection holding time is reduced; 3) speed is increased by 10 times; 4) time consumption is stable; 5) it takes 5 seconds to obtain the Nth record after sorting 50 million data, which can avoid the problem that the larger N is, the longer it takes and the more network transmission data when obtaining the Nth record after sorting caused by the streaming merge sorting method provided by the middleware; since there is no need to sort each sub-library data table and then transmit the sorted data of each sub-library data table to the middleware for merge sorting and search, there is no need to transmit the previous customer share records when searching for the last target customer share record during the dividend tail difference allocation processing, and the time consumption is irrelevant to the ranking of the last target customer share record, which effectively supports the horizontal expansion of the block data table.
[0194] In addition, in order to better implement the method for processing the difference between the dividend and the tail of the dividend under the sub-library in the embodiment of the present application, on the basis of the method for processing the difference between the dividend and the tail of the dividend under the sub-library, the embodiment of the present application also provides a device for processing the difference between the dividend and the tail of the dividend under the sub-library, such as Figure 5 As shown, it is a schematic diagram of the structure of an embodiment of a device for processing the difference between dividends distributed under a sub-library provided in an embodiment of the present application. The device 500 for processing the difference between dividends distributed under a sub-library includes:
[0195] A first acquisition unit is used to acquire the remaining dividends to be distributed of the dividend product, the share record data of the dividend product, and the initial value of the share to be split of the remaining dividends to be distributed, wherein the share record data includes a plurality of sub-library data tables;
[0196] A second acquisition unit is used to acquire the target tail difference value of the remaining dividends to be distributed and the first remaining value of the shares to be split of the target tail difference based on the tail difference column of each sub-library data table and the initial value of the shares to be split;
[0197] The second acquisition unit is further configured to acquire the target share value of the remaining dividends to be distributed and the second remaining value of the shares to be split of the target share value based on the target tail difference value, the first remaining value of the shares to be split and the share column of each sub-library data table;
[0198] The second acquisition unit is further used to acquire the target identification value of the remaining dividends to be distributed based on the target tail difference value, the target share value, the second remaining value of the share to be split, and the identification column of each sub-library data table;
[0199] The processing unit is used to determine the target customer share record of the remaining dividends to be distributed from each customer share record in each sub-library data table based on the target tail difference value, the target share value and the target identification value.
[0200] In some embodiments, the second acquiring unit 502 is specifically configured to:
[0201] Based on the tail difference column of each sub-database data table, obtaining the initial tail difference interval of the remaining dividends to be distributed;
[0202] If the accuracy of the initial tail difference interval does not meet the preset tail difference accuracy, the current value of the tail difference interval variable of the remaining dividends to be distributed is set to the initial tail difference interval, and the current value of the variable of the share to be distributed of the remaining dividends to be distributed is set to the initial value of the share to be split;
[0203] Divide the current value of the tail difference interval variable according to the preset number of tail difference division intervals to obtain each tail difference sub-interval of the current value of the tail difference interval variable;
[0204] Determining a target tail difference sub-interval of the tail difference interval variable from the tail difference sub-intervals;
[0205] Based on the accuracy of the target tail difference sub-interval and the current assignment of the share variable, the target tail difference value and the first remaining value of the share to be split are determined.
[0206] In some embodiments, the second acquiring unit 502 is specifically configured to:
[0207] If the accuracy of the target tail difference subinterval meets the preset tail difference accuracy, the maximum value or the minimum value of the target tail difference subinterval is used as the target tail difference value;
[0208] The difference between the current assignment of the share variable and the target cumulative number of records is used as the first remaining value of the share to be split, wherein the target cumulative number of records is equal to the sum of the total number of shares of the preceding sorted sub-intervals of the target tail difference sub-interval, and the preceding sorted sub-interval is the tail difference sub-interval sorted before the target tail difference sub-interval.
[0209] In some embodiments, the second acquiring unit 502 is specifically configured to:
[0210] If the accuracy of the target tail difference sub-interval does not meet the preset tail difference accuracy, the current assignment of the share variable is updated to the difference between the current assignment of the share variable and the target number of accumulated records, and the current assignment of the tail difference interval variable is updated to the target tail difference sub-interval;
[0211] Based on the current value assigned to the share variable after update and the current value assigned to the tail difference interval variable after update, updating the target tail difference sub-interval of the tail difference interval variable;
[0212] Until the accuracy of the target tail difference sub-interval after update meets the preset tail difference accuracy, the target tail difference value and the first remaining value of the share to be split are obtained.
[0213] In some embodiments, the second acquiring unit 502 is specifically configured to:
[0214] Based on the first number of records in each tail difference sub-interval of each sub-library data table, obtaining the first total number of records in each tail difference sub-interval;
[0215] According to the first total number of records of each tail difference sub-interval and the current assignment of the share variable, the target tail difference sub-interval of the tail difference interval variable is obtained.
[0216] In some embodiments, the second acquiring unit 502 is specifically configured to:
[0217] Under the condition that the tail difference column meets the target tail difference value, based on the share column of each sub-database data table, the initial share range of the remaining dividends to be distributed is obtained;
[0218] If the accuracy of the initial share interval does not meet the preset share accuracy, the current assignment of the share interval variable of the remaining dividends to be distributed is set to the initial share interval, and the current assignment of the share variable of the remaining dividends to be distributed is set to the first remaining value of the share to be split;
[0219] Dividing the current value of the share interval variable according to the preset number of share division intervals to obtain each share sub-interval of the current value of the share interval variable;
[0220] Determining a target share sub-interval of the share interval variable from the share sub-intervals;
[0221] Based on the accuracy of the target share sub-interval and the current assignment of the share variable, the target share value and the second remaining value of the share to be split are determined.
[0222] In some embodiments, the processing unit 503 is specifically configured to:
[0223] From each customer share record in each sub-database data table, obtain a customer share record whose dividend tail difference is greater than the target tail difference value, as the target customer share record;
[0224] Each customer share record in each sub-database data table obtains a customer share record whose dividend tail difference is equal to the target tail difference value and whose share is greater than the target share value, as the target customer share record;
[0225] Each customer share record in each sub-database data table obtains the customer share record whose dividend tail difference is equal to the target tail difference value, whose holding share is equal to the target share value, and whose identification value is greater than or equal to the target identification value, as the target customer share record.
[0226] In specific implementation, the above units can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units can refer to the above-mentioned implementation example of the method for processing the red tail difference under the library division, which will not be repeated here.
[0227] See also Figure 6 , Figure 6 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application. The computer device may be a server.
[0228] like Figure 6As shown, the computer device includes a processor, a memory, and a network interface connected via a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.
[0229] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any method for processing the dividend and tail difference under library division.
[0230] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
[0231] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any method for processing the red and tail differences under library division.
[0232] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0233] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0234] A person of ordinary skill in the art can understand that all or part of the steps in the above-mentioned method for processing dividend and tail differences under library division can be completed by instructions, or by controlling related hardware through instructions. The instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0235] To this end, an embodiment of the present application provides a computer-readable storage medium, in which multiple computer programs are stored. The computer program can be loaded by a processor to execute any of the methods for processing dividend tail differences under divided libraries provided in the embodiments of the present application.
[0236] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0237] In the above-mentioned embodiments of the device for processing the difference between the dividend and the tail of the dividend distributed under the library division and the computer-readable storage medium, the description of each embodiment has its own emphasis. For the part that is not described in detail in a certain embodiment, reference can be made to the relevant description of other embodiments. Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process and beneficial effects of the device for processing the difference between the dividend and the tail of the dividend distributed under the library division, the computer-readable storage medium and its corresponding units described above can refer to the description of the method for processing the difference between the dividend and the tail of the dividend distributed under the library division in the above embodiment, and will not be repeated here.
[0238] The above is a detailed introduction to a method, device, computer equipment and computer-readable storage medium for processing the red and tail difference under the sub-library provided in the embodiment of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application. The non-company software tools or components that appear in the embodiments of the present application are only examples and do not represent actual use.
Claims
1. A method for processing the difference between dividends and tails of sub-databases, characterized in that: The method comprises: Obtain the remaining dividends to be distributed of the dividend product, the share record data of the dividend product, and the initial value of the share to be split of the remaining dividends to be distributed, wherein the share record data includes multiple sub-library data tables; Based on the tail difference column of each sub-database data table and the initial value of the share to be split, the target tail difference value of the remaining dividends to be distributed and the first remaining value of the share to be split of the target tail difference value are obtained; Based on the target tail difference value, the first remaining value of the shares to be split and the share column of each sub-library data table, the target share value of the remaining dividends to be distributed and the second remaining value of the shares to be split of the target share value are obtained; Based on the target tail difference value, the target share value, the second remaining value of the share to be split and the identification column of each sub-library data table, the target identification value of the remaining dividend to be distributed is obtained; Based on the target tail difference value, the target share value and the target identification value, the target customer share record of the remaining dividends to be distributed is determined from each customer share record in each sub-library data table.
2. The method for processing the difference between dividends and tails of sub-libraries according to claim 1 is characterized in that: The step of obtaining the target tail difference value of the remaining dividends to be distributed and the first remaining value of the shares to be split of the target tail difference value based on the tail difference column of each sub-database data table and the initial value of the shares to be split includes: Based on the tail difference column of each sub-database data table, obtaining the initial tail difference interval of the remaining dividends to be distributed; If the accuracy of the initial tail difference interval does not meet the preset tail difference accuracy, the current value of the tail difference interval variable of the remaining dividends to be distributed is set to the initial tail difference interval, and the current value of the variable of the share to be distributed of the remaining dividends to be distributed is set to the initial value of the share to be split; Divide the current value of the tail difference interval variable according to the preset number of tail difference division intervals to obtain each tail difference sub-interval of the current value of the tail difference interval variable; Determining a target tail difference sub-interval of the tail difference interval variable from the tail difference sub-intervals; Based on the accuracy of the target tail difference sub-interval and the current assignment of the share variable, the target tail difference value and the first remaining value of the share to be split are determined.
3. The method for processing the difference in dividends of sub-libraries according to claim 2 is characterized in that: The step of determining the target tail difference value and the first remaining value of the share to be split based on the accuracy of the target tail difference sub-interval and the current assignment of the share to be split variable comprises: If the accuracy of the target tail difference subinterval meets the preset tail difference accuracy, the maximum value or the minimum value of the target tail difference subinterval is used as the target tail difference value; The difference between the current assignment of the share variable and the target cumulative number of records is used as the first remaining value of the share to be split, wherein the target cumulative number of records is equal to the sum of the total number of shares of the preceding sorted sub-intervals of the target tail difference sub-interval, and the preceding sorted sub-interval is the tail difference sub-interval sorted before the target tail difference sub-interval.
4. The method for processing the difference between dividends and tails of sub-libraries according to claim 2 is characterized in that: The step of determining the target tail difference value and the first remaining value of the share to be split based on the accuracy of the target tail difference sub-interval and the current assignment of the share to be split variable comprises: If the accuracy of the target tail difference sub-interval does not meet the preset tail difference accuracy, the current assignment of the share variable is updated to the difference between the current assignment of the share variable and the target number of accumulated records, and the current assignment of the tail difference interval variable is updated to the target tail difference sub-interval; Based on the current value assigned to the share variable after update and the current value assigned to the tail difference interval variable after update, updating the target tail difference sub-interval of the tail difference interval variable; Until the accuracy of the target tail difference sub-interval after update meets the preset tail difference accuracy, the target tail difference value and the first remaining value of the share to be split are obtained.
5. The method for processing the difference in dividends of sub-libraries according to claim 2 is characterized in that: Determining a target tail difference sub-interval of the tail difference interval variable from the tail difference sub-intervals includes: Based on the first number of records in each tail difference sub-interval of each sub-library data table, obtaining the first total number of records in each tail difference sub-interval; According to the first total number of records of each tail difference sub-interval and the current assignment of the share variable, the target tail difference sub-interval of the tail difference interval variable is obtained.
6. The method for processing dividend tail difference of sub-library according to claim 1 is characterized in that: The step of obtaining the target share value of the remaining dividends to be distributed and the second remaining value of the share to be split of the target share value based on the target tail difference value, the first remaining value of the share to be split and the share column of each sub-library data table includes: Under the condition that the tail difference column meets the target tail difference value, based on the share column of each sub-database data table, the initial share range of the remaining dividends to be distributed is obtained; If the accuracy of the initial share interval does not meet the preset share accuracy, the current value of the share interval variable of the remaining dividends to be distributed is set to the initial share interval, and the current value of the variable of the share to be distributed of the remaining dividends to be distributed is set to the first remaining value of the share to be split; Dividing the current value of the share interval variable according to the preset number of share division intervals to obtain each share sub-interval of the current value of the share interval variable; Determining a target share sub-interval of the share interval variable from the share sub-intervals; Based on the accuracy of the target share sub-interval and the current assignment of the share variable, the target share value and the second remaining value of the share to be split are determined.
7. The method for processing dividend tail difference of sub-library according to claim 1 is characterized in that: The step of determining the target customer share record of the remaining dividends to be distributed from each customer share record in each sub-database data table based on the target tail difference value, the target share value and the target identification value includes: From each customer share record in each sub-database data table, obtain a customer share record whose dividend tail difference is greater than the target tail difference value, as the target customer share record; Each customer share record in each sub-database data table obtains a customer share record whose dividend tail difference is equal to the target tail difference value and whose share is greater than the target share value, as the target customer share record; Each customer share record in each sub-library data table obtains the customer share record whose dividend tail difference is equal to the target tail difference value, the holding share is equal to the target share value, and the identification value is greater than or equal to the target identification value, as the target customer share record.
8. A device for processing the difference between dividends and tails of sub-libraries, characterized in that: The sub-library dividend tail difference processing device comprises: A first acquisition unit is used to acquire the remaining dividends to be distributed of the dividend product, the share record data of the dividend product, and the initial value of the share to be split of the remaining dividends to be distributed, wherein the share record data includes a plurality of sub-library data tables; A second acquisition unit is used to acquire the target tail difference value of the remaining dividends to be distributed and the first remaining value of the shares to be split of the target tail difference based on the tail difference column of each sub-library data table and the initial value of the shares to be split; The second acquisition unit is further configured to acquire the target share value of the remaining dividends to be distributed and the second remaining value of the shares to be split of the target share value based on the target tail difference value, the first remaining value of the shares to be split and the share column of each sub-library data table; The second acquisition unit is further used to acquire the target identification value of the remaining dividends to be distributed based on the target tail difference value, the target share value, the second remaining value of the share to be split, and the identification column of each sub-library data table; The processing unit is used to determine the target customer share record of the remaining dividends to be distributed from each customer share record in each sub-library data table based on the target tail difference value, the target share value and the target identification value.
9. A computer device, characterized in that: The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is used to execute the computer program and implement the method for processing the dividend tail difference of the sub-library according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is loaded by a processor to execute the method for processing the dividend tail difference under divided libraries as described in any one of claims 1 to 7.
