Block chain block propagation protocol evaluation method and apparatus, and terminal device
By analyzing the connectivity and shard synchronization process of the blockchain network and calculating the propagation delay data, the problem of inaccurate evaluation of blockchain block propagation protocol in the existing technology is solved, and the blockchain block propagation protocol is realized Accurate performance evaluation and efficiency improvement.
Patent Information
- Application Number
- CN202410873923.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-01
- Publication Date
- 2024-11-29
AI Technical Summary
The existing blockchain block propagation protocol evaluation methods focus on overall performance indicators, resulting in inaccurate evaluation and inaccurate reflection of the propagation delay and efficiency of the blockchain network.
By determining the connectivity and shard synchronization process of the blockchain network, the propagation delay data is analyzed, including calculating the number of first time slots, second time slots, and unit time for each time slot, to evaluate the blockchain blocks Propagation protocol performance.
It realizes a more accurate and rapid evaluation of the blockchain block propagation protocol, improves the accuracy and efficiency of the evaluation, and can better reflect the efficiency of block propagation in the blockchain network.
Smart Images

Figure CN119052149A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of blockchain technology, and in particular, relates to an evaluation method, device and terminal device for a blockchain block propagation protocol. Background Art
[0002] As blockchain technology becomes more popular, the transaction volume and the number of users continue to grow. In the blockchain block propagation protocol, the traditional peer-to-peer network structure faces problems such as propagation delay and bandwidth consumption. In order to improve network performance and efficiency, researchers and developers are committed to improving the propagation protocol and have proposed a variety of innovative solutions to achieve faster and more scalable block propagation. The development of these technologies has promoted the progress and application expansion of the entire blockchain field.
[0003] In the related art, the existing evaluation method of the blockchain block propagation protocol mainly focuses on the evaluation of the overall performance indicators (such as throughput and confirmation time) of the block propagation protocol, which leads to the problem of inaccurate evaluation method of the blockchain block propagation protocol. Summary of the invention
[0004] The embodiments of the present application provide a blockchain block propagation protocol evaluation method, apparatus, terminal device and storage medium, which can solve the problem that the current blockchain block propagation protocol evaluation method mainly focuses on the evaluation of the overall performance indicators of the block propagation protocol, resulting in inaccurate blockchain block propagation protocol evaluation methods.
[0005] In a first aspect, an embodiment of the present application provides an evaluation method for a blockchain block propagation protocol, comprising: determining the connectivity of a blockchain network that applies the blockchain block propagation protocol; analyzing the sharding synchronization process of blocks in the blockchain network to determine the propagation delay data of the blockchain network; and evaluating the blockchain block propagation protocol based on the propagation delay data.
[0006] In a possible implementation of the first aspect, the above-mentioned analyzing the shard synchronization process of blocks in the blockchain network to determine the propagation delay data of the blockchain network includes:
[0007] Determine the first time slot number according to the message request process between each node in the blockchain network;
[0008] Determine the second time slot number according to the shard propagation process between nodes in the blockchain network and the first time slot number;
[0009] The propagation delay data is determined according to the second time slot number and the unit time corresponding to each time slot.
[0010] Optionally, in another possible implementation of the first aspect, determining the first time slot number according to a message request process between nodes in the blockchain network includes:
[0011] Determine the maximum number of active connections for the blockchain network based on the number of nodes in the blockchain network and the average number of connections per node;
[0012] The first time slot number is determined by equating the number of active connections of the blockchain network at the first time slot number with the maximum number of active connections of the blockchain network.
[0013] Optionally, in another possible implementation of the first aspect, determining the second time slot number according to the shard propagation process between nodes in the blockchain network and the first time slot number includes:
[0014] According to the number of nodes in the blockchain network and the number of shards of the block, determine the total number of shards received by all nodes during the shard propagation process;
[0015] Accumulate the number of active connections corresponding to the blockchain network within the first time slot number to determine the total number of shards received by all nodes during the shard propagation process within the first time slot number;
[0016] Determine the total number of fragments received by all nodes during the fragment propagation process within the second time slot number according to the total number of fragments received by all nodes during the fragment propagation process within the first time slot number and the total number of fragments received by all nodes during the fragment propagation process between the first time slot number and the second time slot number;
[0017] The second time slot number is determined by equating the total number of fragments received by all nodes during the fragment propagation process within the second time slot number with the total number of fragments received by all nodes during the fragment propagation process.
[0018] Optionally, in another possible implementation manner of the first aspect, determining the propagation delay data according to the second time slot number and the unit time corresponding to each time slot includes:
[0019] Determine the unit time corresponding to each time slot based on the average number of connections per node, the shard transmission delay data, and the average network propagation delay data;
[0020] The propagation delay data is determined according to the unit time corresponding to each time slot and the number of the second time slot.
[0021] Optionally, in another possible implementation of the first aspect, the shard transmission delay data is determined by the bandwidth of the blockchain network, the size of the block, and the number of shards of the block.
[0022] Optionally, in another possible implementation of the first aspect, the determining the connectivity of the blockchain network to which the blockchain block propagation protocol is applied includes:
[0023] Determine that the connection probability between each node in the blockchain network is greater than or equal to a first preset threshold;
[0024] Determine whether the average number of connections per node is greater than or equal to a second preset threshold to determine the connectivity of the blockchain network, wherein the second preset threshold is determined by the first threshold and the number of nodes in the blockchain network.
[0025] In a second aspect, an embodiment of the present application provides an evaluation device for a blockchain block propagation protocol, comprising: a first determination module for determining the connectivity of a blockchain network to which the blockchain block propagation protocol is applied; a second determination module for analyzing the sharding synchronization process of blocks in the blockchain network to determine the propagation delay data of the blockchain network; and an evaluation module for evaluating the blockchain block propagation protocol based on the propagation delay data.
[0026] In a possible implementation manner of the second aspect, the second determining module includes:
[0027] A first determining unit, configured to determine a first time slot number according to a message request process between nodes in the blockchain network;
[0028] A second determining unit, configured to determine the second time slot number according to the shard propagation process between the nodes in the blockchain network and the first time slot number;
[0029] The third determining unit is used to determine the propagation delay data according to the second time slot number and the unit time corresponding to each time slot.
[0030] In a possible implementation manner of the second aspect, the first determining unit is specifically configured to:
[0031] Determine the maximum number of active connections for the blockchain network based on the number of nodes in the blockchain network and the average number of connections per node;
[0032] The first time slot number is determined by equating the number of active connections of the blockchain network at the first time slot number with the maximum number of active connections of the blockchain network.
[0033] Optionally, in another possible implementation manner of the second aspect, the second determining unit is specifically configured to:
[0034] According to the number of nodes in the blockchain network and the number of shards of the block, determine the total number of shards received by all nodes during the shard propagation process;
[0035] Accumulate the number of active connections corresponding to the blockchain network within the first time slot number to determine the total number of shards received by all nodes during the shard propagation process within the first time slot number;
[0036] Determine the total number of fragments received by all nodes during the fragment propagation process within the second time slot number according to the total number of fragments received by all nodes during the fragment propagation process within the first time slot number and the total number of fragments received by all nodes during the fragment propagation process between the first time slot number and the second time slot number;
[0037] The second time slot number is determined by equating the total number of fragments received by all nodes during the fragment propagation process within the second time slot number with the total number of fragments received by all nodes during the fragment propagation process.
[0038] Optionally, in another possible implementation manner of the second aspect, the third determining unit is specifically configured to:
[0039] Determine the unit time corresponding to each time slot based on the average number of connections per node, the shard transmission delay data, and the average network propagation delay data;
[0040] The propagation delay data is determined according to the unit time corresponding to each time slot and the number of the second time slot.
[0041] Optionally, in another possible implementation of the second aspect, the shard transmission delay data is determined by the bandwidth of the blockchain network, the size of the block, and the number of shards of the block.
[0042] Optionally, in another possible implementation manner of the second aspect, the first determining module includes:
[0043] A fourth determination unit, configured to determine whether a connection probability between nodes in the blockchain network is greater than or equal to a first preset threshold;
[0044] The fifth determination unit is used to determine whether the average number of connections of each node is greater than or equal to a second preset threshold value to determine the connectivity of the blockchain network, wherein the second preset threshold value is determined by the first threshold value and the number of nodes in the blockchain network.
[0045] In a third aspect, an embodiment of the present application provides a terminal device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the evaluation method of the blockchain block propagation protocol as described above when executing the computer program.
[0046] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the evaluation method of the blockchain block propagation protocol as described above.
[0047] In the technical solution of the present application, the connectivity of the blockchain network that applies the blockchain block propagation protocol is first determined, and then the sharding synchronization process of the blocks in the blockchain network is analyzed to determine the propagation delay data of the blockchain network, and finally the blockchain block propagation protocol is evaluated based on the propagation delay data. Thus, by simplifying the evaluation method, only focusing on analyzing the delay of the block sharding propagation in the blockchain, the basic performance of the blockchain block propagation protocol can be evaluated more accurately and quickly. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0049] Figure 1 It is a flowchart of an evaluation method for a blockchain block propagation protocol provided by an embodiment of the present application;
[0050] Figure 2 It is a flow chart of a shard pipeline propagation protocol provided by an embodiment of the present application;
[0051] Figure 3 It is a flowchart of an evaluation method for a blockchain block propagation protocol provided by another embodiment of the present application;
[0052] Figure 4 It is a flow chart of an evaluation device for a blockchain block propagation protocol provided by an embodiment of the present application;
[0053] Figure 5 It is a schematic diagram of the structure of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0054] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0055] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0056] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0057] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0058] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0059] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0060] The following is a detailed description of the evaluation method, apparatus, terminal device and storage medium of the blockchain block propagation protocol provided by the present application with reference to the accompanying drawings.
[0061] Figure 1 A flowchart of a method for evaluating a blockchain block propagation protocol provided in an embodiment of the present application is shown.
[0062] like Figure 1 As shown, the evaluation method of the blockchain block propagation protocol includes the following steps:
[0063] Step 101, determine the connectivity of the blockchain network that applies the blockchain block propagation protocol.
[0064] Among them, connectivity can refer to the degree of connection between nodes in the blockchain network and the ability of information to propagate in the blockchain network.
[0065] It should be noted that the blockchain block propagation protocol can be a sharding and multi-source propagation protocol. Figure 2 As shown in the flowchart of the sharding pipeline propagation protocol shown in FIG, there are three nodes A, B and C in the current blockchain network. When node A mines or receives a block, it sends an INV message to node B. Node B checks whether the block exists in its own node according to the INV message. If not, it sends a GETHEADER message to node A to obtain the block header and Bloom filter, and verify the block header and Bloom filter. After the verification is passed, a GETDATA message is sent to node A to obtain and verify the first batch of block shard sets {Segment1, Segment2, Segment3...Segmentk}. After the verification is passed, the first batch of block shard sets {Segment1, Segment2, Segment3...Segmentk} can be forwarded to node C through the same block propagation method mentioned above. In addition, as Figure 2 As shown, node B can receive multiple INV messages, for example, it can receive the INV message sent by node C, and obtain the second batch of block shard sets {Segmentk+1, Segmentk+2, Segmentk+3...Segmentn}. Through the above embodiment, shard propagation and multi-source propagation of blocks can be realized.
[0066] In an embodiment of the present application, the connectivity of the blockchain network that applies the blockchain block propagation protocol can be determined first, thereby improving the robustness of the blockchain network. Furthermore, the blockchain block propagation protocol can be evaluated more accurately.
[0067] Furthermore, in a possible implementation of the embodiment of the present application, the above step 101 may include:
[0068] Determine that the connection probability between each node in the blockchain network is greater than or equal to a first preset threshold;
[0069] Determine whether the average number of connections per node is greater than or equal to a second preset threshold to determine the connectivity of the blockchain network, wherein the second preset threshold is determined by the first threshold and the number of nodes in the blockchain network.
[0070] It should be noted that the topological structure of the blockchain network can be represented as a random graph G p (N), where N represents the total number of nodes in the blockchain network, and p represents the independent probability that there is a connection between any two selected nodes in the peer-to-peer (P2P) coverage blockchain network. Each node maintains an average of M open connections with other nodes, and all connections in the blockchain network have the same peer-to-peer capacity, denoted as B, and the random graph Gp (N) As the topology of the P2P overlay network, the average number of connections between nodes in the blockchain network can be expressed by the following formula:
[0071]
[0072] Since the average degree of each node is equal to p(N-1), that is, M=p(N-1), the formula can be transformed to obtain:
[0073]
[0074] Because in determining that the connection probability between each node in the blockchain network is greater than or equal to the first preset threshold, that is, When the random graph g p (n) becomes a connected graph, thereby determining the connectivity of the blockchain network that applies the blockchain block propagation protocol, and then the formula After transformation, we can get:
[0075]
[0076] Therefore, according to the above formula, when it is determined that the average number of connections of each node is greater than or equal to the second preset threshold, that is, When the blockchain network is connected to the blockchain block propagation protocol, the connectivity of the blockchain network can be determined. In addition, in this embodiment, the total number of nodes N in the blockchain network is set to be quite large, equivalent to the scale of the public blockchain network (N≈10,000).
[0077] In an embodiment of the present application, it is first determined that the connection probability between each node in the blockchain network is greater than or equal to a first preset threshold, and then it is determined that the average number of connections of each node is greater than or equal to a second preset threshold, thereby determining the connectivity of the blockchain network.
[0078] Step 102, analyzing the sharding synchronization process of blocks in the blockchain network to determine the propagation delay data of the blockchain network.
[0079] Among them, the block sharding synchronization process can refer to the nodes in the blockchain network dividing the block into multiple shards and propagating them in parallel through the network until all other nodes successfully receive and reconstruct the entire block.
[0080] Among them, the propagation delay data can refer to the time required to propagate all shards of a block in the entire blockchain network, including the sum of the time from generating a block from one node and sending the block shards to all other nodes.
[0081] In the embodiment of the present application, by analyzing the shard synchronization process of the block in the blockchain network, the time for each shard to propagate and reconstruct through the blockchain network nodes can be determined, thereby calculating the propagation delay of the entire block in the blockchain network. By measuring the shard transmission time and propagation delay, the propagation delay data of the entire blockchain network can be quantified, and then the performance of the blockchain block propagation protocol can be evaluated.
[0082] Step 103, evaluating the blockchain block propagation protocol based on the propagation delay data.
[0083] As a possible implementation method, when the propagation delay data is smaller, that is, the time required to propagate all shards of a block in the blockchain network is less, the propagation efficiency of the blockchain block propagation protocol corresponding to the propagation delay data is higher. On the contrary, when the propagation delay data is larger, that is, the time required to propagate all shards of a block in the blockchain network is more, the propagation efficiency of the blockchain block propagation protocol corresponding to the propagation delay data is lower.
[0084] In an embodiment of the present application, evaluating the blockchain block propagation protocol based on the propagation delay data can better reflect the efficiency of propagating blocks in the blockchain network, thereby improving the accuracy of the evaluation of the blockchain block propagation protocol.
[0085] The evaluation method of the blockchain block propagation protocol provided in this application first determines the connectivity of the blockchain network to which the blockchain block propagation protocol is applied, then analyzes the sharding synchronization process of the blocks in the blockchain network, determines the propagation delay data of the blockchain network, and finally evaluates the blockchain block propagation protocol based on the propagation delay data. Thus, by simplifying the evaluation method, only focusing on analyzing the delay of the block sharding propagation in the blockchain, the basic performance of the blockchain block propagation protocol can be evaluated more accurately and quickly.
[0086] Figure 3 A flow chart of another method for evaluating a blockchain block propagation protocol provided in an embodiment of the present application is shown.
[0087] like Figure 3 As shown, the evaluation method of the blockchain block propagation protocol includes the following steps:
[0088] Step 301, determine the connectivity of the blockchain network that applies the blockchain block propagation protocol.
[0089] The specific implementation process and principle of the above step 301 can be referred to the detailed description of the above embodiment, which will not be repeated here.
[0090] Step 302, determine the first time slot number according to the message request process between each node in the blockchain network.
[0091] Among them, the message request process can refer to the process of exchanging messages through INV messages and GETDATA messages between nodes in the blockchain network. INV messages refer to inventory messages, which are used to inform other nodes of which blocks or transaction data the current adjacent nodes have. They can inform other nodes of which blocks or transaction data the current node has, so that other nodes can selectively request the required data. For example, after the current adjacent node verifies the validity of a block, regardless of whether the block is received or created by the current adjacent node, it will send an INV message to other adjacent nodes to provide the hash value of the block; GETDATA messages refer to data request messages, which are a type of request message in the blockchain network. Nodes can use it to request data from adjacent nodes for specific blocks or block shards. When a node receives an INV message, it sends a GETDATA message to obtain the actual data content.
[0092] For example, in a blockchain network consisting of N nodes, node n0 successfully creates a block at time t0 and generates k block shards through the block sharding mechanism. Node n0 sends INV messages with different batch numbers to the set of neighbor nodes in its connection pool. Send notification. Each node in W1 will receive the initial INV message from the block and obtain the corresponding block shard by sending a GETDATA message. Then, n0 will start transmitting each batch of block shards to the requesting node.
[0093] The first time slot number may refer to the time slot number corresponding to the stable number of active connections of the blockchain network.
[0094] In the embodiment of the present application, the first time slot number is determined according to the message request process between each node in the blockchain network, thereby optimizing the efficiency of shard propagation and ensuring that the number of connections between nodes is maximized in the shortest time, thereby accelerating the propagation and synchronization of shards. By accurately calculating the first time slot number, the blockchain network can more effectively plan resource allocation and data transmission paths, reduce overall propagation delays, and improve the performance and reliability of the blockchain network.
[0095] Furthermore, in a possible implementation of the embodiment of the present application, the above step 302 may include:
[0096] Determine the maximum number of active connections for the blockchain network based on the number of nodes in the blockchain network and the average number of connections per node;
[0097] The first time slot number is determined by equating the number of active connections of the blockchain network at the first time slot number with the maximum number of active connections of the blockchain network.
[0098] It should be noted that there is an inherent limit to the number of active connections in a blockchain network. In one embodiment, when there are N nodes in the blockchain network and each node has an average of M connections, the maximum number of active connections in the network is:
[0099] C max =N×M
[0100] C i It is expressed as the number of time slots. is the number of active connections in the blockchain network, which represents the degree of parallelism of shard propagation. i is defined as follows:
[0101]
[0102] Set the first time slot number to K, then the number of active connections in the blockchain network at the first time slot number is:
[0103]
[0104] Where W i It means the The number of nodes that respond to the INV message and send the GETDATA message in the number of time slots, that is:
[0105]
[0106] The following describes W i The derivation process:
[0107] There are N nodes in the blockchain network, and the initial number of propagation nodes for each shard is M. In a time slot, the probability of a node responding after receiving an INV message is p fi In the first time slot, only the initial propagation node M sends an INV message. Assume that the INV message sent by each node can be successfully transmitted to other nodes, and these nodes will send GETDATA messages, that is, W1 = M × p f1 ; In the second time slot, the node that receives the INV message in the first time slot will propagate the INV message again, so the number of nodes that respond to the INV message and send the GETDATA message is: W2 = M 2 ×p f1 ×p f2 ; In the third time slot, the node that receives the INV message in the second time slot will propagate the INV message again, so the number of nodes that respond to the INV message and send the GETDATA message is: W3 = M 3 ×p f1 ×p f2 ×p f3, therefore, according to the derivation process of the above formula, we can know that W i The corresponding formula.
[0108] It should be noted that, because the number of active connections in the blockchain network is always less than or equal to the maximum number of active connections in the blockchain network, when the number of active connections in the blockchain network at the first time slot is greater than the maximum number of active connections in the blockchain network, it is necessary to adjust the number of active connections in the blockchain network at the first time slot according to the adaptation factor so that the number of active connections in the blockchain network is equal to the maximum number of active connections in the blockchain network, that is:
[0109]
[0110] Wherein, β is an adaptation factor. According to the above formula, the value of the first time slot number K can be obtained.
[0111] Step 303, determine the second time slot number according to the shard propagation process between each node in the blockchain network and the first time slot number.
[0112] Among them, the shard propagation process can refer to the process in which the nodes in the blockchain network divide the block into multiple shards, transmit them in parallel through the network nodes until all nodes receive all shards and successfully reconstruct the entire block.
[0113] The second time slot number may refer to the number of time slots required for all nodes in the blockchain network to obtain all shards and rebuild blocks. It indicates the time point when the shard synchronization process is completed, ensuring that all nodes successfully rebuild the complete block within this number of time slots.
[0114] In the embodiment of the present application, the second time slot number can be determined according to the shard propagation process between each node in the blockchain network and the first time slot number, thereby ensuring that all nodes obtain enough shards and successfully rebuild blocks in the shortest time, thereby achieving full network synchronization. By accurately calculating the second time slot number, the blockchain network can optimize the data transmission path and resource allocation, and reduce the overall propagation delay.
[0115] Furthermore, in a possible implementation of the embodiment of the present application, the above step 303 may include:
[0116] According to the number of nodes in the blockchain network and the number of shards of the block, determine the total number of shards received by all nodes during the shard propagation process;
[0117] Accumulate the number of active connections corresponding to the blockchain network within the first time slot number to determine the total number of shards received by all nodes during the shard propagation process within the first time slot number;
[0118] Determine the total number of fragments received by all nodes during the fragment propagation process within the second time slot number according to the total number of fragments received by all nodes during the fragment propagation process within the first time slot number and the total number of fragments received by all nodes during the fragment propagation process between the first time slot number and the second time slot number;
[0119] The second time slot number is determined by equating the total number of fragments received by all nodes during the fragment propagation process within the second time slot number with the total number of fragments received by all nodes during the fragment propagation process.
[0120] It should be noted that, in one embodiment, in a network with N nodes, a block is divided into k fragments, and non-redundant fragment transmission is considered. The total number of fragments received by all nodes during the fragment propagation process is:
[0121] N total =(N-1)×k
[0122] The total number of shards received by all nodes during the shard propagation process within the first time slot is the accumulation of the number of active connections corresponding to the blockchain network in each time slot within the first time slot, that is:
[0123]
[0124] For example, when the first time slot number is 2, the total number of fragments received by all nodes during the fragment propagation process within the first time slot number is C1+C2.
[0125] Set the second time slot number to L, then the total number of fragments received by all nodes during the fragment propagation process within the second time slot number is:
[0126]
[0127] Among them, α represents the probability of transmission failure. Because the total number of fragments received by all nodes in the fragment propagation process within the second time slot number must be less than or equal to the total number of fragments received by all nodes in the fragment propagation process, when the total number of fragments received by all nodes in the fragment propagation process within the second time slot number is greater than the total number of fragments received by all nodes in the fragment propagation process, the total number of fragments received by all nodes in the fragment propagation process within the second time slot number is equal to the total number of fragments received by all nodes in the fragment propagation process, that is:
[0128]
[0129] Wherein, β is the adaptation factor. According to the above formula, the value of the second time slot number L can be obtained.
[0130] Step 304: determine propagation delay data according to the second time slot number and the unit time corresponding to each time slot.
[0131] The unit time corresponding to each time slot may refer to the duration required for a node to complete a shard broadcast.
[0132] In an embodiment of the present application, the propagation delay data is determined by the number of second time slots and the unit time corresponding to each time slot, so that the blockchain block propagation protocol can be more reliably evaluated based on the propagation delay data.
[0133] Furthermore, in a possible implementation of the embodiment of the present application, the above step 304 may include:
[0134] Determine the unit time corresponding to each time slot based on the average number of connections per node, shard transmission delay data, and average network propagation delay data. The shard transmission delay data is determined by the bandwidth of the blockchain network, the size of the block, and the number of shards of the block.
[0135] The propagation delay data is determined according to the unit time corresponding to each time slot and the number of the second time slot.
[0136] It should be noted that, in one embodiment, T trans Represents the shard transmission delay data. The bandwidth of the blockchain network is B, S Block represents the block size, k represents the number of shards, so the shard transmission delay data can be expressed as:
[0137]
[0138] Furthermore, the unit time ΔT corresponding to each time slot can be expressed as:
[0139]
[0140] Where M is the average number of connections per node, T prop It is the average network propagation delay data.
[0141] Finally, according to the unit time corresponding to each time slot and the number of second time slots, the propagation delay data can be expressed as:
[0142]
[0143] Step 305, evaluate the blockchain block propagation protocol based on the propagation delay data.
[0144] The specific implementation process and principle of the above step 305 can refer to the detailed description of the above embodiment, which will not be repeated here.
[0145] It should be noted that in the evaluation method provided in this application, the propagation overhead of the fragment itself can be focused on, excluding the additional overhead from the INV and GETDATA messages. In addition, it is assumed that in an ideal scenario where there is no repeated fragment transmission, by ignoring the INV and GETDATA messages and eliminating repeated transmissions, the analysis and evaluation are simplified, focusing on the essence of fragment propagation.
[0146] The evaluation method of the blockchain block propagation protocol provided by the present application first determines the connectivity of the blockchain network to which the blockchain block propagation protocol is applied, and then determines the first time slot number according to the message request process between each node in the blockchain network, and then determines the second time slot number according to the shard propagation process between each node in the blockchain network and the first time slot number, and then determines the propagation delay data according to the second time slot number and the unit time corresponding to each time slot, and finally evaluates the blockchain block propagation protocol according to the propagation delay data. The shard synchronization process is thus divided into two steps. In the first step, through the exchange of INV and GETDATA messages between nodes, the number of active connections in the blockchain network quickly increases from to the maximum number of active connections, and the second step involves using the maximum number of active connections to propagate shards in parallel on the network until all nodes successfully synchronize shards and reconstruct blocks, thereby simplifying the evaluation method, thereby more accurately evaluating the blockchain block propagation protocol and improving the reliability of the evaluation method.
[0147] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0148] Corresponding to the evaluation method of the blockchain block propagation protocol in the above embodiment, Figure 4 A structural block diagram of an evaluation device for a blockchain block propagation protocol provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0149] Reference Figure 4 , the device 400 comprises:
[0150] A first determination module 401 is used to determine the connectivity of a blockchain network that applies a blockchain block propagation protocol;
[0151] The second determination module 402 is used to analyze the shard synchronization process of the blocks in the blockchain network and determine the propagation delay data of the blockchain network;
[0152] The evaluation module 403 is used to evaluate the blockchain block propagation protocol based on the propagation delay data.
[0153] In actual use, the evaluation device for the blockchain block propagation protocol provided in the embodiment of the present application can be configured in any terminal device to execute the aforementioned evaluation method for the blockchain block propagation protocol.
[0154] The evaluation device for the blockchain block propagation protocol provided by the present application first determines the connectivity of the blockchain network to which the blockchain block propagation protocol is applied, then analyzes the sharding synchronization process of the blocks in the blockchain network, determines the propagation delay data of the blockchain network, and finally evaluates the blockchain block propagation protocol based on the propagation delay data. Thus, by simplifying the evaluation method, only focusing on analyzing the delay of the block sharding propagation in the blockchain, the basic performance of the blockchain block propagation protocol can be evaluated more accurately and quickly.
[0155] In a possible implementation of the embodiment of the present application, the second determining module 402 includes:
[0156] A first determining unit, configured to determine a first time slot number according to a message request process between nodes in the blockchain network;
[0157] A second determining unit, configured to determine the second time slot number according to the shard propagation process between the nodes in the blockchain network and the first time slot number;
[0158] The third determining unit is used to determine the propagation delay data according to the second time slot number and the unit time corresponding to each time slot.
[0159] Furthermore, in a possible implementation of the embodiment of the present application, the first determining unit is specifically configured to:
[0160] Determine the maximum number of active connections for the blockchain network based on the number of nodes in the blockchain network and the average number of connections per node;
[0161] The first time slot number is determined by equating the number of active connections of the blockchain network at the first time slot number with the maximum number of active connections of the blockchain network.
[0162] Furthermore, in another possible implementation of the embodiment of the present application, the second determining unit is specifically configured to:
[0163] According to the number of nodes in the blockchain network and the number of shards of the block, determine the total number of shards received by all nodes during the shard propagation process;
[0164] Accumulate the number of active connections corresponding to the blockchain network within the first time slot number to determine the total number of shards received by all nodes during the shard propagation process within the first time slot number;
[0165] Determine the total number of fragments received by all nodes during the fragment propagation process within the second time slot number according to the total number of fragments received by all nodes during the fragment propagation process within the first time slot number and the total number of fragments received by all nodes during the fragment propagation process between the first time slot number and the second time slot number;
[0166] The second time slot number is determined by equating the total number of fragments received by all nodes during the fragment propagation process within the second time slot number with the total number of fragments received by all nodes during the fragment propagation process.
[0167] Furthermore, in another possible implementation of the embodiment of the present application, the third determining unit is specifically configured to:
[0168] Determine the unit time corresponding to each time slot based on the average number of connections per node, the shard transmission delay data, and the average network propagation delay data;
[0169] The propagation delay data is determined according to the unit time corresponding to each time slot and the number of the second time slot.
[0170] Furthermore, in another possible implementation of the embodiment of the present application, the above-mentioned shard transmission delay data is determined by the bandwidth of the blockchain network, the size of the block, and the number of shards of the block.
[0171] Furthermore, in another possible implementation of the embodiment of the present application, the first determining module 401 includes:
[0172] A fourth determination unit, configured to determine whether a connection probability between nodes in the blockchain network is greater than or equal to a first preset threshold;
[0173] The fifth determination unit is used to determine whether the average number of connections of each node is greater than or equal to a second preset threshold value to determine the connectivity of the blockchain network, wherein the second preset threshold value is determined by the first threshold value and the number of nodes in the blockchain network.
[0174] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0175] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0176] In order to implement the above embodiments, the present application also proposes a terminal device.
[0177] Figure 5 A schematic diagram of the structure of a terminal device according to an embodiment of the present application.
[0178] like Figure 5 As shown, the terminal device 200 includes:
[0179] A memory 210 and at least one processor 220, a bus 230 connecting different components (including the memory 210 and the processor 220), the memory 210 stores a computer program, and when the processor 220 executes the program, the evaluation method of the blockchain block propagation protocol described in the embodiment of the present application is implemented.
[0180] Bus 230 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.
[0181] The terminal device 200 typically includes a variety of electronic device readable media, which can be any available media that can be accessed by the terminal device 200, including volatile and non-volatile media, removable and non-removable media.
[0182] The memory 210 may also include computer system readable media in the form of volatile memory, such as random access memory (RAM) 240 and / or cache memory 250. The terminal device 200 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 260 may be used to read and write non-removable, non-volatile magnetic media ( Figure 5 not shown, usually called a "hard drive"). Although Figure 5 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical medium) may be provided. In these cases, each drive may be connected to bus 230 via one or more data medium interfaces. Memory 210 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present application.
[0183] A program / utility 280 having a set (at least one) of program modules 270 may be stored, for example, in the memory 210, such program modules 270 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 270 generally perform the functions and / or methods of the embodiments described herein.
[0184] The terminal device 200 can also communicate with one or more external devices 290 (e.g., keyboard, pointing device, display 291, etc.), and can also communicate with one or more devices that enable users to interact with the terminal device 200, and / or communicate with any device that enables the terminal device 200 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be carried out through an input / output (I / O) interface 292. In addition, the terminal device 200 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN) and / or public network, such as the Internet) through a network adapter 293. As shown in the figure, the network adapter 293 communicates with other modules of the terminal device 200 through a bus 230. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the terminal device 200, including but not limited to: microcode, device driver, redundant processing unit, external disk drive array, RAID system, tape drive, and data backup storage system, etc.
[0185] The processor 220 executes various functional applications and data processing by running the programs stored in the memory 210 .
[0186] It should be noted that the implementation process and technical principles of the terminal device of this embodiment refer to the aforementioned explanation of the evaluation method of the blockchain block propagation protocol of the embodiment of the present application, which will not be repeated here.
[0187] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0188] An embodiment of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0189] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0190] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0191] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0192] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0193] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0194] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for evaluating a blockchain block propagation protocol, characterized in that: include: Determining connectivity of a blockchain network to which the blockchain block propagation protocol is applied; Analyze the sharding synchronization process of blocks in the blockchain network to determine the propagation delay data of the blockchain network; The blockchain block propagation protocol is evaluated based on the propagation delay data.
2. The method according to claim 1, characterized in that The analyzing the sharding synchronization process of the blocks in the blockchain network to determine the propagation delay data of the blockchain network includes: Determine a first time slot number according to a message request process between nodes in the blockchain network; Determine a second time slot number according to the shard propagation process between nodes in the blockchain network and the first time slot number; The propagation delay data is determined according to the second time slot number and the unit time corresponding to each time slot.
3. The method according to claim 2, characterized in that Determining the first time slot number according to the message request process between the nodes in the blockchain network includes: Determining a maximum number of active connections of the blockchain network based on the number of nodes in the blockchain network and the average number of connections of each of the nodes; The first time slot number is determined by equating the number of active connections of the blockchain network at the first time slot number with the maximum number of active connections of the blockchain network.
4. The method according to claim 3, characterized in that Determining the second time slot number according to the shard propagation process between the nodes in the blockchain network and the first time slot number includes: Determine the total number of shards received by all the nodes during the shard propagation process according to the number of nodes in the blockchain network and the number of shards of the block; Accumulate the number of active connections corresponding to the blockchain network within the first time slot number to determine the total number of shards received by all the nodes during the shard propagation process within the first time slot number; Determine the total number of fragments received by all the nodes in the fragment propagation process within the second time slot number according to the total number of fragments received by all the nodes in the fragment propagation process within the first time slot number and the total number of fragments received by all the nodes in the fragment propagation process between the first time slot number and the second time slot number; The second time slot number is determined by equating the total number of fragments received by all the nodes during the fragment propagation process within the second time slot number with the total number of fragments received by all the nodes during the fragment propagation process.
5. The method according to claim 4, characterized in that The determining the propagation delay data according to the second time slot number and the unit time corresponding to each time slot includes: Determine the unit time corresponding to each of the time slots according to the average number of connections of each of the nodes, the slice transmission delay data, and the average network propagation delay data; The propagation delay data is determined according to the unit time corresponding to each of the time slots and the number of the second time slots.
6. The method according to claim 5, characterized in that The shard transmission delay data is determined by the bandwidth of the blockchain network, the size of the block, and the number of shards of the block.
7. The method according to any one of claims 1 to 6, characterized in that: Determining the connectivity of a blockchain network to which the blockchain block propagation protocol is applied includes: Determine that the connection probability between each of the nodes in the blockchain network is greater than or equal to a first preset threshold; Determine whether the average number of connections of each of the nodes is greater than or equal to a second preset threshold to determine the connectivity of the blockchain network, wherein the second preset threshold is determined by the first preset threshold and the number of nodes in the blockchain network.
8. An evaluation device for a blockchain block propagation protocol, characterized in that: include: A first determination module, used to determine the connectivity of the blockchain network applying the blockchain block propagation protocol; A second determination module is used to analyze the sharding synchronization process of the blocks in the blockchain network and determine the propagation delay data of the blockchain network; An evaluation module is used to evaluate the blockchain block propagation protocol based on the propagation delay data.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Block chain-based lease user credit risk assessment method and system
CN120849513A
Blockchain-based lease user credit risk assessment method and system
CN120849513B
