Detailed Description
In order that those skilled in the art will better understand the present application, a technical solution in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be further noted that, the collected information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for presentation, analyzed data, etc.) related to the present application are information and data authorized by the user or sufficiently authorized by each party, and the collection, storage, use, processing, transmission, provision, disclosure, application, etc. of the related data all comply with the relevant laws and regulations and standards, necessary security measures are adopted, no prejudice to the public order, and corresponding operation entries are provided for the user to select authorization or rejection. If an interface is arranged between the system and the related user or institution, a corresponding operation inlet is provided for the user, so that the user can choose to agree or reject the automatic decision result; if the user selects refusal, the expert decision flow is entered.
In accordance with an embodiment of the present application, there is provided an embodiment of a blockchain-based user data processing method, it being noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system, such as a set of computer executable instructions, and that although a logical order is illustrated in the flowcharts, in some cases the steps illustrated or described may be performed in an order other than that illustrated herein.
The method embodiments provided by the embodiments of the present application may be performed in a mobile terminal, a computer terminal, or similar computing device. Fig. 1 shows a block diagram of a hardware architecture of a computer terminal (or mobile device) for implementing a blockchain-based user data processing method. As shown in fig. 1, the computer terminal 10 (or mobile device) may include one or more (shown in the figures as 102a,102 b.) processors 102 (the processors 102 may include, but are not limited to, a microprocessor MCU or a programmable logic device FPGA or the like processing means), a memory 104 for storing data, and a transmission means 106 for communication functions. Among other things, 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 appreciated by those of ordinary skill in the art that the configuration shown in fig. 1 is merely illustrative and is not intended to limit the configuration of the electronic device described above. For example, the computer terminal 10 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
It should be noted that the one or more processors 102 and/or other data processing circuits described above may be referred to generally herein as "data processing circuits. The data processing circuit may be embodied in whole or in part in software, hardware, firmware, or any other combination. Furthermore, the data processing circuitry may be a single stand-alone processing module, or incorporated, in whole or in part, into any of the other elements in the computer terminal 10 (or mobile device). The data processing circuit acts as a processor control (e.g., selection of a variable resistance termination path for interfacing) in a blockchain-based user data processing method as referred to in embodiments of the present application.
The memory 104 may be used to store software programs and modules of application software, such as program instructions/data storage devices corresponding to the blockchain-based user data processing method in the embodiment of the present application, and the processor 102 executes the software programs and modules stored in the memory 104 to perform various functional applications and data processing, i.e., implement the blockchain-based user data processing method described above. Memory 104 may include high-speed random access memory, 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, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission means 106 is arranged to receive or transmit data via a network. The specific examples of the network described above may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module for communicating with the internet wirelessly.
The display may be, for example, a touch screen type Liquid Crystal Display (LCD) that may enable a user to interact with a user interface of the computer terminal 10 (or mobile device).
Some key terms in the embodiments of the present application are explained below:
Blockchain refers to a chain that consists of blocks one after the other. Each block holds certain information, which are linked in a chain according to the respective time sequence generated. This chain is kept in all file servers, and the entire blockchain is secure as long as one server can work in the entire system. These servers, referred to as nodes in the blockchain, provide storage space and computational power support for the entire blockchain system. If the blockchain information is to be modified, half of the nodes must be informed of the consent and the information of all the nodes must be modified, which are usually held in different subject hands, so it is an extremely difficult matter to tamper with the blockchain information.
Decentralizing, typically refers to running on a distributed network, where participants' information is secured (possibly anonymized as well).
The de-centering system has three advantages:
1. fault tolerance-the decentralized system is less likely to cease operation due to some local unexpected failure.
2. Attack resistance-the cost of attacking and damaging the decentralised system is higher relative to the decentralised system.
3. Anti-snagging properties it is difficult for participants in the de-centralised system to snag each other.
Asymmetric encryption, which is a secret method of a key, two keys, a public key (for short, public key) and a private key (for short, private key) are required for asymmetric encryption. The public key and the private key are a pair. If the data is encrypted with a public key, it can only be decrypted with the corresponding private key. Because two different keys are used for encryption and decryption, this algorithm is called an asymmetric encryption algorithm.
Member service, providing member service functions including registration, certificate application and the like. In consideration of the requirements of business application on safety, privacy, supervision, audit and performance, the node can only be added into the blockchain network by a member when the member obtains the certificate, so that the safety of the receipt transaction identification function is greatly improved.
The block chain service is responsible for the calculation and storage of the distributed account book, the ordering service among nodes, the endorsement verification management, the realization of the account book storage mode and the like, is a core component of the block chain, and provides bottom support for the main body function of the block chain.
The chain code service, chain code is also called intelligent contract, is a section of code based on standard, and realizes specific business logic. The chain code and the bottom layer account book are decoupled and run in a separate container, and the updating of the chain code does not affect the original data. The chain code of the order-receiving transaction identification function is written by using java language, is operated through a Docker container, and is connected with nodes in the same channel through gRPC after installation and instantiation.
The interface and the event are called in a mode of providing an API for the third party application, secondary development is convenient, a java language interface is supported, the chain code can be installed and tested in an SDK or CTL mode, the transaction state, data and other functions can be queried, and meanwhile Events occurring in the blockchain network are monitored through Events, so that the calling and processing of a third party application system are convenient.
Network protocol implementing P2P network transport, gPRC and Gossip protocols are used.
Intelligent contracts-a computer protocol that aims to propagate, verify or execute contracts in an informative manner. Smart contracts allow trusted transactions to be made without third parties, which transactions are traceable and irreversible. The purpose of smart contracts is to provide a security approach that is superior to traditional contracts and to reduce other transaction costs associated with the contracts.
And the endorsement node is the node bearing the endorsement task in the blockchain. The endorsement node must prove its legitimacy by signing the expected information of the valid certificate.
Anchor node-in a channel, an anchor node may be discovered and communicate by any node of the channel. Thus, each organization added to the pipeline has at least one anchor node, and a node of one organization can find all nodes of other organizations within the channel by looking up the anchor node.
The leader node is connected to the ordering service node as a representative in the organization, and distributes the blocks received from the ordering service node to other nodes in the organization.
The intelligent contracts of Fabric are called as chain codes, which are divided into system chain codes and user chain codes, wherein the system chain codes are used for realizing the functions of a system layer, and the user chain codes are used for realizing the application functions of users.
Federation chain-a chain federation chain is a blockchain system that is open to certain organizations with pointers. Obviously, this licensing mechanism creates a potential center for the blockchain by allowing only certain specific nodes to connect into the blockchain system. But if a particular transaction only has a particular user in possession of the relevant private key, the decentralization of the coalition chain can be increased.
Consensus algorithm-a series of procedures and rules generated to implement a distributed coherency protocol. After nodes distributed in different fields all carry out negotiation interaction according to the set of rules, a consistent decision is always obtained for a certain/certain problem, so that consistency of different nodes in the distributed nodes is realized.
X.509 is a standard format for public key certificates in cryptography, which X.509 certificate contains a public key, identity information (such as network hostname, organization's name or individual name, etc.), and signature information (signature or self-signature of the certificate issuing authority).
Identity verification, which is also called "verification" and "authentication", means that the user identity is confirmed by a certain means. There are many methods for authentication, and the method adopted in the scheme is based on authentication of a public key encryption algorithm.
Docker is a lightweight virtualization technology, and is an open-source application container running environment building platform, so that an developer can package and apply the application to a container with a movable value in a convenient mode and then install the application on any server running Linux or Windows and other systems. Compared with the traditional virtual machine, the Docker container provides a light-weight virtualization mode, is convenient to install and has high starting speed.
MSP is a modular component abstracted from HYPERLEDGER FABRIC version 1.0 for defining authentication, performing authentication and running rules for accessing the network. Rather, the MSP is a component of HYPERLEDGER FABRIC that performs identity management and authentication of constituent members in the network, including managing user IDs, authenticating nodes that want to join the network, and providing credentials for transactions initiated by customers.
CA is an international generic term for certification authorities, which is an authority that issues, manages, and cancels digital certificates to the applicant of the digital certificates. The CA functions to check the validity of the identity of the holder of the certificate and issue the certificate (digitally signed on the certificate) to prevent the certificate from being counterfeited or tampered with.
The clustering method comprises the steps of dividing data into k groups in advance, randomly selecting k objects as initial clustering centers, calculating the distance between each object and each seed clustering center, and distributing each object to the closest clustering center. For each sample assigned, the cluster center of the cluster is recalculated based on the existing objects in the cluster. This process will repeat until a certain termination condition is met, which may 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 error squared and local minimum.
Outlier detection an outlier is a data object that differs significantly from other data objects, and the system generally suspects that he is being created by a different mechanism and finds out that the process behaves very differently from the intended object is called outlier detection.
The present application provides a blockchain-based user data processing method as shown in fig. 2. FIG. 2 is a flow chart of an alternative blockchain-based user data processing method in accordance with an embodiment of the present application. As shown in fig. 2, the method comprises the steps of:
in step S201, a transaction proposal is initiated to the blockchain through the client, wherein the transaction proposal includes at least intelligent contract information and user data of the churn user of the financial institution.
Alternatively, a client refers to an application that initiates a transaction, invokes a smart contract, or queries for blockchain status. In the present application, the client is an internal system or external application of a financial institution for sending transaction proposal to the blockchain network. The client typically includes an SDK (Software Development Kit ) required to access the blockchain network to interact with the blockchain network and perform related operations.
Optionally, the transaction proposal is an important concept in the blockchain network, and the transaction proposal is the first step of the transaction flow, constructed by the client and sent to the endorsement node. The transaction proposal contains detailed information of the transaction, including smart contracts, contract methods, parameters, and signatures of clients to be executed. Its function is for the endorsement node to verify the legitimacy of the transaction and simulate execution of an intelligent contract to determine whether the transaction is acceptable.
Optionally, the smart contract is a predefined automatically executed program, and the smart contract runs on the blockchain and is capable of automatically executing a specific operation according to a preset condition. In the application, the intelligent contract comprises logic such as data preprocessing, standardization, clustering modeling, outlier detection, result visualization and the like. The execution result of the intelligent contract is confirmed by the endorsement node, and the block chain is written after all nodes reach consensus.
Optionally, the churn user's user data refers to details of the particular churn user that the financial institution wants to analyze, including but not limited to customer credit score, country/region in which the user is located, user gender, age of the user, loan status, number of products used, credit card holding status, active user status, estimated revenue, and possibly outlier information. These data will be input as intelligent contracts, which upon execution will yield corresponding analysis results.
Optionally, the overall architecture of the blockchain in the present application is divided into a network layer, a core layer, and an interface layer. The core layer is provided with member service, blockchain service and chain code service, the interface layer calls information such as identity, account book, transaction, intelligent contract and the like through interfaces and events, and the network layer is responsible for realizing a P2P network so as to ensure consistency of blockchain distributed storage.
Step S202, executing intelligent contracts through endorsement nodes in the blockchain, signing the transaction proposal through a client under the condition that the transaction proposal meets the consistency condition, and submitting the signed transaction proposal to ordering role nodes of the blockchain, wherein the ordering role nodes are nodes participating in consensus decisions in the blockchain.
Optionally, the endorsement node is a Peer node in a blockchain network, the endorsement node being responsible for evaluating the legitimacy of the transaction proposal and executing the code of the intelligent contract. Once the transaction proposal is approved by the endorsement node, they will provide the transaction execution results and their own CA (CERTIFICATE AUTHORITY ) signature, as part of the transaction proposal, back to the client for subsequent consensus processes.
Step S203, the signed transaction proposal is subjected to consensus through the sequencing role node, all consensus results are sequenced according to the generation time of the consensus results, and the data which are subjected to consensus in the transaction proposal are packaged into blocks according to the sequencing results of the consensus results and are sent to the submitting node of the block chain.
Alternatively, consensus is a process in a blockchain network that ensures that all nodes agree on the order and validity of transactions. In a blockchain network, consensus is taken care of by Orderer nodes (corresponding to the ordering role nodes described above) that order collected transaction proposals and generate blocks containing multiple transactions, which are then broadcast to commit nodes in the network (Committer Peers). The submitting node will verify the transaction and write it to the local blockchain ledger.
In step S204, in the case that 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.
Optionally, the submitting node is in a role of a Peer node, and after receiving the Orderer broadcast block, the submitting node performs transaction verification to check whether the execution result of the transaction is consistent with the result provided by the endorsing node, and whether the transaction conflicts with the current ledger state. The verified blobs are appended to the local blockchain and the world state database (World State Database) is updated to reflect the latest ledger state.
Based on the above-mentioned contents of step S201 to step S204, the present application ensures the secure storage and transmission of the lost customer data by the financial institution through the decentralization and encryption mechanism of the blockchain technology. Once data is written to the blockchain, the data will be permanently preserved and cannot be maliciously modified due to its non-tamperability, which greatly improves the security of the data. Secondly, the distributed account book characteristic of the blockchain enables all participants to view transaction histories, and the execution process of the intelligent contract is completely transparent and can be verified by all nodes. The transparency of the whole system is improved, auditability of the data processing process is ensured, financial institutions can track and analyze each step of data processing conveniently, and the trust degree of the data processing is enhanced. In addition, the application automatizes the data processing flow through the intelligent contract, reduces the manual intervention and improves the efficiency and accuracy of data processing. In addition, when the optimized consensus algorithm (such as the Bayesian-tolerant algorithm) processes large-scale data, the transaction confirmation time can be effectively reduced, the consensus process of the data can be accelerated, and the efficient operation of the system in a large-scale data processing scene can be ensured.
In addition, in the present application, the transaction proposal initiated to the blockchain by the client contains intelligent contract information and churn user data. The intelligent complex executes approximately on the endorsement node and is submitted by the client signature after meeting the consistency condition. This process ensures the legitimacy and consistency of data processing and prevents unauthorized data access and tampering. The ordering node orders the transactions according to the generation time of the consensus result, and packages the data with the consensus into blocks, so that the mechanism ensures the ordering and consistency of the data. The submitting node adds the block to the blockchain and updates the world state database after verifying that the block data state matches the blockchain state, which further enhances the security and non-tamper-ability of the data.
In an alternative embodiment, the transaction proposal is initiated to the blockchain through the client, and the method comprises the steps of registering an identity certificate through the client, wherein the identity certificate is used for representing that the client has the authority of accessing the blockchain to process the transaction proposal, and periodically initiating the transaction proposal to the blockchain through the client after the client successfully registers the identity certificate.
Optionally, the client first needs to interact with a Certification Authority (CA) in the network that is responsible for authentication. CA is a key component in a blockchain network for managing digital certificates, verifying the identity of network participants. The client obtains an x.509 digital certificate via the CA, which contains the client's public key and other identity information signed by the CA, such as the organization and role the client belongs to. Acquisition of credentials typically requires the client to provide some identification information. After acquiring the identity credentials, the client needs to register and register through a member service (Membership Service Provider, MSP) to ensure the validity of its identity credentials and to be accepted by other nodes in the network. This process is typically done by the client using HYPERLEDGER FABRIC SDK.
Optionally, upon successful registration and registration, the client's identity certificate will indicate that it has access to the blockchain and the authority to execute a specific intelligent contract (e.g., bank client churn factor outlier detection). This means that only clients holding valid identity credentials can send transaction proposals to the blockchain network and invoke corresponding smart contracts. After successful registration and acquisition of the identity card, the client has the ability to initiate a transaction proposal to the blockchain network on a regular basis. After the transaction proposal is constructed, the client sends it to the endorsement node (Endorsing Peer). The endorsement node is responsible for evaluating the legitimacy of the transaction proposal, executing the intelligent contract after meeting the conditions, and generating the execution result of the proposal and the signature of the node.
Through the flow, the client can safely access the blockchain network, can periodically initiate transaction proposal, execute intelligent contracts, detect and analyze factors lost by a bank client in an automatic mode, and simultaneously ensure the security of all operations and the non-tamper property of data. This mechanism not only improves the efficiency and accuracy of data analysis, but also enhances the security and privacy protection of the data for the financial institution.
Optionally, the MSP is a modular component of a blockchain network for defining authentication, performing authentication and rules for allowing access to the network. In particular, MSP is a modular component for identity management and verification of constituent members in a blockchain network, and in the present application, MSO functions include:
1. the user ID is managed.
2. The nodes that want to join the network are authenticated, wherein each node that wants to join the blockchain network must provide its valid and legitimate MSP information.
3. Credentials are provided for transactions initiated by clients, where data transfer between nodes (clients, peers, orderer) requires verification of the signature of each node.
Alternatively, FIG. 3 is a schematic diagram of the logical structure of an alternative MSP according to an embodiment of the present application, in FIG. 3, RCA refers to the root CA, the folder contains the self-signed X.509 certificate list of the root CA for self-signing and signing the intermediate CA certificate, ICA refers to the intermediate CA, contains the certificate list issued by the root CA, OU refers to the organization, contains a list of organization units whose members are considered to be part of the organization represented by the MSP, and B refers to the administrator, the folder contains an identification list for defining roles that have the role of the organization administrator. For standard MSP types, this list should have one or more X.509 certificates. ReCA refers to revoked certificates, holding information of revoked participants, and monitoring mail cannot be received in the revoked certificate list for users allowed to use the acquirer transaction type identification apparatus. SCA refers to a signature certificate, the endorsement node is a signature certificate in the transaction proposal response, this folder is necessary for the local MSP, and the node must have only one x.509 certificate. KeyStore refers to the private key, which is defined for the Peer node or the Orderer node's local MSP, and contains the node's signing key. This key matches in an encrypted manner the signature certificates contained in the SCA folder and is used to sign the data. This folder is necessary for the local MSP and must contain only one private key. TLS root CA a self-signed x.509 certificate list containing the root CA for TLS communications that the organization trusts. There must be at least one TLS root CA x.509 certificate in this folder. The TLS intermediate CA is configured to maintain a list of intermediate certificates issued by the TLS root CA.
In an alternative embodiment, before executing the intelligent contract through the endorsement node in the blockchain, the blockchain-based user data processing method further comprises verifying a client signature in the transaction proposal according to a client public key in the transaction proposal, wherein the client signature verification is passed on condition that the client public key is matched with a private key of the client, checking whether a submitter of the transaction proposal has authority to execute the intelligent contract through the endorsement node after the client signature verification is passed, and simulating execution of operation logic defined in the intelligent contract through the endorsement node according to the content of the transaction proposal in the case that the submitter has the authority to execute the intelligent contract is determined, wherein simulation execution is used for verifying whether the logic of the intelligent contract conflicts with the transaction rule of the blockchain in the case that the actual account state of the blockchain is not changed.
Optionally, in a blockchain network, all transaction proposals must contain a signature of the client in order to guarantee the origin and integrity of the proposal. The client signs the transaction proposal using its private key, and the endorsement node (Endorsing Peer) verifies the validity of the signature using the client's public key. The condition for signature verification is that the public client key in the proposal matches the private client key used for signing. This process ensures that the source and content of the transaction proposal are not tampered with during transmission. After the signature verification is passed, the endorsement node will further check whether the submitter of the transaction proposal has the right to execute the specific smart contract. This is because blockchains allow fine-grained access control, with each node and user having their roles and rights. Through MSP and CA mechanism, endorsement node can verify the identity and the authority of submitter, ensures that only authorized submitter can execute intelligent contract to protect security and data privacy of network.
Optionally, the endorsement node simulates execution of the operating logic defined in the smart contract upon confirming that the presenter has the authority to execute the smart contract. This process is called simulation execution, and is aimed at verifying whether the logic of the intelligent contract is in compliance with the blockchain transaction rules, and whether there are any potential conflicts or problems, without any change in the actual ledger state of the blockchain. Simulation execution may check whether the code of the smart contract may cause an inconsistency in ledger status or violate established transaction rules, such as data access restrictions, data update rules, etc. Through simulation execution, the endorsement node can ensure that the intelligence is able to operate as intended, approximately without actually altering the ledger state. If any conflict or problem is found during the simulation execution, the proposal will not be endorsed, thereby avoiding potential damage to the blockchain ledger by invalid transactions or malicious operations. Only if the logic of the smart contract is verified without errors and without causing any rule conflict, the endorsement node provides endorsement and returns the execution result of the proposal and the signature of the node to the client.
In the series of verification and execution flows, the blockchain network ensures the safety, legitimacy and correctness of intelligent contract logic of a transaction proposal through asymmetric encryption, identity verification, authority control and simulation execution mechanisms of intelligent contracts. The method not only improves the efficiency and accuracy of data processing, but also enhances the safety and reliability of the whole system, and has important significance for processing sensitive user data of financial institutions, especially the analysis data of lost users. Through the mechanisms, the financial institutions can be sure that the data is properly processed and protected in the blockchain network, and meanwhile, the execution result of the intelligent contract can accurately reflect the real state of the data, so that a solid data base is provided for reducing customer loss and improving service quality.
Optionally, the encryption algorithm employed by the present application is an asymmetric encryption algorithm, and the asymmetric encryption technique refers to an encryption technique integrated into the blockchain to meet security requirements and ownership verification requirements. Asymmetric encryption uses two asymmetric keys, a public key and a private key, in the encryption and decryption processes. The asymmetric key has the following two characteristics:
1. After encrypting information using one key (public or private), it can only be decrypted using the other corresponding key.
2. The public key is disclosed to the owner, the private key is kept secret, and any person cannot deduce the corresponding private key through the public key.
In an alternative embodiment, the user data processing method based on the blockchain further comprises the steps of executing an intelligent contract through an endorsement node in the blockchain, determining variable data from user data, wherein the variable data at least comprises credit scores and geographic position data of a lost user, determining an outlier in the user data according to the variable data, wherein the similarity of data corresponding to the outlier and data corresponding to non-outlier is smaller than a preset threshold, taking the outlier and the outlier at a data position corresponding to the user data as target data, packaging the target data through signature of the endorsement node, sending the packaged target data to a client, and deleting the data corresponding to the outlier from the user data in response to an outlier deleting instruction received by the client.
Optionally, when the client sends the transaction proposal to the blockchain, the proposal contains smart contract information and user data of the churn users of the financial institutions. The endorsement node (Endorsing Peer) will execute the code logic in the smart contract after verifying the signature of the transaction proposal and the presenter's rights. In the present application, the execution logic of the smart contract includes at least the extraction of key variable data from User data including at least credit scores (Customer Credit Score) and geographic location data (User's count/region) of the churn User. The intelligent contract further carries out preprocessing on the extracted variable data, including data cleaning, conversion and standardization, so as to ensure that the data meets analysis requirements and improve the accuracy and reliability of the model.
Alternatively, after the preprocessing of the variable data is completed, the intelligent contract may identify outliers in the user data using statistical methods such as cluster analysis. Outliers refer to data in a dataset that deviates significantly from other data points, which may be present due to measurement errors, abnormal behavior, or other reasons. According to the description, the determination of an outlier is based on the similarity of a data point to a non-outlier being less than a preset threshold, which means that if the distance of one data point from the other data point in the variable space (e.g., using euclidean distance or manhattan distance) is significantly greater than the set threshold, then this data point will be marked as an outlier. Once the outliers are determined, the smart contract takes the outliers, their specific locations in the user data (i.e., data locations), as target data and encapsulates the target data through the signature of the endorsement node. This encapsulation includes details of the outliers and their location identity in the dataset, ensuring the integrity of the data and the trustworthiness of the source. The encapsulated target data is then sent back to the client for use by subsequent operations.
Optionally, after receiving the packaged target data, the client may further analyze the outliers, and determine, according to the analysis result, whether the data corresponding to the outliers needs to be deleted. If the client decides to delete an outlier, it will send an outlier delete instruction to the blockchain, which also must contain the client's signature and associated smart contract information to ensure the legitimacy and security of the operation. After receiving the deletion instruction, the endorsement node executes the intelligent contract again, and the execution logic of this time includes the deletion operation of the outlier data, so as to remove the influence of the outliers in the user data set of the blockchain.
It should be noted that although the deletion of outliers appears to the client as a direct manipulation of the user data set, in the blockchain environment, a new transaction is actually performed through the smart contract, and the modified data state is written into the new block, thus preserving the non-tamper-resistance and consistency of the blockchain ledger. Each modification to the dataset will be recorded as a new chunk, providing the possibility for subsequent auditing and history tracking.
Alternatively, the intelligent contract may process outliers of user data in four phases,
In the first stage, in the execution flow of the intelligent contract, the primary task is to perform fine preprocessing and standardization operations on the user data set so as to ensure the high efficiency and accuracy of the subsequent analysis work. Preprocessing and normalization steps are particularly important when processing a large-scale data set, such as user data containing tens of thousands of records, involving a wide variety of variables, and where the data is collected from different sources, with unit and magnitude differences. The data preprocessing stage aims at improving the quality of a data set and creating favorable conditions for subsequent analysis and model training. The key effects of the stage include cleaning and correcting incomplete, abnormal or error data in the data set, ensuring that model training is based on accurate and reliable information, optimizing the data set by removing redundant data and processing missing values, accelerating the speed of subsequent data analysis and model training, reducing the demand of calculation resources by adjusting the data format, enabling model training to be more efficient, encoding or anonymizing sensitive information, protecting user privacy, adhering to data safety regulations, processing information from different data sources, ensuring the consistency of format and dimension, and facilitating subsequent integrated analysis.
For example, in practical applications, the Smart alloy date transcodes classification variables such as the country/region in which the user is located. For example, for the nationality field, the intelligent contract encodes A1 nationality as 1, a2 nationality as 2, a3 nationality as 3, and so on, ensuring that all classification variables are converted into numeric data. The process is convenient for subsequent statistical analysis, and improves the efficiency of data integration. After the data preprocessing is completed, the intelligent contract performs data standardization, calculates the mean value and standard deviation of each variable, and scales the data to ensure that all the variables are on the same standard scale. The normalization process involves calculating the mean and standard deviation for each variable. And scaling the data by using the calculated mean and standard deviation to reach the standard of zero mean unit variance. The data is centered, i.e., the mean is subtracted, and then scaled, i.e., divided by the standard deviation.
Wherein Table 1 is the data case after normalization based on partial variable data
TABLE 1
The second stage of the intelligent contract focuses on constructing a clustering model and determining key cluster center points so as to lay a solid foundation for subsequent outlier detection. In the scene of the application, the targets of cluster analysis are set into two types, which respectively represent the final state and the unwarped state of the bank clients. The specific implementation flow of the stage is as follows:
initializing a clustering center, namely randomly selecting two sample points in a data set by using the intelligent contract as the initial clustering center, wherein the center points are used as reference points for the follow-up distribution data points.
Iterative allocation and center point updating, namely, the system calculates the distance from each sample point in the data set to two initial clustering centers, and then allocates each sample point to the clustering center closest to the sample point to form a preliminary cluster. The intelligent contract will then recalculate the location of the cluster center based on all sample points in the current cluster, a process that aims at making the cluster center better representative of the sample point features of the belonging cluster.
The iterative process is repeated until the above-mentioned allocation and center updating steps are stabilized, and the above-mentioned allocation and center updating steps are repeatedly performed by the intelligent contract until a stable state is reached, i.e. no sample points are reassigned to other clusters, and at the same time the position of the cluster center is not changed significantly. This process ensures that the cluster model accurately reflects the structure in the dataset.
And determining final cluster centers, namely finally determining two cluster center points by the intelligent contract when iteration is finished, wherein the two cluster center points are used as representatives of the state of losing and not losing of a bank client. These cluster centers are critical to subsequent outlier identification and they will serve as reference points for measuring the degree of anomaly of the data points.
After the second-stage cluster model is built, the intelligent contract enters an outlier detection stage (third stage). This process identifies and marks outliers based on the results of the cluster analysis by:
and calculating the distance between each sample point in the intelligent contract calculation data set and the cluster center, wherein the distance measures the deviation degree of the sample point and the cluster core.
And identifying the outlier, namely intelligently screening 25 sample points farthest from the cluster center according to the calculated distance to serve as the outlier. Considering that the total number of samples of the dataset is ten thousand, this screening scale is 2.5 thousandths, aiming at efficiently identifying those data points that deviate significantly from the clustering trend.
And storing the coordinates of the outliers, namely outputting and storing the identified 25 outliers and specific coordinate information thereof in the data set on the blockchain by the intelligent contract, so as to ensure the transparency and the non-tamper property of the data. This storage step not only records the original data locations of the outliers, but also facilitates further processing of these special data points by other intelligent contracts or system modules.
Alternatively, the final output outlier coordinates can be seen in table 2.
TABLE 2
After data preprocessing, cluster modeling and outlier detection, the fourth stage of the intelligent contract focuses on returning the visualization result and specific coordinate information of the outlier to the client to intuitively display the analysis result. The implementation flow of this stage is as follows:
and drawing a two-dimensional coordinate system by using the intelligent contract to select the loan deposit condition and the product quantity as two key dimensions, and constructing the two-dimensional coordinate system for drawing the positions of the clustering center and the outlier. This option helps to visually demonstrate the distribution of the banking customers in the two dimensions described above.
The cluster center and outliers are noted, i.e., in the constructed graph, the cluster center is marked with a significant asterisk, while the outliers are represented by a plus sign. The visual visualization mode is convenient for the user to quickly identify the core area and the abnormal points of the clusters.
And returning the coordinates of the outliers, namely returning the coordinate information of the identified outliers together with the specific positions of the identified outliers in the data set to the client through the encrypted secure channel by the intelligent contract. These coordinate data clearly indicate which data points are considered outliers for further analysis and processing by the user.
And carrying out data inverse preprocessing and inverse standardization operation after the client receives the outlier coordinates. This process is intended to restore standardized processed data to its original state for easy understanding and analysis by business personnel. Specifically, the method comprises the steps of converting standardized numerical values back to original values, and converting coded fields such as regions, sexes and the like into readable text information.
And finally, displaying the data after the inverse processing, including the credit score, the region, the sex, the age, the bank history of the user, the loan deposit details, the service condition of the product, the holding state of the credit card, the activity degree of the user, the income estimation and the like, to business analysts by a friendly interface, so that the business analysts can conduct deep study on the characteristics and the influence of the outliers.
Wherein, fig. 4 is a schematic diagram of an outlier, as shown in fig. 4, wherein the cluster center is marked with an asterisk, and the outlier is marked with a "+" sign, according to an embodiment of the present application.
In an alternative embodiment, before signing the transaction proposal by the client and submitting the signed transaction proposal to the ordering role node of the blockchain, the blockchain-based user data processing method further comprises the steps of receiving response information of X endorsement nodes for the transaction proposal by the client, wherein X is an integer greater than 1, the response information comprises an execution result of the endorsement nodes for the intelligent contract and signature information of the endorsement nodes for the transaction proposal, conducting consistency check on the response information of the X endorsement nodes for the transaction proposal by the client, wherein the consistency check is used for detecting whether the transaction proposal is supported by at least Y endorsement nodes in the X endorsement nodes, Y is a positive integer smaller than or equal to X, determining that the transaction proposal meets consistency conditions when the transaction proposal is supported by at least Y endorsement nodes, and determining that the transaction proposal does not meet the consistency conditions when the transaction proposal is not supported by at least Y endorsement nodes.
Optionally, when a client submits a transaction proposal to the blockchain network, the proposal is broadcast to a plurality of endorsement nodes. The number X of endorsement nodes is preset and X is greater than 1, which means that at least two or more endorsement nodes will participate in the execution and verification of the proposal. Each endorsement node executes the intelligent contract logic specified in the proposal and returns two main information, namely the execution result of the intelligent contract and the signature information of the node on the transaction proposal. This information is the basis for further inspection and decision making by the client. After receiving the response information of the X endorsement nodes, the client side can perform consistency check to ensure that the proposal is sufficiently supported. The consistency check sets a threshold Y (Y is a positive integer less than or equal to X) that requires that at least a positive response of Y endorsed nodes be obtained. This threshold is set in order to prevent erroneous or malicious behaviour of a few nodes from affecting the decision making process of the whole network. If the proposal is supported by at least Y endorsement nodes, the client determines that the proposal satisfies the consistency condition, otherwise, the proposal is considered to not satisfy the consistency condition, and the proposal may need to be submitted or corrected again.
In the consistency check, the client verifies the signature information of the endorsement nodes to confirm the source and the integrity of the response information, and compares the execution results of the endorsement nodes to ensure the consistency between the endorsement nodes. If the result is consistent and the number of supported endorsement nodes reaches the threshold value Y, the client terminal considers the proposal to be effective, and can continue the subsequent processes of consensus and writing into the blockchain ledger. Finally, the client judges whether the transaction proposal meets the consistency condition of the network according to the consistency check result. If the proposal is supported by at least Y endorsement nodes, i.e. the execution results are consistent and the signature information is valid, the client determines that the proposal satisfies the consistency condition. Conversely, if the proposal is not supported by at least Y endorsement nodes, the client will determine that the proposal does not satisfy the consistency condition. In this case, the proposal may need to be revoked, or the client may need to resubmit the proposal, possibly with modifications to the content of the proposal in hopes of getting support of more nodes. Proposals that do not meet consistency conditions cannot continue to be further performed and validated in the blockchain network, ensuring the stability and security of the network.
In an alternative embodiment, the signed transaction proposal is subjected to consensus through a sequencing role node, all consensus results are sequenced according to the generation time of the consensus results, data which are subjected to consensus in the transaction proposal are packaged into blocks according to the sequencing results of the consensus results and sent to a submitting node of a blockchain, the method comprises the steps of detecting whether signature information of the transaction proposal is correct or not and whether information loss exists in the transaction proposal or not through the sequencing role node, and under the condition that the signature information of the transaction proposal is correct and the information loss does not exist in the transaction proposal, carrying out consensus on the data in the transaction proposal through a plurality of sequencing role nodes to obtain at least one consensus result, wherein each consensus result represents whether a plurality of sequencing role nodes agree on part of data in the transaction proposal, and packaging the data which are subjected to consensus in the transaction proposal into the blocks and sending the data which are subjected to the consensus to the submitting node of the blockchain according to the generation time of each consensus result.
Alternatively, when a transaction proposal is submitted by a client, it first goes through a preliminary check of the ordering role node. The ordering service node verifies whether the signature information in the proposal is correct, which is the first line of defense to ensure the reliability of the proposal source and to prevent data tampering. Signature information is generated by the client, and based on an asymmetric encryption algorithm, it is ensured that only the client with the correct private key can generate a valid signature. In addition, the ordering role node can also check whether information is missing in the proposal or not, so that the completeness of the content of the proposal is ensured, and all necessary parameters and intelligent contract identifications are correctly contained, so that preparation is made for the subsequent consensus process. Transaction proposals that pass signature information and integrity verification will be broadcast to a plurality of ordering role nodes in the network. The nodes will agree on the data in the proposal according to the consensus algorithm of the network, i.e. determine the consistency of all nodes for the proposal data. The consensus process may involve multiple stages, ultimately generating at least one consensus result, each reflecting the acceptance of a particular data or operation in the proposal by a node in the network. Once the multiple ranking role nodes agree on the data in the transaction proposal, the next step is to rank the data according to the time of generation of the consensus result. Time ordering is critical in a distributed ledger system, ensures that the execution sequence of transactions is consistent with the actual submitting sequence, and prevents data inconsistency caused by transaction conflict and time difference. The timestamp mechanism is combined with the consensus algorithm, so that accurate data time sequence is provided for the blockchain network, and the integrity and consistency of the account book are maintained.
In an alternative embodiment, whether the data state of each data in the block conflicts with the state of the blockchain is detected by the submitting node, and under the condition that no conflict exists between the data state of each data in the block and the state of the blockchain, the data state of the data in the block is determined to be matched with the state of the blockchain, and the hash value of the block is linked with the hash value of the block recorded by the blockchain, so that the block is added to the blockchain. And under the condition that the conflict exists between the data state of at least one data in the block and the state of the block chain, determining that the data state of the data in the block is not matched with the state of the block chain, and prohibiting the hash value of the block from being linked with the hash value of the block recorded by the block chain.
Optionally, after the consensus process is completed, the new block is generated and the block is committed to the commit node of the blockchain network. The commit node performs a critical task of detecting whether the data state of each data module (transaction) in the new block conflicts with the state of the current blockchain ledger. Data state conflicts may arise from a variety of circumstances including, but not limited to, repeated transactions with the same account, invalid transactions due to insufficient account balances, execution failures due to unsatisfied smart contract conditions, etc. This detection step ensures that the transaction data in the new block matches the current state of the ledger, avoiding inconsistent or invalid data writing. If each data state in the new block passes the conflict detection, i.e., a complete match with the state of the blockchain ledger, no conflicts are detected, the commit node will confirm that the data state of the new block matches the state of the blockchain. Next, the hash value of the new chunk (a unique digital fingerprint generated from the chunk content) will be linked to the hash value of the previous chunk that the blockchain has recorded. This linking mechanism is the basis for the blockchain data structure, which ensures that the addition of new blocks does not disrupt the blockchain integrity and data continuity. The hash value of the new block is linked with the hash value of the previous block to form a seamless data chain, and the new block is added into the block chain to finish the distributed storage of data and the updating of the consensus state.
However, if a conflict is detected in the new block between the data state of the at least one data and the state of the blockchain, the commit node immediately determines that the new block does not match the state of the blockchain. In this case, the hash value of the new chunk will not be linked into the chain structure of the blockchain, and the new chunk will be prevented from being written to the ledger. The mechanism protects the accuracy and consistency of the ledger, avoids the wide spread of error or inconsistent data, and ensures the robustness and safety of the blockchain network.
In an alternative embodiment, updating the world state database corresponding to the blockchain includes obtaining all key value pairs in an updated ledger of the blockchain that are associated with data in the blocks, and updating the world state database based on state information of the key value pairs.
Alternatively, when a new chunk is verified and successfully added to the blockchain, all transaction data contained by the chunk will be read and parsed. In blockchains, transaction data is typically represented in key-value pair form, where a "key" represents a unique identifier of the data, and a "value" contains specific transaction information or status updates. In this step, the commit node extracts all key-value pairs associated with the transaction from the new block in preparation for subsequent world state database updates. The extracted key-value pairs are further parsed to understand their state information. The status information reflects the results after the transaction is performed, including but not limited to account balance updates, contract status changes, data record modifications, and the like. At this stage, the submitting node will verify the correctness and validity of these state information, ensuring that they conform to the rules of the blockchain ledger and the logic of the intelligent contract. This verification process is a key step in ensuring ledger security and consistency. Once the state information of the key-value pairs is verified, the submitting node will update the world state database based on the state information. The world state database is a lightweight database that stores the most current state of all keys in the blockchain ledger. Updating the world state database means synchronizing state information in the new block into 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.
In an alternative embodiment, the signed transaction proposal is agreed through an ordering role node, which comprises determining Z agenda nodes according to Z dimensions of user data in the transaction proposal, wherein Z is an integer greater than 1, the agenda nodes belong to the ordering role nodes, each agenda node is used for the consensus flow of variable data of one dimension, and after the consensus flow is initiated through the agenda nodes, consensus operation is carried out on the variable data of one dimension responsible for the agenda nodes through a plurality of agenda nodes corresponding to the agenda nodes, wherein the agenda nodes belong to the ordering role nodes which are in communication connection with the agenda nodes.
In view of huge data loss of bank clients processed by the scheme, the data loss reaches millions, and therefore, an agenda node mechanism of an authorized Bayesian fault-tolerant consensus algorithm can be adopted. The agenda node mechanism is responsible for the consensus flow of the dimension data by assigning the data in variable dimensions, with one agenda node assigned to each dimension. For example, if the user data relates to 11 key variables (customer credit score, user location, user gender, age, user banking, loan status, number of products used, credit card holding status, user activity, income estimate, and outlier information), each key variable has a dedicated bargaining node, this design reduces the overall stress on the system during data analysis, increasing the efficiency of the consensus process.
In addition, the mechanism for selecting the bargained node according to the variable dimension and the consensus algorithm flow thereof comprise the determination of a bargained list, the selection of the bargained, the consensus initiation, the participation of the bargained and the view update. The agenda list is composed of variables involved in intelligent contract execution, and the agenda selection algorithm determines subscripts through modular operation based on the current variable data quantity, view numbers and node numbers, so that fairness and randomness are ensured. After the bargained establishment initiates the consensus, if the time interval meets the set condition (for example, 10 seconds), the consensus process is started immediately, and after the bargained establishment request is received by the bargained establishment node, public key verification is performed to ensure the reliability of the information source, and then the bargained establishment process is participated.
The optimization point of the consensus algorithm is characterized in that the consensus of specific variables is carried out by selecting the bargained node, so that the pressure of big data processing on a system consensus mechanism is reduced, and the updating mechanism of the bargained node ensures the dynamic adjustment of the bargained role, avoids the consensus deviation possibly caused by long-term control of the bargained position by a single node, and improves the accuracy of the consensus process and the robustness of the whole system.
In an alternative embodiment, the determining process of the ith agenda node in the Z agenda nodes comprises the steps of obtaining the data volume of variable data of the ith dimension in user data, wherein i is an integer smaller than or equal to Z, obtaining the view number of the client, wherein the view number is the identification of the view layer of the client, obtaining the number of all nodes capable of serving as the agenda nodes in the blockchain, determining a node subscript value according to the data volume of the variable data of the ith dimension, the view number and the number of all nodes capable of serving as the agenda nodes in the blockchain, and taking the node corresponding to the node subscript value in the blockchain as the ith agenda node.
Alternatively, FIG. 5 is an overall architecture diagram of an alternative blockchain-based user data processing system, including a client, SDK components, and blockchain network, as shown in FIG. 5, in accordance with embodiments of the present application. The SDK component is used for realizing interaction between the client and the database. The block chain network comprises a chain code, a ledger, a state database and a history database, wherein the ledger is recorded with blocks, and the state update of the blocks needs to be synchronized to the state database and the history database.
Alternatively, the subscript value of the i-th agenda node may be calculated using the following equation (1):
Mod(s+1-v,Q)(1)
In the formula (1), mod is a remainder function, i.e., a remainder obtained by dividing (s+1-v) by Q is calculated, s is the data amount of variable data in the ith dimension, v is the current view number, and Q is the number of nodes of the agenda node.
Optionally, after the agenda node updates the view number, if the current time exceeds the predetermined interval time (e.g. 10 s) for each round of consensus from the last time the new block was written, a new round of consensus is started immediately, otherwise, consensus is started after the interval time. Then, the bargained node participates in the consensus process, and when the bargained node initiates the consensus, the bargained node broadcasts the consensus to the bargained node, and the bargained node starts to carry out public key verification on the transaction proposal after receiving the transaction proposal, and then carries out the consensus.
In an alternative embodiment, after taking the node corresponding to the node index value in the blockchain as the ith agenda node, the blockchain-based user data processing method further comprises the steps of initiating a view update request through any one agenda node under the condition that the view number of the client is updated and the variable data of the blockchain for the ith dimension is not agreed, wherein the view update request is used for requesting to determine a new agenda node according to the number of the variable data of the ith dimension, the latest view number, the total number of the agenda nodes and a preset ratio, wherein the preset ratio is used for adjusting the number of the variable data of the ith dimension, and updating the ith agenda node under the condition that the view update request is supported by the consensus of the target number of the agenda nodes.
Optionally, when a view life cycle is completed, if consensus is not yet reached, a broadcast request (corresponding to the view update request) is sent by the agenda node to enter the next view cycle and the agenda node is reselected, and when the agenda node is reselected, a percentage (corresponding to the preset ratio) is selected, and then the subscript of the new agenda node is calculated by using the following formula (2):
Mod(s*c+1-v1,Q)(2)
In the formula (2), mod is a remainder function, s is a data amount of variable data of the ith dimension, c is a preset ratio, and v1 is the latest view number. When the request to update the view is supported by 2/3 of the agenda nodes, the whole network reaches consensus and enters the next view period to re-consensus.
It should be noted that the points for optimizing the consensus algorithm are mainly two points, the first point is to select a bargained node according to variable data, and reduce the influence of big data processing on the system consensus by the bargained node, and the second point is to update the bargained node, so that timely updating of the bargained node is beneficial to reducing the hidden trouble that malicious nodes occupy the bargained position due to no updating of the bargained node at all times, and improving the accuracy of the consensus.
In an alternative embodiment, FIG. 6 is a schematic diagram of an alternative blockchain network architecture according to an embodiment of the present application, as shown in FIG. 6, the blockchain network includes a CA certificate management component, an MSP, an orderer node, a channel, a peer0 node, and a peer1 node, where each peer node corresponds to a chain code and a ledger.
In an alternative embodiment, table 3 shows the data structure for variable data in the user data:
TABLE 3 Table 3
| English name of table field | Chinese name of table field |
| Customer Credit Score | Customer credit score |
| User’s country/region | The region where the user is located |
| User Gender | Gender of user |
| Age | Age of |
| User Years | When the user of the bank is multiple |
| Deposit and loan situation | Loan deposit condition |
| Quantity of products used | Quantity of product used |
| Cardholder | Whether or not there is a credit card of the present line |
| Active user | Whether or not the user is active |
| Estimated income | Estimating revenue |
Alternatively, as shown in fig. 7, an alternative transaction proposal is processed as follows:
And step 1, the client calls member service through the SDK to register and register, and the user obtains an identity certificate from the member service.
And 2, the client initiates a transaction proposal to the blockchain network through the SDK, and the transaction proposal sends information such as intelligent contract identification to be called in the transaction, contract method (specific realization logic of the intelligent contract method), parameter information (necessary input item required for calling a corresponding intelligent contract and sent mark capable of identifying a unique intelligent contract), client signature (identification capable of identifying which transaction channel the client is in and identification verification label) and the like to an endorsement node.
And 3, after receiving the transaction proposal, the endorsement node verifies the signature and confirms whether the submitter has the right to execute the operation, simultaneously, the intelligent contract is simulated and executed according to the endorsement policy, and the result and the CA signature of the result are returned to the application program client (namely, the response of the transaction proposal is made).
And 4, after receiving the information returned by the endorsement node, the client judges the transaction scene to which the transaction department belongs, judges whether the proposal results are consistent or not, and whether the proposal results are executed by referring to the appointed endorsement policy, packages the data together by the client to form transaction data, signs the transaction data and sends the transaction data to the ordering role node.
And 5, the ordering role node performs consensus ordering on the received transaction data, and finally packages a batch of transaction data together according to a block generation strategy to generate a new block and sends the new block to the submitting node.
And 6, after receiving the block, the submitting node checks each transaction data in the block, checks whether the input and output of the transaction data are in accordance with the state of the current block chain, adds the block to the local block chain after the completion, and modifies the world state.
According to another aspect of the present application, there is also provided a blockchain-based user data processing device, as shown in fig. 8, including a first processing unit 801, a second processing unit 802, a third processing unit 803, and a fourth processing unit 804.
Optionally, a first processing unit 801 is configured to initiate a transaction proposal to a blockchain through a client, where the transaction proposal at least includes intelligent contract information and user data of a loss user of a financial institution, a second processing unit 802 is configured to execute an intelligent contract through an endorsement node in the blockchain, sign the transaction proposal through the client and submit the signed transaction proposal to an ordering role node of the blockchain if it is determined that the transaction proposal meets a consistency condition, where the ordering role node is a node in the blockchain that participates in a consensus decision, a third processing unit 803 is configured to perform consensus on the signed transaction proposal through the ordering role node and order all consensus results according to a generation time of the consensus results, package and send the data of the consensus in the transaction proposal to a submission node of the blockchain according to the ordering result of the consensus results, and a fourth processing unit 804 is configured to append the block to the corresponding world database in the blockchain through the submission node if the submission node determines that the data state of the data in the block is matched with the state of the blockchain.
Optionally, the first processing unit 801 includes a registration subunit configured to register an identity certificate with the client, where the identity certificate is used to characterize that the client has a right to access the blockchain to process the transaction proposal, and a sending subunit configured to periodically initiate the transaction proposal with the blockchain through the client after the client successfully registers the identity certificate.
Optionally, the blockchain-based user data processing device further comprises a first verification unit, a first detection unit and a simulation detection unit, wherein the first verification unit is used for verifying a client signature in a transaction proposal according to a client public key in the transaction proposal, the client public key is matched with a client private key after the client signature verification is passed, the first detection unit is used for checking whether a submitter of the transaction proposal has authority to execute an intelligent contract through an endorsement node, and the simulation detection unit is used for simulating and executing operation logic defined in the intelligent contract through the endorsement node according to the content of the transaction proposal under the condition that the submitter has the authority to execute the intelligent contract is determined, wherein the simulation execution is used for verifying whether the logic of the intelligent contract conflicts with the transaction rule of the blockchain under the condition that the actual account state of the blockchain is not changed.
Optionally, the user data processing device based on the blockchain further comprises a first determining unit, a second determining unit and a third determining unit, wherein the first determining unit is used for executing an intelligent contract through an endorsement node in the blockchain, variable data are determined from user data, the variable data at least comprise credit scores and geographic position data of a lost user, the second determining unit is used for determining outliers in the user data according to the variable data, the similarity of data corresponding to the outliers and data corresponding to the non-outliers is smaller than a preset threshold, the third determining unit is used for taking the outliers and the outliers at data positions corresponding to the user data as target data, the packaging unit is used for packaging the target data through the signature of the endorsement node, the packaged target data are sent to a client, and the deleting unit is used for deleting the data corresponding to the outliers from the user data in response to an outlier deleting instruction received by the client.
Optionally, the blockchain-based user data processing device further comprises a receiving unit, a consistency detecting unit and a fourth determining unit, wherein the receiving unit is used for receiving response information of X endorsement nodes for a transaction proposal through a client, X is an integer larger than 1, the response information comprises an execution result of the endorsement nodes for the intelligent contract and signature information of the endorsement nodes for the transaction proposal, the consistency detecting unit is used for carrying out consistency checking on the response information of the X endorsement nodes for the transaction proposal through the client, the consistency checking is used for detecting whether the transaction proposal is supported by at least Y endorsement nodes in the X endorsement nodes, Y is a positive integer smaller than or equal to X, the fourth determining unit is used for determining that the transaction proposal meets consistency conditions when the transaction proposal is supported by at least Y endorsement nodes, and the fifth determining unit is used for determining that the transaction proposal does not meet consistency conditions when the transaction proposal is not supported by at least Y endorsement nodes.
Optionally, the third processing unit 803 comprises a first detection subunit, a consensus subunit and a block generation subunit, wherein the first detection subunit is used for detecting whether signature information of a transaction proposal is correct or not and whether the transaction proposal has information missing or not through a sequencing role node, the consensus subunit is used for carrying out consensus on data in the transaction proposal through a plurality of sequencing role nodes to obtain at least one consensus result when detecting that the signature information of the transaction proposal is correct and the transaction proposal has no information missing, each consensus result represents whether the plurality of sequencing role nodes agree on part of the data in the transaction proposal or not, and the block generation subunit is used for packaging the data which completes the consensus in the transaction proposal into blocks according to the generation time of each consensus result and sending the blocks to a submitting node of a block chain.
Optionally, the fourth processing unit 804 includes a second detecting subunit for detecting, by the commit node, whether the data state of each data in the block conflicts with the state of the blockchain, a first determining subunit for determining that the data state of each 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 that has been recorded by the blockchain if no conflict exists between the data state of each data in the block and the state of the blockchain, so as to implement the block addition to the blockchain, and a second determining subunit for determining that the data state of the data in the block does not match the state of the blockchain, and prohibiting linking the hash value of the block with the hash value of the block that has been recorded by the blockchain, if a conflict exists between the data state of at least one data in the block and the state of the blockchain.
Optionally, the fourth processing unit 804 includes a first obtaining subunit configured to obtain all key-value pairs related to data in the block in the update ledger of the blockchain, and an update subunit configured to update the world state database according to the state information of the key-value pairs.
Optionally, the third processing unit 803 includes a third determining subunit configured to determine Z bargained nodes according to Z dimensions of user data in the transaction proposal, where Z is an integer greater than 1, the bargained nodes belong to ordering role nodes, each bargained node is configured to be responsible for a consensus process of variable data of one dimension, and a consensus operation subunit configured to perform a consensus operation on variable data of one dimension for which the bargained node is responsible through a plurality of bargained nodes corresponding to the bargained nodes after initiating the consensus process through the bargained nodes, where the bargained nodes belong to ordering role nodes that are in communication connection with the bargained nodes.
Optionally, the third determining subunit comprises a first obtaining module, a second obtaining module and a third obtaining module, wherein the first obtaining module is used for obtaining the data quantity of variable data of the ith dimension in user data, i is an integer smaller than or equal to Z, the second obtaining module is used for obtaining the view number of the client, the view number is the identification of the view layer of the client, the third obtaining module is used for obtaining the number of all nodes capable of serving as the bargained node in the blockchain, the first determining module is used for determining the node lower standard value according to the data quantity of variable data of the ith dimension, the view number and the number of all nodes capable of serving as the bargained node in the blockchain, and the first processing module is used for taking the node corresponding to the node lower standard value in the blockchain as the ith bargained node.
Optionally, the user data processing device based on the blockchain further comprises a view updating unit, a node updating unit and a node updating unit, wherein the view updating unit is used for initiating a view updating request through any one of the agenda nodes when the view number of the client is updated and the variable data of the ith dimension is not agreed, the view updating request is used for requesting to determine a new agenda node according to the number of the variable data of the ith dimension, the latest view number, the total number of the agenda nodes and a preset ratio, the preset ratio is used for adjusting the number of the variable data of the ith dimension, and the node updating unit is used for updating the ith agenda node when the view updating request is supported by the consensus of the target number of the agenda nodes.
According to another aspect of the present application, there is also provided a computer readable storage medium, wherein the computer readable storage medium includes a stored executable program, and wherein the executable program when run controls a device in which the computer readable storage medium is located to perform the above-described blockchain-based user data processing method.
According to another aspect of the application, the electronic device comprises a memory and a processor, wherein the memory stores an executable program, and the processor is used for running the program, and the program runs to execute the user data processing method based on the blockchain.
According to another aspect of the present application there is also provided a computer program product comprising computer instructions which, when executed by a processor, implement the above-described blockchain-based user data processing method.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
In the foregoing embodiments of the present application, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed technology may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units, for example, may be a logic function division, and may be implemented in another manner, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.