Node determination method and device, equipment, storage medium and product
By dynamically selecting management nodes and audit nodes in the alliance chain, the low security problem caused by the fixedness of smart contract management nodes is solved, and the security and flexibility of smart contract management are improved.
Patent Information
- Application Number
- CN202410999734.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2044-07-24
AI Technical Summary
In the alliance chain, the fixedness of smart contract management nodes leads to fraud in the management process, reducing the security of smart contracts.
By determining multiple candidate nodes in the alliance chain, generating voting links, obtaining voting information of multiple voting nodes in the alliance chain, determining target nodes based on voting information and node weights, and dynamically selecting management nodes and audit nodes to improve smart contract management security.
By dynamically determining management nodes and audit nodes, the flexibility and security of smart contract management are increased and the risk of fraud is reduced.
Smart Images

Figure CN118944853A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and in particular to a node determination method, device, equipment, storage medium and product. Background Art
[0002] A consortium chain is a new type of blockchain. A consortium chain can include multiple consortium nodes. Multiple consortium nodes can automatically execute the agreement reached by both parties through smart contracts. A consortium chain can include multiple smart contracts. Smart contracts can be used to execute different functions and business logics. For any smart contract, it is necessary to determine the management node corresponding to the smart contract.
[0003] In the prior art, when it is necessary to determine a management node for a smart contract, the alliance node in the alliance chain can apply to be a management node. For any alliance node in the alliance chain, after receiving the application request of the alliance node, the alliance node can be determined as a management node. However, in the above process, the alliance node that submits the application request is relatively fixed, which makes the management node of the smart contract relatively fixed, which may lead to fraud in the management process and make the security of smart contract management low. Summary of the invention
[0004] The present application provides a node determination method, device, equipment, storage medium and product to solve the technical problem of low security in smart contract management.
[0005] In a first aspect, the present application provides a node determination method, comprising:
[0006] Determine multiple candidate nodes corresponding to the target smart contract in the alliance chain, where the candidate nodes are nodes that compete for management nodes and audit nodes;
[0007] Generate a voting link according to the multiple candidate nodes, where the voting link includes at least one voting subject, and the voting subject is used to request determination of a management node or an audit node;
[0008] According to the voting link, the voting information of the plurality of voting nodes in the alliance chain is obtained, wherein the voting information includes a selection node corresponding to each voting topic and a node weight corresponding to the selection node, wherein the selection node is a node selected from the plurality of candidate nodes;
[0009] According to the voting information of the multiple voting nodes, a target node for each voting subject of the target smart contract is determined, and the target node includes a management node and an audit node.
[0010] In a possible implementation manner, for any voting topic, determining a target node of the voting topic according to the voting information of the plurality of voting nodes includes:
[0011] Determining a first business type of the target smart contract;
[0012] Determining the voting weight of each voting node according to the first service type;
[0013] The target node of the voting topic is determined according to the voting information and voting weight of each voting node.
[0014] In a possible implementation, determining the target node of the voting topic according to the voting information and voting weight of each voting node includes:
[0015] Determine, according to the voting information of each voting node, a selection node and a node weight of the selection node for each voting node corresponding to the voting topic;
[0016] For any selection node, data processing is performed on the node weight and voting weight of the selection node of at least one voting node to obtain the selection weight of the selection node;
[0017] The target node of the voting node is determined according to the selection weight of each selection node of the voting subject.
[0018] In a possible implementation, determining the target node of the voting node according to the selection weight of each selection node of the voting subject includes:
[0019] Determining whether there is a selection weight greater than or equal to a first threshold;
[0020] If yes, determining at least one selection node corresponding to the selection weight, and determining the target node in the at least one selection node;
[0021] If not, the selection node with the largest weight is selected and determined as the target node.
[0022] In a possible implementation manner, determining the voting weight of each voting node according to the first service type includes:
[0023] Determining a second service type of each voting node;
[0024] Determining a difference level between a second service type of each voting node and the first service type;
[0025] The voting weight of each voting node is determined according to the difference level of each voting node.
[0026] In a possible implementation manner, the voting link includes a management voting topic and an audit voting topic; generating the voting link according to the multiple candidate nodes includes:
[0027] At least one first candidate node for managing the voting topic and at least one second candidate node for reviewing the voting topic are determined from the multiple candidate nodes, and there is no identical candidate node between the at least one first candidate node and the at least one second candidate node.
[0028] In a possible implementation, the alliance chain includes multiple alliance nodes; and obtaining voting information of multiple voting nodes in the alliance chain according to the voting link includes:
[0029] Determining a plurality of authentication nodes among the plurality of alliance nodes;
[0030] Determine the computing power share of each authentication node;
[0031] Determine the authentication node whose computing power occupancy rate is less than or equal to the first threshold as a voting node, so as to determine a plurality of voting nodes;
[0032] The voting link is sent to the plurality of voting nodes, and voting information of the plurality of voting nodes is received.
[0033] In a second aspect, an embodiment of the present application provides a node determination device, including a first determination module, a generation module, an acquisition module, and a second determination module:
[0034] The first determination module is used to determine multiple candidate nodes corresponding to the target smart contract in the alliance chain, and the candidate nodes are nodes that compete for management nodes and review nodes;
[0035] The generating module is used to generate a voting link according to the multiple candidate nodes, wherein the voting link includes at least one voting subject, and the voting subject is used to request determination of a management node or an audit node;
[0036] The acquisition module is used to acquire, according to the voting link, voting information of multiple voting nodes in the alliance chain, wherein the voting information includes a selection node corresponding to each voting topic and a node weight corresponding to the selection node, and the selection node is a node selected from the multiple candidate nodes;
[0037] The second determination module is used to determine the target node of each voting topic of the target smart contract according to the voting information of the multiple voting nodes, and the target node includes a management node and an audit node.
[0038] In a possible implementation manner, for any voting topic, the second determination module is specifically configured to:
[0039] Determining a first business type of the target smart contract;
[0040] Determining the voting weight of each voting node according to the first service type;
[0041] The target node of the voting topic is determined according to the voting information and voting weight of each voting node.
[0042] In a possible implementation manner, the second determining module is specifically configured to:
[0043] Determine, according to the voting information of each voting node, a selection node and a node weight of the selection node for each voting node corresponding to the voting topic;
[0044] For any selection node, data processing is performed on the node weight and voting weight of the selection node of at least one voting node to obtain the selection weight of the selection node;
[0045] The target node of the voting node is determined according to the selection weight of each selection node of the voting subject.
[0046] In a possible implementation manner, the second determining module is specifically configured to:
[0047] Determining whether there is a selection weight greater than or equal to a first threshold;
[0048] If yes, determining at least one selection node corresponding to the selection weight, and determining the target node in the at least one selection node;
[0049] If not, the selection node with the largest weight is selected and determined as the target node.
[0050] In a possible implementation manner, the second determining module is specifically configured to:
[0051] Determining a second service type of each voting node;
[0052] Determining a difference level between a second service type of each voting node and the first service type;
[0053] The voting weight of each voting node is determined according to the difference level of each voting node.
[0054] In a possible implementation manner, the voting link includes a management voting topic and an audit voting topic; and the generation module is specifically used to:
[0055] At least one first candidate node for managing the voting topic and at least one second candidate node for reviewing the voting topic are determined from the multiple candidate nodes, and there is no identical candidate node between the at least one first candidate node and the at least one second candidate node.
[0056] In a possible implementation, the alliance chain includes multiple alliance nodes; and the acquisition module is specifically used to:
[0057] Determining a plurality of authentication nodes among the plurality of alliance nodes;
[0058] Determine the computing power share of each authentication node;
[0059] Determine the authentication node whose computing power occupancy rate is less than or equal to the first threshold as a voting node, so as to determine a plurality of voting nodes;
[0060] The voting link is sent to the plurality of voting nodes, and voting information of the plurality of voting nodes is received.
[0061] In a third aspect, an embodiment of the present application provides an electronic device, including: a memory and a processor,
[0062] The memory stores computer-executable instructions;
[0063] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the node determination method described in any one of the first aspects.
[0064] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer execution instructions, and when the computer execution instructions are executed by a processor, they are used to implement the node determination method described in any one of the first aspects.
[0065] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the node determination method described in any one of the first aspects.
[0066] The node determination method, apparatus, device, storage medium and product provided in the present application can determine multiple candidate nodes from multiple alliance nodes, generate a voting link based on the multiple candidate nodes, and the voting link can include at least one voting subject. The voting subject can be used to request the determination of a management node and an audit node. After receiving the voting information of multiple voting nodes, the target node of each voting subject of the target smart contract can be determined. The target node includes a management node and an audit node. Multiple candidate nodes can be determined from multiple alliance nodes of the alliance chain to randomly determine the management node and the audit node from the multiple candidate nodes. The smart contract can be managed jointly by the management node and the audit node, which can improve the security of smart contract management. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0068] Figure 1 A schematic diagram of an application scenario provided in an embodiment of the present application;
[0069] Figure 2 A schematic diagram of a process flow of a node determination method provided in an embodiment of the present application;
[0070] Figure 3 A flowchart of another node determination method provided in an embodiment of the present application;
[0071] Figure 4 A schematic diagram of the architecture of a node determination method provided in an embodiment of the present application;
[0072] Figure 5 A schematic diagram of the structure of a node determination device provided in an embodiment of the present application;
[0073] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0074] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0075] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0076] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0077] In addition, this application involves big data analysis of user information (including but not limited to personal biometrics, identity data, consumption data, asset data, electronic terminal operation data, etc.), and the use of artificial intelligence technology for automated decision-making, and a technical solution for making decisions that have a significant impact on personal rights and interests based on the results of automated decision-making. The application provides users with corresponding operation entrances for them to choose to agree or reject the results of automated decision-making; if the user chooses to reject, the expert decision-making process will be entered.
[0078] It should be noted that the method and device for determining nodes in the present application can be used in the field of blockchain technology, and can also be used in any field other than blockchain technology. The application field of the method and device for determining nodes in the present application is not limited.
[0079] Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present application. Figure 1 , including multiple alliance nodes 101 and a processing device 102.
[0080] The blockchain can be controlled and managed by a consortium consisting of multiple consortium nodes 101, and the blockchain is a consortium chain. The consortium node 101 can be a terminal device of an organization or institution. After generating a new target smart contract in the consortium chain, the processing device 102 can determine multiple candidate nodes corresponding to the target smart contract from multiple consortium nodes 101 of the consortium chain, and generate a voting link based on the multiple candidate nodes. The voting link may include at least one voting subject, and the voting subject may be used to request the determination of a management node or an audit node.
[0081] The processing device 102 can obtain the voting information of multiple voting nodes in the alliance chain according to the voting link, and the voting information may include the selected node selected from multiple candidate nodes. The processing device 102 can determine the target node of each voting topic of the target smart contract according to the voting information of multiple voting nodes, and the target node may include a management node and an audit node.
[0082] In the prior art, when it is necessary to determine a management node for a smart contract, the alliance node in the alliance chain can apply to be a management node. For any alliance node in the alliance chain, after receiving the application request of the alliance node, the alliance node can be determined as a management node. However, in the above process, the alliance node that submits the application request is relatively fixed, which makes the management node of the smart contract relatively fixed, which may lead to fraud in the management process and make the security of smart contract management low.
[0083] The node determination method provided in the present application can determine multiple candidate nodes from multiple alliance nodes, generate a voting link based on the multiple candidate nodes, and the voting link may include at least one voting topic. The voting topic can be used to request the determination of a management node and an audit node. After receiving the voting information of multiple voting nodes, the target node of each voting topic of the target smart contract can be determined. The target node includes a management node and an audit node. Multiple candidate nodes can be determined from multiple alliance nodes of the alliance chain to randomly determine a management node and an audit node from multiple candidate nodes. The smart contract can be managed jointly by the management node and the audit node, which can improve the security of smart contract management.
[0084] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0085] Figure 2 A flowchart of a node determination method provided in an embodiment of the present application. Figure 2 , the method may include:
[0086] S201. Determine multiple candidate nodes corresponding to the target smart contract in the alliance chain.
[0087] The execution subject of the embodiment of the present application may be a processing device, or a service processing device arranged in the processing device. The service processing device may be implemented by software, or by a combination of software and hardware.
[0088] A consortium chain may include multiple consortium nodes, which work together in a specific industry or field, and the relationship between these multiple consortium nodes is usually mutual trust and non-competitive.
[0089] A plurality of candidate nodes may be determined from a plurality of alliance nodes through a random number algorithm, wherein the candidate nodes may be nodes that run for management nodes and audit nodes.
[0090] For example, the random number algorithm can be any one of the following algorithms: linear congruential algorithm, Mersenne twister algorithm, XORshift algorithm, Monte Carlo method, von Neumann method, etc.
[0091] The target smart contract can be an automated contract of the alliance chain, which can automatically execute the agreement reached between multiple alliance nodes.
[0092] S202: Generate a voting link based on multiple candidate nodes.
[0093] The voting link may include at least one voting subject, and the voting subject may be used to request determination of a management node or an audit node.
[0094] For any voting topic, at least one candidate node may be determined from multiple candidate nodes, and the voting node may select and score from the at least one candidate node.
[0095] Among them, at least one candidate node can be randomly determined from multiple candidate nodes through a random number algorithm.
[0096] For example, assuming there are 2 voting topics, namely voting topic 1 and voting topic 2, and assuming there are 6 candidate nodes, namely candidate nodes 1-6, then the candidate nodes for voting topic 1 can be candidate node 1, candidate node 3 and candidate node 4, and the candidate nodes for voting topic 2 can be candidate node 1, candidate node 2 and candidate node 5.
[0097] In some embodiments, the voting link includes managing a voting topic and reviewing a voting topic, and determining at least one first candidate node for managing the voting topic and at least one second candidate node for reviewing the voting topic from among a plurality of candidate nodes, wherein the same candidate node does not exist among the at least one first candidate node and the at least one second candidate node.
[0098] For example, assuming there are 2 voting topics, namely the management voting topic and the review voting topic, and assuming there are 6 candidate nodes, namely candidate nodes 1-6, then the candidate nodes for the management voting topic can be candidate node 1, candidate node 3 and candidate node 4, and the candidate nodes for the review voting topic can be candidate node 2, candidate node 5 and candidate node 6.
[0099] S203. According to the voting link, the voting information of multiple voting nodes in the alliance chain is obtained.
[0100] A voting node can be a node in the alliance chain that has voting qualification certification and is not a candidate node.
[0101] For example, suppose there are 8 alliance nodes, namely nodes 1-8, and the candidate nodes are nodes 1, 2 and 3. Suppose nodes 4, 5, 6 and 7 are eligible to vote, then the voting nodes can be nodes 4, 5, 6 and 7.
[0102] The voting information may include a selection node corresponding to each voting topic and a node weight corresponding to the selection node. The selection node may be a node selected from multiple candidate nodes.
[0103] S204. Determine the target node for each voting topic of the target smart contract based on the voting information of the multiple voting nodes.
[0104] Target nodes can include management nodes and audit nodes.
[0105] In some embodiments, for any voting topic, the selection weight of each selection node can be determined according to the node weight of the selection node corresponding to each voting node, and the selection node with the largest selection weight can be determined as the target node.
[0106] For any selection node, the average of the node weights corresponding to at least one voting node may be determined as the selection weight of the selection node.
[0107] For example, assuming that voting topic 1 has 2 selection nodes, namely node 1 and node 2, and assuming that there are 3 voting nodes, namely node 3, node 4 and node 5, assuming that the selection node of node 3 is node 1, and the node weight corresponding to node 1 is 0.8; the selection node of node 4 is node 1, and the node weight corresponding to node 1 is 0.5; the selection node of node 4 is node 2, and the node weight corresponding to node 2 is 0.8, then it can be determined that the selection weight of node 1 is 0.75, and the selection weight of node 2 is 0.8, then node 2 can be determined as the target node.
[0108] In some embodiments, for any voting topic, the target node of the voting topic can be determined in the following manner: determine the first business type of the target smart contract; determine the voting weight of each voting node based on the first business type; determine the target node of the voting topic based on the voting information and voting weight of each voting node.
[0109] For example, assuming that the first business type of the target smart contract is business type 1, and that there are three voting nodes, namely voting node 1, voting node 2, and voting node 3, the voting weight of voting node 1 is determined to be 0.9 according to business type 1, the voting weight of voting node 2 is 0.7, and the voting weight of voting node 3 is 0.7.
[0110] A node determination method provided in an embodiment of the present application can determine multiple candidate nodes from multiple alliance nodes, generate a voting link based on the multiple candidate nodes, and the voting link can include at least one voting topic. The voting topic can be used to request the determination of a management node and an audit node. After receiving voting information from multiple voting nodes, the target node of each voting topic of the target smart contract can be determined. The target node includes a management node and an audit node. Multiple candidate nodes can be determined from multiple alliance nodes of the alliance chain to dynamically determine the management node and the audit node from multiple candidate nodes. Smart contracts can be managed simultaneously through management nodes and audit nodes, which can improve the security of smart contract management.
[0111] Figure 3 A flowchart of another node determination method provided in an embodiment of the present application. Figure 3 , the method may include:
[0112] S301. Determine multiple candidate nodes corresponding to the target smart contract in the alliance chain.
[0113] S302: Generate a voting link based on multiple candidate nodes.
[0114] The execution process of S301-S302 can refer to the execution process of S201-S202, which will not be repeated here.
[0115] S303. Determine multiple authentication nodes among multiple alliance nodes.
[0116] The voting qualification of each alliance node except the candidate node can be authenticated to obtain the authentication result of each alliance node, and the alliance node with the authentication result of successful authentication can be determined as the authenticated node.
[0117] For example, assuming that there are 6 alliance nodes, namely nodes 1-6, and assuming that the candidate nodes are nodes 1 and node 2, then nodes 3-node 6 are authenticated. Assuming that the authentication results of nodes 3, 5 and 6 are successful, and the authentication result of node 4 is failed, then nodes 3, 5 and 6 are determined as authenticated nodes.
[0118] S304: Determine the computing power occupancy rate of each authentication node.
[0119] Multiple alliance nodes in the alliance chain need to perform their corresponding business processing, which requires some computing power, and the computing power load of some alliance nodes is relatively large. If the alliance nodes with relatively large computing power load are determined as voting nodes, voting failure may occur.
[0120] S305: Determine the authentication nodes whose computing power occupancy rate is less than or equal to the first threshold as voting nodes to determine multiple voting nodes.
[0121] For example, assuming that there are 5 authentication nodes, namely nodes 1-5, assuming that the computing power occupancy rate of node 1 is 80%, the computing power occupancy rate of node 2 is 85%, the computing power occupancy rate of node 3 is 90%, the computing power occupancy rate of node 4 is 50%, and the computing power occupancy rate of node 5 is 35%. Assuming that the first threshold is 85%, node 1, node 2, node 4 and node 5 are determined as voting nodes.
[0122] S306: Send voting links to multiple voting nodes, and receive voting information from multiple voting nodes.
[0123] In some embodiments, the voting information may include at least one selection node and a node weight corresponding to each selection node.
[0124] In some embodiments, the voting link may include a voting duration, which may be used to define the end time of the voting link. If no voting information of the voting node is received within the voting duration, it is determined that the voting node has given up voting.
[0125] S307. For any voting topic, determine the first business type of the target smart contract.
[0126] For any smart contract, the smart contract has its corresponding business type. There are multiple associated nodes in the alliance chain that are strongly associated with the business type. The smart contract can constrain the multiple associated nodes.
[0127] S308: Determine the second service type of each voting node.
[0128] The second business type of each voting node can be analyzed for differences with the first business type of the target smart contract. For any voting node, if the difference between the second business type and the first business type is large, the impact of the voting information of the voting node is small; if the difference between the second business type of the voting node and the first business type is small, the impact of the voting information of the voting node is large.
[0129] S309: Determine the difference level between the second service type and the first service type of each voting node.
[0130] Furthermore, a difference level table may be obtained, and the difference level between the second business type of each voting node and the first business type of the target smart contract may be determined according to the difference level table. The difference level table may include the difference levels between multiple business types.
[0131] For example, assuming there are 4 business types, the difference level table can be as shown in Table 1, which can include 4 difference levels, namely difference level 1, difference level 2, difference level 3 and difference level 4, among which difference level 1 has the lowest difference and difference level 4 has the highest difference.
[0132] Table 1
[0133]
[0134] S310: Determine the voting weight of each voting node according to the difference level of each voting node.
[0135] For any voting node, the voting weight can be determined according to the difference level between the voting node and the target smart contract, where the greater the difference level, the lower the voting weight, that is, the voting weight of voting nodes of the same business type is larger, and the voting weight of voting nodes of unrelated business types is smaller.
[0136] For example, assuming there are four difference levels, namely difference levels 1-4, the voting weight corresponding to difference level 1 may be 0.9, the voting weight corresponding to difference level 2 may be 0.7, the voting weight corresponding to difference level 3 may be 0.5, and the voting weight corresponding to difference level 4 may be 0.3.
[0137] S311 . Determine, according to the voting information of each voting node, the selection node of each voting node corresponding to the voting topic and the node weight of the selection node.
[0138] For any voting topic, the voting node may select a selection node and a node weight of the selection node from at least one candidate node in the voting link.
[0139] S312: For any selection node, perform data processing on the node weight and voting weight corresponding to at least one voting node to obtain the selection weight of the selection node.
[0140] Furthermore, the node weight and the voting weight of each voting node may be multiplied together to obtain at least one first product, and the average of the at least one first product may be determined as the selection weight of the selection node.
[0141] For example, assuming that the selected node is node 1, and that there are three voting nodes that select node 1, namely node 2, node 3 and node 4; assuming that the voting weight of node 2 is 0.9, and the node weight to node 1 is 0.8; assuming that the voting weight of node 3 is 0.5, and the node weight to node 1 is 0.8; assuming that the voting weight of node 4 is 0.9, and the selection weight is 0.7, it can be determined that the selection weight of node 2 corresponding to node 1 is 0.72, the selection weight of node 3 corresponding to node 1 is 0.4, the selection weight of node 4 corresponding to node 1 is 0.63, and the selection weight of node 1 is 0.6.
[0142] In some embodiments, the influence of the computing power share of the selection node on the selection weight can be considered, and the selection weight of the selection node can be determined based on the computing power share of the selection node, and the node weight and voting weight of each voting node.
[0143] Specifically, the node weight and voting weight of each voting node can be multiplied to obtain at least one first product, the average of at least one first product can be determined as the intermediate weight of the selected node, and the intermediate weight of the selected node can be divided by the computing power occupancy rate to determine the selection weight.
[0144] The greater the computing power share of the selected node, the lower the probability of selecting the selected node, that is, the smaller the selection weight.
[0145] For example, assuming that the selected node is node 1, and assuming that there are 3 voting nodes that select node 1, namely node 2, node 3 and node 4, assuming that the voting weight of node 2 is 0.9, and the node weight to node 1 is 0.8; assuming that the voting weight of node 3 is 0.5, and the node weight to node 1 is 0.8; assuming that the voting weight of node 4 is 0.9, and assuming the selection weight is 0.7, it can be determined that the selection weight of node 2 corresponding to node 1 is 0.72, the selection weight of node 3 corresponding to node 1 is 0.4, and the selection weight of node 4 corresponding to node 1 is 0.63, and the intermediate weight of node 1 is 0.6; assuming that the computing power share of node 1 is 0.9, it can be determined that the selection weight is 0.67.
[0146] S313: Determine the target node of the voting node according to the selection weight of each selection node of the voting topic.
[0147] For example, assuming that the voting topic is voting topic 1, assuming that voting topic 1 has 2 selection nodes, namely node 1 and node 2, assuming that the selection weight of node 1 is 0.5 and the selection weight of node 2 is 0.3, then node 1 is determined as the target node of voting topic 1.
[0148] In some embodiments, it can be determined whether there is a selection weight greater than or equal to a first threshold; if so, at least one selection node corresponding to the selection weight is determined, and a target node is determined among the at least one selection node; if not, the selection node with the largest selection weight is determined as the target node.
[0149] Any one of the selected nodes may be randomly determined as the target node in at least one selected node through a random number algorithm.
[0150] For example, assuming that the voting topic is voting topic 1, assuming that voting topic 1 has a total of 4 selection nodes, namely node 1, node 2, node 3 and node 4, assuming that the selection weight of node 1 is 0.6, the selection weight of node 2 is 0.45, the selection weight of node 3 is 0.7, and the selection weight of node 4 is 0.3, assuming that the first threshold is 0.5, then any one of node 1 and node 3 can be determined as the target node.
[0151] The node determination method provided in the embodiment of the present application can determine multiple candidate nodes from multiple alliance nodes, generate voting links based on the multiple candidate nodes, and the voting links can include at least one voting topic, which can be used to request the determination of management nodes and audit nodes; multiple voting nodes can be determined from multiple alliance nodes, and after receiving the voting information of multiple voting nodes, multiple selection nodes can be determined for any voting topic, and at least one voting node corresponding to each selection node can be determined, and the selection weight of each selection node can be determined according to the voting weight and node right of each voting node, and the target node of the voting topic can be determined according to the selection weight of each selection node, and the target node can be determined according to the selection weight of each selection node. The target node can be a management node or an audit node. In the above process, candidate nodes can be dynamically determined from multiple alliance nodes, and selection nodes can be determined from candidate nodes through voting, and management nodes and audit nodes can be determined according to the selection weight of selection nodes, which can increase the flexibility of determining management nodes and audit nodes and improve the security of smart contract management.
[0152] Figure 4 This is a schematic diagram of the architecture of a node determination method provided in an embodiment of the present application. Figure 4 , multiple candidate nodes corresponding to the target smart contract are determined in the alliance chain. The candidate nodes are nodes that compete for management nodes and audit nodes. Voting links can be generated based on the multiple candidate nodes. The voting links can include management voting topics and audit voting topics. The management voting topics can be used to request the determination of management nodes, and the audit voting topics can be used to request the determination of audit nodes. Multiple voting nodes can be determined in the alliance chain, and multiple voting information of multiple voting nodes can be obtained according to the voting links. Multiple selection nodes, the node weight corresponding to each selection node, and at least one voting node corresponding to each selection node can be determined according to the multiple voting information.
[0153] For any voting topic, the first business type of the target smart contract can be determined, the second business type of each voting node can be determined, and the voting weight of each voting node can be determined based on the difference level between the second business type and the first business type of each voting node. The voting weight of each voting node can be determined based on the voting weight of each voting node and the node weight of the selection node. The target node of the voting node can be determined based on the selection weight of each selection node of the voting topic.
[0154] Figure 5 This is a schematic diagram of the structure of a node determination device provided in an embodiment of the present application. Figure 5 , the node determination device 10 may include a first determination module 11, a generation module 12, an acquisition module 13, and a second determination module 14:
[0155] The first determination module 11 is used to determine multiple candidate nodes corresponding to the target smart contract in the alliance chain, and the candidate nodes are nodes that compete for management nodes and review nodes;
[0156] The generating module 12 is used to generate a voting link according to a plurality of candidate nodes, the voting link including at least one voting subject, the voting subject being used to request determination of a management node or an audit node;
[0157] The acquisition module 13 is used to obtain voting information of multiple voting nodes in the alliance chain according to the voting link, and the voting information includes a selection node corresponding to each voting topic and a node weight corresponding to the selection node. The selection node is a node selected from multiple candidate nodes;
[0158] The second determination module 14 is used to determine the target node of each voting topic of the target smart contract according to the voting information of multiple voting nodes, and the target node includes a management node and an audit node.
[0159] The node determination device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0160] In a possible implementation manner, for any voting topic, the second determination module 14 is specifically configured to:
[0161] Determine the first business type of the target smart contract;
[0162] Determine the voting weight of each voting node according to the first business type;
[0163] According to the voting information and voting weight of each voting node, the target node of the voting topic is determined.
[0164] In a possible implementation manner, the second determining module 14 is specifically configured to:
[0165] According to the voting information of each voting node, determine the selection node and node weight of each voting node corresponding to the voting topic;
[0166] For any selection node, data processing is performed on the node weight and voting weight of the selection node of at least one voting node to obtain the selection weight of the selection node;
[0167] According to the selection weight of each selection node of the voting topic, the target node of the voting node is determined.
[0168] In a possible implementation manner, the second determining module 14 is specifically configured to:
[0169] Determining whether there is a selection weight greater than or equal to a first threshold;
[0170] If so, determining at least one selection node corresponding to the selection weight, and determining a target node in the at least one selection node;
[0171] If not, the node with the largest weight will be selected as the target node.
[0172] In a possible implementation manner, the second determining module 14 is specifically configured to:
[0173] Determining a second service type for each voting node;
[0174] Determine a difference level between the second service type and the first service type of each voting node;
[0175] The voting weight of each voting node is determined according to the difference level of each voting node.
[0176] In a possible implementation, the voting link includes a management voting topic and an audit voting topic; the generation module 12 is specifically used to:
[0177] At least one first candidate node for managing the voting topic and at least one second candidate node for reviewing the voting topic are determined from among the plurality of candidate nodes, and there is no identical candidate node among the at least one first candidate node and the at least one second candidate node.
[0178] In a possible implementation, the alliance chain includes multiple alliance nodes; the acquisition module 13 is specifically used for:
[0179] Determine multiple authentication nodes among multiple alliance nodes;
[0180] Determine the computing power share of each authentication node;
[0181] Determine an authentication node whose computing power occupancy rate is less than or equal to a first threshold as a voting node, so as to determine a plurality of voting nodes;
[0182] Send voting links to multiple voting nodes and receive voting information from multiple voting nodes.
[0183] The node determination device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0184] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 6 The electronic device 20 may include a processor 21 and a memory 22. Exemplarily, the processor 21 and the memory 22 are interconnected via a bus 23.
[0185] The memory 22 stores computer executable instructions;
[0186] The processor 21 executes the computer-executable instructions stored in the memory 22, so that the processor 21 executes the node determination method shown in the above method embodiment.
[0187] Accordingly, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the node determination method of the above method embodiment.
[0188] Accordingly, an embodiment of the present application may also provide a computer program product, including a computer program, which, when executed by a processor, can implement the node determination method shown in the above method embodiment.
[0189] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0190] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0191] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0192] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0193] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0194] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0195] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0196] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0197] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A node determination method, characterized in that: include: Determine multiple candidate nodes corresponding to the target smart contract in the alliance chain, where the candidate nodes are nodes that compete for management nodes and audit nodes; Generate a voting link according to the multiple candidate nodes, where the voting link includes at least one voting subject, and the voting subject is used to request determination of a management node or an audit node; According to the voting link, the voting information of the plurality of voting nodes in the alliance chain is obtained, wherein the voting information includes a selection node corresponding to each voting topic and a node weight corresponding to the selection node, wherein the selection node is a node selected from the plurality of candidate nodes; According to the voting information of the multiple voting nodes, a target node for each voting subject of the target smart contract is determined, and the target node includes a management node and an audit node.
2. The method according to claim 1, characterized in that For any voting topic; determining the target node of the voting topic according to the voting information of the multiple voting nodes, including: Determining a first business type of the target smart contract; Determining the voting weight of each voting node according to the first service type; The target node of the voting topic is determined according to the voting information and voting weight of each voting node.
3. The method according to claim 2, characterized in that Determining the target node of the voting topic according to the voting information and voting weight of each voting node includes: Determine, according to the voting information of each voting node, a selection node and a node weight of the selection node for each voting node corresponding to the voting topic; For any selection node, data processing is performed on the node weight and voting weight of the selection node of at least one voting node to obtain the selection weight of the selection node; The target node of the voting node is determined according to the selection weight of each selection node of the voting subject.
4. The method according to claim 3, characterized in that Determining the target node of the voting node according to the selection weight of each selection node of the voting subject includes: Determining whether there is a selection weight greater than or equal to a first threshold; If yes, determining at least one selection node corresponding to the selection weight, and determining the target node in the at least one selection node; If not, the selection node with the largest weight is selected and determined as the target node.
5. The method according to claim 2, characterized in that: Determining the voting weight of each voting node according to the first service type includes: Determining a second service type of each voting node; Determining a difference level between a second service type of each voting node and the first service type; The voting weight of each voting node is determined according to the difference level of each voting node.
6. The method according to any one of claims 1 to 5, characterized in that: The voting link includes a management voting topic and an audit voting topic; generating the voting link according to the multiple candidate nodes includes: At least one first candidate node for managing the voting topic and at least one second candidate node for reviewing the voting topic are determined from the multiple candidate nodes, and there is no identical candidate node between the at least one first candidate node and the at least one second candidate node.
7. The method according to any one of claims 1 to 6, characterized in that: The alliance chain includes multiple alliance nodes; According to the voting link, the voting information of multiple voting nodes in the alliance chain is obtained, including: Determining a plurality of authentication nodes among the plurality of alliance nodes; Determine the computing power share of each authentication node; Determine the authentication node whose computing power occupancy rate is less than or equal to the first threshold as a voting node, so as to determine a plurality of voting nodes; The voting link is sent to the plurality of voting nodes, and voting information of the plurality of voting nodes is received.
8. A node determination device, characterized in that: It includes a first determination module, a generation module, an acquisition module, and a second determination module: The first determination module is used to determine multiple candidate nodes corresponding to the target smart contract in the alliance chain, and the candidate nodes are nodes that compete for management nodes and review nodes; The generating module is used to generate a voting link according to the multiple candidate nodes, wherein the voting link includes at least one voting subject, and the voting subject is used to request determination of a management node or an audit node; The acquisition module is used to acquire, according to the voting link, voting information of multiple voting nodes in the alliance chain, wherein the voting information includes a selection node corresponding to each voting topic and a node weight corresponding to the selection node, and the selection node is a node selected from the multiple candidate nodes; The second determination module is used to determine the target node of each voting topic of the target smart contract according to the voting information of the multiple voting nodes, and the target node includes a management node and an audit node.
9. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.
11. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 7 when being executed by a processor.
Citation Information
Patent Citations
Block chain generation method and device, computer equipment and storage medium
CN108768665A
Data processing method, device and equipment based on block chain and readable storage medium
CN111324663A
Alliance chain intelligent contract management method and device, electronic device and medium
CN112688775A
Method and device for realizing control processing for voting network based on dynamic weight, processor and storage medium thereof
CN112995318A
Ticket weight determination method and related equipment
CN113132126A
