Blockchain-based user data processing method and apparatus, and storage medium
By leveraging blockchain technology, smart contracts, and consensus algorithms, the problem of poor security of customer data lost by financial institutions has been solved, enabling secure data storage and transparent processing, and improving the efficiency and accuracy of data processing.
Patent Information
- Application Number
- CN202411863622.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2044-12-17
AI Technical Summary
In existing technologies, financial institutions face poor information security when processing user data of lost customers, especially during data sharing and analysis, where there is a risk of data interception or tampering.
By leveraging blockchain technology, smart contracts, and consensus algorithms, the secure storage and transmission of data on the blockchain are ensured. Decentralization and encryption mechanisms are employed to achieve data immutability and transparency. Endorsing nodes are used to verify the legality of transaction proposals, and sorting and submitting nodes are used to ensure the orderliness and consistency of data.
It improves the security and transparency of data on lost customers of financial institutions, enhances the auditability and trustworthiness of data processing, reduces human intervention, improves the efficiency and accuracy of data processing, and optimizes the transaction confirmation time for large-scale data processing.
Smart Images

Figure CN119831740B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of financial technology and blockchain technology, and specifically to a blockchain-based user data processing method, device, and storage medium. Background Art
[0002] As financial institutions increasingly prioritize customer relationship management, predicting and analyzing customer churn has become a critical task. Customer churn not only impacts financial institutions' business and profits but can also reveal underlying market trends and service deficiencies. Therefore, designing and implementing effective customer churn analysis systems is crucial. However, existing technologies pose a significant technical challenge when processing user data related to churned customers, particularly during data sharing and analysis.
[0003] With existing technologies, data can be intercepted or tampered with during transmission, especially when data needs to be shared across different systems or organizations. When analyzing customer churn, financial institutions may need to cross-analyze data from other service providers, making data transmission security a pressing issue.
[0004] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention
[0005] The embodiments of the present application provide a blockchain-based user data processing method, device, and storage medium to at least solve the technical problem of poor information security in the prior art when processing user data of lost customers of financial institutions.
[0006] According to one aspect of an embodiment of the present application, a blockchain-based user data processing method is provided, comprising: initiating a transaction proposal to the blockchain through a client, wherein the transaction proposal includes at least smart contract information and user data of lost users of a financial institution; executing the smart contract through an endorsement node in the blockchain, and when it is determined that the transaction proposal meets the consistency condition, signing the transaction proposal through the client, and submitting the signed transaction proposal to a sorting role node of the blockchain, wherein the sorting role node is a node in the blockchain that participates in consensus decision-making; reaching consensus on the signed transaction proposal through the sorting role node, and sorting all consensus results according to the generation time of the consensus result; packaging the consensus-completed data in the transaction proposal into a block according to the sorting result of the consensus result and sending it to a submission node of the blockchain; when the submission node determines that the data state of the data in the block matches the state of the blockchain, the submission node appends the block to the blockchain and updates the world state database corresponding to the blockchain.
[0007] According to another aspect of the present application, a user data processing device based on blockchain is also provided, which includes: a first processing unit, which is used to initiate a transaction proposal to the blockchain through a client, wherein the transaction proposal includes at least smart contract information and user data of lost users of the financial institution; a second processing unit, which is used to execute the smart contract through the endorsement node in the blockchain, and when it is determined that the transaction proposal meets the consistency condition, sign the transaction proposal through the client, and submit the signed transaction proposal to the sorting role node of the blockchain, wherein the sorting role node is a node participating in consensus decision-making in the blockchain; a third processing unit, which is used to reach consensus on the signed transaction proposal through the sorting role node, and sort all consensus results according to the generation time of the consensus result; according to the sorting result of the consensus result, the data that has completed consensus in the transaction proposal is packaged into a block and sent to the submission node of the blockchain; a fourth processing unit, which is used to append the block to the blockchain through the submission node when the submission node determines that the data status of the data in the block matches the status of the blockchain, and update the world state database corresponding to the blockchain.
[0008] According to another aspect of the present application, a computer-readable storage medium is also provided, wherein the computer-readable storage medium includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the above-mentioned blockchain-based user data processing method.
[0009] According to another aspect of the present application, an electronic device is also provided, wherein the electronic device includes: a memory storing an executable program; and a processor for running the program, wherein the above-mentioned blockchain-based user data processing method is executed when the program is running.
[0010] According to another aspect of the present application, a computer program product is also provided, comprising computer instructions, wherein when the computer instructions are executed by a processor, the above-mentioned blockchain-based user data processing method is implemented.
[0011] In this application, a transaction proposal is first initiated to the blockchain through a client. The transaction proposal includes at least smart contract information and user data of the financial institution's churned users. The smart contract is then executed through the blockchain's endorsement node. If the transaction proposal satisfies the consistency conditions, the client signs the transaction proposal and submits the signed transaction proposal to the blockchain's sorting role node, which is the node in the blockchain that participates in consensus decision-making. The sorting role node then reaches consensus on the signed transaction proposal and sorts all consensus results based on the time they were generated. Based on the sorting results, the consensus data in the transaction proposal is packaged into blocks and sent to the blockchain's submission node. Finally, if the submission node determines that the data state of the data in the block matches the state of the blockchain, the submission node appends the block to the blockchain and updates the blockchain's corresponding world state database.
[0012] As can be seen from the above, through the decentralization and encryption mechanisms of blockchain technology, this application ensures the secure storage and transmission of lost customer data within financial institutions. Once data is written to the blockchain, its immutability means it is permanently stored and cannot be maliciously modified, greatly improving data security. Secondly, the distributed ledger nature of blockchain allows all participants to view transaction history, and the execution of smart contracts is completely transparent and verifiable by all nodes. This not only improves the transparency of the entire system but also ensures the auditability of the data processing process, making it easier for financial institutions to track and analyze every step of data processing and enhancing trust in data processing. In addition, this application automates the data processing process through smart contracts, reducing manual intervention and improving the efficiency and accuracy of data processing. Furthermore, optimized consensus algorithms (such as the Delegated Byzantine Fault Tolerance algorithm) can effectively reduce transaction confirmation time and accelerate the data consensus process when processing large amounts of data, ensuring efficient system operation in large-scale data processing scenarios.
[0013] Furthermore, in this application, transaction proposals initiated by clients to the blockchain include smart contract information and churned user data. Smart contracts are executed on endorsing nodes and submitted with client signatures after consistency conditions are met. This process ensures the legitimacy and consistency of data processing, preventing unauthorized data access and tampering. Ordering nodes sort transactions based on the time of consensus generation and then package consensus-enabling data into blocks. This mechanism ensures data order and consistency. After verifying that the block data state matches the blockchain state, the committing node appends the block to the blockchain and updates the world state database. This process further strengthens data security and immutability.
[0014] It can be seen that through the above technical features, the technical solution of the present application can effectively solve the problem of poor information security in the existing technology when processing the lost customer data of financial institutions. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0016] Figure 1 A hardware structure block diagram of a computer terminal for implementing a user data processing method based on blockchain is shown;
[0017] Figure 2 is a flowchart of an optional blockchain-based user data processing method according to an embodiment of the present application;
[0018] Figure 3 is a schematic diagram of the logical structure of an optional MSP according to an embodiment of the present application;
[0019] Figure 4 is a schematic diagram of an outlier according to an embodiment of the present application;
[0020] Figure 5 This is an overall architecture diagram of an optional blockchain-based user data processing system according to an embodiment of the present application;
[0021] Figure 6 This is a schematic diagram of an optional blockchain network structure according to an embodiment of the present application;
[0022] Figure 7 is a flowchart of an optional transaction proposal processing according to an embodiment of the present application;
[0023] Figure 8 This is a schematic diagram of an optional blockchain-based user data processing device according to an embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0026] It should also be noted that the collected information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this application are information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation portals for users to choose to authorize or refuse. For example, an interface is set up between this system and relevant users or institutions to provide users with corresponding operation portals for users to choose to agree or refuse the automated decision-making results; if the user chooses to refuse, the expert decision-making process will be entered.
[0027] According to an embodiment of the present application, an embodiment of a blockchain-based user data processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0028] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 The following is a hardware structure diagram of a computer terminal (or mobile device) for implementing a user data processing method based on blockchain. Figure 1As shown, the computer terminal 10 (or mobile device) may include one or more (illustrated as 102a, 102b, ..., 102n in the figure) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.
[0029] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuitry." The data processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuitry may be a single independent processing module, or may be fully or partially integrated into any of the other components of the computer terminal 10 (or mobile device). As in the blockchain-based user data processing method involved in the embodiments of the present application, the data processing circuitry serves as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0030] Memory 104 can be used to store software programs and modules for application software, such as the program instructions / data storage device corresponding to the blockchain-based user data processing method in the embodiments of this application. Processor 102 executes the software programs and modules stored in memory 104 to perform various functional applications and data processing, thereby implementing the aforementioned blockchain-based user data processing method. Memory 104 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 104 may further include memory located remotely from processor 102, which can be connected to computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0031] The transmission device 106 is configured to receive or transmit data via a network. A specific example of the aforementioned network may include a wireless network provided by the communications provider of the computer terminal 10. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may be a radio frequency (RF) module, which is configured to communicate with the Internet wirelessly.
[0032] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).
[0033] The following is an explanation of some key terms in the embodiments of this application:
[0034] Blockchain: A chain of blocks. Each block contains specific information, and they are linked together in the order of their creation. This chain is stored across all file servers. As long as at least one server in the system is functioning, the entire blockchain is secure. These servers, called nodes in the blockchain, provide storage space and computing power for the entire blockchain system. Modifying blockchain information requires the consent of half of the nodes and the modification of all nodes. These nodes are often controlled by different entities, making tampering with blockchain information extremely difficult.
[0035] Decentralization: Generally refers to running on a distributed network, where the information of participants is securely protected (and may also be anonymous).
[0036] Decentralized systems have the following three advantages:
[0037] 1. Fault tolerance: A decentralized system is less likely to stop working due to a local accidental failure.
[0038] 2. Anti-attack: The cost of attacking and destroying a decentralized system is higher than that of a centralized system.
[0039] 3. Anti-collusion: It is difficult for participants in a decentralized system to collude with each other.
[0040] Asymmetric encryption: Asymmetric encryption is a method for maintaining key confidentiality. It requires two keys: a public key (referred to as the public key) and a private key (referred to as the private key). The public and private keys form a pair. If data is encrypted with the public key, it can only be decrypted with the corresponding private key. Because encryption and decryption use two different keys, this algorithm is called an asymmetric encryption algorithm.
[0041] Member Services: This service provides member services, including registration, enrollment, and certificate application. Considering the security, privacy, regulatory oversight, auditing, and performance requirements of commercial applications, nodes and members can only join the blockchain network if they obtain a certificate, significantly improving the security of acquiring transaction identification.
[0042] Blockchain service: Responsible for the calculation and storage of distributed ledgers, sorting services between nodes, endorsement verification management, and the implementation of ledger storage methods. It is the core component of the blockchain and provides underlying support for the main functions of the blockchain.
[0043] Chaincode Service: Chaincode, also known as a smart contract, is a standard-based piece of code that implements specific business logic. Chaincode is decoupled from the underlying ledger and runs in a separate container, allowing updates to the chaincode without affecting existing data. Interfaces and Events: This service provides APIs for third-party applications to access, facilitating development. Java interfaces are supported. Chaincode can be installed and tested using the SDK or CTL, and transaction status and data can be queried. Events are also used to monitor events occurring within the blockchain network, facilitating the invocation and processing of third-party applications.
[0044] Network protocol: realize P2P network transmission.
[0045] A smart contract is a computer protocol designed to communicate, verify, or enforce contracts in an information-based manner. Smart contracts allow for trusted, traceable, and irreversible transactions without a third party. They aim to provide superior security to traditional contracts and reduce other transaction costs associated with them.
[0046] Endorsing Node: The node that undertakes the endorsement task in the blockchain is the endorsing node. The endorsing node must prove its legitimacy by signing the expected information of the valid certificate.
[0047] Anchor Node: An anchor node is a node that can be discovered and communicated with by any node in a channel. Therefore, every organization that joins a channel has at least one anchor node. Nodes in one organization can discover all nodes in other organizations in the channel by searching for anchor nodes.
[0048] Leader node: Connects to the sorting service node as a representative within the organization, and distributes the batch blocks received from the sorting service node to other nodes within the organization.
[0049] Chaincode: Fabric's smart contract is called chaincode, which is divided into system chaincode and user chaincode. System chaincode is used to implement system-level functions, and user chaincode is used to implement user application functions.
[0050] Consortium chains: Consortium chains are blockchain systems open to specific organizations. Obviously, since only certain nodes are allowed to connect to the blockchain system, this permission mechanism creates a potential for centralization. However, if only specific users have access to the relevant private keys for specific transactions, the consortium chain can be further decentralized.
[0051] Consensus algorithm: A set of processes and rules created to implement a distributed consensus protocol. When nodes distributed across different domains negotiate and interact according to this set of rules, they can ultimately reach a consensus on a particular issue or issues, thereby achieving consistency across the distributed nodes.
[0052] X.509: X.509 is the format standard for public key certificates in cryptography. An X.509 certificate contains a public key, identity information (such as the network host name, organization name, or individual name), and signature information (signature of the certificate issuing authority or self-signature).
[0053] Authentication: Authentication, also known as "verification" or "authorization," refers to the process of confirming a user's identity through certain means. While there are many authentication methods, this solution utilizes public-key encryption.
[0054] MSP: An MSP is a modular component that defines the rules for identity verification, authentication, and network access. More specifically, an MSP manages and verifies the identities of network members. This includes managing user IDs, verifying nodes that wish to join the network, and providing credentials for transactions initiated by clients.
[0055] CA: CA is the international name for a certification authority, which issues, manages, and revokes digital certificates. A CA's role is to verify the legitimacy of the certificate holder's identity and digitally sign the certificate to prevent forgery or tampering.
[0056] Clustering method: The k-means clustering algorithm is an iterative cluster analysis algorithm. Its steps are as follows: pre-dividing the data into k groups, randomly selecting k objects as the initial cluster centers, then calculating the distance between each object and each seed cluster center, and assigning each object to the cluster center closest to it. With each assignment of a sample, the cluster center is recalculated based on the existing objects in the cluster. This process will be repeated until a termination condition is met. The termination condition can be that no (or a minimum number of) objects are reassigned to different clusters, no (or a minimum number of) cluster centers change again, and the sum of squared errors is locally minimized.
[0057] Outlier detection: An outlier is a data object that is significantly different from other data objects. The system generally suspects that it is generated by a different mechanism. The process of finding out whose behavior is very different from the expected object is called outlier detection.
[0058] This application provides Figure 2 The user data processing method based on blockchain is shown. Figure 2 Flowchart of an optional blockchain-based user data processing method according to an embodiment of the present application. Figure 2 As shown, the method includes the following steps:
[0059] Step S201: Initiate a transaction proposal to the blockchain through the client, wherein the transaction proposal includes at least smart contract information and user data of lost users of the financial institution.
[0060] Optionally, a client refers to an application that initiates transactions, invokes smart contracts, or queries blockchain status. In this application, a client is an internal system or external application within a financial institution that sends transaction proposals to a blockchain network. The client typically includes the SDK (Software Development Kit) required to access the blockchain network and perform operations.
[0061] Alternatively, a transaction proposal is a key concept in blockchain networks. It's the first step in the transaction process, constructed by the client and sent to endorsing peers. A transaction proposal contains detailed transaction information, including the smart contract to be executed, the contract method, parameters, and the client's signature. It allows endorsing peers to verify the transaction's legitimacy and simulate the execution of the smart contract to determine whether the transaction is acceptable.
[0062] Alternatively, a smart contract is a predefined, self-executing program that runs on the blockchain and automatically executes specific actions based on pre-set conditions. In this application, the smart contract includes logic for data preprocessing and standardization, cluster modeling, outlier detection, and result visualization. The execution results of the smart contract are confirmed by endorsing nodes and written to the blockchain after all nodes reach consensus.
[0063] Optionally, user data for churned users refers to detailed information about specific churned users that the financial institution wishes to analyze, including but not limited to customer credit score, country / region, gender, age, years of user experience, deposit and loan history, number of products used, credit card holdings, active user status, estimated income, and possible outlier information. This data will serve as input to the smart contract, generating corresponding analytical results upon execution.
[0064] Optionally, the overall blockchain architecture in this application is divided into a network layer, a core layer, and an interface layer. The core layer consists of three parts: member services, blockchain services, and chaincode services. The interface layer uses interfaces and events to call information such as identity, ledgers, transactions, and smart contracts. The network layer is responsible for implementing the P2P network and ensuring the consistency of the blockchain's distributed storage.
[0065] In step S202, the smart contract is executed by the endorsing node in the blockchain. If the transaction proposal satisfies the consistency condition, the transaction proposal is signed by the client and submitted to the sorting role node of the blockchain. The sorting role node is the node that participates in consensus decision-making in the blockchain.
[0066] Optionally, an endorsing node is a peer node in the blockchain network. Endorsing nodes are responsible for evaluating the legitimacy of transaction proposals and executing the smart contract code. Once a transaction proposal is approved by an endorsing node, they provide the transaction execution results and their own CA (Certificate Authority) signature as part of the transaction proposal and return them to the client for subsequent consensus.
[0067] In step S203, the signed transaction proposal is consensus-based through the sorting role node, and all consensus results are sorted according to the generation time of the consensus results. Based on the sorting results of the consensus results, the consensus data in the transaction proposal is packaged into blocks and sent to the submission node of the blockchain.
[0068] Alternatively, consensus is the process of ensuring that all nodes in a blockchain network agree on the order and validity of transactions. In a blockchain network, consensus is the responsibility of orderer nodes (corresponding to the sorting role nodes mentioned above). They sort the collected transaction proposals and generate blocks containing multiple transactions, which are then broadcast to committer peers in the network. Committer peers verify the transactions and write them to their local blockchain ledgers.
[0069] Step S204: When the commit node determines that the data state of the data in the block matches the state of the blockchain, the commit node appends the block to the blockchain and updates the world state database corresponding to the blockchain.
[0070] Optionally, a commit node is a peer node that performs transaction verification after receiving a block broadcast by an orderer. This verifies whether the transaction's execution result is consistent with the result provided by the endorsing node, and whether the transaction conflicts with the current ledger state. Blocks that pass verification are appended to the local blockchain and the World State Database is updated to reflect the latest ledger state.
[0071] Based on the contents of steps S201 to S204 above, it can be seen that through the decentralization and encryption mechanisms of blockchain technology, this application ensures the secure storage and transmission of lost customer data of financial institutions. Once the data is written to the blockchain, due to its immutability, the data will be permanently stored and cannot be maliciously modified, which greatly improves the security of the data. Secondly, the distributed ledger nature of the blockchain allows all participants to view the transaction history, and the execution process of the smart contract is also completely transparent and can be verified by all nodes. This not only improves the transparency of the entire system, but also ensures the auditability of the data processing process, making it easier for financial institutions to track and analyze every step of the data processing and enhance trust in the data processing. In addition, this application automates the data processing process through smart contracts, reduces manual intervention, and improves the efficiency and accuracy of data processing. In addition, when processing large-scale data, the optimized consensus algorithm (such as the Delegated Byzantine Fault Tolerance algorithm) can effectively reduce transaction confirmation time, accelerate the data consensus process, and ensure the efficient operation of the system in large-scale data processing scenarios.
[0072] Furthermore, in this application, transaction proposals initiated by clients to the blockchain include smart contract information and churned user data. Smart contracts are executed on endorsing nodes and submitted with client signatures after consistency conditions are met. This process ensures the legitimacy and consistency of data processing, preventing unauthorized data access and tampering. Ordering nodes sort transactions based on the time of consensus generation and then package consensus-enabling data into blocks. This mechanism ensures data order and consistency. After verifying that the block data state matches the blockchain state, the committing node appends the block to the blockchain and updates the world state database. This process further strengthens data security and immutability.
[0073] In an optional embodiment, initiating a transaction proposal to the blockchain through a client includes: registering an identity certificate through the client, wherein the identity certificate is used to represent that the client has the authority to access the blockchain to process transaction proposals; after the client successfully registers the identity certificate, periodically initiating transaction proposals to the blockchain through the client.
[0074] Optionally, the client first needs to interact with the network's authentication authority (CA). The CA is a key component in a blockchain network, managing digital certificates and verifying the identities of network participants. The client obtains an X.509 digital certificate from the CA. This certificate contains the client's public key and other identity information, such as the client's organization and role, signed by the CA. Obtaining a certificate typically requires the client to provide some identification information. After obtaining the identity certificate, the client must register and enroll with the Membership Service Provider (MSP) to ensure the validity of its identity certificate and its recognition by other nodes in the network. Optionally, after successful registration and enrolling, the client's identity certificate indicates authorization to access the blockchain and execute specific smart contracts (such as outlier detection for bank customer churn factors). This means that only clients with a valid identity certificate can submit transaction proposals to the blockchain network and invoke corresponding smart contracts. After successfully registering and obtaining an identity certificate, the client has the ability to regularly submit transaction proposals to the blockchain network. After constructing a transaction proposal, the client sends it to an endorsing peer. The endorsing node is responsible for evaluating the legitimacy of the transaction proposal and executing the smart contract after the conditions are met, generating the execution result of the proposal and the node's signature.
[0075] Through the above process, clients can not only securely access the blockchain network but also regularly initiate transaction proposals and execute smart contracts, automatically detecting and analyzing factors contributing to bank customer churn while ensuring the security of all operations and the immutability of data. For financial institutions, this mechanism not only improves the efficiency and accuracy of data analysis, but also enhances data security and privacy.
[0076] Optionally, the aforementioned MSP is a modular component of the blockchain network that defines the rules for identity verification, authentication, and access to the network. Specifically, the MSP is a modular component that manages and verifies the identities of the members of the blockchain network. In this application, the functions of the MSO include:
[0077] 1. Manage user IDs.
[0078] 2. Verify the nodes that want to join the network. Each node that wants to join the blockchain network must provide its valid and legal MSP information.
[0079] 3. Provide credentials for transactions initiated by customers. Data transmission between nodes (Client, Peer, Orderer) requires verification of the signatures of each node.
[0080] Optionally, Figure 3 This is a schematic diagram of the logical structure of an optional MSP according to an embodiment of the present application. Figure 3In the . / configure folder, RCA refers to the root CA, and the folder contains a list of the root CA's self-signed X.509 certificates, used for self-signing and signing intermediate CA certificates. ICA refers to the intermediate CA, and contains a list of certificates issued by the root CA. OU refers to the organizational unit, and contains a list of organizational units whose members are considered part of the organization represented by the MSP. B refers to the administrator, and this folder contains a list of identities that define the roles that have the administrator role for this organization. For standard MSP types, this list should contain one or more X.509 certificates. ReCA refers to the revocation certificate, which stores information about revoked participants. Users who are allowed to use the acquirer transaction type identification device and are on the revocation certificate list will not receive monitoring emails. SCA refers to the signing certificate, which is the signing certificate used by the endorsing node in transaction proposal responses. This folder is required for local MSPs, and each node must have only one X.509 certificate. KeyStore refers to the private key folder, which is defined for the local MSP of a peer or orderer node and contains the node's signing key. This key cryptographically matches the signing certificate contained in the SCA folder and is used to sign data. This folder is required for local MSPs and must contain only one private key. TLS Root CA: Contains a list of self-signed X.509 certificates for root CAs that the organization trusts for TLS communications. There must be at least one TLS root CA X.509 certificate in this folder. TLS Intermediate CA: Holds a list of intermediate certificates issued by the TLS root CA.
[0081] In an optional embodiment, before executing the smart contract through the endorsement node in the blockchain, the blockchain-based user data processing method further includes: verifying the client signature in the transaction proposal based on the client public key in the transaction proposal, wherein the condition for passing the client signature verification is that the client public key matches the client private key; after the client signature verification passes, checking whether the submitter of the transaction proposal has the authority to execute the smart contract through the endorsement node; when it is determined that the submitter has the authority to execute the smart contract, simulating the execution of the operation logic defined in the smart contract according to the content of the transaction proposal through the endorsement node, wherein the simulated execution is used to verify whether the logic of the smart contract conflicts with the transaction rules of the blockchain without changing the actual ledger state of the blockchain.
[0082] In a blockchain network, all transaction proposals must optionally include a client signature to ensure the origin and integrity of the proposal. The client signs the transaction proposal using its private key, and the endorsing peer verifies the validity of the signature using the client's public key. Signature verification requires that the client's public key in the proposal matches the client's private key used for signing. This process ensures that the origin and content of the transaction proposal cannot be tampered with during transmission. After signature verification, the endorsing peer further checks whether the submitter of the transaction proposal has permission to execute the specific smart contract. This is because blockchain allows for fine-grained access control, with each node and user having roles and permissions. Through the MSP and CA mechanisms, endorsing peers can verify the submitter's identity and permissions, ensuring that only authorized submitters can execute smart contracts, thereby protecting network security and data privacy.
[0083] Optionally, after confirming the submitter's permission to execute the smart contract, endorsing peers will simulate the execution of the smart contract's operational logic. This process, known as simulated execution, aims to verify the smart contract's logic complies with the blockchain's transaction rules and avoid any potential conflicts or issues without changing the actual blockchain's ledger state. Simulated execution can check whether the smart contract's code will cause inconsistencies in the ledger state or violate established transaction rules, such as data access restrictions and data update rules. Through simulated execution, endorsing peers can ensure that the smart contract operates as expected without actually changing the ledger state. If any conflicts or issues are discovered during simulated execution, the proposal will not be endorsed, thus preventing potential damage to the blockchain ledger from invalid transactions or malicious operations. Only after the smart contract's logic is verified to be correct and does not cause any rule conflicts will the endorsing peer provide endorsement and return the proposal's execution results and the peer's signature to the client.
[0084] Throughout this verification and execution process, the blockchain network ensures the security and legitimacy of transaction proposals and the correctness of smart contract logic through asymmetric encryption, identity authentication, permission control, and smart contract simulation execution mechanisms. This not only improves the efficiency and accuracy of data processing, but also enhances the security and reliability of the entire system. This is crucial for processing sensitive user data for financial institutions, particularly those analyzing churned customers. Through these mechanisms, financial institutions can be confident that their data is properly processed and protected within the blockchain network. Furthermore, the execution results of smart contracts accurately reflect the true state of the data, providing a solid foundation for reducing customer churn and improving service quality.
[0085] Optionally, the encryption algorithm used in this application is an asymmetric encryption algorithm. Asymmetric encryption technology refers to encryption technology integrated into the blockchain to meet security requirements and ownership verification requirements. Asymmetric encryption uses two asymmetric keys during the encryption and decryption process, namely a public key and a private key. Asymmetric keys have the following two characteristics:
[0086] 1. After using a key (public key or private key) to encrypt information, it can only be decrypted using another corresponding key.
[0087] 2. The public key is open to everyone, and the private key is kept confidential. No one can deduce the corresponding private key from the public key.
[0088] In an optional embodiment, the blockchain-based user data processing method also includes: executing a smart contract through an endorsement node in the blockchain to determine variable data from the user data, wherein the variable data includes at least the credit score and geographic location data of the lost user; determining outliers in the user data based on the variable data, wherein the similarity between the data corresponding to the outliers and the data corresponding to the non-outliers is less than a preset threshold; using the outliers and the data positions corresponding to the outliers in the user data as target data; encapsulating the target data through the signature of the endorsement node, and sending the encapsulated target data to the client; and deleting the data corresponding to the outliers from the user data in response to the outlier deletion instruction received by the client.
[0089] Optionally, when a client submits a transaction proposal to the blockchain, the proposal includes smart contract information and user data of the financial institution's churned customers. After verifying the transaction proposal's signature and the submitter's permissions, the endorsing peer executes the code logic in the smart contract. In this application, the smart contract's execution logic includes at least extracting key variable data from the user data, including at least the churned customer's credit score and location data (country / region). The smart contract further preprocesses the extracted variable data, including data cleaning, conversion, and standardization, to ensure that the data meets analysis requirements and improve the accuracy and reliability of the model.
[0090] Optionally, after variable data preprocessing is complete, the smart contract uses statistical methods such as cluster analysis to identify outliers in the user data. Outliers are data points that significantly deviate from other data points in a dataset. These points may exist due to measurement errors, abnormal behavior, or other reasons. According to the description, outliers are identified based on whether the similarity between a data point and non-outlier points is less than a preset threshold. This means that if the distance between a data point and other data points in the variable space (for example, using Euclidean distance or Manhattan distance) is significantly greater than the set threshold, the data point will be marked as an outlier. Once an outlier is identified, the smart contract uses the outlier and its specific location in the user data (i.e., data location) as the target data and encapsulates the target data with the signature of the endorsing node. This encapsulation includes detailed information about the outlier and its location in the dataset, ensuring data integrity and source trustworthiness. The encapsulated target data is then sent back to the client for subsequent operations.
[0091] Optionally, after receiving the encapsulated target data, the client can further analyze the outliers and, based on the analysis, determine whether the data corresponding to the outliers should be deleted. If the client decides to delete the outliers, it will send an outlier deletion instruction to the blockchain. This instruction must also include the client's signature and relevant smart contract information to ensure the legality and security of the operation. After receiving the deletion instruction, the endorsing node will execute the smart contract again, this time including the execution logic to delete the outlier data, thereby removing the influence of these outliers from the user dataset on the blockchain.
[0092] It's important to note that while deleting outliers appears to be a direct manipulation of the user's dataset from the client's perspective, in a blockchain environment, it actually involves executing a new transaction through a smart contract, writing the modified data state to a new block. This ensures the immutability and consistency of the blockchain ledger. Every modification to the dataset is recorded as a new block, enabling subsequent auditing and historical tracking.
[0093] Optionally, the smart contract processing of outliers in user data can be divided into four stages,
[0094] In the first phase of the smart contract execution process, the primary task is to meticulously preprocess and standardize the user dataset to ensure the efficiency and accuracy of subsequent analysis. Preprocessing and standardization are particularly important when dealing with large datasets, such as those containing 10,000 user records, involving a wide variety of variables, collected from different sources, and with varying units and magnitudes. The data preprocessing phase aims to improve dataset quality and facilitate subsequent analysis and model training. Key tasks in this phase include: cleaning and correcting incomplete, anomalous, or erroneous data in the dataset to ensure that model training is based on accurate and reliable information; optimizing the dataset by removing redundant data and addressing missing values, thereby accelerating subsequent data analysis and model training; adjusting data formats to reduce computing resource requirements and make model training more efficient; encoding or anonymizing sensitive information to protect user privacy while complying with data security regulations; and processing information from different data sources to ensure consistency in format and scale to facilitate subsequent integrated analysis.
[0095] For example, in practical applications, smart contracts convert categorical variables such as the user's country of residence. For example, for the nationality field, the smart contract encodes nationality A1 as 1, nationality A2 as 2, nationality A3 as 3, and so on, ensuring that all categorical variables are converted to numeric data. This process not only facilitates subsequent statistical analysis but also improves data integration efficiency. After completing data preprocessing, the smart contract performs data standardization, calculating the mean and standard deviation for each variable and scaling the data to ensure that all variables are on the same standard scale. The standardization process involves calculating the mean and standard deviation for each variable. Using these calculated mean and standard deviation, the data is scaled to achieve a zero mean and unit variance. The data is centered (by subtracting the mean) and then scaled (by dividing by the standard deviation).
[0096] Among them, Table 1 is the data of some variable data after standardization.
[0097] Table 1
[0098]
[0099]
[0100] The second phase of the smart contract focuses on building a clustering model and identifying key cluster centers, laying a solid foundation for subsequent outlier detection. In this application scenario, the cluster analysis targets two categories, representing the status of bank customers who eventually churned and those who did not. The specific implementation process of this phase is as follows:
[0101] Initialize cluster centers: The smart contract randomly selects two sample points in the dataset as the initial cluster centers. These centers will be used as reference points for subsequent data point allocation.
[0102] Iterative Assignment and Center Update: The system calculates the distance between each sample point in the dataset and the two initial cluster centers. It then assigns each sample point to the cluster center closest to it, forming a preliminary cluster. Subsequently, the smart contract recalculates the location of the cluster center based on all sample points in the current cluster. This process aims to ensure that the cluster center better represents the characteristics of the sample points in the cluster.
[0103] Repeat until stable: The smart contract will repeatedly execute the above assignment and center update steps until a stable state is reached, where no samples are reassigned to other clusters and the positions of cluster centers no longer change significantly. This process ensures that the clustering model accurately reflects the structure of the dataset.
[0104] Determining the final cluster centers: At the end of the iteration, the smart contract will determine two cluster centers, representing the bank's customer churn and non-churn status. These cluster centers are crucial for subsequent outlier identification, serving as benchmarks for measuring the degree of abnormality in data points.
[0105] After the clustering model is built in the second phase, the smart contract enters the outlier detection phase (the third phase). This process is based on the results of cluster analysis and uses the following steps to identify and mark outliers:
[0106] Calculate the distance to the cluster center: The smart contract calculates the distance between each sample point in the dataset and the cluster center to which it belongs. This distance measures the degree of deviation of the sample point from the cluster core.
[0107] Outlier Identification: Based on the calculated distance, the smart contract selects the 25 sample points farthest from the cluster center as outliers. Considering the total number of samples in the dataset is 10,000, this screening ratio is 2.5 per thousand, aiming to efficiently identify data points that significantly deviate from the clustering trend.
[0108] Storing Outlier Coordinates: The smart contract outputs and stores the 25 identified outliers and their specific coordinates within the dataset on the blockchain, ensuring data transparency and immutability. This storage step not only records the original data locations of the outliers but also facilitates further processing of these unique data points by other smart contracts or system modules.
[0109] Optionally, the coordinates of the outliers finally outputted can be seen in Table 2.
[0110] Table 2
[0111]
[0112]
[0113] After data preprocessing, cluster modeling, and outlier detection, the fourth phase of the smart contract focuses on returning the visualization results and specific coordinate information of the outliers to the client to intuitively display the analysis results. The implementation process of this phase is as follows:
[0114] Graphing a two-dimensional coordinate system: The smart contract selects "deposit and loan status" and "number of products used" as two key dimensions and constructs a two-dimensional coordinate system to depict the locations of cluster centers and outliers. This choice helps to visually demonstrate the distribution of bank customers along these two dimensions.
[0115] Cluster centers and outliers are marked: In the constructed coordinate map, cluster centers are clearly marked with asterisks, while outliers are represented by plus signs. This intuitive visualization method allows users to quickly identify the core areas of clusters and outliers.
[0116] Returning Outlier Coordinates: The smart contract returns the coordinates of identified outliers, along with their specific locations within the dataset, to the client via an encrypted secure channel. These coordinates clearly indicate which data points are considered outliers, facilitating further analysis and processing.
[0117] Data Reversal Preprocessing and Display: After receiving the outlier coordinates, the client undergoes reverse preprocessing and denormalization. This process aims to restore the normalized data to its original state for easier understanding and analysis by business personnel. Specifically, this involves converting normalized values back to their original values and converting coded fields such as region and gender into readable text.
[0118] Client data display: Finally, the client presents the reverse-processed data, including customer credit score, region, gender, age, user banking history, deposit and loan details, product usage, credit card holding status, user activity level, and income estimation, to business analysts in a user-friendly interface, facilitating in-depth research on the characteristics and impact of outliers.
[0119] in, Figure 4 is a schematic diagram of an outlier according to an embodiment of the present application, such as Figure 4 As shown, cluster centers are marked with asterisks and outliers are marked with “+” signs.
[0120] In an optional embodiment, before signing the transaction proposal through the client and submitting the signed transaction proposal to the sorting role node of the blockchain, the blockchain-based user data processing method further includes: receiving, through the client, response information from X endorsing nodes to the transaction proposal, where X is an integer greater than 1, and the response information includes the execution result of the smart contract by the endorsing node and signature information of the endorsing node on the transaction proposal; performing, through the client, a consistency check on the response information of the X endorsing nodes to the transaction proposal, where the consistency check is used to detect whether the transaction proposal is supported by at least Y endorsing nodes out of the X endorsing nodes, where Y is a positive integer less than or equal to X; if the transaction proposal is supported by at least Y endorsing nodes, determining that the transaction proposal meets a consistency condition; if the transaction proposal is not supported by at least Y endorsing nodes, determining that the transaction proposal does not meet the consistency condition.
[0121] Optionally, when a client submits a transaction proposal to the blockchain network, the proposal is broadcast to multiple endorsing nodes. The number of endorsing nodes, X, is pre-set and greater than 1, meaning that at least two or more endorsing nodes will participate in the execution and verification of the proposal. Each endorsing node executes the smart contract logic specified in the proposal and returns two key pieces of information: the smart contract execution result and the node's signature on the transaction proposal. This information serves as the basis for further review and decision-making by the client. After receiving responses from X endorsing nodes, the client performs a consistency check to ensure sufficient support for the proposal. This consistency check sets a threshold, Y (where Y is a positive integer less than or equal to X), requiring a proposal to receive positive responses from at least Y endorsing nodes. This threshold is set to prevent errors or malicious behavior by a few nodes from influencing the decision-making process of the entire network. If a proposal receives support from at least Y endorsing nodes, the client determines that the proposal meets the consistency criteria. Otherwise, the proposal is considered inconsistent and may need to be resubmitted or revised.
[0122] During the consistency check, the client verifies the signatures of the endorsing nodes to confirm the source and integrity of the response. It also compares the execution results of each endorsing node to ensure consistency. If the results are consistent and the number of endorsing nodes supporting the proposal reaches a threshold of Y, the client deems the proposal valid and can proceed with the subsequent consensus process and write it to the blockchain ledger. Ultimately, the client uses the consistency check results to determine whether the transaction proposal meets the network's consistency criteria. If the proposal is supported by at least Y endorsing nodes—that is, the execution results are consistent and the signatures are valid—the client determines that the proposal meets the consistency criteria. Conversely, if the proposal does not receive support from at least Y endorsing nodes, the client determines that the proposal does not meet the consistency criteria. In this case, the proposal may need to be withdrawn, or the client may need to resubmit the proposal, possibly with modifications to the proposal content, in order to gain more support. Proposals that do not meet the consistency criteria cannot be further executed and verified on the blockchain network, ensuring network stability and security.
[0123] In an optional embodiment, consensus is reached on the signed transaction proposals through the sorting role nodes, and all consensus results are sorted according to the generation time of the consensus results; based on the sorting results of the consensus results, the data on which consensus has been achieved in the transaction proposals is packaged into blocks and sent to the submission node of the blockchain, including: detecting whether the signature information of the transaction proposal is correct and whether there is any missing information in the transaction proposal through the sorting role nodes; when it is detected that the signature information of the transaction proposal is correct and there is no missing information in the transaction proposal, consensus is reached on the data in the transaction proposal through multiple sorting role nodes to obtain at least one consensus result, wherein each consensus result represents whether multiple sorting role nodes have reached consensus on part of the data in the transaction proposal; based on the generation time of each consensus result, the data on which consensus has been achieved in the transaction proposals is packaged into blocks and sent to the submission node of the blockchain.
[0124] Optionally, when a transaction proposal is submitted by a client, it first undergoes a preliminary check by the ordering service node. The ordering service node verifies the signature information in the proposal. This serves as the first line of defense to ensure the authenticity of the proposal's source and prevent data tampering. The signature information is generated by the client and uses an asymmetric encryption algorithm to ensure that only the client holding the correct private key can generate a valid signature. Furthermore, the ordering service node checks the proposal for missing information and ensures that the proposal is complete and all necessary parameters and smart contract identifiers are correctly included, preparing for the subsequent consensus process. Transaction proposals that pass signature and integrity verification are broadcast to multiple ordering service nodes in the network. These nodes then reach consensus on the data in the proposal based on the network's consensus algorithm, ensuring that all nodes agree on the proposed data. The consensus process may involve multiple stages, ultimately generating at least one consensus result. Each consensus result reflects the degree of agreement among network nodes on specific data or operations in the proposal. Once multiple ordering service nodes reach consensus on the data in the transaction proposal, the next step is to sort the data based on the time when the consensus result was generated. Time ordering is crucial in distributed ledger systems. It ensures that the order in which transactions are executed matches the order in which they are submitted, preventing data inconsistencies caused by transaction conflicts and time differences. The timestamp mechanism, combined with the consensus algorithm, provides blockchain networks with accurate data timing, maintaining the integrity and consistency of the ledger.
[0125] In an optional embodiment, the commit node detects whether the data state of each data item in the block conflicts with the state of the blockchain. If it is detected that the data state of each data item in the block does not conflict with the state of the blockchain, the data state of the data in the block is determined to match the state of the blockchain, and the hash value of the block is linked to the hash value of the block already recorded on the blockchain, thereby appending the block to the blockchain. If it is detected that the data state of at least one data item in the block conflicts with the state of the blockchain, the data state of the data in the block is determined to be mismatched with the state of the blockchain, and the hash value of the block is prohibited from being linked to the hash value of the block already recorded on the blockchain.
[0126] Optionally, after the consensus process is complete and a new block is generated, it is submitted to the blockchain network's commit nodes. The commit nodes perform a critical task: checking whether the data state of each data module (transaction) in the new block conflicts with the current state of the blockchain ledger. Data state conflicts can arise from a variety of reasons, including but not limited to duplicate transactions from the same account, invalid transactions due to insufficient account balances, and execution failures caused by unsatisfied smart contract conditions. This checking step ensures that the transaction data in the new block matches the current state of the ledger, preventing the writing of inconsistent or invalid data. If every data state in the new block passes the conflict check, meaning it fully matches the state of the blockchain ledger without any conflicts being detected, the commit node confirms that the data state of the new block matches the state of the blockchain. Next, the hash value of the new block (a unique digital fingerprint generated by the block's content) is linked to the hash value of the previous block already recorded in the blockchain. This linking mechanism is the foundation of the blockchain's chained data structure, ensuring that the addition of new blocks does not disrupt the integrity of the blockchain and the continuity of data. The hash value of the new block is linked to the hash value of the previous block, forming a seamless data chain. The new block is appended to the blockchain to complete the distributed storage of data and the update of the consensus status.
[0127] However, if the state of at least one piece of data in a new block is detected to conflict with the state of the blockchain, the committing node immediately determines that the new block does not match the blockchain state. In this case, the hash value of the new block is not linked to the blockchain's chain structure, and the new block is prevented from being written to the ledger. This mechanism protects the accuracy and consistency of the ledger, prevents the widespread dissemination of erroneous or inconsistent data, and ensures the robustness and security of the blockchain network.
[0128] In an optional embodiment, updating the world state database corresponding to the blockchain includes: obtaining all key-value pairs related to the data in the block in the update ledger of the blockchain; and updating the world state database according to the state information of the key-value pairs.
[0129] Optionally, after a new block is validated and successfully added to the blockchain, all transaction data contained in the block is read and parsed. In blockchains, transaction data is typically represented as key-value pairs, where the key represents a unique identifier for the data, and the value contains the specific transaction information or state update. During this step, the commit node extracts all transaction-related key-value pairs from the new block in preparation for the subsequent update of the world state database. The extracted key-value pairs are further parsed to understand their state information. This state information reflects the results of transaction execution, including but not limited to account balance updates, contract status changes, and data record modifications. During this phase, the commit node verifies the correctness and validity of this state information, ensuring that it complies with the rules of the blockchain ledger and the logic of the smart contract. This verification process is a critical step in ensuring the security and consistency of the ledger. Once the key-value state information passes verification, the commit node updates the world state database based on this state information. The world state database is a lightweight database that stores the latest state of all keys in the blockchain ledger. Updating the world state database means synchronizing the state information in the new block to the database, ensuring that the database reflects the latest distributed ledger state. This update process is instantaneous, ensuring the real-time and efficiency of the blockchain system.
[0130] In an optional embodiment, consensus is reached on the signed transaction proposal through the sorting role node, including: determining Z speaker nodes based on the Z dimensions of user data in the transaction proposal, wherein Z is an integer greater than 1, the speaker node belongs to the sorting role node, and each speaker node is responsible for the consensus process of variable data of one dimension; after the consensus process is initiated by the speaker node, consensus operations are performed on the variable data of one dimension that the speaker node is responsible for through multiple councilor nodes corresponding to the speaker node, wherein the councilor nodes belong to the sorting role nodes that maintain communication connection with the speaker node.
[0131] Given the massive scale of bank customer churn data processed by this solution, reaching millions, a speaker node mechanism based on the Delegated Byzantine Fault Tolerant consensus algorithm can be employed. The speaker node mechanism distributes data by variable dimensions, assigning a speaker node to each dimension to be responsible for the consensus process for the data in that dimension. For example, if user data involves 11 key variables (customer credit score, user region, user gender, age, user banking experience, deposit and loan status, number of products used, credit card holding status, user activity, income estimate, and outlier information), each key variable will have a dedicated speaker node. This design reduces the overall pressure on the system during data analysis and improves the efficiency of the consensus process.
[0132] In addition, the mechanism for selecting the speaker node according to the variable dimension and its consensus algorithm process include the determination of the list of members, the selection of the speaker, the initiation of consensus, the participation of members, and the update of views. The list of members is composed of the variables involved in the execution of the smart contract. The speaker selection algorithm is based on the current variable data volume, view number and number of nodes, and determines the subscript through modular operation to ensure fairness and randomness. After the speaker initiates the consensus, if the time interval meets the set conditions (for example, 10 seconds), the consensus process will be started immediately. After receiving the consensus request from the speaker, the member node will first perform public key verification to ensure the reliability of the information source, and then participate in the consensus process.
[0133] The optimization points of the consensus algorithm lie in two aspects: first, by selecting the speaker node to reach consensus on specific variables, the pressure of big data processing on the system consensus mechanism is reduced; second, the update mechanism of the speaker node ensures the dynamic adjustment of the speaker role, avoids the consensus deviation that may be caused by a single node controlling the speaker position for a long time, and improves the accuracy of the consensus process and the overall robustness of the system.
[0134] In an optional embodiment, the process of determining the i-th speaker node among Z speaker nodes includes the following steps: obtaining the data volume of the variable data of the i-th dimension in the user data, where i is an integer less than or equal to Z; obtaining the view number of the client, where the view number is the identifier of the view layer of the client; obtaining the number of all nodes in the blockchain that can serve as councilor nodes; determining the node subscript value based on the data volume of the variable data of the i-th dimension, the view number, and the number of all nodes in the blockchain that can serve as councilor nodes; and using the node in the blockchain corresponding to the node subscript value as the i-th speaker node.
[0135] Optionally, Figure 5 This is an overall architecture diagram of an optional blockchain-based user data processing system according to an embodiment of the present application. Figure 5 As shown, the user data processing system includes a client, SDK components, and a blockchain network. The client includes a view layer and a control layer; the SDK component enables interaction between the client and the database. The blockchain network includes chaincode, a ledger, a state database, and a history database. The ledger contains blocks, and block status updates must be synchronized to the state database and history database.
[0136] Alternatively, the following formula (1) can be used to calculate the index value of the i-th speaker node:
[0137] Mod(s+1-v,Q)(1)
[0138] In formula (1), Mod is the remainder function, which is to calculate the remainder after dividing (s+1-v) by Q, s refers to the amount of variable data in the i-th dimension, v refers to the current view number, and Q refers to the number of nodes of the councilor node.
[0139] Optionally, after the chairperson node updates the view number, if the current time since the last new block was written exceeds the predetermined interval between each consensus round (e.g., 10 seconds), a new round of consensus will begin immediately. Otherwise, consensus will be initiated after the interval. The next step is the process of the councilor nodes participating in the consensus. When the chairperson node initiates the consensus, it will be broadcast to the councilor nodes. At this point, the councilor nodes will receive the transaction proposal and begin to verify the public key of the transaction proposal before reaching consensus.
[0140] In an optional embodiment, after the node corresponding to the node subscript value in the blockchain is used as the i-th chairman node, the blockchain-based user data processing method also includes: when the client's view number is updated and the blockchain has not reached a consensus on the variable data of the i-th dimension, initiating a view update request through any member node, wherein the view update request is used to request to determine a new chairman node based on the number of variable data in the i-th dimension, the latest view number, the total number of member nodes and a preset ratio; wherein the preset ratio is used to adjust the number of variable data in the i-th dimension; when the view update request is supported by the consensus of the target number of member nodes, the i-th chairman node is updated.
[0141] Optionally, when a view lifecycle is completed, if consensus has not been reached, a broadcast request (corresponding to the above view update request) is sent through the parliamentarian node to enter the next view cycle and re-select the chairman node. When re-selecting the chairman node, a percentage (corresponding to the above preset ratio) is selected, and then the subscript of the new chairman node is calculated using the following formula (2):
[0142] Mod(s*c+1-v1,Q)(2)
[0143] In formula (2), Mod is the modulo function, s is the amount of variable data in the i-th dimension, c is the preset ratio, and v1 is the latest view number. When a request to update a view is supported by two-thirds of the councilor nodes, the entire network reaches a consensus and enters the next view cycle to re-consensus.
[0144] It should be noted that the consensus algorithm is optimized for two main points. The first is to select the speaker node based on the variable data, and reduce the impact of big data processing on the system consensus through the speaker system. The second is the speaker node update system. Timely updates of the speaker are conducive to reducing the hidden dangers of malicious nodes occupying the speaker position due to the speaker not being updated, thereby improving the accuracy of the consensus.
[0145] In an optional embodiment, Figure 6 This is a schematic diagram of an optional blockchain network structure according to an embodiment of the present application, such as Figure 6 As shown in the figure, the blockchain network includes: CA certificate management component, MSP, orderer node, channel channel, peer0 node and peer1 node, among which each peer node corresponds to a chain code and a ledger.
[0146] In an optional embodiment, Table 3 shows the data structure of variable data in user data:
[0147] Table 3
[0148]
[0149]
[0150] Alternatively, as Figure 7 As shown, an optional transaction proposal processing flow is as follows:
[0151] Step 1: The client calls the membership service through the SDK to register and enroll, and the user obtains the identity certificate from it.
[0152] In step 2, the client initiates a transaction proposal to the blockchain network through the SDK. The transaction proposal sends information such as the smart contract identifier to be called for this transaction, the contract method (the specific implementation logic of the smart contract method), parameter information (the required input items for calling the corresponding smart contract and the input flag that can uniquely identify the smart contract), and the client signature (an identifier that can identify which transaction channel the client is in and a label for verifying identity) to the endorsing node.
[0153] In step 3, after receiving the transaction proposal, the endorsing node verifies the signature and confirms whether the submitter has the authority to perform the operation. At the same time, it simulates the execution of the smart contract according to the endorsement policy and returns the result and its respective CA signature to the application client (i.e., responds to the transaction proposal).
[0154] In step 4, after receiving the information returned by the endorsement node, the client determines the acquiring transaction scenario to which the transaction belongs, whether the proposal result is consistent, and whether it is executed in accordance with the specified endorsement policy. The client packages the data together to form the transaction data, signs it, and sends it to the sorting role node.
[0155] In step 5, the sorting role node performs consensus sorting on the received transaction data, and finally packages a batch of transaction data together according to the block generation strategy, generates a new block, and sends it to the commit node.
[0156] Step 6: After receiving the block, the commit node will verify each transaction data in the block to check whether the input and output that the transaction data depends on are consistent with the current state of the blockchain. After completion, the block will be appended to the local blockchain and the world state will be modified.
[0157] According to another aspect of the present application, a user data processing device based on blockchain is also provided, such as Figure 8 As shown, the blockchain-based user data processing device includes: a first processing unit 801, a second processing unit 802, a third processing unit 803, and a fourth processing unit 804.
[0158] Optionally, a first processing unit 801 is configured to initiate a transaction proposal to a blockchain through a client, wherein the transaction proposal includes at least smart contract information and user data of lost users of a financial institution; a second processing unit 802 is configured to execute a smart contract through an endorsement node in the blockchain, and when it is determined that the transaction proposal satisfies a consistency condition, sign the transaction proposal through the client, and submit the signed transaction proposal to a sorting role node in the blockchain, wherein the sorting role node is a node in the blockchain that participates in consensus decision-making; a third processing unit 803 is configured to reach consensus on the signed transaction proposal through the sorting role node, and sort all consensus results according to the generation time of the consensus results; based on the sorting result of the consensus results, the data in the transaction proposal that has completed consensus is packaged into a block and sent to a submission node in the blockchain; a fourth processing unit 804 is configured to append the block to the blockchain through the submission node when the submission node determines that the data state of the data in the block matches the state of the blockchain, and update the world state database corresponding to the blockchain.
[0159] Optionally, the first processing unit 801 includes: a registration subunit, used to register an identity certificate through the client, wherein the identity certificate is used to indicate that the client has the authority to access the blockchain to process transaction proposals; and a sending subunit, used to periodically initiate transaction proposals to the blockchain through the client after the client successfully registers the identity certificate.
[0160] Optionally, the blockchain-based user data processing device also includes: a first verification unit, used to verify the client signature in the transaction proposal based on the client public key in the transaction proposal, wherein the condition for the client signature verification to pass is that the client public key matches the client private key; a first detection unit, used to check whether the submitter of the transaction proposal has the authority to execute the smart contract through the endorsement node after the client signature verification passes; a simulation detection unit, used to simulate the execution of the operation logic defined in the smart contract according to the content of the transaction proposal through the endorsement node when it is determined that the submitter has the authority to execute the smart contract, wherein the simulated execution is used to verify whether the logic of the smart contract conflicts with the transaction rules of the blockchain without changing the actual ledger state of the blockchain.
[0161] Optionally, the blockchain-based user data processing device also includes: a first determination unit, used to execute a smart contract through an endorsement node in the blockchain, and determine variable data from the user data, wherein the variable data includes at least the credit score and geographic location data of the lost user; a second determination unit, used to determine outliers in the user data based on the variable data, wherein the similarity between the data corresponding to the outliers and the data corresponding to the non-outliers is less than a preset threshold; a third determination unit, used to take the outliers and the data positions corresponding to the outliers in the user data as target data; an encapsulation unit, used to encapsulate the target data through the signature of the endorsement node, and send the encapsulated target data to the client; a deletion unit, used to delete the data corresponding to the outliers from the user data in response to the outlier deletion instruction received by the client.
[0162] Optionally, the blockchain-based user data processing apparatus further includes: a receiving unit, configured to receive, through a client, response information from X endorsing nodes to a transaction proposal, where X is an integer greater than 1, and the response information includes an execution result of the smart contract by the endorsing node and signature information of the endorsing node on the transaction proposal; a consistency checking unit, configured to perform, through the client, a consistency check on the response information from the X endorsing nodes to the transaction proposal, where the consistency check is configured to detect whether the transaction proposal is supported by at least Y of the X endorsing nodes, where Y is a positive integer less than or equal to X; a fourth determining unit, configured to determine that the transaction proposal satisfies a consistency condition if the transaction proposal is supported by at least Y endorsing nodes; and a fifth determining unit, configured to determine that the transaction proposal does not satisfy the consistency condition if the transaction proposal does not receive support from at least Y endorsing nodes.
[0163] Optionally, the third processing unit 803 includes: a first detection subunit, used to detect whether the signature information of the transaction proposal is correct and whether there is any missing information in the transaction proposal through the sorting role node; a consensus subunit, used to, when detecting that the signature information of the transaction proposal is correct and there is no missing information in the transaction proposal, reach consensus on the data in the transaction proposal through multiple sorting role nodes to obtain at least one consensus result, wherein each consensus result represents whether the multiple sorting role nodes reach a consensus on part of the data in the transaction proposal; a block generation subunit, used to package the data on which consensus has been reached in the transaction proposal into blocks according to the generation time of each consensus result and send them to the submission node of the blockchain.
[0164] Optionally, the fourth processing unit 804 includes: a second detection subunit, used to detect whether the data status of each data in the block conflicts with the status of the blockchain through the submission node; a first determination subunit, used to determine that the data status of the data in the block matches the status of the blockchain when it is detected that the data status of each data in the block does not conflict with the status of the blockchain, and link the hash value of the block with the hash value of the block recorded in the blockchain to append the block to the blockchain; a second determination subunit, used to determine that the data status of the data in the block does not match the status of the blockchain when it is detected that the data status of at least one data in the block conflicts with the status of the blockchain, and prohibit linking the hash value of the block with the hash value of the block recorded in the blockchain.
[0165] Optionally, the fourth processing unit 804 includes: a first acquisition subunit, used to obtain all key-value pairs related to the data in the block in the update ledger of the blockchain; and an update subunit, used to update the world state database according to the state information of the key-value pairs.
[0166] Optionally, the third processing unit 803 includes: a third determination sub-unit, used to determine Z speaker nodes based on Z dimensions of user data in the transaction proposal, wherein Z is an integer greater than 1, the speaker node belongs to the sorting role node, and each speaker node is responsible for the consensus process of variable data of one dimension; a consensus operation sub-unit, used to perform consensus operations on the variable data of one dimension that the speaker node is responsible for through multiple councilor nodes corresponding to the speaker node after initiating the consensus process through the speaker node, wherein the councilor nodes belong to the sorting role nodes that maintain communication connection with the speaker node.
[0167] Optionally, the third determination subunit includes: a first acquisition module, used to obtain the data volume of the variable data of the i-th dimension in the user data, wherein i is an integer less than or equal to Z; a second acquisition module, used to obtain the view number of the client, wherein the view number is the identifier of the view layer of the client; a third acquisition module, used to obtain the number of all nodes in the blockchain that can serve as councilor nodes; a first determination module, used to determine the node subscript value based on the data volume of the variable data of the i-th dimension, the view number and the number of all nodes in the blockchain that can serve as councilor nodes; a first processing module, used to use the node in the blockchain corresponding to the node subscript value as the i-th speaker node.
[0168] Optionally, the blockchain-based user data processing device also includes: a view update unit, which is used to initiate a view update request through any member node when the view number of the client is updated and the blockchain has not reached a consensus on the variable data of the i-th dimension, wherein the view update request is used to request to determine a new chairman node based on the number of variable data in the i-th dimension, the latest view number, the total number of member nodes and a preset ratio; wherein the preset ratio is used to adjust the number of variable data in the i-th dimension; a node update unit, which is used to update the i-th chairman node when the view update request is supported by the consensus of the target number of member nodes.
[0169] According to another aspect of the present application, a computer-readable storage medium is also provided, wherein the computer-readable storage medium includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the above-mentioned blockchain-based user data processing method.
[0170] According to another aspect of the present application, an electronic device is also provided, wherein the electronic device includes: a memory storing an executable program; and a processor for running the program, wherein the above-mentioned blockchain-based user data processing method is executed when the program is running.
[0171] According to another aspect of the present application, a computer program product is also provided, comprising computer instructions, wherein when the computer instructions are executed by a processor, the above-mentioned blockchain-based user data processing method is implemented.
[0172] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0173] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0174] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0175] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
Claims
1. A user data processing method based on blockchain, characterized in that: include: Initiating a transaction proposal to the blockchain through the client, wherein the transaction proposal includes at least smart contract information and user data of the churned users of the financial institution; The smart contract is executed by the endorsing node in the blockchain. If the transaction proposal satisfies the consistency condition, the transaction proposal is signed by the client and submitted to the sorting role node of the blockchain. The sorting role node is a node in the blockchain that participates in consensus decision-making. The signed transaction proposal is reached consensus by the sorting role node, including: determining Z speaker nodes according to Z dimensions of user data in the transaction proposal, wherein Z is an integer greater than 1, the speaker node belongs to the sorting role node, and each speaker node is responsible for the consensus process of variable data of one dimension; after the consensus process is initiated by the speaker node, a consensus operation is performed on the variable data of one dimension that the speaker node is responsible for by multiple councilor nodes corresponding to the speaker node, wherein the councilor nodes belong to the sorting role nodes that maintain communication connection with the speaker node, and all the consensus results are sorted according to the generation time of the consensus results; according to the sorting result of the consensus results, the data that have completed the consensus in the transaction proposal are packaged into blocks and sent to the submission node of the blockchain; When the commit node determines that the data state of the data in the block matches the state of the blockchain, appending the block to the blockchain through the commit node includes: detecting, through the commit node, whether the data state of each data in the block conflicts with the state of the blockchain; when it is detected that the data state of each data in the block does not conflict with the state of the blockchain, determining that the data state of the data in the block matches the state of the blockchain, and linking the hash value of the block with the hash value of the block already recorded in the blockchain, so as to append the block to the blockchain and update the world state database corresponding to the blockchain; The blockchain-based user data processing method also includes: executing the smart contract through the endorsement node in the blockchain, determining variable data from the user data, wherein the variable data at least includes the credit score and geographic location data of the lost user; determining outliers in the user data based on the variable data, wherein the similarity between the data corresponding to the outliers and the data corresponding to the non-outliers is less than a preset threshold; using the outliers and the data positions corresponding to the user data as target data; encapsulating the target data through the signature of the endorsement node, and sending the encapsulated target data to the client; and deleting the data corresponding to the outliers from the user data in response to the outlier deletion instruction received by the client.
2. The user data processing method based on blockchain according to claim 1 is characterized in that: Initiate a transaction proposal to the blockchain through the client, including: Registering an identity certificate through the client, wherein the identity certificate is used to indicate that the client has the authority to access the blockchain to process the transaction proposal; After the client successfully registers the identity certificate, the transaction proposal is regularly initiated to the blockchain through the client.
3. The user data processing method based on blockchain according to claim 1 is characterized in that: Before executing the smart contract through the endorsement node in the blockchain, the blockchain-based user data processing method further includes: Verifying the client signature in the transaction proposal based on the client public key in the transaction proposal, where the client signature verification passes if the client public key matches the client private key; After the client signature is verified, the endorsement node checks whether the submitter of the transaction proposal has the authority to execute the smart contract; When it is determined that the submitter has the authority to execute the smart contract, the endorsement node simulates the execution of the operational logic defined in the smart contract based on the content of the transaction proposal, wherein the simulated execution is used to verify whether the logic of the smart contract conflicts with the transaction rules of the blockchain without changing the actual ledger state of the blockchain.
4. The user data processing method based on blockchain according to claim 1 is characterized in that: Before signing the transaction proposal through the client and submitting the signed transaction proposal to the sorting role node of the blockchain, the blockchain-based user data processing method further includes: Receiving, through the client, response information from X of the endorsing nodes regarding the transaction proposal, where X is an integer greater than 1, and the response information includes the execution result of the endorsing node on the smart contract and the signature information of the endorsing node on the transaction proposal; performing, by the client, a consistency check on response information of the X endorsing nodes to the transaction proposal, wherein the consistency check is used to detect whether the transaction proposal is supported by at least Y of the X endorsing nodes, where Y is a positive integer less than or equal to X; If the transaction proposal is supported by at least Y of the endorsing nodes, determining that the transaction proposal satisfies the consistency condition; If the transaction proposal is not supported by at least Y of the endorsing nodes, it is determined that the transaction proposal does not meet the consistency condition.
5. The user data processing method based on blockchain according to claim 1 is characterized in that: The sorting role node reaches a consensus on the signed transaction proposals and sorts all the consensus results according to the generation time of the consensus results; According to the ranking result of the consensus result, the consensus data in the transaction proposal is packaged into blocks and sent to the submission node of the blockchain, including: The sorting role node detects whether the signature information of the transaction proposal is correct and whether there is any missing information in the transaction proposal; Upon detecting that the signature information of the transaction proposal is correct and that there is no missing information in the transaction proposal, the plurality of ordering role nodes conduct consensus on the data in the transaction proposal to obtain at least one consensus result, wherein each consensus result indicates whether the plurality of ordering role nodes have reached consensus on a portion of the data in the transaction proposal; According to the generation time of each consensus result, the data that has completed consensus in the transaction proposal is packaged into blocks and sent to the submission node of the blockchain.
6. The user data processing method based on blockchain according to claim 1 is characterized in that: The blockchain-based user data processing method further includes: In the event that a conflict is detected between the data state of at least one data in the block and the state of the blockchain, it is determined that the data state of the data in the block does not match the state of the blockchain, and linking the hash value of the block with the hash value of the block already recorded in the blockchain is prohibited.
7. The user data processing method based on blockchain according to claim 1 is characterized in that: Update the world state database corresponding to the blockchain, including: Obtaining all key-value pairs related to the data in the block in the updated ledger of the blockchain; The world state database is updated according to the state information of the key-value pairs.
8. The user data processing method based on blockchain according to claim 1 is characterized in that: The process of determining the i-th chairman node among the Z chairman nodes includes the following steps: Obtaining the data volume of variable data of the i-th dimension in the user data, where i is an integer less than or equal to Z; Obtaining a view number of the client, wherein the view number is an identifier of a view layer of the client; Obtain the number of all nodes in the blockchain that can serve as the councilor nodes; Determine a node index value according to the amount of variable data in the i-th dimension, the view number, and the number of all nodes in the blockchain that can serve as the councilor nodes; The node corresponding to the node index value in the blockchain is used as the i-th speaker node.
9. The user data processing method based on blockchain according to claim 8 is characterized in that: After the node corresponding to the node index value in the blockchain is used as the i-th speaker node, the blockchain-based user data processing method further includes: When the view number of the client is updated and the blockchain has not reached a consensus on the variable data of the i-th dimension, a view update request is initiated through any of the councilor nodes, wherein the view update request is used to request the determination of a new chairperson node based on the amount of variable data of the i-th dimension, the latest view number, the total number of councilor nodes, and a preset ratio; wherein the preset ratio is used to adjust the amount of variable data of the i-th dimension; When the view update request is supported by consensus of the target number of parliamentarian nodes, the i-th speaker node is updated.
10. A user data processing device based on blockchain, used to execute the user data processing method based on blockchain according to any one of claims 1 to 9, characterized in that: include: A first processing unit is configured to initiate a transaction proposal to the blockchain via a client, wherein the transaction proposal includes at least smart contract information and user data of churned users of the financial institution; a second processing unit, configured to execute the smart contract through an endorsing node in the blockchain, and if it is determined that the transaction proposal satisfies a consistency condition, sign the transaction proposal through the client, and submit the signed transaction proposal to a sorting role node in the blockchain, wherein the sorting role node is a node in the blockchain that participates in consensus decision-making; A third processing unit is configured to reach consensus on the signed transaction proposals through the sorting role node, and sort all the consensus results according to the generation time of the consensus results; based on the sorting result of the consensus results, package the consensus data in the transaction proposals into blocks and send them to the submission node of the blockchain; and a fourth processing unit, configured to append the block to the blockchain through the submission node and update a world state database corresponding to the blockchain when the submission node determines that the data state of the data in the block matches the state of the blockchain.
11. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored executable program, wherein, when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the blockchain-based user data processing method according to any one of claims 1 to 9.
12. An electronic device, characterized in that: include: a memory storing an executable program; A processor, configured to run the program, wherein when the program is run, the processor executes the blockchain-based user data processing method according to any one of claims 1 to 9.
13. A computer program product comprising computer instructions, characterized in that When the computer instructions are executed by the processor, the steps of the blockchain-based user data processing method according to any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
Method and equipment for implementing blockchain operating smart contract
CN108769173A
Transaction processing method of block chain network and blockchain network
CN110544095A