Credit evaluation system and method based on random forest algorithm and block chain

By integrating the smart contract with random forest algorithm on the blockchain, the problems of information opacity and dynamic evaluation in credit assessment are solved, and the transparency and accuracy of credit assessment are improved.

CN120342631APending Publication Date: 2025-07-18XIAN UNIV OF POSTS & TELECOMM
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510566033.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-30
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

There are problems in the existing credit assessment system that information is opaque and no feature screening is performed and that dynamic evaluation cannot be performed after information changes.

Method used

The random forest algorithm is integrated into the smart contract, the credit evaluation results are obtained through feature value calculations, and the evaluation process and information are stored in the blockchain to make it tamper-proof and support participants' query.

Benefits of technology

It realizes the transparency and dynamic nature of credit assessment, improves the fairness and security of assessment results, and enhances the accuracy of credit assessment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120342631A_ABST
    Figure CN120342631A_ABST
Patent Text Reader

Abstract

The invention provides a credit evaluation system and method based on a random forest algorithm and a block chain, and the system comprises a system deployment module, a credit information module, a trust evaluation module and an evaluation result signature module, supports a user to upload credit data through a digital identity on the chain, and carries out the digital signature confirmation of an evaluation result. According to the method provided by the invention, the intelligent contract is deployed in the block chain, and the random forest algorithm is combined to realize automatic evaluation and cochain evidence storage of the credit data, so that the data cannot be tampered, and the process is traceable, safe and fairness. According to the method, the credit data and the evaluation process combined with feature importance screening are written into the block chain, so that the accuracy and fairness of credit evaluation and the responsibility traceability of responsibilities are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer technology, and further relates to a credit assessment system and method based on a random forest algorithm and blockchain in the field of electronic digital data processing technology. The present invention can realize the automation and transparency of credit risk assessment in blockchain, while improving the accuracy of risk assessment, ensuring the security and fairness of the assessment process. Background Art

[0002] The introduction of blockchain technology is driving the progress of trust rating methods in the supply chain finance system. Compared with the traditional mode that relies on centralized credit rating agencies, fixed asset mortgages or manual reviews, blockchain, with its characteristics of decentralization, immutability and full traceability, enables all behavioral data of individuals on the chain to be completely and truly recorded and verified. This mechanism breaks through the dependence on traditional credit files, making the performance records, transaction frequencies, fund flow paths and contract execution situations of participants the objective basis for credit assessment. This dynamic trust mechanism based on on-chain data can help groups with insufficient coverage in the traditional credit system to gradually establish a credit system through on-chain behaviors.

[0003] Southwest Petroleum University proposed a credit assessment system for agricultural Internet of Things perception layer nodes based on blockchain in its patent document "A Credit Assessment System for Agricultural Internet of Things Perception Layer Nodes Based on Blockchain" (Application No.: CN 202110363308.2, Authorization Publication No.: CN 113114473B). This system includes a perception layer node credit assessment management system and a fusion node positioning system. The perception layer node credit assessment management system conducts credit assessment on the perception layer nodes in the agricultural Internet of Things, and screens out bad nodes according to the credit value. The fusion node positioning system can accurately locate the nodes and establish an ID-address comparison table, and can accurately locate them through the ID-address comparison table and the ID of the bad nodes. Then, through the Merkle tree, it is possible to verify the authenticity without traversing all hash lists, making the system more practical. Through the TOF ranging system and the RSSI ranging system, the distances between the base node and the cluster nodes, and between the cluster nodes and the perception layer nodes can be accurately measured respectively. The distance-coordinate positioning system can locate the nodes based on the distances between the nodes. The disadvantage of this system is that there is a problem of opaque information during the credit assessment process. If the credit assessment process lacks transparency, it is easy to cause the assessment basis to be unable to be externally verified, and it is difficult for participants to understand the generation logic of the scoring results, thus weakening the trust basis for the assessment system.

[0004] The Beijing Big Data Center proposed a method and system for enterprise credit assessment based on blockchain and homomorphic encryption in its patent document "A Method and System for Enterprise Credit Assessment Based on Blockchain and Homomorphic Encryption" (Application No.: CN 202110714716.8, Authorization Publication No.: CN 113435744B). The enterprise credit assessment system disclosed in this patent includes blockchain storage nodes, government department nodes, key management nodes, supervisor nodes, and credit assessment nodes. The enterprise credit assessment method disclosed in this patent mainly uses blockchain and additive homomorphic encryption technology, which can evaluate the enterprise creditworthiness without the original data leaving the database. At the same time, the evaluation process will be automatically calculated and stored by the blockchain smart contract. Based on the decentralized and tamper-proof characteristics of the blockchain, the transparency and distributed trust of the evaluation process can be realized, enabling the secure integration and utilization of data among multiple departments, improving the utilization rate and activity of data, and enhancing the comprehensive management ability of government departments over enterprises. However, the existing deficiencies of this system are that it does not perform feature screening on the credit information in the credit assessment and there is a problem that dynamic assessment cannot be carried out after the information changes. In credit assessment, feature screening helps to eliminate redundant or irrelevant information and improve the accuracy and efficiency of the model; dynamic assessment ensures that the system can timely reflect the changes in credit data and maintain the timeliness and effectiveness of the assessment results. Without feature screening, the model is vulnerable to noise interference and the assessment is inaccurate; if it cannot be updated dynamically, the results will lag behind and it is easy to cause credit judgment errors. Summary of the Invention

[0005] The object of the present invention is to address the deficiencies of the above-mentioned existing technologies and propose a credit assessment system and method based on the random forest algorithm and the smart contract blockchain to solve the problems of information opacity, lack of eigenvalue screening, and inability to perform dynamic assessment after information changes in the existing credit assessment process.

[0006] In the method of the present invention, the random forest algorithm is integrated into the smart contract. After the user data is uploaded, the weight values of each feature are first obtained by calculating the feature values of the user data, and then the credit assessment result is obtained through the trust assessment contract integrating the random forest algorithm, realizing the automatic credit assessment of the participants in the supply chain. During the assessment process, the system process and the information generated by the assessment are stored in the blockchain to support query by participants and are not tamperable. The system of the present invention solves the problems of information opacity and lack of feature screening in the existing assessment method, and the problem that dynamic assessment cannot be carried out after information changes.

[0007] To achieve the above object, the system of the present invention includes a system deployment module, a credit information module, a trust assessment module, and an assessment result confirmation module; among them,

[0008] The system deployment module is used to select a communication node among the consensus nodes of the blockchain; deploy a contract on the blockchain of the selected communication node, and save the contract address returned by the blockchain after the contract deployment to the system deployment module; after the user completes the deployment of the contract through the on-chain account registration contract, the address of the contract returned by the system is used to call the on-chain account registration contract to generate the DID corresponding to the contract on the blockchain;

[0009] The credit information module is used to save the DID submitted by the user and the credit information contract, call the user credit information contract, upload the user's DID and credit information to the blockchain, and after the DID verification is passed, perform structured processing on the unstructured data in the credit information and then upload the contract to the blockchain for storage;

[0010] The trust evaluation module is used to fill in the blank values and perform standardization processing on the user's credit data obtained from the blockchain; call the EvaluateScore function in the trust evaluation contract to perform credit evaluation on the feature variables with the top scores in importance among the trust data submitted by the user, take the average value of the trust prediction values of each decision tree as the final trust prediction value, and perform trust level conversion and then submit it to the trust evaluation module for storage;

[0011] The evaluation result confirmation module is used to call the result confirmation contract, send the result to the blockchain participants for digital signature, and then save the evaluation result with the digital signature to the blockchain.

[0012] The steps of the method of the present invention are as follows:

[0013] Step 1, the system deployment module selects a communication node among the consensus nodes of the blockchain;

[0014] Step 2, the system deployment module deploys a contract on the blockchain of the selected communication node, and saves the contract address returned by the blockchain after the contract deployment to the system deployment module; the contracts include an on-chain account registration contract, a credit information contract, a credit evaluation algorithm contract, and a digital signature contract;

[0015] Step 3, after the user completes the deployment of the contract through the on-chain account registration contract, the address of the contract returned by the system is used to call the on-chain account registration contract to generate the DID corresponding to the contract on the blockchain; the user submits the generated DID and the credit information contract to the credit information module;

[0016] Step 4, the credit information module calls the user credit information contract, uploads the user's DID and credit information to the blockchain, and after the DID verification is passed, performs structured processing on the unstructured data in the credit information and then uploads the contract to the blockchain for storage;

[0017] Step 5: The trust evaluation module fills in the blank values and performs standardization processing on the user's credit data retrieved from the blockchain.

[0018] Step 6: The trust evaluation module calls the EvaluateScore function in the trust evaluation contract to perform credit evaluation on the top feature variables with the highest importance scores in the trust data submitted by the user, takes the average of the trust prediction values of each decision tree as the final trust prediction value, and performs trust level conversion before submitting it to the trust evaluation module for storage.

[0019] Step 7: The user logs in to the system and the evaluation result confirmation module digitally signs the evaluation result.

[0020] Furthermore, selecting a communication node from the consensus nodes of the blockchain means calculating the campaign value of each consensus node in the blockchain, and selecting the consensus node corresponding to the largest campaign value among all consensus nodes as the communication node of the blockchain:

[0021]

[0022] Among them, S i represents the campaign value of the i-th consensus node, n represents the total number of consensus nodes, p i represents the amount of margin pledged by the i-th consensus node, and P total represents the total amount of margin pledged by all consensus nodes in the blockchain, and t(i, j) represents the communication delay between the i-th node and the j-th node among the consensus nodes.

[0023] Furthermore, the implementation content of the contract is as follows:

[0024] The on-chain account registration contract converts the user name in string type submitted by the user into a DID through the UserRegister function and stores the DID on the blockchain.

[0025] The credit information contract receives the credit data submitted by the user and stores it on the blockchain through the uploadCreditData function.

[0026] The credit evaluation algorithm contract embeds a random forest credit scoring model composed of multiple decision trees; this contract performs trust evaluation on the credit data submitted by the user.

[0027] The digital signature contract generates a signature for the data to be signed according to the user's private key using the ECDSA algorithm through the GenerateSignature function.

[0028] The embedding of a random forest credit scoring model consisting of multiple decision trees in the credit assessment algorithm contract means that the structural information of each decision tree, including the feature index corresponding to the split node, the split threshold, the relationship between the left and right child nodes, and the predicted value of the leaf node, is uniformly converted into a data structure that can be called within the contract. The feature importance screening logic is integrated into the FeatureSelection function of the credit assessment algorithm contract, and the prediction logic of the decision tree and the averaging process of the prediction results of all trees are integrated into the EvaluateScore function within the contract.

[0029] The steps for performing a trust assessment on the credit data submitted by the user are as follows:

[0030] In the first step, feature screening is performed on the credit data submitted by the user. Based on the reduction in impurity caused by each feature in the decision tree node split in the credit data, the importance score of the feature is calculated according to the following formula:

[0031]

[0032] where Importance j represents the importance score of the j-th feature in the decision tree node split, N tree represents the number of decision trees for calculating feature importance, set to 300, T represents the set of all split nodes in a tree, t represents the serial number of the split node in the decision tree, Gini(t) represents the Gini impurity before the split of the t-th node, and Gini(t') represents the Gini impurity after the split of the t-th node;

[0033] In the second step, the importance scores of all features are sorted in descending order, and the bottom two-thirds of the features are deleted, and only the top one-third of the features are retained as the feature set used in the credit scoring process;

[0034] In the third step, each decision tree randomly samples from the credit data corresponding to the feature set through the bootstrap sampling method, and the filtered feature set forms the training set;

[0035] In the fourth step, each time a node is split, one-third of the features are selected from the training set to form a candidate set. The split thresholds of each feature in the candidate set are traversed, the corresponding reduction in Gini impurity is calculated, and the feature and its split point that result in the largest reduction in impurity are selected as the optimal split feature and threshold for this node. This step is repeated for the training subset until the complete decision tree structure is constructed;

[0036] In the fifth step, for the regression task, each decision tree independently outputs a trust prediction value, and finally the prediction values of each decision tree are averaged to obtain the overall credit scoring result.

[0037] Further, the steps for processing the credit data are as follows:

[0038] First step, fill in the blank values in the trust data submitted by the user through the KNN algorithm:

[0039]

[0040] Among them, x miss represents the missing value to be filled in the data sample submitted by the user, and x i represents the value of the i-th neighbor sample, which is the most similar to the missing value feature in the feature space of the data submitted by the user, on this feature. k represents the 3 - 5 nearest neighbors of the feature value of the i-th neighbor sample;

[0041] Second step, standardize the credit data through the Z - score standardization method:

[0042]

[0043] Among them, x' represents the standardized feature value, μ represents the mean of the features in the training subset, and σ represents the standard deviation of the features in the training set.

[0044] Further, the steps for processing the trust prediction score are as follows:

[0045] First step, the EvaluateScore function in the trust evaluation contract averages the trust prediction values of each decision tree to obtain the final trust prediction value;

[0046]

[0047] Among them, y represents the continuous value output by the model, B represents the total number of decision trees, x represents the pre - processed feature vector, and T b represents the b-th decision tree, and the prediction value given to the input feature x;

[0048] Second step, according to the following credit rating conversion rules, use the EvaluateScore function to convert the trust prediction value to obtain the final rating of the user trust evaluation:

[0049] y≥800, LEVEL A,

[0050] 700≤y<800, LEVEL B,

[0051] y<700, LEVEL C

[0052] Among them, LEVEL represents the final rating of the trust assessment, including three levels: A, B, and C. A indicates that the final rating of the user trust assessment obtained by converting the trust prediction value is excellent, B indicates that the final rating of the user trust assessment obtained by converting the trust prediction value is average, and C indicates that the final rating of the user trust assessment obtained by converting the trust prediction value is poor.

[0053] Further, the steps for digitally signing the evaluation result are as follows:

[0054] In the first step, the credit evaluation module returns the credit score result obtained by evaluating the credit information submitted by the user to the user;

[0055] In the second step, the user logs in to the credit evaluation system through the on-chain digital identity DID to obtain the result information;

[0056] In the third step, after receiving the result information, the user performs a digital signature operation on the confirmed evaluation result to indicate its recognition of the result, and the signature is completed using its private key.

[0057] The present invention has the following advantages compared with the prior art:

[0058] First, in the system of the present invention, the credit information module and the trust assessment module write credit data and the assessment process into the blockchain at any time, provide a unified on-chain identity for the users participating in the system, and use smart contracts to automatically execute assessment rules and logics to prevent data from being tampered with during the assessment process. The assessment result signature module sends the assessment result to the blockchain participants for digital signature and persists it in the blockchain. This makes the entire assessment process open and verifiable to the relevant parties. Thus, it overcomes the defect of opaque assessment information in traditional credit, enables all historical assessment records of the present invention to be traceable, and ensures the fairness of the assessment and the accountability of responsibilities, ensuring the security and fairness of the assessment process.

[0059] Second, the method of the present invention embeds a smart contract in the random forest model. The random forest algorithm evaluates the credit data, and ranks the feature importance of different features in the credit data before the algorithm evaluation to identify the key variables most representative of the credit assessment, avoiding the assessment deviation caused by feature redundancy or selection errors in the traditional method. This improves the risk assessment accuracy of the credit data in the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 is a schematic structural diagram of the system of the present invention;

[0061] Figure 2 is a flowchart of the method of the present invention. DETAILED DESCRIPTION OF THE INVENTION

[0062] Next, the methods and systems in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, only some of the embodiments of the present invention are described, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts belong to the scope of protection of the present invention.

[0063] Refer to Figure 1 , and make a further detailed description of the system of the present invention.

[0064] The system of the present invention includes a system deployment module, a user registration module, a credit information module, a credit evaluation module, and an evaluation result signature module, where:

[0065] The system deployment module builds a blockchain network in the form of a consortium chain based on the FISICI BCOS blockchain underlying platform, generates smart contracts required for each module of the system, and deploys system smart contracts in the blockchain network. Other modules of the system can call the system smart contracts to implement module functions.

[0066] The user registration module is used to register the user's digital identity DID on the blockchain for the user, and the digital identity on the chain can digitally sign the user's credit evaluation result.

[0067] The credit information upload module is used to upload user credit data to the blockchain.

[0068] The credit evaluation module is used to evaluate the user's credit level through the random forest algorithm. First, the data submitted by the user is processed, its missing values are filled, and explanatory variables and scoring indicators are selected from the data submitted by the user. After the index selection is completed, feature importance screening is performed on it to obtain the most suitable feature variables for user credit evaluation and evaluate the user's credit.

[0069] The evaluation result signature module is used to send the credit evaluation result to the evaluated person. The evaluated person views the credit evaluation result and digitally signs it and saves the credit evaluation result with the digital signature to the blockchain.

[0070] Refer to Figure 2 , and make a further detailed description of the implementation steps of the method of the present invention in the trust evaluation of small and medium-sized enterprises.

[0071] Step 1, the system deployment module generates system smart contracts.

[0072] The system first completes the initialization of the blockchain environment and the contract deployment operation. The system deployment module generates and deploys multiple function modular smart contracts according to the requirements of the business process, specifically including the following steps:

[0073] The first step is to deploy an on-chain account registration contract, which is used to implement the on-chain registration of user identities and the generation of unique identifiers, ensuring that all operating entities are traceable and anti-counterfeiting. This contract is designed to implement the registration and management of user identities on the blockchain. Inside the contract, there is a mapping structure mapping(address => User), where the User structure records fields such as user ID, public key, and registration time. The registration function registerUser() will verify whether the user address already exists. If it does not exist, a unique ID will be assigned and recorded.

[0074] The second step is to deploy a credit information contract, which is used to receive user credit data and encrypt it onto the chain, achieving standardized management and tamper-proof storage of the data. This contract is used to receive the credit characteristic data of users, such as income, liabilities, and the number of credit cards. In the design, a struct CreditData is used to store structured data, and a mapping mapping(address => CreditData) is used to identify the data of each user. The contract provides an uploadCreditData function, requiring the data to be encrypted by the client and uploaded onto the chain to ensure data privacy. The contract records the upload timestamp and triggers the CreditDataUploaded event to ensure that the data cannot be tampered with and cannot be updated after submission. The third step is to deploy a credit assessment algorithm contract, which embeds a credit assessment model based on random forest to automatically execute the scoring logic on the on-chain data, achieving the automation and transparency of the assessment process; this contract integrates a preset scoring model, and its main structure stores decision tree nodes in the form of an array or a mapping. Each node includes fields: feature index, threshold, left child node, right child node, and output value (leaf node). The scoring function evaluateScore calculates the result recursively by reading the data uploaded by the user and according to the tree structure.

[0075] The third step is to deploy a digital signature contract to verify the signatures of the data and evaluation results submitted by users, enhancing the data credibility and non-repudiation of the system. This contract is responsible for verifying the authenticity of user data and scoring results. In the design, the ECDSA algorithm is used to generate signatures for the submitted data and results, and a mapping mapping(bytes32 => bytes) storing the signatures and the original hash values is used. The verification function verifySignature checks whether the signature comes from the corresponding user address. This mechanism prevents data forgery or repudiation behaviors and ensures the credibility of the entire assessment process.

[0076] Step 4: Deploy a result confirmation contract to achieve the consensus and confirmation of the credit assessment results by all participating parties, which serves as the basis for subsequent authorization and access. This contract implements the consensus confirmation process for the assessment results by the participating parties. The contract design includes a mapping (address => bool) approvals table to record the confirmation status of each party. The function confirmResult allows a participating party to sign and confirm the credit score of a certain user. When the preset majority consent threshold is reached, the status changes to "confirmed". This status serves as the basis for the user to access resources or perform subsequent operations, ensuring that the data is jointly recognized by multiple parties and enhancing the level of trust.

[0077] Step 2: In the embodiments of the present invention, all users register their corresponding digital identities in the blockchain-based credit assessment system. The user registration module registers a unique digital identity for each user to achieve the registration of their digital identities.

[0078] The digital identity is used for the digital signature when the user uploads information to the blockchain in the credit information upload module;

[0079] The user's registration of a digital identity means that an individual participating in the credit rating registers a credential in the blockchain network

[0080] Step 3: The implementation steps of the function of uploading credit-related information in the embodiments of the present invention are as follows:

[0081] Step 3.1: In the credit data preparation step, the user sorts and classifies the original credit information according to a preset classification standard, converts the unstructured data into a structured data format recognizable by the blockchain such as JSON or XML, and at the same time performs desensitization processing on sensitive fields involving personal privacy using the SHA-256 hash algorithm or homomorphic encryption technology.

[0082] Step 3.2: In the data upload request step, the user calls a pre-deployed smart contract through the blockchain node client, submits the processed credit data packet together with the metadata (including data source, timestamp, version number, etc.), and digitally signs the upload request using the private key of the participant to complete identity authentication and anti-tampering verification.

[0083] Step 3.3: In the data verification step, the smart contract automatically executes the verification logic, including: verifying the data integrity through the Merkle tree, checking the DID identity information and access rights of the submitter, checking whether the data format conforms to the preset specification, and verifying the validity of the digital signature to ensure that only legal and compliant data can enter the subsequent processing process.

[0084] Step 3.4, the data storage step is to encrypt the verified original credit data using the AES-256 encryption algorithm and store it in the IPFS distributed storage system. At the same time, record the hash value, storage address, and key feature summary of this data on the blockchain to form an immutable evidence record, realizing a hybrid storage architecture of "storing evidence on the chain and storing data off the chain".

[0085] Step 3.5, the index generation step is that the smart contract automatically triggers an event to generate an index record containing key information such as the data owner's DID, data type, and time range, and associates the index with the hash pointer of the original data and stores it in the blockchain database to establish an efficient multi-dimensional query mechanism.

[0086] Step 4, the credit assessment module uses the random forest algorithm to evaluate the user's credit level. First, process the data submitted by the user, fill in its missing values, select explanatory variables and scoring metrics from the data submitted by the user, and perform feature importance screening after the index selection to obtain the feature variables most suitable for user credit assessment and combine with the smart contract to conduct a credit assessment of the user.

[0087] Step 4.1, the data preprocessing step is that the smart contract automatically cleans and transforms the original credit data submitted by the user, specifically including the following sub-steps:

[0088] Step 4.1.1, data integrity check: The smart contract first verifies the integrity of the data fields and marks the missing fields.

[0089] Step 4.1.2, missing value processing: Adopt the KNN missing value filling algorithm (formula: ), where the k value is dynamically set to 3 - 5 nearest neighbors according to the data characteristics.

[0090] Step 4.1.3, data standardization: Use the Z-score standardization method: where μ and σ are obtained from the training dataset and stored in the contract state variables.

[0091] Step 4.1.4, outlier detection: Identify abnormal data points through the Gini impurity calculation, and truncate the values outside the 3σ range.

[0092] Step 4.1.5, resource consumption calculation: The Gas cost consumed by all preprocessing operations is calculated and recorded in real time according to the formula GasCost = ∑(BaseCost i ×OpCount i .

[0093] Step 4.2, the feature engineering step is that the smart contract performs the following detailed operations.

[0094] Step 4.2.1, Feature Importance Evaluation: Feature importance scoring based on random forest Among them, N_tree is set to 300.

[0095] Step 4.2.2, Feature Screening: Retain the top 15 feature variables in terms of importance scores, specifically including core indicators such as repayment records, debt ratios, and income stability.

[0096] Step 4.2.3, Feature Verification: Calculate the AUC-ROC metric It is required that the AUC of the validation set ≥ 0.85 to pass the verification.

[0097] Step 4.3, The model inference step is the detailed execution process of the random forest algorithm deployed in the smart contract.

[0098] Step 4.3.1, Model Initialization: Load the pre-trained random forest model parameters, including the structure and splitting thresholds of 500 decision trees

[0099] Step 4.3.2, Prediction Execution: Execute the integrated prediction function where B = 500 and x is the preprocessed feature vector

[0100] Step 4.3.3, Rating Classification: Output the final rating according to the following credit rating conversion formula:

[0101] y ≥ 800, LEVEL A; 700 ≤ y < 800, LEVEL B; y < 700, LEVEL C

[0102] Step 4.3.4, Performance Monitoring: The model accuracy is monitored in real time through the formula When the accuracy is lower than 90%, a model update warning is triggered.

[0103] Step 4.4, The result verification step is the complete process of confirming the evaluation results through the consensus mechanism.

[0104] Step 4.4.1, Node Selection: The system randomly selects 5 verification nodes, and at least 3 of them need to complete the verification.

[0105] Step 4.4.2, Independent Calculation: Each node performs independent calculations using the same preprocessing formula and model algorithm.

[0106] Step 4.4.3, Consensus Reached: The final result needs to meet the Byzantine fault tolerance condition (n ≥ 3f + 1), where f = 1 indicates that 1 malicious node is allowed to exist.

[0107] Step 4.4.4, Result Upload: The total Gas consumed in the complete calculation process is recorded on the chain, including the calculation time consumption and resource consumption details of each node.

[0108] Step 5, The evaluation result signature module sends the credit evaluation result to the evaluated person and blockchain participants for digital signature.

[0109] First step, the evaluation result signature module sends the result to the blockchain participants and the evaluated person respectively.

[0110] Second step, the evaluated person logs in to the credit evaluation system through the on-chain digital identity to view the result information.

[0111] Third step, after the blockchain participants confirm the matching result of the system, they call the digital signature contract and use the private key of the on-chain identity to digitally sign the result.

[0112] Step 6, the evaluation result signature module calls the result confirmation contract and saves the matching result with digital signature to the blockchain network.

[0113] The evaluation result signature module calls the result confirmation contract and saves the signed result to the blockchain network.

[0114] The saved matching result can be viewed and queried by on-chain users, ensuring the traceability of credit information and evaluation results.

[0115] Step 7, the evaluation result signature module calls the result confirmation contract, sends the result to the blockchain participants for digital signature, and then saves the evaluation result with digital signature to the blockchain.

[0116] First step, the evaluation result signature module sends the result to the corresponding participants respectively.

[0117] Second step, the participants log in to the credit evaluation system through the on-chain digital identity to view the evaluation result information.

[0118] Third step, after the blockchain participants confirm the evaluation result of the system, they call the digital signature contract and use the private key of the on-chain identity to digitally sign the matching result.

[0119] Fourth step, the evaluation result signature module saves the matching result digitally signed by the participants to the blockchain.

[0120] The saved evaluation result can be viewed and queried by on-chain users, ensuring the traceability of the credit information and evaluation results submitted by users.

Claims

1. A credit assessment system based on the random forest algorithm and blockchain, characterized in that, The evaluation system includes a system deployment module, a credit information module, a trust evaluation module, and an evaluation result confirmation module; among them, The system deployment module is used to select a communication node from the consensus nodes of the blockchain; deploy a contract on the blockchain of the selected communication node, and save the contract address returned by the blockchain after the contract deployment to the system deployment module; after the user completes the deployment of the on-chain account registration contract, the address of the contract returned by the system calls the on-chain account registration contract to generate a DID corresponding to the contract on the blockchain; The credit information module is used to save the DID and the credit information contract submitted by the user, call the user credit information contract, upload the user's DID and credit information to the blockchain, and after the DID verification passes, perform structured processing on the unstructured data in the credit information and then upload the contract to the blockchain for storage; The trust evaluation module is used to fill in blank values and perform standardization processing on the user's credit data obtained from the blockchain; call the EvaluateScore function in the trust evaluation contract to perform credit evaluation on the feature variables with the highest importance scores among the trust data submitted by the user, take the average of the trust prediction values of each decision tree as the final trust prediction value, and submit it to the trust evaluation module for storage after trust level conversion; The evaluation result confirmation module is used to call the result confirmation contract, send the result to the blockchain participants for digital signature, and then save the evaluation result with the digital signature to the blockchain.

2. A credit assessment method based on the random forest algorithm and blockchain for the credit assessment system according to claim 1, characterized in that The steps of this method are as follows: Step 1, the system deployment module selects a communication node from the consensus nodes of the blockchain; Step 2, the system deployment module deploys a contract on the blockchain of the selected communication node, and saves the contract address returned by the blockchain after the contract deployment to the system deployment module; the contracts include an on-chain account registration contract, a credit information contract, a credit evaluation algorithm contract, and a digital signature contract; Step 3, after the user completes the deployment of the on-chain account registration contract, the address of the contract returned by the system calls the on-chain account registration contract to generate a DID corresponding to the contract on the blockchain; the user submits the generated DID and the credit information contract to the credit information module; Step 4, the credit information module calls the user credit information contract, uploads the user's DID and credit information to the blockchain, and after the DID verification passes, performs structured processing on the unstructured data in the credit information and then uploads the contract to the blockchain for storage; Step 5, the trust evaluation module fills in the blank values and standardizes the credit data of the user obtained from the blockchain; Step 6, the trust evaluation module calls the EvaluateScore function in the trust evaluation contract to conduct a credit evaluation on the feature variables among the top in terms of importance score in the trust data submitted by the user, takes the average of the trust prediction values of each decision tree as the final trust prediction value, and submits it to the trust evaluation module for saving after trust level conversion; Step 7, the user logs in to the system, and the evaluation result confirmation module performs digital signature on the evaluation result.

3. The credit assessment method according to claim 2, characterized in that, The selection of a communication node from the consensus nodes of the blockchain in Step 1 means calculating the campaign value of each consensus node in the blockchain, and selecting the consensus node corresponding to the largest campaign value among all consensus nodes as the communication node of the blockchain: Among them, S i represents the election value of the i-th consensus node, n represents the total number of consensus nodes, and p i represents the amount of margin pledged by the i-th consensus node, and P total represents the total amount of margin pledged by all consensus nodes in the blockchain, and t(i, j) represents the communication delay between the i-th node and the j-th node among the consensus nodes.

4. The credit assessment method according to claim 2, wherein The implementation content of the contract in Step 2 is as follows: The on-chain account registration contract converts the user name in string type submitted by the user into a DID through the UserRegister function and stores the DID on the blockchain; The credit information contract receives the credit data submitted by the user and stores it on the blockchain through the uploadCreditData function; The random forest credit scoring model composed of multiple decision trees is embedded in the credit evaluation algorithm contract; this contract performs trust evaluation on the credit data submitted by the user; The digital signature contract uses the GenerateSignature function to generate a signature for the data to be signed according to the user's private key using the ECDSA algorithm.

5. The credit assessment method according to claim 4, wherein Embedding a random forest credit scoring model composed of multiple decision trees in the credit evaluation algorithm contract means that the structural information of each decision tree, including the feature index corresponding to the split node, the split threshold, the left and right child node relationships, and the predicted values of the leaf nodes, is uniformly converted into a data structure that can be called within the contract, and the feature importance screening logic is integrated into the FeatureSelection function of the credit evaluation algorithm contract, and the prediction logic of the decision tree and the mean process of the prediction results of all trees are integrated into the EvaluateScore function within the contract.

6. The credit assessment method according to claim 4, wherein The steps for performing a trust evaluation on the credit data submitted by the user are as follows: In the first step, feature screening is performed on the credit data submitted by the user. According to the reduction in impurity caused by each feature in the decision tree node split in the credit data, the importance score of the feature is calculated according to the following formula: Among them, Importance j represents the importance score of the j-th feature in the splitting of the decision tree node. N tree represents the number of decision trees for calculating feature importance, which is set to 300. T represents the set of all splitting nodes in a tree, t represents the serial number of the splitting node in the decision tree, Gini(t) represents the Gini impurity before the splitting of the t-th node, and Gini(t') represents the Gini impurity after the splitting of the t-th node; In the second step, the importance scores of all features are sorted in descending order, and the bottom two-thirds of the features are deleted, and only the top one-third of the features are retained as the feature set used in the credit scoring process. In the third step, each decision tree randomly samples from the credit data corresponding to the feature set through the bootstrap sampling method, and the filtered feature set forms the training set. In the fourth step, each time a node is split, one-third of the features are selected from the training set to form a candidate set. The split thresholds of each feature in the candidate set are traversed, the corresponding Gini impurity reduction amount is calculated, and the feature and its split point that result in the largest impurity reduction amount are selected as the optimal split feature and threshold for the node. Repeat this step for the training subset until a complete decision tree structure is constructed. In the fifth step, for the regression task, each decision tree independently outputs a trust prediction value, and finally the prediction values of each decision tree are averaged to obtain the overall credit scoring result.

7. The credit assessment method according to claim 6, wherein The steps for processing the credit data described in step 5 are as follows: In the first step, the blank values in the trust data submitted by the user are filled through the KNN algorithm: where x miss represents the missing value to be filled in the data sample submitted by the user, and x i represents the value of the i-th neighbor sample that is the most similar to the sample corresponding to the missing value feature in the feature space of the data submitted by the user for this feature, and k represents the 3-5 nearest neighbors of the feature value of the i-th neighbor sample; In the second step, the credit data is standardized through the Z-score normalization method: where x' represents the standardized feature value, μ represents the mean of the feature in the training subset, and σ represents the standard deviation of the feature in the training set.

8. The credit assessment method according to claim 7, wherein The steps for processing the trust prediction score described in step 6 are as follows: In the first step, the EvaluateScore function in the trust evaluation contract averages the trust prediction values of each decision tree to obtain the final trust prediction value; Among them, y represents the continuous value output by the model, B represents the total number of decision trees, x represents the preprocessed feature vector, and T b represents the prediction value given by the b-th decision tree for the input feature x; In the second step, according to the following credit rating conversion rules, the EvaluateScore function is used to convert the trust prediction value to obtain the final rating of the user trust evaluation: y≥800, LEVEL A, 700≤y<800, LEVEL B, y<700, LEVEL C Among them, LEVEL represents the final rating of the trust assessment, including three levels: A, B, and C. A means that the final rating of the user trust assessment obtained by converting the trust prediction value is excellent, B means that the final rating of the user trust assessment obtained by converting the trust prediction value is average, and C means that the final rating of the user trust assessment obtained by converting the trust prediction value is poor.

9. The credit assessment method according to claim 8, characterized in that The steps for digitally signing the evaluation results described in step 7 are as follows: In the first step, the credit assessment module evaluates the credit information submitted by the user and returns the credit score result to the user; In the second step, the user logs into the credit assessment system through the on-chain digital identity DID to obtain the result information; In the third step, after receiving the result information, the user digitally signs the confirmed evaluation result to indicate that he / she approves the result. The signature is completed using his / her private key.

Citation Information

Patent Citations

  • Credit evaluation system for agricultural Internet of Things sensing layer nodes based on block chain

    CN113114473A

  • A credit assessment system based on agricultural blockchain IoT sensing layer nodes

    CN113114473B

  • Enterprise credit assessment method and system based on block chain and homomorphic encryption

    CN113435744A

  • A method and system for enterprise credit assessment based on blockchain and homomorphic encryption

    CN113435744B