Blockchain-based bank risk control method and device
By using blockchain technology and encryption algorithms to process user lending data from internet companies and banks, accurate risk control model training and result generation can be achieved without data leakage, solving the risk control problem caused by the lack of data sharing.
Patent Information
- Application Number
- CN202110696871.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-23
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2041-06-23
AI Technical Summary
The lack of data sharing between internet companies and banks regarding user lending makes it difficult to achieve accurate risk control.
By collecting sample data from various participants using blockchain technology, public and private keys are generated using encryption algorithms for data encryption and decryption, hash mapping is performed to achieve data alignment, and federated training is conducted to generate a bank risk control prediction model.
Without exposing their respective financial data, more accurate risk control model training and result generation were achieved, solving the problem of precise risk control for internet companies and bank users.
Smart Images

Figure CN113554505B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to data processing technology, in particular to a bank risk control method and device based on a block chain. BACKGROUND
[0002] With the development of the Internet, the businesses of major Internet companies gradually involve the financial field, and small loans are launched. The amount of loans is analyzed by using big data to analyze the purchasing power and usage habits of users to grant credit, which is different from the bank loan credit investigation and flow control mode. Bank financial business is licensed, while the p2p business of Internet companies is not licensed, which has the risk of explosion.
[0003] The user loan data of Internet companies and the user loan data of banks are not shared with each other, and the credit limit of users is obtained by relying on big data analysis and the credit limit of users is obtained by the traditional bank risk control mode, which has the risk of being difficult to accurately control the risk of users. SUMMARY
[0004] In view of the defects of the bank risk control in the prior art, the present application provides a bank risk control method based on a block chain, comprising:
[0005] Collecting sample data provided by each sample data participant through a block chain;
[0006] Performing data alignment processing on the sample data of each sample data participant received;
[0007] Model training on a preset bank risk control prediction model using the sample data after data alignment processing;
[0008] Processing the received bank risk control data using the bank risk control prediction model after model training to generate a bank risk control result.
[0009] In the embodiment of the present application, before collecting the sample data provided by each sample data participant through the block chain, it further comprises:
[0010] Generating a public key and a private key using a preset encryption algorithm;
[0011] Sending the generated public key to each sample data participant through the block chain.
[0012] In the embodiment of the present application, before collecting the sample data provided by each sample data participant through the block chain, it further comprises:
[0013] Hash mapping processing on the sample ID;
[0014] Encrypting the sample ID after hash mapping processing using the public key.
[0015] In the embodiment of the present application, the data alignment processing of the received sample data of each sample data participant includes:
[0016] The received sample data is decrypted using the private key to generate a hash mapping processed sample ID;
[0017] According to the decrypted hash mapping processed sample ID, the sample data of each participant is matched to complete the data alignment processing.
[0018] In the embodiment of the present application, the model training of the preset bank risk control prediction model using the sample data after data alignment processing includes:
[0019] The preset bank risk control prediction model is trained using the aligned sample data to generate a trained bank risk control prediction model.
[0020] Meanwhile, the present application also provides a bank risk control device based on a block chain, comprising:
[0021] The data transceiving module is used for receiving sample data provided by each sample data participant through a block chain;
[0022] The sample alignment module is used for data alignment processing of the received sample data of each sample data participant;
[0023] The model training module is used for model training of the preset bank risk control prediction model using the sample data after data alignment processing;
[0024] The prediction module is used for processing the received bank risk control data using the trained bank risk control prediction model to generate a bank risk control result.
[0025] In the embodiment of the present application, the device further includes:
[0026] The key generation module is used for generating a public key and a private key using a preset encryption algorithm;
[0027] The generated public key is sent to each sample data participant through a block chain through the data transceiving module.
[0028] In the embodiment of the present application, the device further includes:
[0029] The hash mapping module is used for hash mapping processing of the sample ID;
[0030] The encryption module is used for encrypting the hash mapping processed sample ID using the public key.
[0031] In the embodiment of the present application, the sample alignment module includes:
[0032] The decryption unit is used to decrypt the received sample data using the private key to generate a sample ID after hash mapping.
[0033] The matching and alignment unit is used to match the sample data of each participant according to the sample ID after decryption and hash mapping to complete the data alignment process.
[0034] In this embodiment of the invention, the model training module uses the aligned sample data to perform federated training on a preset bank risk control prediction model to generate a trained bank risk control prediction model.
[0035] Meanwhile, the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described method.
[0036] In addition, the present invention also provides a computer-readable storage medium storing a computer program for performing the above-described method.
[0037] This invention provides a blockchain-based bank risk control method that receives sample data from various participants via blockchain, performs data alignment processing on the received sample data, and solves the problem of data non-sharing between internet companies and banks in existing technologies, without any participant exposing their own user financial data. It utilizes user financial data for more accurate risk control, trains a pre-set bank risk control prediction model using the aligned sample data, and processes the received bank risk control data to generate bank risk control results. This more accurate model training, without any participant exposing their own financial data, solves the problem of precise risk control for both internet companies and bank users.
[0038] To make the above and other objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0039] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0040] Figure 1 A flowchart illustrating the blockchain-based bank risk control method provided by this invention;
[0041] Figure 2 This is a block diagram of an embodiment of the present invention;
[0042] Figure 3 This is a flowchart illustrating an embodiment of the present invention;
[0043] Figure 4 A block diagram of a blockchain-based bank risk control device provided by the present invention;
[0044] Figure 5 A schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0045] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0046] Currently, internet companies and banks do not share user lending data. The reliance on big data analytics to determine credit limits, compared to traditional bank risk control methods, presents a risk of difficulty in achieving accurate risk management for individual users. Therefore, establishing a data sharing mechanism between internet companies and banks to enable precise risk control is a pressing issue that needs to be addressed.
[0047] In view of this, the present invention provides a blockchain-based bank risk control method, such as... Figure 1 As shown, it includes:
[0048] Step S101: Receive sample data provided by each sample data participant through the blockchain;
[0049] Step S102: Perform data alignment processing on the received sample data of each participant.
[0050] Step S103: Use the sample data after data alignment to train the preset bank risk control prediction model.
[0051] Step S104: The received bank risk control data is processed using the bank risk control prediction model trained by the model to generate bank risk control results.
[0052] This invention provides a blockchain-based bank risk control method. It receives sample data from various participants via blockchain, leveraging the immutability of the blockchain to ensure the security of the data. The method aligns the received sample data, enabling more accurate risk control by internet companies and banks using user financial data without exposing the financial data of the participants. The aligned sample data is used to train a pre-defined bank risk control prediction model, and the received bank risk control data is processed to generate bank risk control results. This more accurate model training, without exposing the financial data of the participants, solves the problem of precise risk control for internet companies and banks.
[0053] In this embodiment of the invention, the process of receiving sample data provided by each participant through the blockchain includes:
[0054] Generate public and private keys using a preset encryption algorithm;
[0055] The generated public key is sent to each participant in the sample data via the blockchain.
[0056] Specifically, in this embodiment of the invention, the RSA algorithm is used to generate private and public keys, and the participants simultaneously receive their own public keys, which will be used to encrypt the data to be transmitted.
[0057] By sending the generated public key to each sample data participant via the blockchain, each participant uses the public key to encrypt the transmitted data, ensuring that the user ID is not transmitted in plaintext and further improving security.
[0058] In this embodiment of the invention, before receiving the sample data provided by each sample data participant via blockchain, the following steps are also included:
[0059] Perform hash mapping on the sample ID;
[0060] The public key is used to encrypt the sample ID after hash mapping.
[0061] In this embodiment of the invention, the data alignment process for the received sample data from each participant includes:
[0062] The received sample data is decrypted using the private key to generate a sample ID after hash mapping.
[0063] The sample data of each participant is matched with the sample ID after the decryption and hash mapping are processed to complete the data alignment process.
[0064] Specifically, in one embodiment of the present invention, participant A generates a public key and private key pair required for encrypting the sample ID locally according to the RSA algorithm, then saves the private key locally, and sends the sample set ID and public key to the blockchain node. The blockchain node then sends the sample set ID and public key to participant B. Participant B first hashes the original ID of the local sample using an agreed hash function to generate a sample set ID, ensuring that the user ID is not transmitted in plaintext. Then, it encrypts the mapped sample set ID using participant A's public key to generate an encrypted sample set ID for participant B, and sends the encrypted sample set ID to the blockchain node. The blockchain node sends the encrypted sample set ID to participant A. Participant A decrypts the hashed sample set ID to obtain the sample set ID from participant B, then maps the local sample using the same mapping function, and matches it with the sample ID from participant B. Finally, it sends the matched sample set ID to the blockchain node, and the blockchain node sends the matched sample set ID to participant B, completing the sample alignment process.
[0065] This invention, through hash mapping of sample IDs, aligns sample data without exposing the user IDs of participating parties. It then uses the sample data from each participating party to train a pre-set bank risk control prediction model for bank risk control prediction. This allows for more accurate model training and the generation of a more precise risk control model, without exposing the financial data of the participating parties, thus solving the problem of accurate risk control for internet companies and bank users.
[0066] In this embodiment of the invention, the step of training a preset bank risk control prediction model using sample data after data alignment processing includes:
[0067] The pre-set bank risk control prediction model is federated and trained using the aligned sample data to generate the trained bank risk control prediction model.
[0068] Use the RSA algorithm to generate private and public keys;
[0069] The system simultaneously distributes its own public key to each participant, which will be used to encrypt the data to be transmitted.
[0070] Each participant computes intermediate feature results on its own dataset;
[0071] Each participant calculates its own gradient, and the gradients are aggregated and then transmitted to the participants.
[0072] Iterate through the above steps until the loss function converges, completing the entire training process.
[0073] This invention provides a method for applying blockchain-based federated learning to bank risk control, which solves the problem of accurate risk control for internet companies and bank users without exposing their own users' financial data.
[0074] like Figure 2 The diagram shown is a block diagram of a system provided in an embodiment of the present invention, which includes:
[0075] Heterogeneous data processing module 1, data preprocessing module 2, sample alignment module 3, federated learning module 4, blockchain module 5.
[0076] In this embodiment of the invention, the heterogeneous data processing module 1 is used to uniformly describe and transform the original data.
[0077] Specifically, the heterogeneous data processing module 1 first converts the original data format to JSON representation, and then uses the Spark computing framework to uniformly perform distributed parsing to generate Hive table structures. Heterogeneous data access does not perform sample data preprocessing operations, only providing basic field type conversion operations.
[0078] In data preprocessing module 2, the user has already vectorized all available data, allowing the upper-layer application to focus only on the implementation of the algorithm model without having to perform messy data preprocessing operations.
[0079] In real-world scenarios, there are numerous string-type fields, such as gender (male, female), place of residence (Beijing, Shanghai, Guangzhou, etc.), and type of employer (public institution, private enterprise, foreign-invested enterprise, etc.). These string formats are primarily for human understanding but cannot be directly input into machine learning models. To address the processing of string-type data, this embodiment of the invention performs one-hot encoding after mapping the string to numerical values through encoding conversion.
[0080] Sample alignment module 3 ensures that all participants maintain consistency in the samples used for training.
[0081] like Figure 3 The diagram shown is a flowchart of the sample alignment process performed by the sample alignment module in this embodiment.
[0082] In this embodiment of the invention, the RSA encryption algorithm is used to encrypt the sample data.
[0083] T1, Participant A generates the public and private key pair required for the encrypted sample ID locally according to the RSA algorithm;
[0084] T2 stores the private key locally and sends the sample set ID and public key to the blockchain node;
[0085] T3, the blockchain node then sends the sample set ID and public key to participant B;
[0086] T4. Next, participant B uses the agreed hash function to hash the original ID of the local sample to ensure that the user ID is not transmitted in plaintext.
[0087] T5, then use the public key of participant A to encrypt the mapped sample set ID, and generate the encrypted sample set ID of participant B;
[0088] T6 sends the encrypted B-side sample set ID to the blockchain node;
[0089] T7, the blockchain node sends the encrypted sample set ID of Party B to participant A;
[0090] T8, participant A decrypts to obtain the sample set of participant B after hash mapping;
[0091] T9, then map the local samples using the same mapping function;
[0092] T10 is then matched with the sample ID from Party B;
[0093] T11, finally sends the matched sample set ID to the blockchain node;
[0094] At T12, the blockchain node sends the matching sample set ID to Party B, completing the sample alignment process.
[0095] Federated learning module 4 is the overall process of federated modeling between two participants after sample alignment. The central server is responsible for gradient aggregation and updating the models of each party. In this embodiment, the central server is used to implement the functions of the federated learning module, distribute public keys to each participant, aggregate the gradients of each participant, and then transmit them to the participants until the loss function converges.
[0096] The overall training process is as follows:
[0097] 1. First, the central server uses the RSA algorithm to generate the private and public keys.
[0098] 2. The central server simultaneously distributes its public key to both participating parties, which will be used to encrypt the data to be transmitted;
[0099] 3. The two participants each compute intermediate feature results on their own datasets;
[0100] 4. The two participants each calculate the gradient (see Equations 4.8 and 4.9 for details), encrypt it using the public key, and then transmit it to the central server.
[0101] 5. The central server uses the private key for decryption;
[0102] 6. The central server performs gradient aggregation (Equation 4.12 below) and then transmits it to the two participants;
[0103] 7. Iterate the above steps until the loss function converges to complete the entire training process.
[0104] Participants update their local models:
[0105] Assume there are two participants performing federated training and the trained model is an LR model. Also assume the two participants have completed the sample alignment process. The aligned sample set of participant A is... Indicates that the aligned sample set of B is used Note that the sample size of both A and B is m, and D A The sample does not contain the true label y, meaning that in a credit federation scenario, only one participant has the true label of the sample.
[0106] Assume that the model parameters of participants A and B are initialized to θ respectively. A θ B The original objective function for optimization is:
[0107]
[0108] Where, β A and β B These are the L2 norm regularization coefficients of the local model parameters for participant A and participant B, respectively. The goal is to find the optimal parameters {θ}. A θ B The set makes the following equation true:
[0109]
[0110] Will and They are respectively denoted as as well as To protect data privacy and facilitate gradient aggregation after decryption, a homomorphic encryption process is required on the original objective function. This encryption method allows both parties to perform algebraic operations on the ciphertext, resulting in an encrypted result, while ensuring that the decrypted result is identical to the result obtained by performing the same operations on the plaintext. This technique enables operations such as retrieval and comparison of encrypted data without requiring decryption throughout the process. Because it effectively protects user privacy, it is widely used to address confidentiality issues when data is hosted by a third party.
[0111] In this embodiment of the invention, the encrypted function can be denoted as:
[0112]
[0113] Here, Enc[·] represents the encryption process. Then, expanding the encrypted objective function yields three sub-functions:
[0114]
[0115] Among them, Enc[L A (D A D B ;θ A ,θ B [)] represents the portion of the losses incurred only by participant A;
[0116] Enc[L B (D A D B ;θ A ,θ B [)] represents the portion of the losses incurred only by participant B;
[0117] Enc[L A∩B (D A D B ;θ A ,θ B This indicates that A and B are both involved in the loss.
[0118] The formulas are shown in 4.5 and 4.6:
[0119]
[0120] According to equations 4.4, 4.5, and 4.6, we can see that:
[0121] Enc[L(D A D B ;θ A ,θ B )]=Enc[L A (D A D B ;θ A ,θ B )]+Enc[L B (D A D B ;θ A ,θ B )]+Enc[L A∩B (D A D B ;θ A ,θ B (4.7)
[0122] Let Enc[L(D) A D B ;θA ,θ B )] for θ A Taking the partial derivative, we get:
[0123]
[0124] Similarly, for θ B Find the partial derivative, as shown in Equation 4.9.
[0125]
[0126] Note that for θ A and θ B The calculation of the partial derivatives all depend on their common parts. Therefore, when updating the gradient, participant B will first calculate its local gradient, then send the common part to participant A, and only then can participant A calculate the gradient with respect to θ. A The gradient.
[0127] Furthermore, since the entire calculation process is encrypted, the final loss and gradient decryption are performed on the central server.
[0128] The client sends the sample data to be predicted to the central server. The central server copies the request and transmits it to each participant. Then, each participant calculates its local result and sends it back to the central server. The central server decrypts the data to obtain the user's credit score.
[0129] Specifically, the user-related data transmitted by the client is represented by Enc[y];
[0130]
[0131] in, This represents the data dimension belonging to participant A;
[0132] This is the data dimension belonging to participant B;
[0133] The reasoning process of participant A's end-side model can be represented by Equation 4.10:
[0134]
[0135] in, This represents the private parameters of participant A.
[0136] Similarly, the reasoning process of participant B is shown in Equation 4.11:
[0137]
[0138] Ultimately, all participating parties will use the end-side inference result, which is Enc[u] A] and Enc[u B The data is transmitted to the central server. The central server's aggregation process is shown in Equation 4.12:
[0139]
[0140] Then, the credit score is decoded using Dec[y] (Dec[y] refers to the decryption of the data in Enc[y]). Finally, the credit score is transmitted to the client, which makes the final credit decision based on the credit score.
[0141] The gradient data trained locally by the participants (Equations 4.8, 4.9, and 4.12) and the data processed by the federated learning module 4 are sent to the blockchain module 5.
[0142] Blockchain Module 5 is used to save the training results of the federated learning module to the blockchain. The blockchain's proof-of-work algorithm is used to calculate the participants with the greatest contribution, and the blockchain's reward mechanism is used to incentivize the participants with the greatest contribution to improve the model's prediction performance. Participants with the greatest contribution can view the model's prediction results at each stage, ensuring that institutions that provide more data can obtain better model results, thereby reflecting the degree of contribution of the institution to the model.
[0143] The system provided in this invention enables the sharing of user lending data from internet companies with user lending data from banks, thereby achieving precise risk control for users.
[0144] Meanwhile, this invention also provides a blockchain-based bank risk control device, such as... Figure 4 As shown, it includes:
[0145] The data transceiver module 401 is used to receive sample data provided by each sample data participant through the blockchain.
[0146] The sample alignment module 402 is used to perform data alignment processing on the sample data of each participant in the received sample data;
[0147] The model training module 403 is used to train a preset bank risk control prediction model using sample data after data alignment processing.
[0148] The prediction module 404 is used to process the received bank risk control data and generate bank risk control results using the bank risk control prediction model trained by the model.
[0149] In this embodiment of the invention, the device further includes:
[0150] The key generation module is used to generate public and private keys using a preset encryption algorithm;
[0151] The generated public key is sent to each sample data participant via the blockchain through the data transceiver module.
[0152] In this embodiment of the invention, the apparatus further includes:
[0153] The hash mapping module is used to perform hash mapping processing on sample IDs;
[0154] The encryption module is used to encrypt the sample ID after hash mapping using the public key.
[0155] In this embodiment of the invention, the sample alignment module includes:
[0156] The decryption unit is used to decrypt the received sample data using the private key to generate a sample ID after hash mapping.
[0157] The matching and alignment unit is used to match the sample data of each participant according to the sample ID after decryption and hash mapping to complete the data alignment process.
[0158] In this embodiment of the invention, the model training module uses the aligned sample data to perform federated training on a preset bank risk control prediction model to generate a trained bank risk control prediction model.
[0159] Those skilled in the art will clearly understand the implementation of the blockchain-based bank risk control device provided by the present invention through the description of the foregoing embodiments, and will not repeat it here.
[0160] It should be noted that the blockchain-based bank risk control method and device disclosed herein can be used for bank risk control in the financial field, as well as for risk control in any field other than the financial field. The application fields of the blockchain-based bank risk control method and device disclosed herein are not limited.
[0161] This embodiment also provides an electronic device, which may be a desktop computer, tablet computer, or mobile terminal, etc., and this embodiment is not limited to these. In this embodiment, the electronic device may refer to the embodiments of the foregoing methods and apparatus, the contents of which are incorporated herein by reference, and repeated details will not be described again.
[0162] Figure 5 This is a schematic block diagram illustrating the system configuration of an electronic device 600 according to an embodiment of the present invention. Figure 5 As shown, the electronic device 600 may include a central processing unit 100 and a memory 140; the memory 140 is coupled to the central processing unit 100. It is worth noting that this figure is exemplary; other types of structures may be used to supplement or replace this structure to achieve telecommunications functions or other functions.
[0163] In one embodiment, blockchain-based bank risk control functions can be integrated into a central processing unit 100. The central processing unit 100 can be configured to perform the following controls:
[0164] Receive sample data provided by each participant through blockchain;
[0165] Perform data alignment processing on the received sample data from each participant;
[0166] The pre-set bank risk control prediction model is trained using the data alignment-processed sample data.
[0167] The bank risk control prediction model, trained by the model, is used to process the received bank risk control data and generate bank risk control results.
[0168] In another implementation, the blockchain-based bank risk control device can be configured separately from the central processing unit 100. For example, the blockchain-based bank risk control device can be configured as a chip connected to the central processing unit 100, and the blockchain-based bank risk control function can be realized through the control of the central processing unit.
[0169] like Figure 5 As shown, the electronic device 600 may also include: a communication module (transmitter / receiver) 110, an input unit 120, an audio processor 130, a display 160, and a power supply 170. It is worth noting that the electronic device 600 does not necessarily need to include these components. Figure 5 All components shown; in addition, the electronic device 600 may also include Figure 5 For components not shown, please refer to existing technologies.
[0170] like Figure 5 As shown, the central processing unit 100, sometimes also referred to as a controller or operating control, may include a microprocessor or other processor device and / or logic device. The central processing unit 100 receives inputs and controls the operation of various components of the electronic device 600.
[0171] The memory 140 may be, for example, one or more of a cache, flash memory, hard drive, removable media, volatile memory, non-volatile memory, or other suitable devices. It may store the aforementioned failure-related information, and also store a program for executing that information. The central processing unit 100 may execute the program stored in the memory 140 to perform information storage or processing, etc.
[0172] Input unit 120 provides input to central processing unit 100. Input unit 120 may be, for example, a keypad or touch input device. Power supply 170 provides power to electronic device 600. Display 160 displays images and text. Display may be, for example, an LCD display, but is not limited thereto.
[0173] The memory 140 can be a solid-state memory, such as a read-only memory (ROM), random access memory (RAM), a SIM card, etc. It can also be a memory that retains information even when power is off, can be selectively erased, and contains more data; examples of this type of memory are sometimes referred to as EPROMs. The memory 140 can also be some other type of device. The memory 140 includes a buffer memory 141 (sometimes referred to as a buffer). The memory 140 may include an application / function storage unit 142 for storing application programs and function programs or processes for executing the operation of the electronic device 600 via the central processing unit 100.
[0174] The memory 140 may also include a data storage unit 143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 144 of the memory 140 may include various drivers for the electronic device's communication functions and / or for performing other functions of the electronic device (such as messaging applications, address book applications, etc.).
[0175] The communication module (transmitter / receiver) 110 is a communication module (transmitter / receiver) 110 that transmits and receives signals via antenna 111. The communication module (transmitter / receiver) 110 is coupled to the central processing unit 100 to provide input signals and receive output signals, which can be the same as in a conventional mobile communication terminal.
[0176] Based on different communication technologies, multiple communication modules (transmitters / receivers) 110 can be configured in the same electronic device, such as cellular network modules, Bluetooth modules, and / or wireless LAN modules. The communication module (transmitter / receiver) 110 is also coupled to a speaker 131 and a microphone 132 via an audio processor 130 to provide audio output via the speaker 131 and receive audio input from the microphone 132, thereby realizing typical telecommunications functions. The audio processor 130 may include any suitable buffer, decoder, amplifier, etc. Additionally, the audio processor 130 is coupled to a central processing unit 100, enabling on-device recording via the microphone 132 and on-device playback of stored sound via the speaker 131.
[0177] This invention also provides a computer-readable program, wherein when the program is executed in an electronic device, the program causes the computer to perform the blockchain-based bank risk control method as described in the above embodiments in the electronic device.
[0178] This invention also provides a storage medium storing a computer-readable program, wherein the computer-readable program enables a computer to perform the blockchain-based bank risk control described in the above embodiments in an electronic device.
[0179] Preferred embodiments of the invention have been described above with reference to the accompanying drawings. Many features and advantages of these embodiments are apparent from this detailed description, and therefore the appended claims are intended to cover all such features and advantages of these embodiments that fall within their true spirit and scope. Furthermore, since many modifications and alterations will readily occur to those skilled in the art, the embodiments of the invention are not intended to be limited to the precise structures and operations illustrated and described, but rather to encompass all suitable modifications and equivalents falling within their scope.
[0180] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0181] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0182] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1The function specified in one or more boxes.
[0183] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0184] Specific embodiments have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.
Claims
1. A blockchain-based bank risk control method, characterized in that, The method comprises: Collecting sample data provided by each sample data participant through a block chain; Performing data alignment processing on the sample data of each sample data participant received; The first participant generates a public key and a private key required for generating an encrypted sample ID according to an RSA algorithm locally, saves the private key locally, and sends the sample set ID and the public key to a block chain node; the block chain node sends the sample set ID and the public key to the second participant; the second participant first performs hash mapping on the local sample original ID by using an agreed hash function, so as to ensure that the user ID is not transmitted in plaintext, then encrypts the sample set ID after the mapping by using the public key of the first participant, generates an encrypted sample set ID, and sends the encrypted sample set ID to the block chain node; the block chain node sends the encrypted sample set ID to the first participant; the first participant decrypts to obtain the sample set ID after the hash mapping, and then maps the local sample by using the same mapping function, matches the sample ID from the second participant, and sends the matched sample set ID to the block chain node; the block chain node sends the matched sample set ID to the second participant, and completes the sample alignment process; Model training is performed on a preset bank risk control prediction model by using the sample data after the data alignment processing; A bank risk control result is generated by processing received bank risk control data by using the bank risk control prediction model after the model training; The bank risk control method based on the block chain further comprises: The aligned sample set of the first participant is denoted by The aligned sample set of the second participant is denoted by Note that the number of samples of the first participant and the second participant are both m, and D A does not contain the true label y of the sample, that is, in the credit federation scenario, only one participant has the true label of the sample; The model parameters of the first participant and the second participant are initialized as θ A , θ B , and the original objective function to be optimized is: where β A and β B are the L2 regularization coefficients of the local model parameters of the first and second participants, respectively, and the goal is to find the optimal set of parameters {θ A , θ B} such that the following holds: will be described below. and are respectively denoted as and In order to protect data privacy and gradient aggregation after decryption, a homomorphic encryption process needs to be performed on the original objective function. This encryption method allows both parties to perform algebraic operations on the ciphertext and still obtain an encrypted result, but ensures that the result obtained after decryption is consistent with the result obtained by performing the same operation on the plaintext. This technology enables searching and comparison operations on encrypted data without the need to decrypt the data during the entire process. The function after encryption is denoted as: Wherein, Enc[·] represents an encryption process, then the encrypted target function is expanded to obtain three sub-functions: wherein, Enc[L A (D A ,D B ; θ A , θ B )] represents the portion of the loss involving only the first party. Enc[L B (D A ,D B ; θ A , θ B )] represents the portion of the loss involving only the second party. Enc[L A∩B (D A ,D B ; θ A , θ B )] represents that the first participant and the second participant jointly involve in the loss part; The formulas are shown in 4.5 and 4.6: According to formula 4.4, formula 4.5 and formula 4.6: Enc[L(D A ,D B ; θ A , θ B )] = Enc[L A (D A ,D B ; θ A , θ B )] + Enc[L B (D A ,D B ; θ A , θ B )] + Enc[L A∩B (D A ,D B ; θ A , θ B )](4.7) Let's take the partial derivative of Enc[L(D A ,D B ); θ A , θ B ) with respect to θ A . Similarly for θ B Partial derivatives are taken as shown in equation 4.9 Note that the computation of the partial derivatives of θ A and θ B both rely on their common part θ Thus, when updating the gradient, the second party will first compute its local gradient, send the common part to the first party, and then the first party can compute the gradient of θ A . The user-related data transmitted by the client is denoted as Enc[y]; wherein, represents a data dimension belonging to the first participant; This is the data dimension belonging to the second participating party; The end-side model inference process of the first participant is denoted as formula 4.10: wherein, a private parameter representative of the first participant; Similarly, the end-side inference process of the second participant is formula 4.11: The end-side inference results of the first participant and the second participant, i.e., Enc[u A ] and Enc[u B ], are finally aggregated, and the aggregation process is shown in Equation 4.12: Then, the credit score is decoded by Dec[y]; Dec[y] means that the data of Enc[y] is decrypted; finally, the credit score is transmitted to the client, and the client makes a final credit decision according to the credit score; The gradient data of the local training of the participant: formula 4.8, formula 4.9, formula 4.12, and the data after the federated learning processing are sent to the block chain; The result of the model training is saved on the block chain, the proof-of-work algorithm of the block chain is used to calculate the participants with high contribution degree, and the reward mechanism of the block chain is used to encourage the participants with high contribution degree to improve the prediction effect of the model; the participants with high contribution degree can check the prediction results of the model at each stage, so that the institutions providing more data can obtain better model effect, thereby reflecting the contribution degree of the institutions to the model.
2. The blockchain-based bank risk control method of claim 1, wherein, Before the block chain collects the sample data provided by each sample data participant, the method further comprises: Generating a public key and a private key by using a preset encryption algorithm; Sending the generated public key to each sample data participant through the block chain. 3.The blockchain-based bank risk control method of claim 2, wherein, Before the block chain collects the sample data provided by each sample data participant, the method further comprises: Performing hash mapping processing on the sample ID; The public key is used to encrypt the sample ID after hash mapping processing. 4.The blockchain-based bank risk control method of claim 3, wherein, The data alignment processing of the sample data of each sample data participant includes: The private key is used to decrypt the received sample data to generate a sample ID after hash mapping processing; The sample data of each participant is matched according to the sample ID after hash mapping processing to complete the data alignment processing. 5.The blockchain-based bank risk control method of claim 1, wherein, The model training of the preset bank risk control prediction model using the sample data after data alignment processing includes: The preset bank risk control prediction model is trained using the sample data after alignment processing to generate a trained bank risk control prediction model. 6.A blockchain-based bank risk control device, characterized in that, The device includes: The data transceiver module is configured to receive sample data provided by each sample data participant through the blockchain; The sample alignment module is configured to perform data alignment processing on the sample data of each sample data participant received; The first participant generates a public key and a private key required for RSA algorithm to encrypt the sample ID, saves the private key locally, and sends the sample set ID and the public key to the blockchain node; the blockchain node sends the sample set ID and the public key to the second participant; the second participant first uses a predetermined hash function to perform hash mapping on the local sample original ID to ensure that the user ID is not transmitted in plaintext, then uses the public key of the first participant to encrypt the mapped sample set ID to generate an encrypted sample set ID, and sends the encrypted sample set ID to the blockchain node; the blockchain node sends the encrypted sample set ID to the first participant; the first participant decrypts to obtain the sample set ID after hash mapping, and then maps the local sample set ID using the same mapping function and matches the sample set ID from the second participant, and sends the matched sample set ID to the blockchain node; the blockchain node sends the matched sample set ID to the second participant to complete the sample alignment process; The model training module is configured to train the preset bank risk control prediction model using the sample data after data alignment processing; The prediction module is configured to process the received bank risk control data using the trained bank risk control prediction model to generate a bank risk control result; The bank risk control device based on the blockchain further includes: The blockchain module is configured to save the result of the model training on the blockchain, calculate the participants with high contribution degrees using the proof of work algorithm of the blockchain, and use the reward mechanism of the blockchain to encourage the participants with high contribution degrees to improve the prediction effect of the model; the participants with high contribution degrees can view the prediction results of the model at each stage, and the institutions providing more data can obtain better model effects, thereby reflecting the contribution of the institutions to the model; The bank risk control device based on the blockchain is further specifically configured to: The aligned sample set of the first participant is denoted by The aligned sample set of the second participant is denoted by Note that the number of samples of the first participant and the second participant are both m, and D A The real label y of the sample is not contained in D, that is, only one participant has the real label of the sample in the credit federation scenario. The model parameters of the first participant and the second participant are initialized as θ A , θ B , and the original objective function to be optimized is: where β A and β B are the L2 regularization coefficients of the local model parameters of the first and second participants, respectively, and the goal is to find the optimal set of parameters {θ A , θ B} such that the following holds: will be described below. and are respectively denoted as and In order to protect data privacy and gradient aggregation after decryption, a homomorphic encryption process needs to be performed on the original objective function. This encryption method allows both parties to perform algebraic operations on the ciphertext and still obtain an encrypted result, but ensures that the result obtained after decryption is consistent with the result obtained by performing the same operation on the plaintext. This technology enables searching and comparison operations on encrypted data without the need to decrypt the data during the entire process. The encrypted function is denoted as: Where Enc[·] represents the encryption process, and then the encrypted target function is expanded to obtain three sub-functions: wherein, Enc[L A (D A ,D B ; θ A , θ B )] represents the portion of the loss involving only the first party. Enc[L B (D A ,D B ; θ A , θ B )] represents the portion of the loss involving only the second party. Enc[L A∩B (D A ,D B ; θ A , θ B )] represents that the first participant and the second participant jointly involve in the loss part; The formulas are shown in Equations 4.5 and 4.6: According to Equations 4.4, 4.5, and 4.6: Enc[L(D A ,D B ; θ A ,θ B )] = Enc[L A (D A ,D B ; θ A ,θ B )] + Enc[L B (D A ,D B ; θ A ,θ B )] + Enc[L A∩B (D A ,D B ; θ A , θ B )](4.7) Let's take the partial derivative of Enc[L(D A ,D B ); θ A , θ B ) with respect to θ A . Similarly for θ B Partial derivatives are taken as shown in equation 4.9 Note that the computation of the partial derivatives of θ A and θ B both rely on their common part Thus, when updating the gradient, the second party will first compute its local gradient, send the common part to the first party, and only then the first party can compute the gradient of θ A . The user-related data transmitted by the client is denoted as Enc[y]; wherein, represents a data dimension belonging to the first participant; This is the data dimension belonging to the second participating party; The end-side model inference process of the first participant is represented by equation 4.10: wherein, a private parameter representative of the first participant; Similarly, the end-side inference process of the second participant is represented by equation 4.11: The end-side inference results of the first participant and the second participant, i.e., Enc[u A ] and Enc[u B ] are finally aggregated, and the aggregation process is shown in Equation 4.12: Then the credit score is decoded through Dec[y]; Dec[y] means decrypting the data of Enc[y]; finally the credit score is transmitted to the client, and the client makes a final credit decision according to the credit score; The gradient data of the local training of the participants: equation 4.8, equation 4.9, equation 4.12, and the data processed by the federated learning are sent to the blockchain module.
7. The blockchain-based bank risk control apparatus of claim 6, wherein, The device further comprises: A key generation module for generating a public key and a private key using a preset encryption algorithm; The generated public key is sent to each sample data participant through the blockchain by the data transceiver module.
8. The blockchain-based bank risk control apparatus of claim 7, wherein, The device further comprises: A hash mapping module for performing hash mapping processing on the sample ID; An encryption module for encrypting the sample ID after hash mapping processing using the public key.
9. The blockchain-based bank risk control apparatus of claim 8, wherein, The sample alignment module comprises: A decryption unit for decrypting the received sample data using the private key to generate the sample ID after hash mapping processing; A matching alignment unit for matching the sample data of each participant according to the decrypted sample ID after hash mapping processing to complete the data alignment processing.
10. The blockchain-based bank risk control apparatus of claim 6, wherein, The model training module uses the sample data after alignment processing to perform federated training on the preset bank risk prediction model to generate the trained bank risk prediction model.
11. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the method of any one of claims 1-5.
12. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program for executing the method of any one of claims 1-5.
Citation Information
Patent Citations
Credit risk control system and method based on federation mode
CN111461874A