Reconciliation method and device, electronic equipment and storage medium
By using the FPE algorithm encryption account and hash processing during the reconciliation process, the problem of improving the efficiency and accuracy of the reconciliation is solved, and the accurate determination of the reconciliation results and the protection of sensitive information.
Patent Information
- Application Number
- CN202411419599.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2025-01-28
AI Technical Summary
In Internet companies, especially financial-related departments, there is an urgent need for reconciliation between systems. How to improve reconciliation efficiency and accuracy is an urgent problem.
Putting a method of reconciliation, using the format to retain the encryption FPE algorithm to encrypt the account number, and use hash processing to generate the account code, combined with the comparison result of the ciphertext and the comparison of the account code, determine the reconciliation result.
The recognition of the account after encrypted has remained consistent, improved the efficiency of reconciliation, and enhanced the protection of sensitive personal information, and improved the accuracy and reliability of the reconciliation.
Smart Images

Figure CN119379413A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a reconciliation method, device, electronic device and storage medium. Background Art
[0002] In Internet companies, especially in finance-related departments, reconciliation between systems is a must, such as reconciliation between banks and companies, reconciliation between payment systems and payout channels, reconciliation between business departments and settlement systems, etc.
[0003] During the reconciliation process, some key information will be verified, such as our account number, our account name, the other party's account number, the other party's account name, transaction amount, transaction time, payment notes, etc. How to improve the efficiency and accuracy of reconciliation is an urgent problem to be solved. Summary of the invention
[0004] The present application aims to solve one of the technical problems in the related art at least to some extent.
[0005] To this end, the first purpose of this application is to propose a reconciliation method to improve the efficiency and accuracy of reconciliation.
[0006] The second objective of the present application is to provide a reconciliation device.
[0007] The third objective of the present application is to provide an electronic device.
[0008] A fourth objective of the present application is to provide a computer-readable storage medium.
[0009] A fifth object of the present application is to provide a computer program product.
[0010] To achieve the above-mentioned purpose, the first embodiment of the present application proposes a reconciliation method, comprising:
[0011] Obtain a first account to be reconciled detail and a second account to be reconciled detail; wherein the first account to be reconciled detail includes a first account number, and the second account to be reconciled detail includes a second account number;
[0012] Using a format-preserving encryption (FPE) algorithm, encrypt the first account and the second account respectively to obtain a first ciphertext of the first account and a second ciphertext of the second account;
[0013] Performing hash processing on the first to-be-reconciled detail and the second to-be-reconciled detail respectively to obtain a first reconciliation code and a second reconciliation code;
[0014] A reconciliation result between the first to-be-reconciled detail and the second to-be-reconciled detail is determined according to a comparison result between the first ciphertext and the second ciphertext, and a comparison result between the first reconciliation code and the second reconciliation code.
[0015] To achieve the above-mentioned purpose, the second embodiment of the present application proposes a reconciliation device, including:
[0016] An acquisition module, configured to acquire a first account detail to be reconciled and a second account detail to be reconciled; wherein the first account detail to be reconciled includes a first account number, and the second account detail to be reconciled includes a second account number;
[0017] An encryption module, used to encrypt the first account and the second account respectively by using a format-preserving encryption (FPE) algorithm to obtain a first ciphertext of the first account and a second ciphertext of the second account;
[0018] A hash processing module, used to perform hash processing on the first to-be-reconciled detail and the second to-be-reconciled detail respectively to obtain a first reconciliation code and a second reconciliation code;
[0019] A determination module is used to determine a reconciliation result between the first to-be-reconciled detail and the second to-be-reconciled detail according to a comparison result between the first ciphertext and the second ciphertext, and a comparison result between the first reconciliation code and the second reconciliation code.
[0020] To achieve the above-mentioned purpose, the third aspect of the present application provides an electronic device, including:
[0021] A processor, and a memory communicatively connected to the processor;
[0022] The memory stores computer-executable instructions;
[0023] The processor executes the computer-executable instructions stored in the memory to implement the method described in the first aspect embodiment above.
[0024] To achieve the above-mentioned purpose, the fourth aspect embodiment of the present application proposes a computer-readable storage medium, in which computer execution instructions are stored. When the computer execution instructions are executed by a processor, they are used to implement the method described in the first aspect embodiment above.
[0025] To achieve the above-mentioned purpose, the fifth aspect of the present application proposes a computer program product, including a computer program, which implements the method described in the first aspect when executed by a processor.
[0026] The reconciliation method, device, electronic device and storage medium provided in the present application encrypt the first account number in the first account detail to be reconciled and the second account number in the second account detail to be reconciled by using the FPE algorithm, so that the length of the encrypted account number is consistent with that before encryption, thereby ensuring the recognition of the encrypted account number, improving the reconciliation efficiency, and enhancing the protection of sensitive personal information. In addition, based on the comparison result of the first ciphertext and the second ciphertext, combined with the comparison result between the first reconciliation code and the second reconciliation code obtained by hashing the first account detail to be reconciled and the second account detail to be reconciled, the reconciliation result is determined, thereby improving the accuracy and reliability of the reconciliation.
[0027] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0029] Figure 1 A flowchart of a reconciliation method provided in an embodiment of the present application;
[0030] Figure 2 A flowchart of another reconciliation method provided in an embodiment of the present application;
[0031] Figure 3 A flowchart of another reconciliation method provided in an embodiment of the present application;
[0032] Figure 4 A schematic diagram of the reconciliation process between enterprise account details and bank details provided in an embodiment of the present application;
[0033] Figure 5 A schematic diagram of a process for performing FPE encryption on the counterparty account number in the enterprise account details and bank details provided in an embodiment of the present application;
[0034] Figure 6 A schematic diagram of the structure of a reconciliation device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0035] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0036] The following describes the reconciliation method and device of the embodiments of the present application with reference to the accompanying drawings.
[0037] Figure 1 A flowchart of a reconciliation method provided in an embodiment of the present application.
[0038] In some embodiments, the items to be reconciled can be masked before reconciliation. For example, in a bank-enterprise reconciliation scenario, names, bank account numbers, etc. can be masked before reconciliation. However, when masks are used for desensitization, there are a lot of similarities in the desensitized information, which affects the accuracy of the reconciliation. In addition, in the scenario of large-scale reconciliation, based on the masked information, it may not be possible to distinguish whether multiple accounts and bank details are uniquely matched, which seriously affects the efficiency of large-scale account reconciliation and increases the possibility of sensitive personal information leakage.
[0039] Based on this, the present application embodiment provides a reconciliation method, such as Figure 1 As shown, the reconciliation method includes the following steps:
[0040] Step 101: Obtain the first account details to be reconciled and the second account details to be reconciled.
[0041] Among them, the details to be reconciled may include but are not limited to our account, our account number, the other party's account, the other party's account number, transaction amount, transaction time, transaction remarks, etc.
[0042] Exemplarily, the first reconciliation details may include the first account number, the first account, transaction notes, amount, transaction time, etc., and the second reconciliation details may include the second account number, the second account, transaction notes, amount, transaction time, etc. Among them, the first account number and the second account number are of the same type, and the first account number and the second account number are of the same type. For example, the first account number may refer to the counterparty account number in the first reconciliation details, the second account number may refer to the counterparty account number in the second reconciliation details, the first account may refer to the counterparty account in the first reconciliation details, and the second account may refer to the counterparty account in the second reconciliation details.
[0043] For example, in a bank-enterprise reconciliation scenario, the first detail to be reconciled may refer to the enterprise account details, and the second detail to be reconciled may refer to the bank details.
[0044] Step 102: Use the FPE algorithm to encrypt the first account and the second account respectively to obtain a first ciphertext of the first account and a second ciphertext of the second account.
[0045] Among them, the FPE (Format Preserving Encryption) algorithm is a data encryption method that preserves the format. FPE is also called shape-preserving encryption. The encryption result can preserve the original data format and keep the ciphertext and plaintext in the same format. For example, English remains English after encryption, and numbers remain numbers after encryption. For example, using the FPE algorithm, "6516155474156452179" can be encrypted into "4543994682069536129".
[0046] In this application, the first account and the second account are encrypted respectively using the FPE algorithm to obtain the first ciphertext of the first account and the second ciphertext of the second account, so that the first ciphertext has the same format as the first account, and the second ciphertext has the same format as the second account. Since the FPE algorithm is used to encrypt the account in the reconciliation details, the length of the encrypted account remains consistent with that before encryption, thereby ensuring the recognition of the encrypted account.
[0047] Step 103: Perform hash processing on the first to-be-reconciled details and the second to-be-reconciled details respectively to obtain a first reconciliation code and a second reconciliation code.
[0048] In the present application, the first details to be reconciled may be hashed to obtain a first reconciliation code, and the second details to be reconciled may be hashed to obtain a second reconciliation code.
[0049] Exemplarily, each item to be reconciled in the first reconciliation details may be hashed to obtain a hash value of each item to be reconciled, and then the hash values of each item to be reconciled may be concatenated to obtain a first reconciliation code. The second reconciliation code may be obtained in the same manner.
[0050] Step 104: Determine the reconciliation result between the first to-be-reconciled detail and the second to-be-reconciled detail based on the comparison result between the first ciphertext and the second ciphertext, and the comparison result between the first reconciliation code and the second reconciliation code.
[0051] The reconciliation result may be a success or failure.
[0052] Exemplarily, if the first ciphertext is consistent with the second ciphertext, and the first reconciliation code is consistent with the second reconciliation code, it can be determined that the reconciliation between the first to-be-reconciled detail and the second to-be-reconciled detail is successful. If the first ciphertext is inconsistent with the first ciphertext, or the first reconciliation code is inconsistent with the second reconciliation code, it can be determined that the reconciliation between the first to-be-reconciled detail and the second to-be-reconciled detail has failed.
[0053] For example, if the first ciphertext is consistent with the second ciphertext, the first reconciliation code is consistent with the second reconciliation code, and the transaction time in the first reconciliation detail is the same as the transaction time in the second reconciliation detail, it can be determined that the reconciliation between the first reconciliation detail and the second reconciliation detail is successful. Thus, the accuracy of reconciliation can be further improved by combining the transaction time.
[0054] In an embodiment of the present application, the first account number in the first detail to be reconciled and the second account number in the second detail to be reconciled are encrypted by using the FPE algorithm, so that the length of the encrypted account number remains consistent with that before encryption, thereby ensuring the recognition of the encrypted account number, improving reconciliation efficiency, and enhancing the protection of sensitive personal information. In addition, based on the comparison result of the first ciphertext and the second ciphertext, combined with the comparison result between the first reconciliation code and the second reconciliation code obtained by hashing the first detail to be reconciled and the second detail to be reconciled, the reconciliation result is determined, thereby improving the accuracy and reliability of the reconciliation.
[0055] Figure 2 A flowchart of another reconciliation method provided in an embodiment of the present application.
[0056] like Figure 2 As shown, the reconciliation method may include the following steps:
[0057] Step 201: Obtain the first account details to be reconciled and the second account details to be reconciled.
[0058] In the present application, step 201 can be implemented in any of the embodiments of the present application, so it will not be described in detail here.
[0059] Step 202: for any one of the first account and the second account, determine whether any one of the accounts exists in a preset encryption parameter table.
[0060] In this application, the encryption parameter table may include but is not limited to existing accounts, ciphertexts of existing accounts, salt values corresponding to existing accounts, alternative salt values, etc. Among them, the existing accounts may refer to the counterparty accounts in all two existing reconciliation details. For example, the first reconciliation detail refers to the enterprise account details, and the second reconciliation detail refers to the bank details. Then the existing accounts may refer to the counterparty accounts in all existing enterprise account details and bank details.
[0061] For any of the first account and the second account, it can be determined whether any of the accounts exists in the encryption parameter table. In other words, it can be determined whether the first account exists in the encryption parameter table, and whether the second account exists in the encryption parameter table.
[0062] Step 203, in response to any account not existing in the encryption parameter table, encrypt any account using the FPE algorithm based on the initial salt value to obtain the initial ciphertext of any account, and determine whether the initial ciphertext exists in the encryption parameter table.
[0063] For the first account, if the first account does not exist in the encryption parameter table, the first account can be encrypted using the FPE algorithm based on the initialization salt value and the initialization key to obtain the initial ciphertext of the first account, and it is determined whether the initial ciphertext of the first account exists in the encryption parameter table.
[0064] For the second account, if the second account does not exist in the encryption parameter table, the second account can be encrypted using the FPE algorithm based on the initialization salt value and the initialization key to obtain the initial ciphertext of the second account, and it is determined whether the initial ciphertext of the second account exists in the encryption parameter table.
[0065] Optionally, if neither the first account nor the second account exists in the encryption parameter table, it can be determined whether either account is a valid account. If either account is a valid account, the FPE algorithm is used to encrypt either account based on the initialization salt value to obtain the initial ciphertext of either account.
[0066] That is to say, if the first account does not exist in the encryption parameter table, you can first determine whether the first account is a valid account. If the first account is a valid account, then encrypt the first account. If the second account does not exist in the encryption parameter table, you can first determine whether the second account is a valid account. If the second account is a valid account, then encrypt the second account.
[0067] Exemplarily, whether the first account is a valid account can be determined by determining whether the length of the first account is within a preset range, determining whether the first account is pure digits, etc. If the length of the first account is within the preset range and the first account is pure digits, the first account can be determined to be a valid account. It is understandable that a similar method can be used to determine whether the second account is a valid account. Therefore, if any of the first account and the second account does not exist in the encryption parameter table, it can be determined whether the account is a valid account first, and if it is a valid account, encryption is performed, so that invalid accounts can be identified and filtered out, avoiding unnecessary processing of invalid accounts, reducing potential security risks, and saving computing resources.
[0068] Step 204, in response to the existence of the initial ciphertext in the encryption parameter table, select a salt value from the candidate salt values, and continue to encrypt the any account using the FPE algorithm based on the selected salt value until there is no ciphertext of any account in the encryption parameter table.
[0069] In the present application, if the initial ciphertext of the first account exists in the encryption parameter table, a salt value can be selected from the alternative salt values in the encryption parameter table, and the first account can be continuously encrypted using the FPE algorithm based on the selected salt value until the ciphertext of the first account obtained by this encryption does not exist in the encryption parameter table. In this case, the ciphertext of the first account obtained by this encryption is the first ciphertext.
[0070] If the initial ciphertext of the second account exists in the encryption parameter table, a salt value can be selected from the alternative salt values in the encryption parameter table. Based on the selected salt value, the second account is continuously encrypted using the FPE algorithm until the ciphertext of the second account obtained by this encryption does not exist in the encryption parameter table. The ciphertext of the second account obtained by this encryption is the second ciphertext.
[0071] Optionally, if any of the first account and the second account does not exist in the encryption parameters, any account, the ciphertext of any account, and the salt value used by the obtained ciphertext of any account are updated to the encryption parameter table. That is to say, if the first account does not exist in the encryption parameters, the first account, the first ciphertext, and the salt value used by the obtained first ciphertext can be updated to the encryption parameter table, and if the second account does not exist in the encryption parameters, the second account, the second ciphertext, and the salt value used by the obtained second ciphertext can be updated to the encryption parameter table. Therefore, timely updating of the encryption parameter table can improve the accuracy of the encryption parameter table, and further improve the accuracy of duplicate checking.
[0072] Step 205, in response to any account being the same as any existing account in the encryption parameter table, the ciphertext corresponding to any existing account in the encryption parameter table is used as the ciphertext of any account.
[0073] In this application, if the first account is the same as any existing account in the encryption parameter table, it means that the first account exists in the encryption parameter table, then the corresponding ciphertext of the existing account in the encryption parameter is used as the first ciphertext of the first account.
[0074] If the second account is the same as any existing account in the encryption parameter table, it means that the second account exists in the encryption parameter table, and then the corresponding ciphertext of the existing account in the encryption parameter is used as the second ciphertext of the second account.
[0075] When there are a large number of different counterpart accounts and the encrypted original text is relatively short in character length, for example, the counterpart account is relatively short, there may be a certain probability that the ciphertext may be repeated. By using the encryption parameter table, checking the ciphertext for duplication and adjusting the salt value, the probability of ciphertext duplication can be reduced.
[0076] Step 206: Perform hash processing on the first to-be-reconciled details and the second to-be-reconciled details respectively to obtain a first reconciliation code and a second reconciliation code.
[0077] In the present application, step 206 can be implemented in any of the embodiments of the present application, so it will not be described in detail here.
[0078] Step 207: Determine the reconciliation result between the first to-be-reconciled detail and the second to-be-reconciled detail according to the comparison result between the first ciphertext and the second ciphertext, and the comparison result between the first reconciliation code and the second reconciliation code.
[0079] In the present application, step 207 can be implemented in any of the embodiments of the present application, so it will not be described in detail here.
[0080] In an embodiment of the present application, when encrypting the first account and the second account, it is determined whether the first account and the second account exist in the ciphertext parameter table. If not, the account is encrypted, and it is determined whether the encrypted ciphertext exists in the encryption parameter table. If so, encryption is continued using the alternative salt value until the encrypted ciphertext is not in the encryption parameter table. If the first account or the second account exists in the encryption parameter table, the corresponding ciphertext in the encryption parameter table is used as the ciphertext of the account. Therefore, by using the encryption parameter table to check the ciphertext for duplication and adjust the salt value, the probability of ciphertext duplication can be reduced, and the problem of possible duplication of ciphertext due to the existence of a large number of different counterpart accounts and the relatively small character length of the encrypted original text is solved, thereby improving the accuracy of reconciliation.
[0081] Figure 3 A flowchart of another reconciliation method provided in an embodiment of the present application.
[0082] like Figure 3 As shown, the reconciliation method may include the following steps:
[0083] Step 301: Obtain the first account details to be reconciled and the second account details to be reconciled.
[0084] In the present application, step 301 can be implemented in any of the embodiments of the present application, so it will not be described in detail here.
[0085] Step 302: Use the FPE algorithm to encrypt the first account and the second account respectively to obtain a first ciphertext of the first account and a second ciphertext of the second account.
[0086] In the present application, step 302 can be implemented in any of the embodiments of the present application, so it will not be described in detail here.
[0087] There are two types of FPE algorithms: FF1 and FF3-1. The iteration rounds of these two algorithms are different. In this application, the required FPE algorithm can be selected according to actual needs.
[0088] Exemplarily, for any account among the first account and the second account, the master key of the current encryption round of the FPE algorithm is obtained, and the encryption key of the current encryption round is generated based on the master key and any account and based on the key derivation function, and the encryption key of the current encryption round is used to encrypt the encryption result obtained in the previous encryption round corresponding to any account in the current round until the last round of encryption is completed to obtain the ciphertext of any account.
[0089] Taking the first account as an example, the master key of the current encryption round of the FPE algorithm can be obtained, and the encryption key of the current encryption round can be generated by using a key derivation function based on the master key of the current encryption round and the first account. The encryption key of the current encryption round is used to encrypt the encryption result obtained in the previous encryption round for the current round, and then the encryption key of the next encryption round is generated by using a key derivation function based on the master key of the next encryption round and the first account. The encryption result of the previous encryption round is encrypteed using the encryption key of the next encryption round, until the last round of encryption is completed to obtain the ciphertext of the first account.
[0090] Taking the encryption of the first account as an example, the encryption process of each encryption round can be expressed as the following formula 1:
[0091] Acc i =FPE round (Acc i-1 ,k i ) (1)
[0092] Among them, Acc i Indicates the account number after the i-th round of encryption, FPE round represents the encryption function of the i-th round, k i represents the encryption key of the i-th round, k i It can be generated based on the master key of the i-th round and the first account using a key derivation function.
[0093] Therefore, in the process of encryption using the FPE algorithm, for each encryption round, based on the master key of the current encryption round and the account to be encrypted, a key derivation function is used to generate an encryption key for the current encryption round, and encryption is performed using the generated encryption key, which can improve security.
[0094] Step 303: Perform hash processing on the first to-be-reconciled detail and the second to-be-reconciled detail respectively to obtain a first reconciliation code and a second reconciliation code.
[0095] In the present application, step 303 can be implemented in any of the embodiments of the present application, so it will not be described in detail here.
[0096] For example, each item to be reconciled in the first reconciliation details may be concatenated to obtain a first concatenated reconciliation item, and the first concatenated reconciliation item may be hashed to obtain a first reconciliation code, each item to be reconciled in the second reconciliation details may be concatenated to obtain a second concatenated reconciliation item, and the second concatenated reconciliation item may be hashed to obtain a second reconciliation code. Thus, concatenating each item to be reconciled and then performing the hashing process may save computing resources.
[0097] For example, the counterparty account, counterparty account number, transaction remarks, and amount to be reconciled items in the first to-be-reconciled detail may be concatenated, and the concatenated string may be hashed to obtain the first reconciliation code of the first to-be-reconciled detail.
[0098] It can be understood that the items to be reconciled in the first to-be-reconciled details are the same as the items to be reconciled in the second to-be-reconciled details.
[0099] Exemplarily, an irreversible hash algorithm may be used to perform hash calculations on the first concatenated reconciliation item and the second concatenated reconciliation item, respectively, to ensure that the possibility of duplication of reconciliation codes is eliminated as much as possible, thereby improving the accuracy of reconciliation.
[0100] Exemplarily, the first reconciliation code and the second reconciliation code may be grouped for comparison. For example, the first reconciliation code and the second reconciliation code are hash strings obtained based on hash calculation, and may be grouped for user viewing and comparison. Taking the hash value of 64 strings as an example, c7f8d217bdbd83fb997268b9ff5cbb7fd12e9bd7d41a2f12d6376f37ebbf00d5 will be divided by 8 for grouping and separated by a "-" sign, and the result is c7f8d217-bdbd83fb-997268b9-ff5cbb7f-d12e9bd7-d41a2f12-d6376f37-ebbf00d5.
[0101] Step 304: mask the first account and the second account respectively using a first masking method to obtain a masked first account and a masked second account.
[0102] In the present application, the first masking method can be used to mask the first account and the second account respectively. For example, the characters from the 5th to the 10th position in the first account and the second account are replaced with asterisks to obtain the masked account.
[0103] Step 305 , using a second masking method, masking the first account in the first account-to-be-reconciled detail and the second account in the second account-to-be-reconciled detail respectively to obtain a masked first account and a masked second account.
[0104] The first account may refer to the counterparty account in the first account to be reconciled details, and the second account may refer to the counterparty account in the second account to be reconciled details. For example, the counterparty account may be a person's name.
[0105] In this application, the second masking method can be used to mask the first account and the second account respectively to obtain the masked first account and the masked second masking method. For example, if the first account and the second account are names of people, if the name is three characters, the middle character can be replaced with "*", and if the name is two characters, the second character in the name can be replaced with "*".
[0106] Step 306, determining the reconciliation result according to the comparison result of the first ciphertext and the second ciphertext, the comparison result of the first reconciliation code and the second reconciliation code, the comparison result of the masked first account and the masked second account, and the comparison result of the masked first account and the masked second account.
[0107] Exemplarily, if the first ciphertext is consistent with the second ciphertext, the first reconciliation code is consistent with the second reconciliation code, the masked first account number is consistent with the masked second account number, and the masked first account number is consistent with the masked second account number, it can be determined that the reconciliation between the first to-be-reconciled detail and the second to-be-reconciled detail is successful. If the first ciphertext is inconsistent with the second ciphertext, or the first reconciliation code is inconsistent with the second reconciliation code, or the masked first account number is inconsistent with the masked second account number, or the masked first account number is inconsistent with the masked second account number, it can be determined that the reconciliation between the first to-be-reconciled detail and the second to-be-reconciled detail has failed.
[0108] For example, if the first ciphertext is consistent with the second ciphertext, the first reconciliation code is consistent with the second reconciliation code, the masked first account number is consistent with the masked second account number, the masked first account number is consistent with the masked second account number, and the transaction time in the first to-be-reconciled detail is the same as the transaction time in the second to-be-reconciled detail, it can be determined that the reconciliation between the first to-be-reconciled detail and the second to-be-reconciled detail is successful. Thus, in combination with the transaction time, the accuracy of the reconciliation can be further improved.
[0109] For ease of understanding, take the reconciliation between corporate account details and bank details as an example. Figure 4 To explain, Figure 4 A schematic diagram of the reconciliation process between enterprise account details and bank details provided in an embodiment of the present application.
[0110] like Figure 4 As shown in , the reconciliation process may include P5 mask processing, P6 FPE encryption, and P7 hash processing.
[0111] In the P5 mask processing stage, the counterparty account P1 and counterparty account number P2 in the enterprise account details and bank details are respectively masked, for example, the middle part of the characters are replaced with asterisks, and finally the desensitized counterparty account P8 and desensitized counterparty account number P9 are obtained.
[0112] In the P6 FPE encryption phase, the counterparty account number P2 in the enterprise account details and the bank details is encrypted to obtain the conformable counterparty account number P10. The encryption process can refer to the method described in the above embodiment and will not be repeated here.
[0113] In the P7 hash processing stage, the counterparty account P1, counterparty account number P2, transaction remarks P3, and amount P4 in the enterprise account details and bank details are respectively concatenated, and then hashed to obtain the reconciliation code P11.
[0114] During the reconciliation process, after confirming that the preserved counterpart account number P10 in the enterprise account details and bank details is consistent, further verification and comparison of the anonymized counterpart account number P8, anonymized counterpart account number P9, reconciliation code P11, transaction time, etc. can be performed to quickly lock in the scope of the enterprise account details and bank details that can be fully matched and complete the reconciliation operation.
[0115] In an embodiment of the present application, the first account and the second account are respectively masked by using a first masking method, and the first account in the first to-be-reconciled detail and the second account in the second to-be-reconciled detail are respectively masked by using a second masking method, and the reconciliation result is determined based on the comparison result of the first ciphertext and the second ciphertext and the comparison result of the first reconciliation code and the second reconciliation code, and in combination with the comparison result of the masked first account and the masked second account and the comparison result of the masked first account and the masked second account, thereby further improving the accuracy of the reconciliation.
[0116] In order to facilitate understanding of the process of encrypting the first account and the second account based on the FPE algorithm in this application, the following takes the other party's account number in the enterprise account details and the bank details as an example. Figure 5 To explain, Figure 5 A schematic diagram of the process of performing FPE encryption on the counterparty account number in the enterprise account details and bank details provided in the embodiment of the present application.
[0117] The process of FPE encryption of the other party's account is as follows (for specific procedures, please refer to Figure 5 ):
[0118] First, create an encryption parameter table to store all existing enterprise account details and bank details of the system, as well as their corresponding account ciphertexts and salt values, and configure multiple alternative salt values;
[0119] Step 501, for the obtained enterprise account details and bank details, determine whether the other party's account number exists in the account encryption parameter table. If so, execute step 502 to directly extract the corresponding ciphertext in the encryption parameter table and save it to the corresponding detailed data, and end this processing. Otherwise, proceed to step 503;
[0120] Step 503, determine whether the other party's account is a valid account. For example, determine the length range of the other party's account, whether the other party's account is pure numbers, etc. If the other party's account is a valid account, execute step 504, otherwise end the process.
[0121] Step 504: Initialize the key and salt value required for this encryption. Exemplarily, numeric characters from 0 to 9 can be used as the message space.
[0122] Step 505: Use the FPF algorithm to encrypt the other party's account based on the selected salt value to obtain a ciphertext.
[0123] Step 506, determine whether the current ciphertext exists in the encryption parameter table. If so, execute step 507 to select a salt value from the alternative salt values and continue with step 505; if not, update the ciphertext and salt value to the encryption parameter table, and save the ciphertext to the corresponding detailed data, ending this processing.
[0124] In order to implement the above embodiment, the present application also proposes a reconciliation device. Figure 6 A schematic diagram of the structure of a reconciliation device provided in an embodiment of the present application.
[0125] like Figure 6 As shown, the reconciliation device 600 includes:
[0126] The acquisition module 610 is used to acquire a first account detail to be reconciled and a second account detail to be reconciled; wherein the first account detail to be reconciled includes a first account number, and the second account detail to be reconciled includes a second account number;
[0127] An encryption module 620, configured to encrypt the first account and the second account respectively by using a format preserving encryption (FPE) algorithm to obtain a first ciphertext of the first account and a second ciphertext of the second account;
[0128] A hash processing module 630, configured to perform hash processing on the first to-be-reconciled detail and the second to-be-reconciled detail respectively to obtain a first reconciliation code and a second reconciliation code;
[0129] The determination module 640 is used to determine the reconciliation result between the first to-be-reconciled detail and the second to-be-reconciled detail according to the comparison result between the first ciphertext and the second ciphertext, and the comparison result between the first reconciliation code and the second reconciliation code.
[0130] Furthermore, in a possible implementation of the embodiment of the present application, the encryption module 620 is used to:
[0131] For any one of the first account and the second account, determine whether the account exists in a preset encryption parameter table; wherein the encryption parameter table includes an existing account, a ciphertext of the existing account, a salt value corresponding to the existing account, and an alternative salt value;
[0132] In response to the absence of any of the accounts in the encryption parameter table, encrypting any of the accounts using the FPE algorithm based on the initialization salt value to obtain an initial ciphertext of any of the accounts, and determining whether the initial ciphertext exists in the encryption parameter table;
[0133] In response to the initial ciphertext existing in the encryption parameter table, selecting a salt value from the candidate salt values, and continuing to encrypt the any one of the accounts using the FPE algorithm based on the selected salt value until the ciphertext of the any one of the accounts does not exist in the encryption parameter table;
[0134] In response to the any one of the accounts being the same as any one of the existing accounts in the encryption parameter table, the ciphertext corresponding to any one of the existing accounts in the encryption parameter table is used as the ciphertext of the any one of the accounts.
[0135] Furthermore, in a possible implementation of the embodiment of the present application, the device may also include:
[0136] An update module is used to update the any account, the ciphertext of the any account and the salt value used to obtain the ciphertext of the any account into the encryption parameter table in response to the absence of the any account in the encryption parameter.
[0137] Furthermore, in a possible implementation of the embodiment of the present application, the encryption module 620 is used to:
[0138] Determine whether any of the accounts is a valid account;
[0139] In response to any one of the accounts being a valid account, based on the initialization salt value, the any one of the accounts is encrypted using the FPE algorithm to obtain the initial ciphertext.
[0140] Furthermore, in a possible implementation of the embodiment of the present application, the encryption module 620 is used to:
[0141] For any one of the first account and the second account, obtain a master key of a current encryption round of the FPE algorithm;
[0142] Generate an encryption key for the current encryption round based on the master key and any one of the accounts and a key derivation function;
[0143] The encryption key of the current encryption round is used to encrypt the encryption result obtained in the previous encryption round in the current round until the last round of encryption is completed to obtain the ciphertext of any account.
[0144] Furthermore, in a possible implementation of the embodiment of the present application, the hash processing module 630 is used to:
[0145] splicing the items to be reconciled in the first to-be-reconciled account details to obtain a first spliced reconciliation item;
[0146] Performing hash processing on the first concatenated reconciliation item to obtain the first reconciliation code;
[0147] splicing the items to be reconciled in the second to-be-reconciled account details to obtain second spliced reconciliation items;
[0148] Perform hash processing on the second concatenated reconciliation item to obtain the second reconciliation code.
[0149] Furthermore, in a possible implementation of the embodiment of the present application, the determination module 640 is configured to:
[0150] Using a first masking method, masking the first account to obtain a masked first account;
[0151] Using the first masking method, masking the second account to obtain a masked second account;
[0152] Using a second masking method, masking the first account in the first to-be-reconciled account details to obtain the masked first account;
[0153] Using the second masking method, masking the second account in the second to-be-reconciled account details to obtain the masked second account;
[0154] The reconciliation result is determined according to the comparison result between the first ciphertext and the second ciphertext, the comparison result between the first reconciliation code and the second reconciliation code, the comparison result between the masked first account and the masked second account, and the comparison result between the masked first account and the masked second account.
[0155] It should be noted that the above explanations and descriptions of the embodiment of the reconciliation method are also applicable to the reconciliation device of this embodiment, and will not be repeated here.
[0156] In an embodiment of the present application, the first account number in the first detail to be reconciled and the second account number in the second detail to be reconciled are encrypted by using the FPE algorithm, so that the length of the encrypted account number remains consistent with that before encryption, thereby ensuring the recognition of the encrypted account number, improving reconciliation efficiency, and enhancing the protection of sensitive personal information. In addition, based on the comparison result of the first ciphertext and the second ciphertext, combined with the comparison result between the first reconciliation code and the second reconciliation code obtained by hashing the first detail to be reconciled and the second detail to be reconciled, the reconciliation result is determined, thereby improving the accuracy and reliability of the reconciliation.
[0157] In order to implement the above embodiments, the present application also proposes an electronic device, comprising: a processor, and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the method provided by the above embodiments.
[0158] In order to implement the above embodiments, the present application also proposes a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the methods provided by the above embodiments.
[0159] In order to implement the above embodiments, the present application also proposes a computer program product, including a computer program, which implements the methods provided by the above embodiments when executed by a processor.
[0160] The collection, storage, use, processing, transmission, provision and disclosure of user personal information involved in this application are in compliance with relevant laws and regulations and do not violate public order and good morals.
[0161] It should be noted that personal information from users should be collected for legitimate and reasonable purposes and should not be shared or sold outside of these legitimate uses. In addition, such collection / sharing should be carried out after receiving the user's informed consent, including but not limited to notifying the user to read the user agreement / user notice and sign the agreement / authorization including authorization of relevant user information before the user uses the function. In addition, any necessary steps should be taken to protect and safeguard access to such personal information data and ensure that others who have access to personal information data comply with its privacy policy and procedures.
[0162] The present application is expected to provide an implementation scheme for users to selectively block the use or access of personal information data. That is, the present disclosure is expected to provide hardware and / or software to prevent or block access to such personal information data. Once the personal information data is no longer needed, the risk can be minimized by limiting data collection and deleting the data. In addition, when applicable, such personal information is de-identified to protect the privacy of the user.
[0163] In the description of the aforementioned embodiments, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0164] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0165] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0166] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0167] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0168] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0169] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0170] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A reconciliation method, characterized in that: The following steps are involved: Obtain a first account to be reconciled detail and a second account to be reconciled detail; wherein the first account to be reconciled detail includes a first account number, and the second account to be reconciled detail includes a second account number; Using a format-preserving encryption (FPE) algorithm, encrypt the first account and the second account respectively to obtain a first ciphertext of the first account and a second ciphertext of the second account; Performing hash processing on the first to-be-reconciled detail and the second to-be-reconciled detail respectively to obtain a first reconciliation code and a second reconciliation code; A reconciliation result between the first to-be-reconciled detail and the second to-be-reconciled detail is determined according to a comparison result between the first ciphertext and the second ciphertext, and a comparison result between the first reconciliation code and the second reconciliation code.
2. The method according to claim 1, characterized in that The method of using the format-preserving encryption (FPE) algorithm to encrypt the first account and the second account respectively to obtain a first ciphertext of the first account and a second ciphertext of the second account includes: For any one of the first account and the second account, determine whether the account exists in a preset encryption parameter table; wherein the encryption parameter table includes an existing account, a ciphertext of the existing account, a salt value corresponding to the existing account, and an alternative salt value; In response to the absence of any of the accounts in the encryption parameter table, encrypting any of the accounts using the FPE algorithm based on the initialization salt value to obtain an initial ciphertext of any of the accounts, and determining whether the initial ciphertext exists in the encryption parameter table; In response to the initial ciphertext existing in the encryption parameter table, selecting a salt value from the candidate salt values, and continuing to encrypt the any one of the accounts using the FPE algorithm based on the selected salt value until the ciphertext of the any one of the accounts does not exist in the encryption parameter table; In response to the any one of the accounts being the same as any one of the existing accounts in the encryption parameter table, the ciphertext corresponding to any one of the existing accounts in the encryption parameter table is used as the ciphertext of the any one of the accounts.
3. The method according to claim 2, characterized in that Also includes: In response to the absence of any of the accounts in the encryption parameters, the any of the accounts, the ciphertext of the any of the accounts, and the salt value used to obtain the ciphertext of the any of the accounts are updated into the encryption parameter table.
4. The method according to claim 2, characterized in that: In response to the absence of any account in the encryption parameter table, encrypting any account using the FPE algorithm based on the initialization salt value to obtain an initial ciphertext of any account includes: Determine whether any of the accounts is a valid account; In response to any one of the accounts being a valid account, based on the initialization salt value, the any one of the accounts is encrypted using the FPE algorithm to obtain the initial ciphertext.
5. The method according to claim 1, characterized in that The method of using the format preserving encryption algorithm FPE to encrypt the first account and the second account respectively to obtain a first ciphertext of the first account and a second ciphertext of the second account includes: For any one of the first account and the second account, obtain a master key of a current encryption round of the FPE algorithm; Generate an encryption key for the current encryption round based on the master key and any one of the accounts and a key derivation function; The encryption key of the current encryption round is used to encrypt the encryption result obtained in the previous encryption round in the current round until the last round of encryption is completed to obtain the ciphertext of any account.
6. The method according to claim 1, characterized in that The performing hash processing on the first to-be-reconciled details and the second to-be-reconciled details respectively to obtain a first reconciliation code and a second reconciliation code includes: splicing the items to be reconciled in the first to-be-reconciled account details to obtain a first spliced reconciliation item; Performing hash processing on the first concatenated reconciliation item to obtain the first reconciliation code; splicing the items to be reconciled in the second to-be-reconciled account details to obtain second spliced reconciliation items; Perform hash processing on the second concatenated reconciliation item to obtain the second reconciliation code.
7. The method according to any one of claims 1 to 6, characterized in that The determining the reconciliation result between the first to-be-reconciled detail and the second to-be-reconciled detail according to the comparison result between the first ciphertext and the second ciphertext, and the comparison result between the first reconciliation code and the second reconciliation code, includes: Using a first masking method, masking the first account to obtain a masked first account; Using the first masking method, masking the second account to obtain a masked second account; Using a second masking method, masking the first account in the first to-be-reconciled account details to obtain the masked first account; Using the second masking method, masking the second account in the second to-be-reconciled account details to obtain the masked second account; The reconciliation result is determined according to the comparison result between the first ciphertext and the second ciphertext, the comparison result between the first reconciliation code and the second reconciliation code, the comparison result between the masked first account and the masked second account, and the comparison result between the masked first account and the masked second account.
8. A reconciliation device, characterized in that: include: An acquisition module, configured to acquire a first account detail to be reconciled and a second account detail to be reconciled; wherein the first account detail to be reconciled includes a first account number, and the second account detail to be reconciled includes a second account number; An encryption module, used to encrypt the first account and the second account respectively by using a format-preserving encryption (FPE) algorithm to obtain a first ciphertext of the first account and a second ciphertext of the second account; A hash processing module, used to perform hash processing on the first to-be-reconciled detail and the second to-be-reconciled detail respectively to obtain a first reconciliation code and a second reconciliation code; A determination module is used to determine a reconciliation result between the first to-be-reconciled detail and the second to-be-reconciled detail according to a comparison result between the first ciphertext and the second ciphertext, and a comparison result between the first reconciliation code and the second reconciliation code.
9. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.
11. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 7 when being executed by a processor.
Citation Information
Patent Citations
Identification method for data owner in big data transaction
CN106973044A
Data encryption method, system and terminal in transaction process
CN109299944A
Data desensitization processing method and device and storage medium
CN111767565A
Encryption reconciliation method and system based on block chain
CN112347494A
Reconciliation method and device based on homomorphic encryption, electronic equipment and storage medium
CN115774885A
