Node role adjustment method based on node trust value in relay chain

By introducing node trust value adjustment method in the relay chain, analyzing node trust value and dividing roles, the transaction verification inaccuracy and reliability problems of the relay cross-chain system are solved, and the security and performance of the system are improved.

CN118694510BActive Publication Date: 2024-11-19NANJING UNIV OF INFORMATION SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411163217.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2024-11-19
Estimated Expiration
2044-08-23

AI Technical Summary

Technical Problem

The current transaction verification of the relay cross-chain system is low and the traditional notary mechanism relies on the credibility of the intermediary nodes and lacks a rollback strategy to deal with transaction failures. The relay chain needs to process and store a large amount of block header information. Causes performance impact.

Method used

By introducing the adjustment method of node trust value in the relay chain, the trust value calculation algorithm is used to analyze the resource capabilities of nodes, process transaction conditions and cooperation between nodes, determine the trust value, and divide the trust value through the trust value consensus and role adjustment mechanism. Node roles to improve system reliability and security.

Benefits of technology

It effectively solves the opacity and centralization of node elections. By punishing malicious nodes, the accuracy and reliability of transaction verification of relay cross-chain systems are improved, and the possibility of malicious node attacks is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118694510B_ABST
    Figure CN118694510B_ABST
Patent Text Reader

Abstract

The present application relates to a node role adjustment method based on the node trust value in the relay chain. The method includes: when the trust value update instruction is triggered, each node in the relay chain system obtains the resource capacity, transaction processing status and node-to-node collaboration status of the trust value node to be updated in the relay chain system from the last trust value update time point to the current trust value update time point, analyzes the trust value of the trust value node to be updated, and determines the current trust value of the trust value node to be updated; deducts the deposit paid when joining the relay chain from the node whose current final trust value is less than the trust threshold among the trust value nodes to be updated, and kicks it out of the relay chain system; when the node role adjustment instruction is triggered, the roles are divided according to the current final trust value of all nodes, and the final relay chain collection node set, committee node set and verification node set are determined. The correctness and reliability of transaction verification of the relay cross-chain system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of blockchain technology, and in particular to a node role adjustment method based on node trust values ​​in a relay chain. Background Art

[0002] Due to the decentralization and security of blockchain, it has been widely used in many fields. The distributed ledger structure provided by blockchain makes transaction and circulation records open, transparent, tamper-proof and traceable. As a secure distributed network architecture, it has received widespread attention in the Mobile Edge Computing (MEC) system. Blockchain-based decentralized computing service platforms, such as iExec and Golem, can provide powerful computing power and meet users' needs for processing complex computing tasks and applications through resource management and financial incentives. In the distributed management architecture based on blockchain, with the rapid growth of mobile users' demand for services, a large number of consensus authentication processes have emerged. Due to access rights restrictions, inconsistent encryption standards, and data privacy and security issues, the existence of consortium chains and private chains will limit the interoperability between blockchains, resulting in a significant increase in system authentication costs. Blockchain cross-chain technology can break through the barriers between different blockchains, shield the underlying differences between different blockchains, assist blockchains in completing inter-chain communication and interaction, and realize on-chain data circulation sharing and business collaboration.

[0003] At present, blockchain cross-chain technology is mainly divided into three categories: notary mechanism, side chain / relay chain mechanism and hash lock mechanism. Among them, the relay chain mechanism has many advantages such as strong versatility and high degree of decentralization, and has received widespread attention. However, the current relay chain technology still has problems such as poor node verification and consensus performance. The trust mechanism can be used to ensure that blockchain nodes provide trusted and reliable services, and enhance the privacy and security of interactive or communication nodes in the relay chain environment. The adoption of this trust mechanism can also reduce risks, improve the predictability of the relay chain system, and help the relay chain system operate better, thereby reducing malicious nodes and consensus failures.

[0004] Although many cross-chain technologies and concepts have been proposed, there are still some problems. For example, the traditional notary mechanism relies on one or more nodes that are mutually trusted by both parties to the transaction as intermediaries to complete cross-chain transactions. Although it is relatively mature, there is still room for improvement. First, the success of the transaction is highly dependent on the credibility and security of the intermediary node; second, if multiple intermediaries are involved, the risk increases accordingly, and the failure of any intermediary may lead to the failure of the transaction; finally, the mechanism lacks a rollback strategy for transaction failures. Once a problem occurs in the transaction, the interests of the participants may be damaged. Therefore, the traditional notary mechanism needs to be optimized in terms of the reliability of the selection of intermediaries and the remedial measures after the transaction fails.

[0005] In addition to the notary mechanism, many current cross-chain technologies also face challenges. For example, although the relay chain mechanism supports the interaction of multiple heterogeneous blockchains, the relay chain needs to process and store a large amount of block header information from different blockchains, which places high demands on data processing and storage capabilities. Cross-chain performance may be affected by the increase in transaction complexity, and all key verification steps are completed on the relay chain, which requires the relay chain to have higher performance, and the overall efficiency depends on the current state of the relay chain.

[0006] Therefore, the correctness and reliability of transaction verification in the current relay cross-chain system are low. Summary of the invention

[0007] Based on this, it is necessary to provide a node role adjustment method based on the node trust value in the relay chain, which can improve the correctness and reliability of transaction verification in the relay cross-chain system, in response to the above technical problems.

[0008] A node role adjustment method based on node trust values ​​in a relay chain, the method comprising:

[0009] When the trust value update instruction is triggered, each node in the relay chain system obtains the resource capabilities, transaction processing status and inter-node collaboration status of the trust value node to be updated in the relay chain system from the last trust value update time point to the current trust value update time point, calls the node trust value calculation algorithm to analyze the trust value of the trust value node to be updated, and determines the current trust value of the trust value node to be updated;

[0010] Each node in the relay chain system sends the current trust value of the trust value node to be updated to other nodes for trust value consensus, and determines the current final trust value of the trust value node to be updated;

[0011] The nodes whose current final trust value is less than the trust threshold among the trust value nodes to be updated are deducted the deposit paid when joining the relay chain, and kicked out of the relay chain system;

[0012] When the node role adjustment instruction is triggered, each node in the relay chain system obtains the current final trust value of all nodes in the relay chain system to divide the roles and determine the relay chain collection node set, committee node set and verification node set;

[0013] Each node in the relay chain system sends the relay chain collection node set, committee node set and verification node set to other nodes for consensus to determine the final relay chain collection node set, committee node set and verification node set.

[0014] In one of the embodiments, when the trust value update instruction is triggered, each node in the relay chain system obtains the resource capabilities, transaction processing status and inter-node collaboration status of the trust value node to be updated in the relay chain system from the last trust value update time point to the current trust value update time point, calls the node trust value calculation algorithm to analyze the trust value of the trust value node to be updated, and determines the current trust value of the trust value node to be updated, including:

[0015] When the trust value update instruction is triggered, each node in the relay chain system determines the trust value node to be updated according to the trust value node type to be updated carried in the trust value update instruction;

[0016] Each node in the relay chain system obtains the resource capabilities, transaction processing status, and inter-node collaboration status of the trust value node to be updated in the relay chain system from the last trust value update time point to the current trust value update time point, calls the node trust value calculation algorithm to analyze the trust value of the trust value node to be updated, and determines the current trust value of the trust value node to be updated;

[0017] Each node in the relay chain system compares the current trust value of the trust value node to be updated with the previous trust value, determines the trust value node to be updated whose fluctuation range exceeds the threshold, calls the node trust value correction algorithm to correct the trust value of the trust value node to be updated whose fluctuation range exceeds the threshold, and obtains the corrected trust value;

[0018] The corrected trust value is used as the current trust value of the trust value node to be updated.

[0019] In one embodiment, the node trust value calculation algorithm includes:

[0020] Analyze the resource capabilities of the trust value node to be updated and determine the trust value node to be updated i The trust value of the capability of the node to be updated i Capability trust value C i The expression is:

[0021] ;

[0022] in, for The normalized result is i ∈1, 2, …, J , J To represent the trust value node to be updated i The number of resource capabilities, Indicates the trust value node to be updated i No. jResource capabilities;

[0023] The trust value node to be updated is determined by analyzing the transaction status of the trust value node to be updated from the last trust value update time point to the current trust value update time point. i With current role r In the current t The behavior trust value of the trust value update, the trust value node to be updated i With current role r In the current t Behavior trust value of trust value update The expression is:

[0024] ;

[0025] in, α r , β r and γ r is the weight, The trust value node to be updated i With current role r The number of transactions successfully processed between the last trust value update time and the current trust value update time, The trust value node to be updated i With current role r The number of transactions that failed to be processed between the last trust value update time point and the current trust value update time point, The trust value node to be updated i With current role r The trust value that is reduced because the processing time of cross-chain transactions exceeds the threshold between the last trust value update time point and the current trust value update time point, The trust value node to be updated i The trust value of the current character that has been reduced due to unprocessed transactions from the last trust value update time point to the current trust value update time point;

[0026] The trust value node to be updated is determined by analyzing the inter-node collaboration between the trust value node to be updated and the trust value node to be updated. i With current role r In the current t The collaborative trust value of the trust value update, the trust value node to be updated i With current role r In the current t The collaborative trust value of the trust value update The expression is:

[0027] ,

[0028] ;

[0029] in, For Node a Trust value nodes to be updated between the last trust value update time point and the current trust value update time point i The collaborative trust accounts for the trust value nodes to be updated i The weight of the total collaborative trust from the last trust value update time point to the current trust value update time point, For Node a Trust value nodes to be updated between the last trust value update time point and the current trust value update time point i The collaborative trust value, p is the node with the trust value to be updated i The number of nodes that have collaborated, For time slot z The number of successful collaborations performed in the node a and the trust value node to be updated i The proportion of total collaboration between z is a time slot from the last trust value update time point to the current trust value update time point, s is the total number of time slots divided from the time point of the last trust value update to the time point of the current trust value update, is the time decay coefficient of time slot z;

[0030] The current trust value of the trust value node to be updated is determined by analyzing the capability trust value, behavior trust value and collaboration trust value of the trust value node to be updated. The expression is:

[0031] ;

[0032] in, α , β and γ are the weights of the capability trust value, collaboration trust value and behavior trust value of the trust value node to be updated, respectively. α + β + γ= 1.

[0033] In one embodiment, the node trust value correction algorithm includes:

[0034] Get the trust value node to be updated i With current role r List of historical trust values , ,in, is the trust value node to be updated t- The trust value of 1 trust value update;

[0035] According to the trust value node to be updated i With current role r The historical trust value list is analyzed to determine the trust value node to be updated i The historical trust value fluctuations, the historical trust value fluctuations U The expression is:

[0036] ;

[0037] in, Indicates the trust value node to be updated i The historical average trust value of Indicates the trust value node to be updated i In the n The trust value of the trust value update, t The trust value node to be updated i The number of trust value updates at the current trust value update time point;

[0038] According to the trust value node to be updated i The historical trust value fluctuations are analyzed to determine the trust value node to be updated i In the current t The historical trust value when the trust value is updated, the trust value node to be updated i In the current t Historical trust value at the time of trust value update The expression is:

[0039] ;

[0040] in, is the threshold of trust value fluctuation, is the time decay parameter;

[0041] According to the trust value node to be updated i In the current t Historical trust value at the time of trust value update Current trust value Correction is performed to determine the trust value node to be updated i The corrected trust value, the trust value node to be updated i Corrected confidence value The expression is:

[0042] .

[0043] In one embodiment, when the node role adjustment instruction is triggered, each node in the relay chain system obtains the current final trust value of all nodes in the relay chain system to perform role division, and determines the relay chain collection node set, committee node set and verification node set, including:

[0044] When the node role adjustment instruction is triggered, each node in the relay chain system obtains the current final trust value of all nodes in the relay chain system;

[0045] Sort all nodes according to their trust values ​​from large to small to obtain a node queue;

[0046] According to the preset distribution ratio of the relay chain collection node set, committee node set and verification node set, the number of nodes corresponding to the committee node set is determined q 1. Verify the number of nodes corresponding to the node set q 2 and the number of nodes corresponding to the relay chain collection node set q 3;

[0047] The node queue is placed in front q 1 node is determined as a committee node in the committee node set, and the first node in the node queue is q 1+1 nodes to q 1+ q Two nodes are determined as verification nodes in the verification node set, and the remaining nodes in the node queue are determined as relay chain collection nodes in the relay chain collection node set.

[0048] The node role adjustment method based on the node trust value in the relay chain is as follows: when the trust value update instruction is triggered, each node in the relay chain system obtains the resource capabilities, transaction processing status and inter-node collaboration status of the trust value node to be updated in the relay chain system from the last trust value update time point to the current trust value update time point, calls the node trust value calculation algorithm to analyze the trust value of the trust value node to be updated, and determines the current trust value of the trust value node to be updated; each node in the relay chain system sends the current trust value of the trust value node to be updated to other nodes for trust value consensus, and determines the current trust value of the trust value node to be updated. Final trust value; the node whose current final trust value is less than the trust threshold in the trust value node to be updated will have the deposit paid when joining the relay chain deducted, and will be kicked out of the relay chain system; when the node role adjustment instruction is triggered, each node in the relay chain system obtains the current final trust value of all nodes in the relay chain system to divide the roles, and determine the relay chain collection node set, committee node set and verification node set; each node in the relay chain system sends the relay chain collection node set, committee node set and verification node set to other nodes for consensus, and determines the final relay chain collection node set, committee node set and verification node set. Therefore, the node capabilities, transaction processing behaviors and collaborative relationships of the nodes in the relay chain system are comprehensively considered, and the opacity and centralization of node elections are effectively solved. By punishing malicious nodes, the cost of malicious node attacks is increased and the possibility of attacks is reduced, thereby improving the correctness and reliability of transaction verification in the relay cross-chain system. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 A schematic diagram of a process of adjusting a node role based on a node trust value in a relay chain in one embodiment;

[0050] Figure 2 A diagram showing a relationship between node roles changing according to node trust values ​​in an embodiment;

[0051] Figure 3 A schematic diagram of the structure of a method for adjusting node roles based on node trust values ​​in a relay chain in one embodiment. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0053] In one embodiment, Figure 1 As shown, a node role adjustment method based on the node trust value in the relay chain is provided, comprising the following steps:

[0054] Step S220, when the trust value update instruction is triggered, each node in the relay chain system obtains the resource capabilities, transaction processing status and inter-node collaboration status of the trust value node to be updated in the relay chain system from the last trust value update time point to the current trust value update time point, and calls the node trust value calculation algorithm to analyze the trust value of the trust value node to be updated, and determines the current trust value of the trust value node to be updated.

[0055] The trust value node to be updated may be a node in the relay chain system that needs to update its trust value at the current trust value update time point.

[0056] Among them, the resource capabilities of the node include the computing power of the node processor, the size of the main memory, the bandwidth and other resources that are not easy to change over time. The resource capability set of the node is recorded as: , Indicates the trust value node to be updated i No. j resource capacity, i ∈1, 2, …, J , J To represent the trust value node to be updated i The resource capacity of a node can be obtained when the node joins the relay chain system and is sent by the application chain where the node is located to the supervisory node of the relay chain system.

[0057] Among them, the application chain includes the source chain and the target chain. The application chain is connected to the relay chain system through registration and has a separate consensus mechanism to ensure its own security. The source chain and the target chain are the application chains of the transaction initiator and receiver respectively.

[0058] Among them, the supervisory node is responsible for supervising the behavior of several other nodes in the relay chain system, and the supervisory node does not participate in the trust value evaluation of the node.

[0059] Among them, the transaction processing status of the node can be generated because each behavior is the processing of cross-chain transactions, such as the number of successfully processed transactions, the number of failed transactions, the trust value reduced because the processing time of cross-chain transactions exceeds the threshold, and the trust value reduced due to unprocessed transactions, etc. The behavior and the number of times are recorded in the relay chain system to ensure the authenticity of the behavior.

[0060] Among them, the inter-node collaboration situation of the nodes can be the actual collaborative behavior between the nodes due to the processing of cross-chain transactions and recorded in the relay chain system, such as: collecting and forwarding transactions / consensus results / blocks, collecting transaction packages / forwarding signature packages, and sending consensus results.

[0061] Among them, the smart contract for the relay chain system is deployed in the Ethereum blockchain system. By executing the smart contract, the trust evaluation and related information of the nodes in the relay chain system are automatically collected. According to the node role, the node behavior information and collaborative behavior information, the number of successful transactions, the total number of transactions, the total time, the stable operation time, the processing time, etc. are obtained and stored on the nodes of the relay chain system.

[0062] Among them, the nodes in the relay chain system are arranged in descending order according to their trust values. q 1 node is designated as the committee node, followed by q 1+1 nodes to q 1+ q The second node is a verification node, and the last is a relay chain collection node. Depending on the different trust values ​​of the nodes, their roles r= 1, 2, and 3 represent committee nodes, verification nodes, and relay chain collection nodes, respectively. Nodes with different roles perform different functions.

[0063] Among them, the committee node is responsible for collecting cross-chain transaction verification results submitted by multiple verification groups in the relay chain system. If the committee verification is passed, the committee leader node will package these results into blocks for broadcast across the entire relay chain.

[0064] The verification group consists of verification nodes. According to the trust value and communication delay of the verification node, the verification node is assigned to different verification groups.

[0065] Among them, the verification node refers to the node that verifies the transactions sent by the relay chain collection node, and forwards them to the leading node among the verification nodes after the transaction is verified.

[0066] Among them, the relay chain collection node is responsible for collecting transactions issued by the source chain collection node and forwarding them to the verification group.

[0067] Among them, due to the special characteristics of the relay cross-chain system, such as the need to process a large number of concurrent transactions and the need for multi-role nodes to collaborate to complete tasks, the evaluation indicators are also different from previous trust calculations. Multi-source trust evaluation methods such as comprehensive capability trust, behavioral trust and collaborative trust are used to improve the accuracy of node trust calculation in the relay system.

[0068] In one embodiment, when the trust value update instruction is triggered, each node in the relay chain system obtains the resource capabilities, transaction processing status, and inter-node collaboration status of the trust value node to be updated in the relay chain system from the last trust value update time point to the current trust value update time point, and calls the node trust value calculation algorithm to analyze the trust value of the trust value node to be updated, and determines the current trust value of the trust value node to be updated, including:

[0069] When the trust value update instruction is triggered, each node in the relay chain system determines the trust value node to be updated according to the type of the trust value node to be updated carried by the trust value update instruction; each node in the relay chain system obtains the resource capacity, transaction processing status and inter-node collaboration status of the trust value node to be updated in the relay chain system from the last trust value update time point to the current trust value update time point, calls the node trust value calculation algorithm to analyze the trust value of the trust value node to be updated, and determines the current trust value of the trust value node to be updated; each node in the relay chain system compares the current trust value of the trust value node to be updated with the previous trust value, determines the trust value node to be updated whose fluctuation range exceeds the threshold, calls the node trust value correction algorithm to correct the trust value of the trust value node to be updated whose fluctuation range exceeds the threshold, and obtains the corrected trust value; and uses the corrected trust value as the current trust value of the trust value node to be updated.

[0070] Among them, after completing a period of cross-chain transaction process, the node trust value is dynamically updated and the node role is adjusted. In order to save the maintenance and calculation overhead of the trust value, the node trust value is updated by a dynamic detection cycle method, and a dynamic update cycle is provided, that is: for nodes whose node trust value maintains a high trust value or steadily increases, a long update cycle is adopted (such as updating after the term of multiple accounting nodes expires), and vice versa, for nodes whose node trust value is low or continuously decreasing, a short update cycle is adopted. Therefore, the node types of trust values ​​to be updated may include: node types whose node trust value maintains a high trust value (that is, the node trust value is greater than the preset first threshold) or steadily increases, and node types whose node trust value is low (that is, the node trust value is less than the preset second threshold) or continuously decreases, wherein the preset first threshold is greater than the preset second threshold.

[0071] In one example, when the trust value node type to be updated is a node type whose node trust value maintains a high trust value or steadily increases, the trust value node to be updated includes nodes whose node trust value is greater than a preset first threshold and steadily increases; when the trust value node type to be updated is a node type whose node trust value is low or continuously decreases, the trust value node to be updated includes nodes whose node trust value is less than a preset second threshold and continuously decreases.

[0072] It should be understood that on the basis of comprehensively considering the node capabilities, transaction processing behaviors and collaborative relationships of the nodes in the relay chain system, the historical trust values ​​of the nodes are also combined to correct the trust values ​​of the nodes whose fluctuation range exceeds the threshold to be updated, so as to further effectively solve the opacity and centralization problems of node elections.

[0073] In one embodiment, the node trust value calculation algorithm includes:

[0074] Analyze the resource capabilities of the trust value nodes to be updated and determine the trust value nodes to be updated iThe ability trust value of the node to be updated i Capability trust value C i The expression is:

[0075] ;

[0076] in, for The normalized result is i ∈1, 2, …, J , J To represent the trust value node to be updated i The number of resource capabilities, Indicates the trust value node to be updated i No. j Resource capabilities;

[0077] According to the transaction status of the trust value node to be updated from the last trust value update time point to the current trust value update time point, determine the trust value node to be updated i With current role r In the current t The behavior trust value of the trust value update, the trust value node to be updated i With current role r In the current t Behavior trust value of trust value update The expression is:

[0078] ;

[0079] in, α r , β r and γ r is the weight, The trust value node to be updated i With current role r The number of transactions successfully processed between the last trust value update time and the current trust value update time, The trust value node to be updated i With current role r The number of transactions that failed to be processed between the last trust value update time point and the current trust value update time point, The trust value node to be updated i With current role r The trust value that is reduced because the processing time of cross-chain transactions exceeds the threshold between the last trust value update time point and the current trust value update time point, The trust value node to be updated iThe trust value of the current character that has been reduced due to unprocessed transactions from the last trust value update time point to the current trust value update time point;

[0080] According to the cooperation between nodes of the trust value node to be updated from the last trust value update time point to the current trust value update time point, the trust value node to be updated is determined. i With current role r In the current t The collaborative trust value of the trust value update, the trust value node to be updated i With current role r In the current t The collaborative trust value of the trust value update The expression is:

[0081] ,

[0082] ;

[0083] in, For Node a Trust value nodes to be updated between the last trust value update time point and the current trust value update time point i The collaborative trust accounts for the trust value nodes to be updated i The weight of the total collaborative trust from the last trust value update time point to the current trust value update time point, For Node a Trust value nodes to be updated between the last trust value update time point and the current trust value update time point i The collaborative trust value, p The node with the trust value to be updated i The number of nodes that have collaborated, For time slot z The number of successful collaborations in the node a and the trust value node to be updated i The proportion of total collaboration between z is a time slot from the last trust value update time point to the current trust value update time point, s is the total number of time slots divided from the time point of the last trust value update to the time point of the current trust value update, is the time decay coefficient of time slot z;

[0084] According to the ability trust value, behavior trust value and collaboration trust value of the trust value node to be updated, the current trust value of the trust value node to be updated is determined. The expression is:

[0085] ;

[0086] in, α , β and γ are the weights of the capability trust value, collaboration trust value, and behavior trust value of the trust value node to be updated. α + β + γ= 1.

[0087] Among them, if a malicious node launches an attack by providing unstable computing power, the transaction processing time may be extended, resulting in a decrease in the trust value of the malicious node. If the attack of the malicious node involves providing false verification or packaging false transactions into blocks, the verification node and the committee node can discover the behavior through collaboration between nodes, and the supervision node can detect the behavior by monitoring the node behavior stored in the relay chain system. Therefore, the trust value of the malicious node will be reduced due to its bad behavior. Based on the above analysis, there are two key parts to node trust calculation: incentives and penalties. Nodes are rewarded according to their contributions, that is, successfully processed transactions can increase their trust value, and nodes are punished for their bad behavior, that is, unsuccessfully processed transactions will result in a decrease in trust value.

[0088] Among them, the security, credibility and orderliness of a relay chain system as an autonomous whole depend on the joint participation of all nodes in the relay chain governance. Therefore, the participation percentage can be defined as μ To describe the proportion of nodes participating in the transaction consensus and block generation process, the participation percentage μ Can be: , n b Indicates the total number of transaction packages successfully uploaded to the chain in the recent period; n c It refers to the total number of nodes participating in the consensus process during this period. A participation threshold ζ is set to ensure that when the participation of the relay chain system exceeds ζ, it indicates that the relay chain system is co-governed and recognized by the majority of nodes. In theory, the higher the ζ value, the higher the security and credibility of the blockchain. However, if the participation is lower than ζ, it means that the relay chain system has been controlled by some nodes, and its security and credibility become unknown. Therefore, when using the node trust value calculation algorithm to analyze the trust value of the node to be updated, the participation percentage of the relay chain system can be determined first. μ Whether the participation threshold ζ is exceeded, and if it is exceeded, further analysis of the trust value of the trust value node to be updated can further increase the security of the relay chain system.

[0089] It should be understood that node capabilities, node behaviors and collaborative node evaluations are comprehensively considered; in addition to the trust values ​​of the incentive and punishment parts of node behavior, node capability trust and collaborative trust are also added to improve node credibility and more effectively select trusted nodes to participate in the transaction consensus process, thereby enhancing the security of the relay chain system.

[0090] In one embodiment, the node trust value correction algorithm includes:

[0091] Get the trust value node to be updated i With current role r List of historical trust values , ,in, Is the trust value node to be updated t- The trust value of 1 trust value update;

[0092] According to the trust value node to be updated i With current role r Analyze the historical trust value list to determine the trust value node to be updated i Historical trust value fluctuations, historical trust value fluctuations U The expression is:

[0093] ;

[0094] in, Indicates the trust value node to be updated i The historical average trust value of Indicates the trust value node to be updated i In the n The trust value of the trust value update, t The trust value node to be updated i The number of trust value updates at the current trust value update time point;

[0095] According to the trust value node to be updated i Analyze the historical trust value fluctuations and determine the trust value nodes to be updated i In the current t The historical trust value when the trust value is updated, the trust value node to be updated i In the current t Historical trust value at the time of trust value update The expression is:

[0096] ;

[0097] in, is the threshold of trust value fluctuation, is the time decay parameter;

[0098] According to the trust value node to be updated i In the current t Historical trust value at the time of trust value update Current trust value Perform corrections to determine the trust value nodes to be updated i Corrected trust value, trust value node to be updated i Corrected confidence value The expression is:

[0099] .

[0100] Among them, given the existence of malicious behavior and its corresponding reward and punishment mechanism, the historical trust value may change sensitively and show irregular fluctuations. Therefore, different weights will be given according to the fluctuation of the historical trust value to more accurately reflect the dynamic changes of the trust value. If the fluctuation exceeds the threshold , which indicates that the fluctuation of the trust value is large, so the most recent calculated trust value should be the main consideration. On the contrary, if the fluctuation is lower than , which means that the change of trust value is relatively stable, so the historical trust value can be used as the main basis.

[0101] In step S240, each node in the relay chain system sends the current trust value of the trust value node to be updated to other nodes for trust value consensus, and determines the current final trust value of the trust value node to be updated.

[0102] Among them, the trust value consensus method can be that each node receives the trust value node to be updated sent by other nodes. i Current trust value, statistics of trust value nodes to be updated i The number of current trust values ​​that are the same, the current trust value with the largest number of current trust values ​​that are the same is determined as the trust value node to be updated i The current final trust value.

[0103] Step S260: The nodes whose current final trust value is less than the trust threshold among the trust value nodes to be updated will have their deposit paid when joining the relay chain deducted, and will be kicked out of the relay chain system.

[0104] Among them, it is determined whether the trust value of the node to be updated reaches the trust threshold (i.e. greater than or equal to the trust threshold). If it reaches the trust threshold, the node to be updated is determined to be a trusted node, and then the role is divided according to the trust value and participates in the consensus. If the trust threshold is not reached, the deposit paid by the node when joining the relay chain system will be deducted, and the node will be kicked out of the relay chain system.

[0105] Step S280, when the node role adjustment instruction is triggered, each node in the relay chain system obtains the current final trust value of all nodes in the relay chain system to divide the roles and determine the relay chain collection node set, committee node set and verification node set.

[0106] In one embodiment, when the node role adjustment instruction is triggered, each node in the relay chain system obtains the current final trust value of all nodes in the relay chain system to perform role division, and determines the relay chain collection node set, committee node set and verification node set, including:

[0107] When the node role adjustment instruction is triggered, each node in the relay chain system obtains the current final trust value of all nodes in the relay chain system; sorts all nodes from large to small according to the trust value to obtain the node queue; determines the number of nodes corresponding to the committee node set according to the preset distribution ratio of the relay chain collection node set, committee node set and verification node set q 1. Verify the number of nodes corresponding to the node set q 2 and the number of nodes corresponding to the relay chain collection node set q 3; Put the node in the queue q 1 node is determined as the committee node in the committee node set, and the first node in the node queue is q 1+1 nodes to q 1+ q 2 nodes are determined as verification nodes in the verification node set, and the remaining nodes in the node queue are determined as relay chain collection nodes in the relay chain collection node set.

[0108] in, q 1+ q 2+ q 3= N , N is the total number of nodes in the relay chain system, q 1. q 2 and q The ratio of 3 to the total number of nodes in the relay chain system can be dynamically adjusted according to the needs of transaction package verification and committee consensus.

[0109] Among them, the node role is dynamically adjusted according to the needs of cross-chain transaction package verification and committee consensus. During the cross-chain communication process, various nodes perform their duties and dynamically collaborate. After the node trust value is updated, the node role changes according to the node trust value relationship diagram as shown in the figure Figure 2As shown in the figure, trust attributes are added to the nodes in the relay chain system and the trust values ​​are calculated. According to the trust values ​​of the nodes, the nodes are dynamically divided into roles such as relay chain collection nodes, verification nodes and committee nodes. The three types of nodes adjust their roles according to the changes in trust values. Each role has a certain proportion, and the proportion of nodes is dynamically adjusted according to the needs of cross-chain transaction package verification and committee consensus. By having committee nodes and verification nodes with high trust values ​​participate in the transaction consensus process of the relay chain, the number of nodes participating in the transaction consensus is reduced to improve the efficiency of reaching transaction consensus, thereby reducing transaction delays and saving system energy consumption. At the same time, during the operation of the relay chain system, the trust value of the node will change dynamically due to its behavior, so the role of the node will be upgraded and adjusted accordingly to improve the credibility of the node.

[0110] It should be understood that node capabilities, node behaviors and collaborative node evaluations are comprehensively considered; in addition to the trust values ​​of the incentive and punishment parts of node behavior, node capability trust and collaborative trust are also added to improve node credibility and more effectively select trusted nodes to participate in the transaction consensus process, thereby enhancing the security of the relay chain system.

[0111] Step S300, each node in the relay chain system sends the relay chain collection node set, committee node set and verification node set to other nodes for consensus, and determines the final relay chain collection node set, committee node set and verification node set.

[0112] Among them, the consensus method can be that each node counts the number of identical relay chain collection node sets, committee node sets and verification node sets based on the relay chain collection node sets, committee node sets and verification node sets received from other nodes, and determines the one with the largest number of identical relay chain collection node sets, committee node sets and verification node sets as the final relay chain collection node set, committee node set and verification node set.

[0113] The node role adjustment method based on the node trust value in the relay chain is as follows: when the trust value update instruction is triggered, each node in the relay chain system obtains the resource capacity, transaction processing status and inter-node collaboration status of the trust value node to be updated in the relay chain system from the previous trust value update time point to the current trust value update time point, calls the node trust value calculation algorithm to analyze the trust value of the trust value node to be updated, and determines the current trust value of the trust value node to be updated; each node in the relay chain system sends the current trust value of the trust value node to be updated to other nodes for trust value consensus, and determines the current final trust value of the trust value node to be updated. The nodes whose current final trust value is less than the trust threshold in the trust value nodes to be updated will have their deposit paid when joining the relay chain deducted, and will be kicked out of the relay chain system; when the node role adjustment instruction is triggered, each node in the relay chain system obtains the current final trust value of all nodes in the relay chain system for role division, and determines the relay chain collection node set, committee node set and verification node set; each node in the relay chain system sends the relay chain collection node set, committee node set and verification node set to other nodes for consensus, and determines the final relay chain collection node set, committee node set and verification node set. Therefore, the node capabilities, transaction processing behaviors and collaborative relationships of the nodes in the relay chain system are comprehensively considered, and the opacity and centralization of node elections are effectively solved. By punishing malicious nodes, the cost of malicious node attacks is increased and the possibility of attacks is reduced, thereby improving the correctness and reliability of transaction verification in the relay cross-chain system.

[0114] In one embodiment, it is applied to the relay chain system. For the nodes in the relay chain system, it is necessary to solve the trust problem of the interaction between multiple participants in the relay chain system, such as Figure 3 As shown in Figure 1, the proposed node role adjustment method based on the node trust value in the relay chain mainly includes: trust value calculation, node role adjustment and trust value update. First, the trust value of the node is calculated, and then the nodes are divided into three types according to the trust value: committee nodes ( r =1)、Verification Node( r =2), relay chain collection node ( r =3), where rRepresents the role of a node. The verification group is composed of verification nodes, from which one verification node is selected as the verification group leader node. Each type of node performs its own duties and completes the processing of cross-chain transactions in the relay chain system. For example, the relay chain collection node collects and forwards transactions / consensus results / blocks, etc., the verification nodes form a verification group and select the verification group leader node, the nodes in the verification group verify transactions, etc., the verification group leader node collects transaction packages / forwards signature packages, etc., the committee nodes form a committee, verify signature packages, send transaction consensus results, and package blocks, etc. According to the interactive results in transaction processing, when the term of the accounting node expires, the trust value of each node is updated and the role of the node is readjusted. Due to the particularity of the relay chain system scenario, unlike previous trust calculations, the accuracy of relay node trust calculations is improved through multi-source trust evaluation methods such as comprehensive ability trust, behavior trust, and collaborative trust in evaluation indicators.

[0115] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0116] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0117] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A node role adjustment method based on node trust value in a relay chain, characterized in that: The method comprises: When the trust value update instruction is triggered, each node in the relay chain system obtains the resource capabilities, transaction processing status, and inter-node collaboration status of the trust value node to be updated in the relay chain system from the last trust value update time point to the current trust value update time point, and calls the node trust value calculation algorithm to analyze the trust value of the trust value node to be updated, and determines the current trust value of the trust value node to be updated. The resource capabilities include node processor computing power, main memory size, and bandwidth; Each node in the relay chain system sends the current trust value of the trust value node to be updated to other nodes for trust value consensus, and determines the current final trust value of the trust value node to be updated; The nodes whose current final trust value is less than the trust threshold among the trust value nodes to be updated are deducted the deposit paid when joining the relay chain, and kicked out of the relay chain system; When the node role adjustment instruction is triggered, each node in the relay chain system obtains the current final trust value of all nodes in the relay chain system to divide the roles and determine the relay chain collection node set, committee node set and verification node set; Each node in the relay chain system sends the relay chain collection node set, committee node set and verification node set to other nodes for consensus, and determines the final relay chain collection node set, committee node set and verification node set; When the trust value update instruction is triggered, each node in the relay chain system obtains the resource capabilities, transaction processing status and inter-node collaboration status of the trust value node to be updated in the relay chain system from the last trust value update time point to the current trust value update time point, calls the node trust value calculation algorithm to analyze the trust value of the trust value node to be updated, and determines the current trust value of the trust value node to be updated, including: When the trust value update instruction is triggered, each node in the relay chain system determines the trust value node to be updated according to the trust value node type to be updated carried in the trust value update instruction; Each node in the relay chain system obtains the resource capabilities, transaction processing status, and inter-node collaboration status of the trust value node to be updated in the relay chain system from the last trust value update time point to the current trust value update time point, calls the node trust value calculation algorithm to analyze the trust value of the trust value node to be updated, and determines the current trust value of the trust value node to be updated; Each node in the relay chain system compares the current trust value of the trust value node to be updated with the previous trust value, determines the trust value node to be updated whose fluctuation range exceeds the threshold, calls the node trust value correction algorithm to correct the trust value of the trust value node to be updated whose fluctuation range exceeds the threshold, and obtains the corrected trust value; Using the corrected trust value as the current trust value of the trust value node to be updated; The node trust value calculation algorithm includes: Analyze the resource capabilities of the trust value node to be updated and determine the trust value node to be updated i The trust value of the capability of the node to be updated i Capability trust value C i The expression is: ; in, for The normalized result is i ∈1, 2, …, J , J To represent the trust value node to be updated i The number of resource capabilities, Indicates the trust value node to be updated i No. j Resource capabilities; The trust value node to be updated is determined by analyzing the transaction status of the trust value node to be updated from the last trust value update time point to the current trust value update time point. i With current role r In the current t The behavior trust value of the trust value update, the trust value node to be updated i With current role r In the current t Behavior trust value of the trust value update The expression is: ; in, α r , β r and γ r is the weight, The trust value node to be updated i With current role r The number of transactions successfully processed between the last trust value update time and the current trust value update time, The trust value node to be updated i With current role r The number of transactions that failed to be processed between the last trust value update time point and the current trust value update time point, The trust value node to be updated i With current role r The trust value that is reduced because the processing time of cross-chain transactions exceeds the threshold between the last trust value update time point and the current trust value update time point, The trust value node to be updated i The trust value of the current character that has been reduced due to unprocessed transactions from the last trust value update time point to the current trust value update time point; The trust value node to be updated is determined by analyzing the inter-node collaboration between the trust value node to be updated and the trust value node to be updated. i With current role r In the current t The collaborative trust value of the trust value update, the trust value node to be updated i With current role r In the current t The collaborative trust value of the trust value update The expression is: , ; in, For Node a Trust value nodes to be updated between the last trust value update time point and the current trust value update time point i The collaborative trust accounts for the trust value nodes to be updated i The weight of the total collaborative trust from the last trust value update time point to the current trust value update time point, For Node a Trust value nodes to be updated between the last trust value update time point and the current trust value update time point i The collaborative trust value, p is the node with the trust value to be updated i The number of nodes that have collaborated, For time slot z The number of successful collaborations in the node a and the trust value node to be updated i The proportion of total collaboration between z is a time slot from the last trust value update time point to the current trust value update time point, s is the total number of time slots divided from the time point of the last trust value update to the time point of the current trust value update, is the time decay coefficient of time slot z; The current trust value of the trust value node to be updated is determined by analyzing the capability trust value, behavior trust value and collaboration trust value of the trust value node to be updated. The expression is: ; in, α , β and γ are the weights of the capability trust value, collaboration trust value and behavior trust value of the trust value node to be updated, respectively. α + β + γ= 1; The node trust value correction algorithm includes: Get the trust value node to be updated i With current role r List of historical trust values , ,in, is the trust value node to be updated t- The trust value of 1 trust value update; According to the trust value node to be updated i With current role r The historical trust value list is analyzed to determine the trust value node to be updated i The historical trust value fluctuations, the historical trust value fluctuations U The expression is: ; in, Indicates the trust value node to be updated i The historical average trust value of Indicates the trust value node to be updated i In the n The trust value of the trust value update, t The trust value node to be updated i The number of trust value updates at the current trust value update time point; According to the trust value node to be updated i The historical trust value fluctuations are analyzed to determine the trust value node to be updated i In the current t The historical trust value when the trust value is updated, the trust value node to be updated i In the current t Historical trust value at the time of trust value update The expression is: ; in, is the threshold of trust value fluctuation, is the time decay parameter; According to the trust value node to be updated i In the current t Historical trust value at the time of trust value update Current trust value Correction is performed to determine the trust value node to be updated i The corrected trust value, the trust value node to be updated i Corrected confidence value The expression is: ; When the node role adjustment instruction is triggered, each node in the relay chain system obtains the current final trust value of all nodes in the relay chain system to divide the roles, and determines the relay chain collection node set, committee node set and verification node set, including: When the node role adjustment instruction is triggered, each node in the relay chain system obtains the current final trust value of all nodes in the relay chain system; Sort all nodes according to their trust values ​​from large to small to obtain a node queue; According to the preset distribution ratio of the relay chain collection node set, committee node set and verification node set, the number of nodes corresponding to the committee node set is determined q 1. Verify the number of nodes corresponding to the node set q 2 and the number of nodes corresponding to the relay chain collection node set q 3; The node queue is placed in front q 1 node is determined as a committee node in the committee node set, and the first node in the node queue is q 1+1 nodes to q 1+ q Two nodes are determined as verification nodes in the verification node set, and the remaining nodes in the node queue are determined as relay chain collection nodes in the relay chain collection node set.