Cross-chain interaction method and device, computer equipment, storage medium and program product

By collecting node indicator data, calculating credit scores and selecting notary nodes in the alliance chain, establishing a global coordinated chain, the problems of narrow application scope, low security and complex implementation methods of cross-chain interaction methods in the existing technology are solved, and efficient and secure cross-chain interaction is achieved.

CN119892336APending Publication Date: 2025-04-25CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411794195.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

In the prior art, cross-chain interaction methods have problems such as narrow application scope, low security and complex implementation methods, especially when cross-chain interactions are conducted in consortium chains, it is difficult to effectively solve them.

Method used

By collecting node index data of each local chain to be interacted in the alliance chain, using the credit evaluation model to calculate the node's credit score, select the node with the highest credit score as the notary node, and establish a global coordinated chain based on these notary nodes to realize cross-chain interaction between each local chain to be interacted.

Benefits of technology

It improves the security and efficiency of cross-chain interaction, simplifies the implementation process, expands the scope of application, and conducts cross-chain interaction without the need for third-party nodes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119892336A_ABST
    Figure CN119892336A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of block chains, and discloses a cross-chain interaction method and device, computer equipment, a storage medium and a program product. The method comprises the following steps: collecting a plurality of index data of each node in each to-be-interacted local chain in an alliance chain; adopting a credit evaluation model to respectively process the plurality of index data of each node in each to-be-interacted local chain to obtain a credit score of each node; for each of the to-be-interacted local chains, selecting a target number of to-be-determined nodes with the maximum credit score, and selecting notarist nodes corresponding to the to-be-interacted local chains from the to-be-determined nodes; and based on the notarist node corresponding to each selected to-be-interacted local chain, establishing a global overall planning chain, so that each to-be-interacted local chain performs cross-chain interaction through the global overall planning chain. According to the scheme, when the cross-chain interaction function is achieved, the scheme is simple, the safety is good, and the efficiency is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain technology, and in particular to a cross-chain interaction method, device, computer equipment, storage medium and program product. Background Art

[0002] With the development of blockchain technology, many different types of blockchain networks have emerged, among which consortium chains are widely used due to their strong privacy and authentication-based access. The blockchain island effect refers to the situation where there are interoperability and communication barriers between multiple independent blockchain networks. Due to the existence of the blockchain island effect, how to conduct cross-chain interaction in the consortium chain has become an urgent problem to be solved.

[0003] Related technologies usually use three methods: hash time lock, notary mechanism and side chain / relay chain for cross-chain interaction. However, hash time lock does not support cross-chain smart contracts and has a narrow application scope. The notary mechanism relies too much on the credibility of a third party and has low security. The side chain / relay chain is not friendly to the alliance chain, the implementation method is complex, the compatibility requirements are too high, and the credit of the consensus nodes participating in the relay process cannot be guaranteed.

[0004] Therefore, there is an urgent need for a cross-chain interaction method that has a wide range of applications, is easy to implement, and has high security. Summary of the invention

[0005] In view of this, the purpose of the present invention is to provide a cross-chain interaction method, device, computer equipment, storage medium and program product to solve the problems of narrow application scope, low security and complex implementation methods when performing cross-chain interaction.

[0006] In a first aspect, the present invention provides a cross-chain interaction method, the method comprising:

[0007] Collect multiple indicator data of each node in each local chain to be interacted in the alliance chain;

[0008] Adopting the credit evaluation model, the multiple indicator data of each node in each local chain to be interacted are processed separately to obtain the credit score of each node;

[0009] For each of the local chains to be interacted, select a target number of pending nodes with the largest credit scores, and select a notary node corresponding to the local chain to be interacted from the pending nodes;

[0010] Based on the notary nodes corresponding to the selected local chains to be interacted, a global coordination chain is established, so that the local chains to be interacted can perform cross-chain interaction through the global coordination chain.

[0011] In an optional implementation, the credit assessment model is used to process multiple indicator data of each node in each local chain to be interacted with, and obtain the credit score of each node, including:

[0012] Based on the maximum and minimum values ​​of each node under different indicator data, calculate the pre-processed data of each node under different indicator data;

[0013] Based on the preprocessed data of each node under different indicator data and the sum of all preprocessed data, calculate the intermediate weight of each node under different indicator data;

[0014] Based on the intermediate weight of each node under different indicator data and the natural logarithm of the total number of nodes, the entropy value of different indicator data is calculated;

[0015] Based on the entropy values ​​of different indicator data, the information entropy redundancy of different indicator data is calculated;

[0016] Based on the information entropy redundancy of different indicator data and the sum of the information entropy redundancy of each indicator data, the weight value of each indicator data is calculated;

[0017] The different indicator data of each node are normalized, multiplied by the corresponding weight value and summed up to obtain the credit score of each node.

[0018] In an optional implementation, the calculating of the preprocessed data of each node under different indicator data based on the maximum value and the minimum value of each node under different indicator data includes:

[0019] Divide multiple indicator data into positive indicators and negative indicators;

[0020] Calculate preprocessing data of the indicator data based on the difference between the indicator data of the positive indicator and the minimum value of the indicator data and the difference between the maximum value of the indicator data and the minimum value of the indicator data;

[0021] Based on the difference between the maximum value of the indicator data and the indicator data of the negative indicator and the difference between the maximum value of the indicator data and the minimum value of the indicator data, the preprocessing data of the indicator data is calculated.

[0022] In an optional implementation, the step of establishing a global coordination chain based on the selected notary nodes corresponding to the local chains to be interacted with includes:

[0023] The notary node corresponding to each local chain to be interacted obtains routing information between the notary node and other local chains to be interacted with other local chains to be interacted with.

[0024] Each notary node submits the block header format, serialization method, deserialization method, digital signature verification method, and hash tree information of the local chain to be interacted with, so that the notary nodes in other local chains to be interacted with can obtain it;

[0025] Each local chain to be interacted obtains the preset common data format of the global coordination chain, and establishes a format conversion step between the preset common data format and the local chain to be interacted.

[0026] In an optional implementation, the local chains to be interacted perform cross-chain interaction through the global coordination chain, including:

[0027] The first notary node in the global coordination chain receives the cross-chain request of the first node in the first local chain to be interacted with and forwards it to the second notary node in the global coordination chain;

[0028] The second notary node receives the cross-chain request forwarded by the first notary node, and forwards it to the second node in the second local chain to be interacted;

[0029] The second node receives the cross-chain request forwarded by the second notary node, and sends a cross-chain response to the cross-chain request to the second notary node;

[0030] The second notary node receives the cross-chain response sent by the second node, and forwards it to the first notary node;

[0031] The first notary node receives the cross-chain response forwarded by the second notary node, and forwards it to the first node;

[0032] The first node receives the cross-chain response and completes the cross-chain interaction.

[0033] In an optional implementation, a margin information account is pre-established in the global coordination chain; the method further includes:

[0034] When the first notary node receives the cross-chain request of the first node, the first deposit information corresponding to the first notary node in the deposit information account is reduced by a first amount;

[0035] When the second notary node receives the cross-chain request forwarded by the first notary node, the second deposit information corresponding to the second notary node in the deposit information account is reduced by a second amount;

[0036] When the cross-chain interaction is completed, the first deposit information is increased by a first amount, and the second deposit information is increased by a second amount;

[0037] When the first node and / or the second node exhibit malicious behavior, the first deposit information and / or the second deposit information is reduced, and the credit scores of the first node and / or the second node, the first notary node and / or the second notary node are lowered.

[0038] In a second aspect, the present invention provides a cross-chain interaction device, the device comprising:

[0039] A data collection module is used to collect multiple indicator data of each node in each local chain to be interacted;

[0040] The credit score module is used to use a credit assessment model to process multiple indicator data of each node in each local chain to be interacted with, and obtain the credit score of each node;

[0041] A notary node selection module is used to select a target number of pending nodes with the largest credit score for each of the local chains to be interacted with, and select a notary node corresponding to the local chain to be interacted with from the pending nodes;

[0042] The global coordination chain establishment module is used to establish a global coordination chain based on the notary nodes corresponding to the selected local chains to be interacted, so that the local chains to be interacted can perform cross-chain interaction through the global coordination chain.

[0043] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the cross-chain interaction method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0044] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the cross-chain interaction method of the first aspect or any corresponding embodiment thereof.

[0045] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions, which are used to enable a computer to execute the cross-chain interaction method of the above-mentioned first aspect or any corresponding embodiment thereof.

[0046] The technical solution provided by the present invention may include the following beneficial effects:

[0047] The cross-chain interaction method provided by the present invention first collects multiple indicator data of each node in each local chain to be interacted in the alliance chain, then uses a credit evaluation model to process multiple indicator data of each node in each local chain to be interacted respectively, obtains the credit score of each node, and then selects the target number of pending nodes with the largest credit score for each of the local chains to be interacted, and selects the notary node corresponding to the local chain to be interacted from the pending nodes, and finally establishes a global coordination chain based on the notary nodes corresponding to the selected local chains to be interacted, so that each local chain to be interacted can perform cross-chain interaction through the global coordination chain. The above scheme can improve the security of cross-chain interaction by calculating the credit score of each node and selecting nodes with high credit scores as notary nodes; by selecting notary nodes in each local chain to be interacted to form a global coordination chain, and realizing cross-chain interaction between local chains to be interacted through the global coordination chain, cross-chain interaction can be performed without the need for third-party nodes, thereby improving the security and efficiency of cross-chain interaction; the scheme is simple and easy to implement, and is not limited by hash time lock, and has a wide range of applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0049] Figure 1 A schematic diagram of blockchain island effect in related technologies is shown;

[0050] Figure 2 A schematic diagram showing a notary mechanism in the related art is shown;

[0051] Figure 3 is a flowchart of a cross-chain interaction method according to an embodiment of the present invention;

[0052] Figure 4 is a flowchart of another cross-chain interaction method according to an embodiment of the present invention;

[0053] Figure 5 is a schematic diagram of a global coordination chain according to an embodiment of the present invention;

[0054] Figure 6 is a flowchart of another cross-chain interaction method according to an embodiment of the present invention;

[0055] Figure 7 Schematic diagram of the impact of the margin information mechanism on the transaction success rate according to an embodiment of the present invention;

[0056] Figure 8 is a structural block diagram of a cross-chain interaction device according to an embodiment of the present invention;

[0057] Fig. 9 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0058] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0059] With the development of blockchain technology, many different types of blockchain networks have emerged, among which consortium chains are widely used due to their strong privacy and authentication-based access. The blockchain island effect refers to the situation where there are interoperability and communication barriers between multiple independent blockchain networks. There are a series of barriers between different blockchain networks, mainly including data isolation, asset isolation, technical differences, lack of interoperability standards, inconsistent governance, etc. Figure 1 The schematic diagram of the blockchain island effect in the related technology shows that it is difficult for each local chain to interact across chains. Blockchain Cross-Chain refers to the technology and protocol for achieving interoperability and interconnectivity between different blockchain networks. Due to the existence of the blockchain island effect, how to perform cross-chain interaction in the alliance chain has become an urgent problem to be solved.

[0060] In related technologies, three methods are usually used for cross-chain interaction: hash time lock, notary mechanism and side chain / relay chain. Hash Time Locked Contracts (HTLC) technology is a smart contract protocol for cross-chain transactions of blockchains. It associates the transfer of digital assets with time and hash value to ensure the trusted execution of transactions. The Notary Mechanism allows multiple notaries to work together to verify the validity of cross-chain transactions and ensure their legitimacy and traceability. When a user initiates a cross-chain transaction, the transaction can only proceed when all necessary signatures are confirmed. Figure 2The schematic diagram of the notary mechanism in the related art is shown. If user A of chain A wants to establish cross-chain interaction with user B of chain B, it needs confirmation from notaries 1 to 4 before it can proceed. A side chain is a blockchain attached to the main chain, with an independent blockchain structure and consensus mechanism. A relay chain is a special side chain that connects different blockchain networks and acts as a bridge for cross-chain interaction. However, hash time lock does not support cross-chain smart contracts, has a narrow application scope, and the notary mechanism relies too much on the credibility of a third party, with low security. Once a notary node has a problem, it will cause cross-chain failure. The side chain / relay chain is not friendly to the alliance chain, the implementation method is complex, the compatibility requirements are too high, and the credit of the consensus nodes participating in the relay process cannot be guaranteed.

[0061] Therefore, an embodiment of the present invention provides a cross-chain interaction method, which selects nodes with high credit scores in each local chain to be interacted as notary nodes to build a global coordination chain for cross-chain interaction. The solution is simple and easy to implement, ensuring the security and efficiency of cross-chain interaction.

[0062] According to an embodiment of the present invention, an embodiment of a cross-chain interaction method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0063] In this embodiment, a cross-chain interaction method is provided, which can be used for desktop computers, laptops, servers, etc. Figure 3 is a flow chart of a cross-chain interaction method according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:

[0064] Step S301, collecting multiple indicator data of each node in each local chain to be interacted in the alliance chain.

[0065] The local chain to be interacted is a local chain with cross-chain interaction requirements among all local chains of the alliance chain. Each local chain contains multiple nodes, and each node contains multiple performance parameters that can be used as indicator data. When it is necessary to establish cross-chain interaction for the alliance chain, multiple indicator data of each node in each local chain to be interacted are collected. The multiple indicator data can be selected according to actual needs, for example, the accumulated working time, communication rate, etc. in the performance parameters of the node are selected as indicator data.

[0066] Step S302: using a credit evaluation model, respectively processing multiple indicator data of each node in each local chain to be interacted with, and obtaining a credit score of each node.

[0067] The credit assessment model can adopt a model with credit assessment function in the relevant technology, or it can be constructed by itself, and is used to calculate the credit score of each node based on the multiple indicator data collected from each node. When calculating, for each indicator data, the median credit score of each node under different indicator data can be calculated respectively, and then the median credit scores of each node are combined as the credit score of each node, for example, each median credit score is assigned a weight and then added as the credit score.

[0068] Step S303: for each of the partial chains to be interacted, select a target number of pending nodes with the largest credit scores, and select a notary node corresponding to the partial chain to be interacted from the pending nodes.

[0069] The notary node of each local chain to be interacted is selected from each node in each local chain to be interacted. Specifically, the notary node is selected according to the credit score of each node of each local chain to be interacted. For each local chain to be interacted, the credit scores of the corresponding nodes are sorted according to the size, and the nodes with the largest target number are selected as the pending nodes. The target number can be set according to actual needs. For example, if it is set to 3, the 3 nodes with the largest credit scores are selected from each node as the pending nodes. Then, the notary node is selected from the selected pending nodes. It can be randomly selected or assigned different probabilities or weights according to the size of the credit score. For example, there are 3 pending nodes. The selection probability is set to 40%, 35%, and 25% according to the size of the credit score, and the notary node is selected according to the probability. Each local chain to be interacted can decide the number of corresponding notary nodes by itself, such as 1 or 2. The selected notary node serves as the intermediate node for the local chain to be interacted with other local chains to be interacted in the alliance chain for cross-chain interaction.

[0070] Optionally, steps S101 to S103 are re-executed at target time intervals, and notary nodes of each local chain to be interacted are re-selected, so as to improve the fairness and anti-attack performance of cross-chain interaction without introducing a third-party intermediate node, and ensure the security of cross-chain interaction. The target time can be set as required, for example, to 7 days.

[0071] Step S304: Based on the selected notary nodes corresponding to the local chains to be interacted, a global coordination chain is established, so that the local chains to be interacted can perform cross-chain interaction through the global coordination chain.

[0072] A global coordination chain is established between the notary nodes corresponding to each local chain to be interacted, as an intermediate "platform" for cross-chain interaction between each local chain to be interacted. Since there is no limitation on the scope of application like the hash time lock in the related art, the cross-chain interaction method of the present invention supports cross-chain smart contracts, cross-chain transactions, data sharing, etc., and has a wider scope of application. When the nodes in each local chain to be interacted need to interact with the nodes in other local chains to be interacted, the interaction request is first sent to the notary node corresponding to the local chain to be interacted, and the notary node corresponding to the local chain to be interacted communicates with the notary node corresponding to the target local chain to be interacted through the global coordination chain, and sends the interaction request to the notary node corresponding to the target local chain to be interacted, and the notary node corresponding to the target local chain to be interacted then forwards the interaction request to the target node in the target local chain to be interacted, and the target node can also forward the response to the interaction request through the notary node corresponding to the target local chain to be interacted, and then transmits it to the node in the local chain to be interacted that initially issued the interaction request through the global coordination chain.

[0073] The cross-chain interaction method provided in this embodiment first collects multiple indicator data of each node in each local chain to be interacted in the alliance chain, then uses a credit evaluation model to process multiple indicator data of each node in each local chain to be interacted respectively, and obtains the credit score of each node, and then selects the target number of pending nodes with the largest credit score for each of the local chains to be interacted, and selects the notary node corresponding to the local chain to be interacted from the pending nodes, and finally establishes a global coordination chain based on the notary nodes corresponding to the selected local chains to be interacted, so that each local chain to be interacted can interact across chains through the global coordination chain. The above scheme can improve the security of cross-chain interaction by calculating the credit score of each node and selecting nodes with high credit scores as notary nodes; by selecting notary nodes in each local chain to be interacted to form a global coordination chain, and realizing cross-chain interaction between local chains to be interacted through the global coordination chain, cross-chain interaction can be carried out without the need for third-party nodes, thereby improving the security and efficiency of cross-chain interaction; the scheme is simple and easy to implement, and is not limited by hash time lock, and has a wide range of applications.

[0074] In this embodiment, a cross-chain interaction method is provided, which can be used for desktop computers, laptops, servers, etc. Figure 4 is a flow chart of a cross-chain interaction method according to an embodiment of the present invention. Figure 4 As shown, the process includes the following steps:

[0075] Step S401, collecting multiple indicator data of each node in each local chain to be interacted in the alliance chain.

[0076] Optionally, the indicator data includes the number of valid blocks, the number of invalid blocks, system configuration, communication time and recovery time. The number of valid blocks is used to indicate the number of blocks successfully created by a node and verified and accepted by other nodes in the network. The number of invalid blocks is used to indicate the number of blocks created by a node but not verified and accepted by other nodes in the network. The system configuration is used to indicate the basic parameters and rules of the blockchain network, which define how the blockchain operates, such as the size limit of the block, the time interval between blocks, the consensus algorithm, the encryption algorithm, etc. The communication time is used to indicate the time required for a node to propagate information with other nodes in the blockchain network. The recovery time is used to indicate the time required for a node to resume normal operation after a failure or fork in the blockchain network.

[0077] Step S402: using a credit evaluation model, respectively processing multiple indicator data of each node in each local chain to be interacted with, and obtaining a credit score of each node.

[0078] Specifically, the above step S402 includes:

[0079] Step S4021, based on the maximum value and minimum value of each node under different indicator data, calculate the pre-processed data of each node under different indicator data.

[0080] Exemplarily, the corresponding indicator data of each node is sorted under different indicator data, the maximum and minimum values ​​of each node under different indicator data are counted, and then the ratio of each indicator data of each node to the corresponding maximum and minimum values ​​is calculated as pre-processed data. For example, the valid number of blocks, invalid number of blocks, system configuration, communication time and recovery time of each node are counted respectively, and the maximum and minimum values ​​of the valid number of blocks, invalid number of blocks, system configuration, communication time and recovery time between each node are obtained respectively, and then the ratio of the valid number of blocks, invalid number of blocks, system configuration, communication time and recovery time of each node relative to the maximum and minimum values ​​of the valid number of blocks, invalid number of blocks, system configuration, communication time and recovery time between each node is calculated respectively, and the ratio is used as the pre-processed data of the valid number of blocks, invalid number of blocks, system configuration, communication time and recovery time of each node.

[0081] Optionally, multiple indicator data are divided into positive indicators and negative indicators. Positive indicators are used to indicate indicator data that are helpful in improving the credit score, and negative indicators are used to indicate indicator data that are helpful in reducing the credit score. For example, the number of valid blocks, system configuration, communication time, and recovery time are positive indicators, and the number of invalid blocks is a negative indicator. For positive indicators, based on the difference between the indicator data of the positive indicator and the minimum value of the indicator data, and the difference between the maximum value of the indicator data and the minimum value of the indicator data, the preprocessing data of the indicator data is calculated. For negative indicators, based on the difference between the maximum value of the indicator data of the negative indicator and the indicator data, and the difference between the maximum value of the indicator data and the minimum value of the indicator data, the preprocessing data of the indicator data is calculated.

[0082] Exemplarily, the preprocessed data of the positive indicator is calculated by the following formula:

[0083]

[0084] Among them, m represents the total number of nodes, n represents the total number of indicator data, and x ij Represents the jth indicator data of the i-th node, y ij Represents the preprocessed data of the j-th indicator data of the i-th node, i = 1, 2, ..., m, j = 1, 2, ..., n.

[0085] The preprocessed data of the negative indicator is calculated by the following formula:

[0086]

[0087] Step S4022, based on the preprocessed data of each node under different indicator data and the sum of all preprocessed data, calculate the intermediate weight of each node under different indicator data.

[0088] For each indicator data of each node, the intermediate weight of each node under each indicator data is calculated through the preprocessed data of the indicator data and the sum of the preprocessed data of the indicator data of each node.

[0089] Exemplarily, the intermediate weight of each node under each indicator data is calculated by the following formula:

[0090]

[0091] Among them, w ij Represents the intermediate weight of the j-th indicator data of the i-th node.

[0092] Step S4023, based on the intermediate weight of each node under different indicator data and the natural logarithm of the total number of nodes, calculate the entropy value of different indicator data.

[0093] For each indicator data, the entropy value of the indicator data is calculated based on the intermediate weight of the indicator data of each node and the natural logarithm of the total number of nodes in the local chain to be interacted. Specifically, the intermediate weight of the indicator data of each node is multiplied by the natural logarithm of the intermediate weight of the indicator data to obtain the intermediate product of the indicator data of each node, and then the intermediate products of the indicator data of each node are summed and multiplied by the inverse of the natural logarithm of the total number of nodes, and then multiplied by -1 to obtain the entropy value of the indicator data.

[0094] Exemplarily, the entropy value of each indicator data is calculated by the following formula:

[0095]

[0096] Among them, e j Represents the entropy value of the j-th indicator data, k=1 / ln(m).

[0097] Step S4024, based on the entropy values ​​of different indicator data, calculate the information entropy redundancy of different indicator data.

[0098] Exemplarily, the information entropy redundancy of different indicator data is calculated by the following formula:

[0099] r j =1-e j

[0100] Among them, r j Represents the information entropy redundancy of the j-th indicator data.

[0101] Step S4025, calculating the weight value of each indicator data based on the information entropy redundancy of different indicator data and the sum of the information entropy redundancy of each indicator data.

[0102] Optionally, the quotient of the information entropy redundancy of each indicator data and the sum of the information entropy redundancy of each indicator data is used as the weight value of the indicator data.

[0103] Exemplarily, the weight value of each indicator data is calculated by the following formula:

[0104]

[0105] in, Represents the weight value of the j-th indicator data.

[0106] Step S4026, normalize the different indicator data of each node, multiply them by the corresponding weight values ​​and then sum them up to obtain the credit score of each node.

[0107] Each indicator data of each node is normalized and multiplied by the weight value corresponding to each indicator data to obtain the indicator credit score of each indicator data of the node, and then the indicator credit scores of each indicator data of the node are summed up as the credit score of the node.

[0108] Step S403: for each of the partial chains to be interacted, select a target number of pending nodes with the largest credit scores, and select a notary node corresponding to the partial chain to be interacted from the pending nodes.

[0109] For details, please see Figure 1 Step S303 of the illustrated embodiment will not be described in detail here.

[0110] Step S404: Based on the selected notary nodes corresponding to the local chains to be interacted, a global coordination chain is established, so that the local chains to be interacted can perform cross-chain interaction through the global coordination chain.

[0111] Optionally, when establishing a global coordination chain, first, the notary node corresponding to each local chain to be interacted obtains the routing information between other local chains to be interacted outside the local chain to be interacted. The communication connection between each notary node can be established through the routing information, which is helpful to establish a cross-chain interactive communication channel. Then, each notary node submits the block header format, serialization method, deserialization method, digital signature verification method, and hash tree information of the local chain to be interacted, so that the notary nodes in other local chains to be interacted can obtain it, and parse and verify the block header information of the corresponding local chain to be interacted according to the block header format, serialization method, deserialization method, and digital signature verification method, and verify the authenticity and integrity of the cross-chain information according to the hash tree information. Since different blockchains to be interacted may use different underlying blockchain technologies, the data format may be different during data transmission, which hinders cross-chain interaction. Therefore, a common data format is set for the global coordination chain in advance according to demand to ensure that data can be transmitted between different local chains to be interacted and ensure the effectiveness of cross-chain interaction. When establishing a global coordination chain, each local chain to be interacted with obtains the preset universal data format of the global coordination chain and establishes a format conversion step between the preset universal data format. When conducting cross-chain interaction, the notary node converts the received data into the preset universal data format, and then forwards it to the target notary node in the global coordination chain that needs to conduct cross-chain interaction.

[0112] Figure 5 Schematic diagram of the global coordination chain according to an embodiment of the present invention. Figure 5As shown in the figure, the local chains to be interacted include chain A, chain B and chain C. Notary nodes (orange nodes in the figure) are selected from chain A, chain B and chain C to form a global coordination chain as a medium for cross-chain interaction between chain A, chain B and chain C. Peer represents a peer node.

[0113] After the global coordination chain is established, each local chain to be interacted can perform cross-chain interaction through the global coordination chain. Exemplarily, when the first node in the first local chain to be interacted needs to interact with the second node in the second local chain to be interacted, the first node in the first local chain to be interacted initiates a cross-chain request to the first notary node corresponding to the first local chain to be interacted, and the first notary node in the global coordination chain receives the cross-chain request of the first node in the first local chain to be interacted, verifies and checks the cross-chain request, and forwards the cross-chain request to the second notary node in the global coordination chain after the cross-chain request passes the verification and inspection. The second notary node receives the cross-chain request forwarded by the first notary node and verifies and checks it, and forwards the cross-chain request to the second node in the second local chain to be interacted after the cross-chain request passes the verification and inspection. Then, the second node receives the cross-chain request forwarded by the second notary node, and sends a cross-chain response to the cross-chain request to the second notary node. The second notary node receives the cross-chain response sent by the second node and forwards it to the first notary node. The first notary node receives the cross-chain response forwarded by the second notary node and forwards it to the first node. The first node receives the cross-chain response and completes the cross-chain interaction.

[0114] It can be understood that before forwarding the cross-chain request to the second notary node, the first notary node converts the cross-chain request into the preset common data format of the global coordination chain; before forwarding the cross-chain response to the first notary node, the second notary node converts the cross-chain response into the preset common data format of the global coordination chain.

[0115] Optionally, a deposit information account is pre-established in the global coordination chain to record the deposit information of the notary nodes corresponding to each local chain to be interacted in the global coordination chain. The deposit information is used to indicate the deposit number, for example, the deposit number is 100. The deposit information can also indicate the account status of the deposit information account, for example, the account status is enabled / not enabled.

[0116] When the first notary node receives the cross-chain request of the first node, the first deposit information corresponding to the first notary node in the deposit information account is reduced by a first number; when the second notary node receives the cross-chain request forwarded by the first notary node, the second deposit information corresponding to the second notary node in the deposit information account is reduced by a second number. By reducing the deposit information of the notary node before the cross-chain interaction is completed, it can play a supervisory role in the cross-chain interaction process, wherein different reduction numbers can be allocated according to the specific circumstances of different local chains to be interacted, or the first number can be set to be equal to the second number. When the cross-chain interaction is completed, the first deposit information is increased by a first number, and the second deposit information is increased by a second number. By restoring the deposit information of the notary node to the number before the cross-chain interaction after the cross-chain interaction is completed, the fairness of the cross-chain interaction to the notary node can be guaranteed. Optionally, when the cross-chain interaction is completed, the first deposit information is increased by a first number, and then by a third number; the second deposit information is increased by a second number, and then by a fourth number. By restoring the notary node's margin information to the number before the cross-chain interaction after the cross-chain interaction is completed, the notary node can be encouraged to actively participate in the cross-chain interaction and maintain good credit, which is conducive to the continuation of the cross-chain interaction. When the first node and / or the second node exhibit malicious behavior, the first margin information and / or the second margin information are reduced, and the credit score of the first node and / or the second node, the first notary node and / or the second notary node is lowered to urge each node to maintain credit. When the node's credit score reaches the preset minimum threshold or the number of malicious behaviors reaches the preset number, the node can also be added to the blacklist, prohibiting cross-chain interaction and being selected as a notary node.

[0117] The cross-chain interaction method provided in this embodiment first collects multiple indicator data of each node in each local chain to be interacted in the alliance chain, then uses a credit evaluation model to process multiple indicator data of each node in each local chain to be interacted respectively, and obtains the credit score of each node, and then selects the target number of pending nodes with the largest credit score for each of the local chains to be interacted, and selects the notary node corresponding to the local chain to be interacted from the pending nodes, and finally establishes a global coordination chain based on the notary nodes corresponding to the selected local chains to be interacted, so that each local chain to be interacted can interact across chains through the global coordination chain. The above scheme can improve the security of cross-chain interaction by calculating the credit score of each node and selecting nodes with high credit scores as notary nodes; by selecting notary nodes in each local chain to be interacted to form a global coordination chain, and realizing cross-chain interaction between local chains to be interacted through the global coordination chain, cross-chain interaction can be carried out without the need for third-party nodes, thereby improving the security and efficiency of cross-chain interaction; the scheme is simple and easy to implement, and is not limited by hash time lock, and has a wide range of applications.

[0118] As one or more specific application embodiments of the embodiments of the present invention, the optimal implementation scheme or the scheme that the inventor most wants to embody is described below in combination with specific application scenarios.

[0119] Figure 6 is a flow chart of a cross-chain interaction method according to an embodiment of the present invention. Figure 6 As shown, the global coordination chain includes the notary node of local chain A and the notary node of local chain B. When user Alice in local chain A and user Bob in local chain B need to interact across chains, user Alice sends a cross-chain request to the notary node of local chain A. The notary node of local chain A receives the cross-chain request and forwards it to the notary node of local chain B. The notary node of local chain B receives the cross-chain request and sends the cross-chain request to user Bob. User Bob responds to the cross-chain request and sends a cross-chain response to the notary node of local chain B. The notary node of local chain B receives the cross-chain response and forwards it to the notary node of local chain A. The notary node of local chain A receives the cross-chain response and sends it to user Alice.

[0120] Optionally, a margin information mechanism can also be set up, that is, a margin information account is established in the global coordination chain. When the notary node of local chain A receives a cross-chain request, the margin information of the notary node of local chain A can be reduced. When the notary node of local chain B receives a cross-chain request, the margin information of the notary node of local chain A can be reduced. After the cross-chain interaction is completed, the margin information of the notary node of local chain A and the notary node of local chain B can be restored or increased. When a node behaves maliciously, the margin information of the node can also be reduced or the status of the node can be set to prohibit cross-chain interaction.

[0121] Figure 7 Schematic diagram of the impact of the margin information mechanism on the transaction success rate according to an embodiment of the present invention. Figure 7 As shown in the figure, when the proportion of malicious nodes gradually increases, the transaction success rate with the margin information mechanism is relatively stable, while the transaction success rate without the margin information mechanism decreases significantly, proving that the margin information mechanism can promote transaction success rate and improve user experience.

[0122] In this embodiment, a cross-chain interaction device is also provided, which is used to implement the above embodiments and preferred implementations, and will not be repeated here. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0123] This embodiment provides a cross-chain interaction device, such as Figure 8 As shown, including:

[0124] The data collection module 801 is used to collect multiple indicator data of each node in each local chain to be interacted;

[0125] The credit score module 802 is used to use a credit evaluation model to process multiple indicator data of each node in each local chain to be interacted with, and obtain the credit score of each node;

[0126] The notary node selection module 803 is used to select a target number of pending nodes with the largest credit score for each of the local chains to be interacted with, and select a notary node corresponding to the local chain to be interacted with from the pending nodes;

[0127] The global coordination chain establishment module 804 is used to establish a global coordination chain based on the notary nodes corresponding to the selected local chains to be interacted, so that the local chains to be interacted can perform cross-chain interaction through the global coordination chain.

[0128] In an optional embodiment, the credit score module is also used to: calculate the preprocessed data of each node under different indicator data based on the maximum and minimum values ​​of each node under different indicator data; calculate the intermediate weight of each node under different indicator data based on the preprocessed data of each node under different indicator data and the sum of all preprocessed data; calculate the entropy value of different indicator data based on the intermediate weight of each node under different indicator data and the natural logarithm of the total number of nodes; calculate the information entropy redundancy of different indicator data based on the entropy value of different indicator data; calculate the weight value of each indicator data based on the information entropy redundancy of different indicator data and the sum of the information entropy redundancy of each indicator data; normalize the different indicator data of each node, multiply them by the corresponding weight value respectively and then sum them to obtain the credit score of each node.

[0129] In an optional embodiment, the credit score module is also used to: divide multiple indicator data into positive indicators and negative indicators; calculate pre-processed data of the indicator data based on the difference between the indicator data of the positive indicator and the minimum value of the indicator data and the difference between the maximum value of the indicator data and the minimum value of the indicator data; calculate pre-processed data of the indicator data based on the difference between the maximum value of the indicator data of the negative indicator and the indicator data and the difference between the maximum value of the indicator data and the minimum value of the indicator data.

[0130] In an optional embodiment, the global coordination chain establishment module is also used for: the notary nodes corresponding to each local chain to be interacted obtain routing information between the local chains to be interacted and other local chains to be interacted outside the local chain to be interacted; each notary node submits the block header format, serialization method, deserialization method, digital signature verification method, and hash tree information of the local chain to be interacted, for acquisition by the notary nodes in other local chains to be interacted; each local chain to be interacted obtains the preset common data format of the global coordination chain, and establishes a format conversion step between the preset common data format.

[0131] In an optional embodiment, the global coordination chain establishment module is also used for: the first notary node in the global coordination chain receives the cross-chain request of the first node in the first local chain to be interacted and forwards it to the second notary node in the global coordination chain; the second notary node receives the cross-chain request forwarded by the first notary node, and forwards it to the second node in the second local chain to be interacted; the second node receives the cross-chain request forwarded by the second notary node, and sends a cross-chain response to the cross-chain request to the second notary node; the second notary node receives the cross-chain response sent by the second node and forwards it to the first notary node; the first notary node receives the cross-chain response forwarded by the second notary node and forwards it to the first node; the first node receives the cross-chain response and completes the cross-chain interaction.

[0132] In an optional embodiment, a margin information account is pre-established in the global coordination chain; the device also includes a margin information module, which is used to: when the first notary node receives a cross-chain request from the first node, reduce the first margin information corresponding to the first notary node in the margin information account by a first number; when the second notary node receives a cross-chain request forwarded by the first notary node, reduce the second margin information corresponding to the second notary node in the margin information account by a second number; when the cross-chain interaction is completed, increase the first margin information by a first number, and increase the second margin information by a second number; when the first node and / or the second node exhibit malicious behavior, reduce the first margin information and / or the second margin information, and lower the credit scores of the first node and / or the second node, the first notary node and / or the second notary node.

[0133] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0134] The cross-chain interaction device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0135] The embodiment of the present invention also provides a computer device having the above Figure 8 The cross-chain interaction device shown.

[0136] See also Fig. 9 , Fig. 9 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Fig. 9 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig. 9 A processor 10 is taken as an example.

[0137] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0138] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0139] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0140] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0141] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Fig. 9 The example of connecting through bus is taken in the following.

[0142] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.

[0143] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0144] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0145] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations shall all fall within the protection scope of the present invention.

Claims

1. A cross-chain interaction method, characterized in that: The method comprises: Collect multiple indicator data of each node in each local chain to be interacted in the alliance chain; Adopting the credit evaluation model, the multiple indicator data of each node in each local chain to be interacted are processed separately to obtain the credit score of each node; For each of the local chains to be interacted, select a target number of pending nodes with the largest credit scores, and select a notary node corresponding to the local chain to be interacted from the pending nodes; Based on the notary nodes corresponding to the selected local chains to be interacted, a global coordination chain is established, so that the local chains to be interacted can perform cross-chain interaction through the global coordination chain.

2. The method according to claim 1, characterized in that: The credit evaluation model is used to process multiple indicator data of each node in each local chain to be interacted with, and obtain the credit score of each node, including: Based on the maximum and minimum values ​​of each node under different indicator data, calculate the pre-processed data of each node under different indicator data; Based on the preprocessed data of each node under different indicator data and the sum of all preprocessed data, calculate the intermediate weight of each node under different indicator data; Based on the intermediate weight of each node under different indicator data and the natural logarithm of the total number of nodes, the entropy value of different indicator data is calculated; Based on the entropy values ​​of different indicator data, the information entropy redundancy of different indicator data is calculated; Based on the information entropy redundancy of different indicator data and the sum of the information entropy redundancy of each indicator data, the weight value of each indicator data is calculated; The different indicator data of each node are normalized, multiplied by the corresponding weight value and summed up to obtain the credit score of each node.

3. The method according to claim 2, characterized in that The method of calculating the pre-processed data of each node under different indicator data based on the maximum value and the minimum value of each node under different indicator data includes: Divide multiple indicator data into positive indicators and negative indicators; Calculate preprocessing data of the indicator data based on the difference between the indicator data of the positive indicator and the minimum value of the indicator data and the difference between the maximum value of the indicator data and the minimum value of the indicator data; Based on the difference between the maximum value of the indicator data and the indicator data of the negative indicator and the difference between the maximum value of the indicator data and the minimum value of the indicator data, the preprocessing data of the indicator data is calculated.

4. The method according to any one of claims 1 to 3, characterized in that: The process of establishing a global coordination chain based on the notary nodes corresponding to the selected local chains to be interacted with includes: The notary node corresponding to each local chain to be interacted obtains routing information between the notary node and other local chains to be interacted with other local chains to be interacted with. Each notary node submits the block header format, serialization method, deserialization method, digital signature verification method, and hash tree information of the local chain to be interacted with, so that the notary nodes in other local chains to be interacted with can obtain it; Each local chain to be interacted obtains the preset common data format of the global coordination chain, and establishes a format conversion step between the preset common data format and the local chain to be interacted.

5. The method according to any one of claims 1 to 3, characterized in that: The local chains to be interacted perform cross-chain interaction through the global coordination chain, including: The first notary node in the global coordination chain receives the cross-chain request of the first node in the first local chain to be interacted with and forwards it to the second notary node in the global coordination chain; The second notary node receives the cross-chain request forwarded by the first notary node, and forwards it to the second node in the second local chain to be interacted; The second node receives the cross-chain request forwarded by the second notary node, and sends a cross-chain response to the cross-chain request to the second notary node; The second notary node receives the cross-chain response sent by the second node, and forwards it to the first notary node; The first notary node receives the cross-chain response forwarded by the second notary node, and forwards it to the first node; The first node receives the cross-chain response and completes the cross-chain interaction.

6. The method according to claim 5, characterized in that A margin information account is pre-established in the global coordination chain; the method further includes: When the first notary node receives the cross-chain request of the first node, the first deposit information corresponding to the first notary node in the deposit information account is reduced by a first amount; When the second notary node receives the cross-chain request forwarded by the first notary node, the second deposit information corresponding to the second notary node in the deposit information account is reduced by a second amount; When the cross-chain interaction is completed, the first deposit information is increased by a first amount, and the second deposit information is increased by a second amount; When the first node and / or the second node exhibit malicious behavior, the first deposit information and / or the second deposit information is reduced, and the credit scores of the first node and / or the second node, the first notary node and / or the second notary node are lowered.

7. A cross-chain interaction device, characterized in that: The device comprises: A data collection module is used to collect multiple indicator data of each node in each local chain to be interacted; The credit score module is used to use a credit evaluation model to process multiple indicator data of each node in each local chain to be interacted with, and obtain the credit score of each node; A notary node selection module is used to select a target number of pending nodes with the largest credit score for each of the local chains to be interacted with, and select a notary node corresponding to the local chain to be interacted with from the pending nodes; The global coordination chain establishment module is used to establish a global coordination chain based on the notary nodes corresponding to the selected local chains to be interacted, so that the local chains to be interacted can perform cross-chain interaction through the global coordination chain.

8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the cross-chain interaction method according to any one of claims 1 to 6 by executing the computer instructions.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the cross-chain interaction method according to any one of claims 1 to 6.

10. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the cross-chain interaction method according to any one of claims 1 to 6.