A method for data pairing and related equipment
By using genetic algorithms to obtain the pairing error of the population, and selecting and optimizing the target population, the problem of low data pairing efficiency in traditional methods is solved, and fast and accurate data pairing is achieved.
Patent Information
- Application Number
- CN202010467395.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-05-28
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2040-05-28
AI Technical Summary
Traditional exhaustive search methods are inefficient when matching data with large amounts of data, and cannot quickly and accurately complete the data matching.
A genetic algorithm is used to obtain the pairing error of the population. The target population is determined by fitness function selection and crossover mutation operations, and data pairing is performed based on the target population.
It enables fast and accurate data matching, saving time and improving efficiency.
Smart Images

Figure CN113806409B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method for data pairing and related equipment. Background Technology
[0002] With the development of computer technology, data matching is required in many fields, which involves pairing paired data with data to be matched in order to make reasonable overall planning and utilization of data.
[0003] For ease of understanding, the following is combined with Figure 1 The process of data pairing described above will be introduced. Figure 1 This is a schematic diagram illustrating an application example provided in this application. For example... Figure 1 As shown, in the accounting reconciliation process in the financial field, the receipt list contains multiple receipt items (pairing data), and the invoice list contains multiple invoice items (data to be paired). If some receipt items in the receipt list can be paired with a certain invoice item in the invoice list, the reconciliation can be considered successful.
[0004] To achieve data pairing, a traditional exhaustive search method can be used to determine all possible pairing solutions in both the pairing data and the data to be paired. However, when the amount of data is too large, this method requires too much time and is inefficient in data pairing. Summary of the Invention
[0005] This application provides a data pairing method and related equipment, which can quickly and accurately complete data pairing, thereby saving time and improving efficiency.
[0006] A first aspect of this application provides a data pairing method, the method comprising:
[0007] Obtain L populations, each containing the pairing relationships between N paired data and M unpaired data;
[0008] The pairing error of each population is obtained using a genetic algorithm;
[0009] Based on the pairing error of each population, the target population is determined among L populations;
[0010] Based on the target population, pair N pairs of data with K pairs of data from M pairs of data to be paired.
[0011] Where L≥2, N≥2, M≥1, K≤M.
[0012] As can be seen from the above method: First, multiple populations are obtained, each representing a pairing relationship between multiple paired data and multiple unpaired data. Then, a genetic algorithm is used to obtain the pairing error of each population. Based on the pairing error of each population, a target population is determined from the multiple populations, that is, the final pairing relationship between the multiple paired data and the multiple unpaired data is determined. Finally, based on this relationship, the multiple paired data and the multiple unpaired data are paired. The embodiments of this application are based on genetic algorithms, which can quickly and accurately complete data pairing, which helps to save time and improve efficiency.
[0013] In conjunction with the first aspect, in a first implementation of the first aspect of the embodiments of this application, obtaining the pairing error of each population through a genetic algorithm includes:
[0014] Based on a preset fitness function, select T populations from L populations;
[0015] Cross over T populations and then mutate the resulting T populations.
[0016] The pairing error of each of the 2T populations is calculated based on the fitness function.
[0017] Where T≤L, the 2T populations include the T populations after mutation and the T populations before crossover.
[0018] In conjunction with the first implementation of the first aspect, in the second implementation of the first aspect of this application, the fitness function is:
[0019] E u ={e u,1 ,e u,2 ,...,e u,M}
[0020] e u,j =∑x i ×L u,j,i -y j -g
[0021] In the above formula, E u Let e represent the pairing error of the u-th population, where u∈(1,2,…,2T); u,j Let x represent the pairing error of the j-th unpaired data in the u-th population, where j∈(1,2,…,M); i Let y represent the i-th pair of data, i∈(1,2,…,N); j This represents the j-th data to be paired; if L u,j,i If L is 1, it means that the i-th paired data is paired with the j-th unpaired data. u,j,iIf the value is 0, it means that the i-th paired data was not paired with the j-th unpaired data; g is a preset tolerance value.
[0022] In conjunction with the second implementation of the first aspect, in the third implementation of the first aspect of this application, determining the target population among the L populations based on the pairing error of each population includes:
[0023] The score of each of the 2T populations is obtained based on the pairing error of each population. The score of each population is obtained by comparing the pairing error of that population with the pairing errors of the other populations in the 2T populations.
[0024] Based on the score of each of the 2T populations, determine P populations from the 2T populations;
[0025] Based on the pairing error of each of the P populations, the cumulative error value of each of the P populations is obtained. The cumulative error value of each population is obtained by summing the pairing errors of K unpaired data in the population, where K≤M.
[0026] The target population is determined from the P populations based on the cumulative error of each population.
[0027] A second aspect of this application provides a data pairing apparatus, the apparatus comprising:
[0028] The first acquisition module is used to acquire L populations, each population containing the pairing relationships between N paired data and M unpaired data;
[0029] The second acquisition module is used to obtain the pairing error of each population through a genetic algorithm;
[0030] The determination module is used to determine the target population among L populations based on the pairing error of each population;
[0031] The pairing module is used to pair N pairs of data with K pairs of M pairs of data to be paired, based on the target population.
[0032] Where L≥2, N≥2, M≥1, K≤M.
[0033] In conjunction with the second aspect, in a first implementation of the second aspect of this application, the second acquisition module includes:
[0034] The first operation unit is used to select T populations from L populations based on a preset fitness function;
[0035] The second operation unit is used to perform crossover on T populations and to mutate the T populations after crossover.
[0036] The third operation unit is used to calculate the pairing error of each of the 2T populations based on the fitness function.
[0037] Where T≤L, the 2T populations include the T populations after mutation and the T populations before crossover.
[0038] In conjunction with the first implementation of the second aspect, in the second implementation of the second aspect of this application, the fitness function is:
[0039] E u ={e u,1 ,e u,2 ,...,e u,M}
[0040] e u,j =∑x i ×L u,j,i -y j -g
[0041] In the above formula, E u Let e represent the pairing error of the u-th population, where u∈(1,2,…,2T); u,j Let x represent the pairing error of the j-th unpaired data in the u-th population, where j∈(1,2,…,M); i Let y represent the i-th pair of data, i∈(1,2,…,N); j This represents the j-th data to be paired; if L u,j,i If L is 1, it means that the i-th paired data is paired with the j-th unpaired data. u,j,i If the value is 0, it means that the i-th paired data was not paired with the j-th unpaired data; g is a preset tolerance value.
[0042] In conjunction with the second implementation of the second aspect, in the third implementation of the second aspect of this application, the determining module includes:
[0043] The score of each of the 2T populations is obtained based on the pairing error of each population. The score of each population is obtained by comparing the pairing error of that population with the pairing errors of the other populations in the 2T populations.
[0044] Based on the score of each of the 2T populations, determine P populations from the 2T populations;
[0045] Based on the pairing error of each of the P populations, the cumulative error value of each of the P populations is obtained. The cumulative error value of each population is obtained by summing the pairing errors of K unpaired data in the population, where K≤M.
[0046] The target population is determined from the P populations based on the cumulative error of each population.
[0047] A third aspect of this application provides a data pairing apparatus, the apparatus comprising:
[0048] One or more central processing units, memory, input / output interfaces, wired or wireless network interfaces, and power supply;
[0049] The memory can be either temporary or permanent storage.
[0050] The central processing unit is configured to communicate with memory and execute instructions in memory on a resource-scheduled device as described in any of the first aspects.
[0051] A fourth aspect of this application provides a computer-readable storage medium including instructions that, when executed on a computer, cause the computer to perform the method as described in any of the first aspects.
[0052] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:
[0053] This application provides a method and apparatus for data pairing. In this embodiment, multiple populations are first obtained, each representing a pairing relationship between multiple paired data and multiple unpaired data. Then, a genetic algorithm is used to obtain the pairing error of each population. Based on the pairing error of each population, a target population is determined from the multiple populations, thus determining the final pairing relationship between the multiple paired data and the multiple unpaired data. Finally, based on this relationship, the multiple paired data and the multiple unpaired data are paired. This application embodiment, based on a genetic algorithm, can quickly and accurately complete data pairing, saving time and improving efficiency. Attached Figure Description
[0054] Figure 1 A schematic diagram illustrating an application example provided in this application embodiment;
[0055] Figure 2 A flowchart illustrating the data pairing method provided in this application embodiment;
[0056] Figure 3 A schematic diagram of the cross-operation provided in the embodiments of this application;
[0057] Figure 4 A schematic diagram of the data pairing apparatus provided in the embodiments of this application;
[0058] Figure 5 Another schematic diagram of the data pairing device provided in the embodiments of this application. Detailed Implementation
[0059] This application provides a data pairing method and related equipment, which can quickly and accurately complete data pairing, thereby saving time and improving efficiency.
[0060] Figure 2 This is a flowchart illustrating a data pairing method provided in an embodiment of this application. Figure 2 As shown, the method includes:
[0061] 201. Obtain L populations.
[0062] If we need to pair N pairs of data with M pairs of data to be paired, we can first obtain L populations. Each population contains one pairing relationship between the N pairs of data and the M pairs of data to be paired. Therefore, the L populations represent the L pairing relationships between the N pairs of data and the M pairs of data to be paired. Where L≥2, N≥2, and M≥1.
[0063] To facilitate understanding, the population will be described in detail below with reference to Table 1.
[0064] Table 1
[0065] L(1,1) L(1,2) … L(1, M) x1 0 1 … 0 x2 0 1 … 0 x3 1 0 … 0 … … … … … xN 0 0 … 1 y1 y2 … yM
[0066] Table 1 shows the pairing relationships contained in population 1. As shown in Table 1, in population 1, L(1,j) represents the gene sequence of population 1. For example, L(1,1) represents how many of the N pairing data are paired with the data to be paired y1. In L(1,1), L... 1,1,1 A value of 0 (in the first column of Table 1, the value corresponding to x1 is 0) indicates that x1 was not paired with y1, while L 1,1,3 A value of 1 (the value corresponding to x3 in column 1 of Table 1) indicates that x3 is paired with y1. Similarly, we can obtain the number of paired data for each of the M pairs of data to be paired. It should be noted that the sum of the values in each row of Table 1 (for example, the sum of the values corresponding to a pair of data in all columns) is equal to 0 or 1, because a pair of data can only be paired with one pair of data.
[0067] Therefore, population 1 shows the first pairing relationship between N paired data and M unpaired data. The remaining populations can be used to determine the other pairing relationships between the N paired data and the M unpaired data. To determine an optimal pairing relationship based on L pairing relationships, after obtaining L populations, a genetic algorithm can be used to obtain the pairing error of each population.
[0068] 202. Based on a preset fitness function, select T populations from L populations.
[0069] After obtaining L populations, T populations can be selected from the L populations based on a preset fitness function. Where T ≤ L, and the fitness function is:
[0070] E u ={e u,1 ,e u,2 ,...,e u,M}
[0071] e u,j =∑x i ×L u,j,i -y j -g
[0072] In the above formula, E u Let e represent the pairing error of the u-th population, where u∈(1,2,…,2T); u,j Let x represent the pairing error of the j-th unpaired data in the u-th population, where j∈(1,2,…,M); i Let y represent the i-th pair of data, i∈(1,2,…,N); j This represents the j-th data to be paired; if L u,j,i If L is 1, it means that the i-th paired data is paired with the j-th unpaired data. u,j,i If the value is 0, it means that the i-th paired data was not paired with the j-th unpaired data; g is a preset tolerance value.
[0073] Based on the fitness function, the pairing error of each of the L populations can be obtained. It should be understood that the pairing error of each population is the set of pairing errors for each pair of data points within that population. Therefore, by comparing the pairing errors, T superior populations can be selected from the L populations to achieve local optimization.
[0074] For example, suppose L is 10, T is 5, and each population contains 3 pairs of data to be paired: y1, y2, and y3. First, the 10 populations are divided into groups of 2. Then, based on the fitness function, the pairing error of each population is calculated. Within each group, the pairing errors of the two populations are compared to select the better population. Specifically, the comparison can be as follows: Suppose the first group contains population 1 and population 2, with pairing errors of {1, 2, 3} for population 1 and {2, 3, 3} for population 2. By comparison, it can be seen that in population 1, the pairing error of data y1 is smaller, the pairing error of y2 is smaller, and the pairing errors of y3 are equal for both populations. Therefore, population 1 can be selected as the better population from the first group. It should be noted that if, after comparing two populations in a group, it is impossible to distinguish which population is better, then a population is randomly selected as the better population.
[0075] 203. Perform crossover on T populations and then mutate the resulting T populations.
[0076] After obtaining T superior populations, crossover operations can be performed on these T populations. For ease of understanding, the following will combine... Figure 3 The aforementioned cross-operation will be introduced. Figure 3 A schematic diagram of the cross-operation provided in the embodiments of this application, such as Figure 3 As shown, the T populations are first divided into groups, with each group containing two populations. Let the first group contain population 1 and population 7. We will use L(1,1) and L(7,1) for illustration, where L(1,1) is the first gene sequence in population 1, and L(7,1) is the first gene sequence in population 7. If L(1,1) and L(7,1) crossover occurs, the sequence fragments in L(1,1) and L(7,1) are exchanged, forming a new gene sequence. Similarly, crossover operations also occur between other gene sequences in population 1 and population 7. Furthermore, the remaining groups can also perform crossover operations as described above to complete the crossover operation for all T populations.
[0077] Then, mutation operations can be performed on the T populations after the crossover. For ease of understanding, the above mutation operations are described below with reference to Table 2 (Table 2 shows population 2 before mutation) and Table 3 (Table 3 shows population 2 after mutation).
[0078] Table 2
[0079] L(2,1) L(2,2) … L(2, M) x1 1 0 … 0 x2 1 0 … 0 x3 0 1 … 0 … … … … … xN 0 0 … 1 y1 y2 … yM
[0080] Table 3
[0081] L(2,1) L(2,2) … L(2, M) x1 0 1 … 0 x2 1 0 … 0 x3 0 1 … 0 … … … … … xN 0 0 … 1 y1 y2 … yM
[0082] Based on Tables 2 and 3, a mutation operation is performed on a gene sequence in population 2, such as L in L(2,2). 2,2,1 The original value of L is 0. After mutation, its value can be changed to 1. In order to ensure that the sum of the values in each row is equal to 0 or 1, L in L(1,2) 2,1,1 It also needs to be mutated to change its value from 1 to 0. Similarly, the other populations can also undergo the mutation operation described above to complete the mutation operation for T populations.
[0083] 204. Based on the fitness function, calculate the pairing error of each of the 2T populations.
[0084] After the mutation operation is performed, the T mutated populations (child populations) are merged with the T unmutated populations (parent populations) to obtain 2T populations. Then, based on the aforementioned fitness function, the pairing error of each of the 2T populations is calculated.
[0085] 205. Obtain the score of each of the 2T populations based on the pairing error of each population.
[0086] After obtaining the pairing error of each of the 2T populations, a score for each of the 2T populations can be obtained based on the pairing error. The score for each population is obtained by comparing its pairing error with the pairing errors of the remaining populations in the 2T populations. Specifically, after obtaining the pairing error of a certain population, its pairing error can be compared with the pairing errors of the remaining populations in the 2T populations to obtain the score for that population.
[0087] For example, suppose the pairing error of population 1 is {1,2,3}, the pairing error of population 2 is {2,3,3}, the pairing error of population 3 is {2,3,1}, and the pairing error of population 4 is {1,1,3}. By comparing the pairing errors of population 1 with those of populations 2, 3, and 4, population 1 scores 2 points compared to population 2 (the comparison shows that in population 1, the pairing error of the data to be paired, y1, is smaller, the pairing error of y2 is smaller, and the pairing errors of y3 in both populations are equal, hence population 1 scores 2 points compared to population 2), 1 point compared to population 3, and -1 point compared to population 4. Therefore, population 1 scores 2 points. Similarly, population 2 scores -5 points, population 3 scores -1 point, and population 4 scores 4 points.
[0088] 206. Based on the scores of each of the 2T populations, determine P populations from the 2T populations.
[0089] After obtaining the score of each of the 2T populations, the 2T populations can be sorted based on their scores, thus identifying P populations with higher scores among the 2T populations. It should be noted that if 2T-P+1 populations have the same score (and the scores of the remaining P-1 populations are all higher than the score of the 2T-P+1 population), then the last population needs to be selected from these 2T-P+1 populations. There are several ways to select the last population, such as random selection, or setting a reference point, calculating the distance from each of the 2T-P+1 populations to the reference point, and selecting the closest population, etc.
[0090] 207. Based on the pairing error of each of the P populations, obtain the cumulative error value of each of the P populations.
[0091] After obtaining P populations, the cumulative error value of each population can be obtained. The cumulative error value of each population is obtained by summing the pairing errors of the K unpaired data points in that population, where K ≤ M. It should be noted that the K unpaired data points are the final selected data points for pairing.
[0092] For example, let P equal 4 and K equal 2. There are four populations: population 5, population 6, population 7, and population 8. The pairing error for population 5 is {3, 1, 2}, for population 6 it is {4, 1, 3}, for population 7 it is {1, 1, 2}, and for population 8 it is {1, 1, 1}. Then, the elements in the pairing error set for each population are sorted in ascending order, resulting in pairing errors of {1, 2, 3} for population 5, {1, 3, 4} for population 6, {1, 1, 2} for population 7, and {1, 1, 1} for population 8. Finally, the first K = 2 elements from each set are summed to obtain the cumulative error value for each population: the cumulative error value for population 5 is 3, for population 6 it is 4, for population 7 it is 2, and for population 8 it is 2.
[0093] 208. Based on the cumulative error value of each of the P populations, determine the target population from the P populations.
[0094] Obtain the cumulative error value for each of the P populations. Based on the magnitude of the cumulative error value, select the population corresponding to the minimum cumulative error value as the target population. It should be noted that if there are multiple populations corresponding to the minimum cumulative error value, a target population can be randomly selected, or a target population can be selected using a reference point, etc.
[0095] 209. Based on the target population, pair N paired data with K unpaired data from M unpaired data.
[0096] Since the target population contains a pairing relationship between N paired data and M unpaired data (i.e., the final determined target pairing relationship), based on this pairing relationship, K paired data can be paired between the N paired data and K unpaired data. Specifically, based on step 207, for the target population, the pairing error set of the target population contains the pairing errors of M unpaired data. The pairing errors of the M unpaired data can be sorted according to the magnitude of the pairing error. The first K unpaired data are determined from the M unpaired data. Then, according to the pairing relationship between the N paired data and the M unpaired data contained in the target population, the N paired data are paired to the K unpaired data. It should be noted that during the pairing process, it is possible that some of the paired data in the N paired data are paired to the K unpaired data, or it is possible that all the paired data in the N paired data are paired to the K unpaired data; this is not limited here.
[0097] Furthermore, this application also uses a preset tolerance value to further improve the accuracy of data pairing. This tolerance value can be understood as the difference between several paired data items and a specific data item to be paired. For example, if four receipt items form a combination, and there is a difference between the amount of this combination and the amount of a paired invoice item (this difference could be a bank fee charged during the remittance process, etc.), then a tolerance value should be set to ensure that the pairing is completed.
[0098] When setting this tolerance value in advance, it is usually based on the spatial bisection method. Specifically, a tolerance value g is determined, and the sample is divided into [0, g / 2] and [g / 2, g]. Then, the tolerance values in the aforementioned fitness function are set to 0 and g / 2. A certain amount of paired data and data with paired elements are taken to form a sample population. The fitness function is used to calculate the pairing error of the sample population in the two cases. If the pairing error is small when the tolerance value is 0, the sample is further divided into [0, g / 4] and [g / 4, g / 2], and the calculation and comparison continue. If the pairing error is small when the tolerance value is g / 2, the sample is further divided into [g / 2, 3g / 4] and [3g / 4, g], and the calculation and comparison continue. The division stops when the number of iterations meets the condition or the pairing error of the sample population meets the condition, and the current tolerance value is taken as the final set tolerance value.
[0099] In this embodiment, multiple populations are first obtained, each representing a pairing relationship between multiple paired data and multiple unpaired data. Then, a genetic algorithm is used to obtain the pairing error of each population. Based on the pairing error of each population, a target population is determined from the multiple populations, thus determining the final pairing relationship between the multiple paired data and the multiple unpaired data. Finally, based on this relationship, the multiple paired data and the multiple unpaired data are paired. This embodiment, based on a genetic algorithm, can quickly and accurately complete data pairing, saving time and improving efficiency.
[0100] The above is an introduction to the data pairing method provided in the embodiments of this application. The following will describe the data pairing apparatus provided in the embodiments of this application. Figure 4 Please refer to the schematic diagram of a data pairing device provided in the embodiments of this application. Figure 4 The device includes:
[0101] The first acquisition module 401 is used to acquire L populations, each population containing the pairing relationships between N paired data and M unpaired data;
[0102] The second acquisition module 402 is used to acquire the pairing error of each population through a genetic algorithm;
[0103] The determination module 403 is used to determine the target population among L populations based on the pairing error of each population;
[0104] The pairing module 404 is used to pair N pairs of data with K pairs of M pairs of data based on the target population.
[0105] Where L≥2, N≥2, M≥1, K≤M.
[0106] In one possible implementation, the second acquisition module 402 includes:
[0107] The first operation unit is used to select T populations from L populations based on a preset fitness function;
[0108] The second operation unit is used to perform crossover on T populations and to mutate the T populations after crossover.
[0109] The third operation unit is used to calculate the pairing error of each of the 2T populations based on the fitness function.
[0110] Where T≤L, the 2T populations include the T populations after mutation and the T populations before crossover.
[0111] In one possible implementation, the fitness function is:
[0112] E u ={e u,1 ,e u,2 ,...,e u,M}
[0113] e u,j =∑x i ×L u,j,i -y j -g
[0114] In the above formula, E u Let e represent the pairing error of the u-th population, where u∈(1,2,…,2T); u,j Let x represent the pairing error of the j-th unpaired data in the u-th population, where j∈(1,2,…,M); i Let y represent the i-th pair of data, i∈(1,2,…,N); j This represents the j-th data to be paired; if L u,j,i If L is 1, it means that the i-th paired data is paired with the j-th unpaired data. u,j,i If the value is 0, it means that the i-th paired data was not paired with the j-th unpaired data; g is a preset tolerance value.
[0115] In one possible implementation, the determining module 403 includes:
[0116] The score of each of the 2T populations is obtained based on the pairing error of each population. The score of each population is obtained by comparing the pairing error of that population with the pairing errors of the other populations in the 2T populations.
[0117] Based on the score of each of the 2T populations, determine P populations from the 2T populations;
[0118] Based on the pairing error of each of the P populations, the cumulative error value of each of the P populations is obtained. The cumulative error value of each population is obtained by summing the pairing errors of the K pairs of data to be paired in that population.
[0119] The target population is determined from the P populations based on the cumulative error of each population.
[0120] It should be noted that the information interaction and execution process between the modules / units of the above-mentioned device are based on the same concept as the method embodiments of this application, and the resulting technical effects are the same as those of the method embodiments of this application. For details, please refer to the description in the method embodiments shown above in this application, and will not be repeated here.
[0121] Figure 5For another structural schematic diagram of the data pairing device provided in the embodiments of this application, please refer to [link / reference]. Figure 5 The device may include one or more central processing units 501, memory 502, input / output interfaces 503, wired or wireless network interfaces 504, and power supply 505.
[0122] Memory 502 can be temporary or persistent storage. Furthermore, central processing unit 501 can be configured to communicate with memory 502 and execute a series of instruction operations in memory 502 on user-plane functional entities.
[0123] In this embodiment, the central processing unit 501 can execute the aforementioned... Figure 2 The specific operations performed by the data pairing device in the illustrated embodiment will not be described here.
[0124] In this embodiment, the specific functional module division in the central processing unit 501 can be the same as described above. Figure 4 The functional module division of the first acquisition module, second acquisition module, determination module, and pairing module described in the illustrated embodiment is similar, and will not be repeated here.
[0125] This application also relates to a computer-readable storage medium, including instructions that, when executed on a computer, cause the computer to perform actions such as... Figure 2 The method in the illustrated embodiment.
[0126] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0127] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.
[0128] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0129] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0130] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A method for data pairing, characterized in that, The method is applied to the reconciliation process in the financial field. A receipt list contains multiple receipt entries, and an invoice list contains multiple invoice entries. When the receipt entries in the receipt list are matched with the invoice entries in the invoice list, the reconciliation is successful. The method includes: Obtain L populations, each population containing pairing relationships between N paired data and M unpaired data, wherein the paired data includes the receipt entries and the unpaired data includes the invoice entries; The pairing error of each population is obtained through a genetic algorithm and a preset tolerance value. The pairing error of each population includes the set of pairing errors of each pairing data in each population. The preset tolerance value includes the difference between the N pairing data and the M pairing data. Based on the pairing error of each population, the target population is determined among the L populations; The target population includes N pairs of data and K pairs of data to be paired with M pairs of data to be paired. The K pairs of data to be paired are the first K pairs of data to be paired after sorting according to the pairing error of the M pairs of data to be paired. Where L≥2, N≥2, M≥1, K<M.
2. The method according to claim 1, characterized in that, The process of obtaining the pairing error of each population through a genetic algorithm and a preset tolerance value includes: Based on a preset fitness function, T populations are selected from the L populations, wherein the fitness function is determined by the preset tolerance value; Cross over the T populations and then mutate the resulting T populations. The fitness function is used to calculate the pairing error of each of the 2T populations. Where T≤L, the 2T populations include the T populations after mutation and the T populations before crossover.
3. The method according to claim 2, characterized in that, The fitness function is: ; ; In the above formula, Let represent the pairing error of the u-th population, u∈(1,2,…,2T); Let $\mathbf{u}$ represent the pairing error of the $j$-th data to be paired in the $u$-th population, where $j \in (1, 2, ..., M)$. This represents the i-th pair of data, where i ∈ (1, 2, ..., N); This represents the j-th data to be paired; if If the value is 1, it means that the i-th paired data is paired with the j-th unpaired data. If the value is 0, it means that the i-th pairing data was not paired with the j-th pairing data; This is the preset tolerance value.
4. The method according to claim 3, characterized in that, The step of determining the target population from the L populations based on the pairing error of each population includes: The score of each of the 2T populations is obtained based on the pairing error of each population. The score of each population is obtained by comparing the pairing error of the population with the pairing errors of the other populations in the 2T populations. Based on the score of each of the 2T populations, P populations are determined from the 2T populations; Based on the pairing error of each of the P populations, the cumulative error value of each of the P populations is obtained, wherein the cumulative error value of each population is obtained by accumulating the pairing errors of K unpaired data in the population. The target population is determined from the P populations based on the cumulative error value of each population.
5. A data pairing device, characterized in that, The device is used in the financial reconciliation process. A receipt list contains multiple receipt entries, and an invoice list contains multiple invoice entries. When the receipt entries in the receipt list are matched with the invoice entries in the invoice list, the reconciliation is successful. The device includes: The first acquisition module is used to acquire L populations, each population containing pairing relationships between N paired data and M unpaired data, wherein the paired data includes the receipt entries and the unpaired data includes the invoice entries. The second acquisition module is used to acquire the pairing error of each population through a genetic algorithm and a preset tolerance value, wherein the pairing error of each population includes the set of pairing errors of each pairing data in each population, and the preset tolerance value includes the difference between the N pairing data and the M pairing data. A determination module is used to determine a target population among the L populations based on the pairing error of each population; The pairing module is used to pair N pairs of data from the target population with K pairs of data from M pairs of data to be paired. The K pairs of data to be paired are the first K pairs of data to be paired after sorting according to the pairing error of the M pairs of data to be paired. Where L≥2, N≥2, M≥1, K<M.
6. The apparatus according to claim 5, characterized in that, The second acquisition module includes: The first operation unit is used to select T populations from the L populations based on a preset fitness function, wherein the fitness function is determined by the preset tolerance value. The second operation unit is used to perform crossover on the T populations and to mutate the T populations after crossover. The third operation unit is used to calculate the pairing error of each of the 2T populations based on the fitness function. Where T≤L, the 2T populations include the T populations after mutation and the T populations before crossover.
7. The apparatus according to claim 6, characterized in that, The fitness function is: ; ; In the above formula, Let represent the pairing error of the u-th population, u∈(1,2,…,2T); Let $\mathbf{u}$ represent the pairing error of the $j$-th data to be paired in the $u$-th population, where $j \in (1, 2, ..., M)$. This represents the i-th pair of data, where i ∈ (1, 2, ..., N); This represents the j-th data to be paired; if If the value is 1, it means that the i-th paired data is paired with the j-th unpaired data. If the value is 0, it means that the i-th pairing data was not paired with the j-th pairing data; This is the preset tolerance value.
8. The apparatus according to claim 7, characterized in that, The determining module includes: The score of each of the 2T populations is obtained based on the pairing error of each population. The score of each population is obtained by comparing the pairing error of the population with the pairing errors of the other populations in the 2T populations. Based on the score of each of the 2T populations, P populations are determined from the 2T populations; Based on the pairing error of each of the P populations, the cumulative error value of each of the P populations is obtained, wherein the cumulative error value of each population is obtained by accumulating the pairing errors of K unpaired data in the population. The target population is determined from the P populations based on the cumulative error value of each population.
9. A data pairing device, characterized in that, The device includes: One or more central processing units, memory, input / output interfaces, wired or wireless network interfaces, and power supply; The memory is either a short-term storage memory or a persistent storage memory; The central processing unit is configured to communicate with the memory and execute instructions in the memory on a resource scheduling device to perform the method according to any one of claims 1 to 4.
10. A computer-readable storage medium comprising instructions that, when executed on a computer, cause the computer to perform the method as claimed in any one of claims 1 to 4.
Citation Information
Patent Citations
D2D node pairing method based on logistic regression and an improved genetic algorithm
CN109829544A