Method and apparatus for data sending, device and storage medium

By recording the number of times proposals are sent in the blockchain system and adjusting the reissue time interval, the problem of frequent proposal reissues caused by network instability is solved, and the performance of the blockchain system and network bandwidth utilization are improved.

WO2024221823A1PCT designated stage expired Publication Date: 2024-10-31TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/129989
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-04-27
Filing Date
2023-11-06
Publication Date
2024-10-31

AI Technical Summary

Technical Problem

In the blockchain system, proposal transmission fails due to network instability, and the master node needs to frequently reissue proposals, causing network congestion and affecting system performance, especially when the amount of data is large.

Method used

The master node records the number of times a proposal is sent to the slave node, and determines the reissue time interval based on this number. It gradually increases the time interval to reduce frequent reissuance and ensure that the proposal can be delivered in time without occupying a large amount of network bandwidth.

Benefits of technology

By adjusting the reissue time interval, network congestion is alleviated, the performance of the blockchain system is improved, and proposals can be quickly delivered to non-received nodes while reducing the impact on normal nodes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023129989_31102024_PF_FP_ABST
    Figure CN2023129989_31102024_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are a method and an apparatus for data sending, a device and a storage medium, which can be applied to various scenarios such as cloud computing, big data, data transmission and blockchains. The method comprises: a master node sending a generated proposal to N slave nodes in a blockchain system, and recording a completed number of times of the master node's sending the proposal to each slave node in the N slave nodes; receiving node state information sent by M slave nodes in the N slave nodes, and based on node state information of each slave node in the M slave nodes, determining a first node not receiving the proposal in the N slave nodes; acquiring a completed number of times of the master node's sending the proposal to the first node, and based on the completed number of times of the master node's sending the proposal to the first node, determining a time interval for the master node's resending the proposal to the first node next time, the time interval being positively correlated with the completed number of times; and based on the time interval, resending the proposal to the first node. As such, there will be no occupation of a large amount of network bandwidth, thereby improving the performance of the whole blockchain system.
Need to check novelty before this filing date? Find Prior Art

Description

Data transmission method, device, equipment and storage medium

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on April 27, 2023, with application number 2023104816145 and invention name “Data sending method, device, equipment and storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The embodiments of the present application relate to the field of computer technology, and in particular to a data sending method, apparatus, device, and storage medium. Background Art

[0003] In blockchain systems, the core of the Byzantine consensus algorithm lies in the master node packaging transactions into a proposal (or block), which it then broadcasts to other nodes for consensus. However, when the master node sends the proposal to other nodes in the blockchain, it may fail to send the proposal due to network instability, packet loss, or disconnection. In this case, the master node needs to resend the proposal to the nodes that did not receive it in order to ensure the stable and continuous operation of the blockchain consensus system.

[0004] Currently, to ensure consensus performance in the blockchain system, the master node typically resends proposals to nodes in the blockchain that have not received them every second. However, for proposals with large amounts of data, this current resending method can cause network congestion, impacting the performance of the entire blockchain system.

[0005] Summary of the Invention

[0006] The present application provides a data transmission method, apparatus, device, and storage medium, which can improve the efficiency of data retransmission in the blockchain, thereby improving the performance of the blockchain system.

[0007] In a first aspect, the present application provides a data transmission method, which is applied to a master node in a blockchain system, comprising:

[0008] Send the generated proposal to N slave nodes in the blockchain system, and record the number of times the master node has sent the proposal to each of the N slave nodes, where N is a positive integer;

[0009] receiving node status information sent by M slave nodes among the N slave nodes, and determining a first node among the N slave nodes that has not received the proposal based on the node status information of each of the M slave nodes, where M is a positive integer less than or equal to N;

[0010] Obtain the currently recorded number of times the master node has sent the proposal to the first node, and based on the number of times the master node has sent the proposal to the first node, determine a time interval for the master node to resend the proposal to the first node next time, where the time interval is positively correlated with the number of times the master node has sent the proposal to the first node; the time interval is the time difference between the time when the master node resends the proposal to the slave node next time and the time when the master node last sent the proposal to the slave node;

[0011] Based on the time interval, the proposal is resent to the first node.

[0012] In a second aspect, the present application provides a data sending device, which is applied to a master node in a blockchain system, comprising:

[0013] a recording unit, configured to send the generated proposal to N slave nodes in the blockchain system, and record the number of times the master node has sent the proposal to each of the N slave nodes, where N is a positive integer;

[0014] a first node determining unit, configured to receive node status information sent by M slave nodes among the N slave nodes, and determine, based on the node status information of each of the M slave nodes, a first node among the N slave nodes that has not received the proposal, where M is a positive integer less than or equal to N;

[0015] a time interval determining unit, configured to obtain a currently recorded number of times the master node has sent the proposal to the first node, and determine, based on the number of times the master node has sent the proposal to the first node, a time interval for the master node to resend the proposal to the first node next time, wherein the time interval is positively correlated with the number of times the master node has sent the proposal to the first node; the time interval is the time difference between the time when the master node resends the proposal to the slave node next time and the time when the master node last sent the proposal to the slave node;

[0016] A resending unit is configured to resend the proposal to the first node based on the time interval.

[0017] In some embodiments, the time interval determination unit is specifically used to determine the time interval for the master node to resend the proposal to the first node next time based on the number of times the master node has sent the proposal to the first node and the time interval between the master node sending the proposal to the first node among the number of times the master node has sent the proposal to the first node.

[0018] In some embodiments, the time interval determination unit is specifically used to determine the time interval for the master node to resend the proposal to the first node next time based on the first time interval for the master node to last send the proposal to the first node and the second time interval for the master node to last send the proposal to the first node, if the number of times the master node has sent the proposal to the first node is greater than or equal to 2; or, if the number of times the master node has sent the proposal to the first node is equal to 1, determine the first time interval for the master node to last send the proposal to the first node as the time interval for the master node to resend the proposal to the first node next time.

[0019] In some embodiments, the time interval determining unit is specifically configured to determine the sum of the first time interval and the second time interval as the time interval for the master node to resend the proposal to the first node next time.

[0020] In some embodiments, the master node stores consensus status information of each of the N slave nodes. For each of the N slave nodes, the consensus status information of the slave node includes the number of times the master node has sent the proposal to the slave node. The recording unit is specifically used to record the number of times the master node has sent the proposal to the slave node for each of the N slave nodes through the consensus status information of the slave node; the first node determination unit is specifically used to obtain the number of times the master node has sent the proposal to the first node from the consensus status information of the first node.

[0021] In some embodiments, for each of the N slave nodes, the node status information of the slave node includes the current proposal hash value of the slave node, and the consensus status information of the slave node also includes a proposal hash value. The first node determination unit is further used to update the proposal hash value in the consensus status information of the slave node for each of the M slave nodes based on the current proposal hash value in the node status information of the slave node before determining the first node of the N slave nodes that has not received the proposal based on the node status information of each of the M slave nodes; for each of the N slave nodes, if the updated proposal hash value in the consensus status information of the slave node is empty, the slave node is determined to be the first node.

[0022] In some embodiments, the first node determination unit is further configured to, if M is less than N, determine other nodes among the N slave nodes except the M slave nodes as the first nodes.

[0023] In some embodiments, for each of the N slave nodes, the consensus status information of the slave node also includes the sending time when the master node last sent the proposal to the slave node. The reissuing unit is specifically used to obtain the sending time when the master node last sent the proposal to the first node from the consensus status information of the first node; determine the first time difference between the current time and the sending time of the proposal corresponding to the first node; if the first time difference is greater than or equal to the time interval, resend the proposal to the first node.

[0024] In some embodiments, after reissuing the proposal to the first node, the reissuing unit is further used to increase the number of times the proposal has been sent in the consensus status information of the first node by 1, and to update the sending time of the proposal in the consensus status information of the first node to the current time.

[0025] In some embodiments, for each of the N slave nodes, the node status information of the slave node includes the height value of the slave node in the blockchain system at the current moment, and the consensus status information of the slave node also includes the height value of the slave node. The reissuing unit is further used to, for the i-th slave node among the M slave nodes, if the height value in the node status information of the i-th slave node is inconsistent with the height value in the consensus status information of the i-th slave node, update the height value in the consensus status information of the i-th slave node to the height value in the node status information of the i-th slave node, and reset the number of times sent and the sending time in the consensus status information of the i-th slave node to 0.

[0026] In some embodiments, for each of the N slave nodes, the consensus status information of the slave node also includes the status update time of the slave node, and the status update time of the slave node is the time when the master node last received the status information of the slave node. The first node determination unit is further used to obtain the status update time corresponding to the first node from the consensus status information of the first node before obtaining the number of times the master node has sent the proposal to the first node from the consensus status information of the first node; determine the second time difference between the status update time corresponding to the first node and the current time; if the second time difference is less than or equal to a preset value, obtain the number of times the master node has sent the proposal to the first node from the consensus status information of the first node.

[0027] In some embodiments, the first node determination unit is further configured to determine that the first node is a faulty node and stop reissuing the proposal to the first node if the second time difference is greater than the preset value.

[0028] In some embodiments, the first node determination unit is further configured to set the number of times sent and the sending time in the consensus status information of the first node to 0 if the first node is a faulty node.

[0029] In a third aspect, the present application provides an electronic device comprising a processor and a memory, wherein the memory is configured to store a computer program, and the processor is configured to call and execute the computer program stored in the memory to perform the method of the first aspect.

[0030] In a fourth aspect, a chip is provided for implementing the method of the first aspect and its various implementations. Specifically, the chip includes a processor for calling and executing a computer program from a memory, so that a device equipped with the chip executes the method of the first aspect.

[0031] In a fifth aspect, a computer-readable storage medium is provided for storing a computer program, wherein the computer program enables a computer to execute the method of the first aspect.

[0032] In a sixth aspect, a computer program product is provided, comprising computer program instructions, wherein the computer program instructions enable a computer to execute the method of the first aspect.

[0033] In a seventh aspect, a computer program is provided, which, when executed on a computer, enables the computer to execute the method of the first aspect.

[0034] In summary, the present application sends the generated proposal to N slave nodes in the regional chain system through the master node in the blockchain system, and records the number of times the master node has sent the proposal to each of the N slave nodes; then, the master node receives the node status information sent by M of the N slave nodes, and based on the node status information of each of the M slave nodes, determines the first node among the N slave nodes that has not received the proposal, where M is a positive integer less than or equal to N; then, the master node obtains the currently recorded number of times the master node has sent the proposal to the first node, and based on the number of times the master node has sent the proposal to the first node, determines the time interval for the master node to resend the proposal to the first node next time, and the time interval is positively correlated with the number of times the master node has sent the proposal to the first node; finally, the master node resends the proposal to the first node based on the time interval. In an embodiment of the present application, when the master node resends the proposal to the first node, it determines the time interval for the master node to resend the proposal to the first node next time based on the currently recorded number of times the master node has sent the proposal to the first node, and the time interval is positively correlated with the number of times the proposal has been sent. In other words, each time the master node resends a proposal to the first node, the master node determines the time interval for the next resend of the proposal to the first node based on the currently recorded number of times the master node has sent the proposal to the first node, and the time interval is positively correlated with the number of times the proposal has been sent. For example, when the proposal is resent to the first node for the second time, since the number of times the proposal has been sent is 1, the time interval corresponding to the second resend can be determined based on 1. When the proposal is resent to the first node for the third time, since the number of times the proposal has been sent is 2, the time interval corresponding to the third resend can be determined based on 2. Since the number of times sent and the time interval are positively correlated each time resend, the time interval will become longer as the number of times sent increases. In this way, by gradually increasing the time interval for resending proposals, the situation of continuously sending proposals is reduced. On the one hand, it can alleviate the network congestion of the nodes of both parties, and thus ensure that the proposal can be sent to the nodes that have not received the proposal as soon as possible. On the other hand, it will not occupy a large amount of network bandwidth, thereby reducing the impact of the master node sending proposals to other normal nodes in the network. Based on this, gradually increasing the time interval for reissuing proposals can improve the Byzantine consensus in the face of poor node networks and broken links, and ultimately improve the performance of the entire blockchain system. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0036] Figure 1 is a schematic diagram of a blockchain system;

[0037] Figure 2 is a schematic diagram of sending a proposal in a blockchain system;

[0038] FIG3 is a schematic diagram of an implementation environment of a data processing method provided in an embodiment of the present application;

[0039] FIG4 is a schematic diagram of a flow chart of a data sending method provided in an embodiment of the present application;

[0040] FIG5 is a schematic diagram of a consensus status information update according to an embodiment of the present application;

[0041] FIG6 is a schematic diagram of another consensus status information update method according to an embodiment of the present application;

[0042] FIG7 is a flow chart of a data transmission method according to an embodiment of the present application;

[0043] FIG8 is a schematic diagram of another consensus status information update involved in an embodiment of the present application;

[0044] Figure 9 is a schematic diagram showing the relationship between the number of proposals sent and the time interval for proposal resending;

[0045] FIG10 is a schematic block diagram of a data sending device provided in an embodiment of the present application;

[0046] FIG11 is a schematic block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0047] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0048] It should be understood that in the embodiments of the present invention, "B corresponding to A" means that B is associated with A. In one implementation, B can be determined based on A. However, it should also be understood that determining B based on A does not mean determining B based solely on A; B can also be determined based on A and / or other information.

[0049] In the description of the present application, unless otherwise specified, "plurality" means two or more than two.

[0050] In addition, to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art will understand that the words "first" and "second" do not limit the quantity or execution order, and the words "first" and "second" do not necessarily mean different.

[0051] The data sending method provided in the embodiment of the present application can be applied to various scenarios such as cloud computing, big data, data transmission, and blockchain. When the master node in the blockchain issues a proposal to a node in the blockchain that has not received the proposal, it is ensured that the proposal can be reissued as soon as possible without occupying a large amount of network bandwidth. This improves the network situation of the Byzantine consensus when facing poor node network and link disconnection, and ultimately improves the performance of the entire system.

[0052] To facilitate understanding of the embodiments of the present application, the following concepts are first introduced:

[0053] Cloud technology is a general term for network technologies, information technologies, integration technologies, management platform technologies, and application technologies based on the cloud computing business model. It can form a resource pool that can be used flexibly and conveniently on demand. Cloud computing technology will become a crucial support. Backend services for technical network systems, such as video websites, image websites, and more portals, require extensive computing and storage resources. With the rapid development and application of the internet industry, every item will likely have its own unique identifier, requiring transmission to backend systems for logical processing. Different levels of data will be processed separately, and data from various industries will require a strong system backend, which can only be achieved through cloud computing.

[0054] Big data refers to collections of data that cannot be captured, managed, and processed within a specific timeframe using conventional software tools. These massive, rapidly growing, and diverse information assets require new processing models to enhance decision-making, insight discovery, and process optimization. With the advent of the cloud era, big data has attracted increasing attention. Big data requires specialized technologies to efficiently process large amounts of time-sensitive data. Technologies suitable for big data include massively parallel processing databases, data mining, distributed file systems, distributed databases, cloud computing platforms, the internet, and scalable storage systems.

[0055] As shown in Figure 1, blockchain technology is a distributed database characterized by decentralization, immutability, and scalability. In a blockchain system, all data is stored in blocks. Newly written data forms a new block, which is appended to the end of the current blockchain. Each block not only stores the data but also a unique number corresponding to all the data recorded in the previous block. This number is often a hash of all the data. If someone attempts to modify the data in a previous block, the number stored in the subsequent block will not match, and the chain will not form. Therefore, a blockchain system can be thought of as a system in which mutually untrusted computers on a distributed network jointly maintain a traceable, immutable chain of data through consensus rules. Because the data and platform are not unilaterally controlled by any one organization, the blockchain system can be considered a highly secure, reliable, and trustworthy decentralized computing framework.

[0056] The consensus mechanism uses voting by specific nodes to quickly verify and confirm transactions. If several nodes with unrelated interests can reach consensus on a transaction, it can be assumed that the entire network has reached consensus. In other words, the consensus mechanism is equivalent to a voting rule, and different consensus mechanisms have different voting rules, such as requiring a majority of votes or a two-thirds majority. All nodes have voting rights, and each time a result is determined, all nodes participate in the vote, voting according to different voting rules (consensus mechanisms) to select a node. All nodes reach consensus through the consensus mechanism, and the result of this selected node is the final result for the current round of voting; the results of other nodes are not counted.

[0057] Byzantine Fault Tolerance (BFT) is a consensus mechanism that originates from the Byzantine Generals Problem. Its purpose is to solve the problem of how nodes can reach consensus in a non-trusted environment.

[0058] Currently, Byzantine consensus in mainstream blockchain systems consists of three main phases: proposal, prevote, and precommit. It should be noted that the names of these three phases may vary in different Byzantine algorithms, but the core process remains the same. The core of consensus is that the master node packages and generates a proposal, then broadcasts it to the slave nodes. Upon receiving the proposal, the slave nodes verify and vote on it.

[0059] The embodiments of the present application mainly relate to the first stage, that is, the process in which the master node sends the generated proposal to other slave nodes.

[0060] As shown in Figure 2, in a blockchain system, the master node sends a generated proposal to the slave nodes in the blockchain. However, due to network instability, packet loss, or disconnection, the proposal may fail to be sent. In this case, the master node needs to resend the proposal to the nodes that did not receive it in order to ensure the stable and continuous operation of the regional blockchain system's consensus.

[0061] Currently, to ensure consensus performance within the blockchain system, the masternode typically resends proposals every second to any nodes in the blockchain that haven't received them. However, in typical Byzantine consensus projects, proposals often contain numerous transactions, resulting in a large data volume, at least tens of megabytes (MB). If proposals are resent every second or so to nodes with poor network conditions, disconnected connections, or downtime, the continued resending of proposals to nodes with unstable or even disconnected connections will further congest both nodes, preventing them from receiving the proposals in a timely manner. Furthermore, the masternode's constant resending of proposals to nodes with unstable networks will significantly consume the masternode's network bandwidth, hindering its ability to send proposals to other healthy nodes and ultimately reducing the performance of the entire blockchain system.

[0062] In order to solve the above technical problems, when the master node of the embodiment of the present application sends a proposal to N slave nodes in the blockchain, it records the number of times the master node has sent the proposal to each of the N slave nodes. In this way, when the master node determines the first node that has not received the proposal from the N slave nodes based on the node status information of the slave node, it determines the time interval for the master node to resend the proposal to the first node based on the currently recorded number of times the master node has sent the proposal to the first node. The time interval is positively correlated with the number of times the proposal has been sent, that is, the more times the proposal is sent, the longer the resend time interval of the proposal. In this way, by gradually increasing the proposal resend time interval, the situation of continuously sending proposals is reduced. On the one hand, it can alleviate the network congestion of the nodes of both parties and ensure that the proposal can be sent to the node that has not received the proposal as soon as possible. On the other hand, it will not occupy a large amount of network bandwidth, thereby reducing the impact of the master node sending proposals to other normal nodes in the network. Based on this, by gradually increasing the proposal resend time interval, the network situation of the Byzantine consensus in the face of poor node network and link disconnection can be improved, and ultimately the performance of the entire blockchain system.

[0063] The following introduces the application scenarios of the embodiments of the present application.

[0064] FIG3 is a schematic diagram of an implementation environment of a data processing method provided in an embodiment of the present application. As shown in FIG1 , the implementation environment includes: a master node 110 and N slave nodes 120 , and the master node 110 and the N slave nodes 120 constitute a blockchain system.

[0065] In the blockchain system composed of the master node 110 and N slave nodes 120, each node is connected to each other, and each node will broadcast its node status information to other nodes at regular intervals.

[0066] In some embodiments, the master node 110 packages the transactions into a proposal and broadcasts the proposal to N slave nodes 120 .

[0067] The embodiment of the present application does not limit the specific forms of expression of the master node 110 and the N slave nodes 120.

[0068] In some embodiments, at least one of the master node 110 and the N slave nodes 120 is a terminal device, which may be at least one of a smartphone, a camera, a desktop computer, a tablet computer, an MP4 player, and a laptop computer.

[0069] In some embodiments, at least one of the master node 110 and the N slave nodes 120 is a server. The server may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. The server may also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0070] In an embodiment of the present application, the master node 120 sends a generated proposal to N slave nodes in the regional chain and records the number of times the master node 120 has sent the proposal to each of the N slave nodes. Next, the master node 120 receives node status information sent by M of the N slave nodes, and based on the node status information of each of the M slave nodes, determines the first node among the N slave nodes that has not received the proposal. Then, the master node 120 obtains the currently recorded number of times the master node 120 has sent the proposal to the first node, and based on the number of times the master node 120 has sent the proposal to the first node, determines the time interval for the master node 120 to resend the proposal to the first node next time, where the time interval is positively correlated with the number of times the proposal has been sent. Finally, the master node 120 resends the proposal to the first node based on the time interval. In this way, masternode 120 reissues proposals by gradually increasing the reissue interval, thereby reducing the situation of continuous proposal transmission. This can, on the one hand, alleviate network congestion on both nodes and ensure that proposals can be sent to nodes that have not received them as quickly as possible. On the other hand, it does not occupy a large amount of network bandwidth, thereby reducing the impact of the masternode sending proposals to other normal nodes on the network. Based on this, reissuing proposals by gradually increasing the reissue interval can improve the Byzantine consensus in the face of poor node network conditions and link disconnections, ultimately improving the performance of the entire blockchain system.

[0071] The following describes the technical solutions of the embodiments of the present application in detail through some embodiments. The following embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.

[0072] Figure 4 is a flow chart of a data transmission method provided by an embodiment of the present application. The execution subject of the embodiment of the present application can be the master node shown in Figure 3. As shown in Figure 3, the blockchain system includes 1 master node and N slave nodes.

[0073] As shown in FIG4 , the data processing method of the embodiment of the present application includes:

[0074] S101. The master node sends the generated proposal to N slave nodes in the regional chain system, and records the number of times the master node has sent the proposal to each of the N slave nodes.

[0075] Wherein, N is a positive integer.

[0076] The blockchain system in this embodiment includes N+1 nodes. Each of these N+1 nodes periodically broadcasts its node status information to other nodes. To ensure that other nodes receive its status in a timely manner, the broadcast is typically once per second. Each node also maintains the node status information of other nodes and updates the status of the other nodes it maintains based on the latest node status information sent by other nodes.

[0077] The embodiment of the present application does not limit the specific content included in the node status information of the node.

[0078] In some embodiments, the node status information includes the node's identifier and the node's height in the blockchain system. The node's height in the blockchain system can be understood as the node's position in the blockchain system.

[0079] When one of the N+1 nodes becomes the master node through an election or other means, the other N nodes can be considered slave nodes of the master node. At this point, the master node will package the transaction into a proposal and send the proposal to each of the N slave nodes based on the node status information currently maintained by the master node. For example, the master node will send the proposal to the slave node based on the slave node's identity and height value.

[0080] In an embodiment of the present application, in order to facilitate the subsequent determination of whether the master node resends a proposal to a slave node among N slave nodes that has not received a proposal, the master node records the number of times the master node has sent a proposal to each of the N slave nodes.

[0081] That is, each time the master node sends a proposal to a slave node, the number of times it has sent proposals to that slave node is increased by 1. This facilitates the master node to determine the time interval for the next proposal it will send to the slave node based on the number of times it has sent proposals to the slave node. For example, the greater the number of times it has sent proposals, the longer the time interval for resending proposals. This can avoid the problem of the master node frequently sending proposals to slave nodes with unstable networks, which can lead to more congestion in the slave node's network and a large amount of the master node's network bandwidth being occupied, affecting the reception of proposals by other nodes with normal networks. In other words, in the embodiment of the present application, the master node resends proposals by gradually increasing the proposal resending time interval, thereby reducing the situation of continuously sending proposals. On the one hand, this can alleviate the network congestion of both nodes and ensure that proposals can be sent to nodes that have not received proposals as soon as possible. On the other hand, it will not occupy a large amount of network bandwidth, thereby reducing the impact of the master node sending proposals to other nodes with normal networks. Based on this, resending proposals by gradually increasing the proposal resending time interval can improve the network conditions of the Byzantine consensus when facing poor node networks and link disconnections, ultimately improving the performance of the entire blockchain system.

[0082] The embodiment of the present application does not limit the specific method by which the master node records the number of times the master node has sent a proposal to each of the N slave nodes.

[0083] In some embodiments, the master node records the number of times the master node has sent a proposal to each of the N slave nodes using the following Table 1:

[0084] Table 1

[0085] As shown in Table 1 above, each time the master node sends a proposal to a slave node, the number of times the proposal has been sent to the corresponding node in Table 1 is accumulated by 1.

[0086] In some embodiments, the master node stores consensus status information for each of the N slave nodes, where the consensus status information for each slave node includes the number of times the master node has sent the proposal to the slave node. That is, for each of the N slave nodes, the master node records the number of times the master node has sent the proposal to the slave node using the slave node's consensus status information.

[0087] In the embodiment of the present application, the consensus status information of each of the N slave nodes maintained by the master node is substantially the same. Take the consensus status information of the i-th slave node among the N slave nodes maintained by the master node as an example. The consensus status information of the i-th slave node includes the identifier of the i-th slave node and the number of times the master node has sent proposals to the i-th slave node (i.e., the number of times the proposal has been sent).

[0088] For example, the consensus status information of the i-th slave node is shown in Table 2:

[0089] Table 2: Consensus status information

[0090] As shown in Table 2, each time the master node sends a proposal to the i-th slave node, the number of times the proposal has been sent corresponding to the i-th node in Table 2 is accumulated by 1.

[0091] In some embodiments, the consensus status information of the i-th slave node shown in Table 2 may also include other information related to the i-th slave node, which is not limited here.

[0092] In an embodiment of the present application, after the master node sends the generated proposal to N slave nodes in the blockchain system, the following step S102 is executed.

[0093] S102. The master node receives node status information sent by M slave nodes among N slave nodes, and determines the first node among the N slave nodes that has not received the proposal based on the node status information of each slave node among the M slave nodes.

[0094] Wherein, M is a positive integer less than or equal to N.

[0095] As can be seen from the above, each node in the blockchain system regularly broadcasts its node status information to other nodes. In this way, when the master node sends the generated proposal to N slave nodes, the master node can also receive the node status information sent by other nodes in the blockchain system.

[0096] However, due to network instability or some nodes in the blockchain system being offline, the master node receives node status information sent by M of the N slave nodes, and then determines the first node among the N slave nodes that has not received the proposal based on the node status information of each of the M slave nodes.

[0097] In the embodiment of the present application, the master node determines the first node among the N slave nodes that has not received a proposal based on the node status information of each of the M slave nodes. Specific methods include but are not limited to the following:

[0098] Method 1: If M is less than N, it means that among the N slave nodes, M slave nodes can communicate with the master node, but NM nodes may not be able to communicate with the master node. In this case, after the master node sends a proposal to N slave nodes and only receives node status information sent by M slave nodes, the slave nodes other than the M slave nodes among the N slave nodes can be determined as slave nodes that have not received the proposal. For ease of description, this embodiment of the application records the slave nodes that have not received the proposal as the first node. At this time, there are NM first nodes in the blockchain system that have not received the proposal.

[0099] Method 2: Each slave node in the blockchain system periodically sends its node status information, which includes the current proposal hash value of the slave node. This proposal hash value can be understood as identification information for the proposal currently received by the slave node. This proposal hash value typically has two values: one is empty, and the other is the hash value of the proposal sent by the master node. In this way, the master node can determine the first node among N slave nodes that has not received a proposal based on the hash value in the node status information of each slave node in the M slave nodes.

[0100] In the embodiment of the present application, the node status information of each of the M slave nodes is substantially the same. For example, the node status information of the i-th slave node among the M slave nodes is used. The node status information of the i-th slave node includes the identifier of the i-th slave node and the current proposal hash value of the i-th slave node.

[0101] Exemplarily, the node status information of the i-th slave node is shown in Table 3:

[0102] Table 3: Node status information

[0103] In an embodiment of the present application, for the i-th slave node among the N slave nodes, the master node sends a proposal to the i-th slave node. If the i-th slave node receives the proposal sent by the master node, the i-th slave node sets the proposal hash value in the node status information of the i-th slave node to the hash value of the proposal sent by the master node. If the i-th slave node does not receive the proposal sent by the master node due to network reasons, the i-th slave node sets the proposal hash value in the node status information of the i-th slave node to empty (or 0), or the i-th slave node does not process the current proposal hash value of the i-th slave node because the initial value of the proposal hash value is empty (or 0). Then, when the sending time of the node status information arrives, the i-th slave node sends the current node status information of the i-th slave node to the master node. In some embodiments, in addition to sending the node status information to the master node, the i-th slave node also sends it to other slave nodes.

[0104] Based on this, the master node can receive the node status information sent by M slave nodes, and then determine the first node among the N slave nodes that has not received the proposal based on the proposal hash value in the node status information of each of the M slave nodes.

[0105] In this embodiment of the present application, the master node determines the first node among N slave nodes that has not received a proposal based on the proposal hash value in the node status information of each slave node among the M slave nodes in at least two ways:

[0106] Method 1: The master node directly determines the first node based on the proposal hash value in the node status information of the M slave nodes. For example, for the i-th slave node among the M slave nodes, if the proposal hash value in the node status information of the i-th slave node is empty, it is determined that the i-th slave node has not received the proposal sent by the master node, and the i-th slave node is then determined to be the first node.

[0107] Since slave nodes in a blockchain system only receive proposals sent by the master node, if the proposal hash value in the node status information of the i-th slave node is not empty, it indicates that the proposal hash value in the node status information of the i-th slave node is the hash value of the proposal sent by the master node. Therefore, it can be determined that the i-th slave node has received the proposal sent by the master node, and the master node does not need to resend the proposal to the i-th slave node.

[0108] Method 2: The consensus status information of the embodiment of the present application also includes a proposal hash value. The master node uses the received node status information to update the consensus status information maintained by the master node, and then determines the first node that has not received the proposal based on the proposal hash value in the consensus status information.

[0109] At this time, before the master node determines the first node among the N slave nodes that has not received the proposal based on the node status information of each of the M slave nodes in executing the above S102, the master node first updates the proposal hash value in the consensus status information of the slave node for each of the M slave nodes based on the current proposal hash value in the node status information of the slave node.

[0110] In the embodiment of the present application, the consensus status information of each slave node maintained by the master node is expressed in a substantially similar manner. Taking the i-th slave node as an example, the consensus status information of the i-th slave node includes the identifier of the i-th slave node, the number of times the master node has sent proposals to the i-th slave node (i.e., the number of times the proposal has been sent), and the proposal hash value.

[0111] For example, the consensus status information of the i-th slave node is shown in Table 4:

[0112] Table 4: Consensus status information

[0113] In the embodiment of the present application, as shown in Table 3, the node status information of the i-th slave node includes the current proposal hash value of the i-th slave node, and the consensus status information of the i-th slave node is shown in Table 4. After the master node receives the node status information of the i-th slave node as shown in Table 3 above, the master node uses the proposal hash value in the received node status information of the i-th slave node to update the proposal hash value in the consensus status information of the i-th slave node maintained by the master node.

[0114] For example, as shown in Figure 5, the proposal hash value in the consensus state information of the i-th slave node maintained by the master node at time t0 is empty. The master node sends a proposal to the i-th slave node at time t1. At time t2, the master node receives the node state information sent by the i-th slave node, in which the proposal hash value is 696c4861a. In this way, the master node updates the proposal hash value in the consensus state information maintained by the i-th slave node from empty to 696c4861a.

[0115] The master node may refer to the above method and update the proposal hash value in the consensus status information of each slave node based on the current proposal hash value in the node status information of the slave node based on the M slave nodes.

[0116] At this time, the master node can determine the first node based on the updated proposal hash value in the consensus status information of each of the M slave nodes.

[0117] For example, for each of the M slave nodes, if the updated proposal hash value in the consensus status information of the slave node is empty, it is determined that the slave node has not received the proposal sent by the master node, and then the slave node is determined to be the first node.

[0118] If the updated proposal hash value in the consensus status information of the slave node is non-empty, it is determined that the slave node has received the proposal sent by the master node, and the master node will no longer resend the proposal to the slave node.

[0119] In this second approach, the master node can determine the first node among the M slave nodes that has not received a proposal based on the proposal hash value in the node status information sent by the M slave nodes. In some embodiments, if M is less than N, the master node further determines the slave node among the N slave nodes other than the M slave nodes as the first node.

[0120] Based on this, the master node can accurately determine the first node among the N slave nodes that has not received the proposal based on the above steps. After the master node determines the first node among the N slave nodes that has not received the proposal based on the above steps, it executes the following step S103.

[0121] S103. The master node obtains the currently recorded number of times the master node has sent proposals to the first node, and based on the number of times the master node has sent proposals to the first node, determines the time interval for the master node to resend the proposal to the first node next time.

[0122] The time interval is positively correlated with the number of times the master node has sent a proposal to the first node, which is also referred to as the number of times the first node has sent a proposal. The time interval can be understood as the time difference between the next time the master node sends a proposal to the slave node and the last time the master node sent a proposal to the slave node. In other words, the time interval is the time difference between the next time the master node resends the proposal to the slave node and the last time the master node sent the proposal to the slave node.

[0123] It should be understood that a positive correlation means that as the independent variable grows, the dependent variable also grows. In other words, the two variables change in the same direction: when one variable changes from large to small or from small to large, the other variable also changes from large to small or from small to large. Based on this, a positive correlation between the time interval and the number of proposals sent by the master node to the first node means that the greater the number of proposals sent by the master node to the first node, the longer the time interval, and the smaller the number of proposals sent by the master node to the first node, the shorter the time interval.

[0124] As can be seen from the above, the master node of the present embodiment stores the number of times the master node has sent proposals to each of the N slave nodes. Thus, after determining the first node among the N slave nodes that has not received a proposal based on step S102 above, the master node obtains the currently recorded number of times the master node has sent proposals to the first node. Based on the number of times the master node has sent proposals to the first node, the master node determines the next time interval for resending proposals to the first node. This time interval is positively correlated with the number of times the master node has sent proposals to the first node. That is, the greater the number of times the master node has sent proposals to the first node, the longer the time interval for the master node to send proposals to the first node. This allows the proposal resending interval to be gradually increased, thereby reducing the situation of continuous proposal transmission. This can, on the one hand, alleviate network congestion on both nodes and ensure that proposals can be sent to nodes that have not received proposals as quickly as possible. On the other hand, it does not occupy a large amount of network bandwidth, thereby reducing the impact of the master node sending proposals to other nodes with normal network conditions. Based on this, resending proposals by gradually increasing the proposal resending interval can improve the network performance of the Byzantine consensus in the face of poor node networks and link disconnections, ultimately improving the performance of the entire blockchain system.

[0125] The embodiment of the present application does not limit the manner in which the master node obtains the currently recorded number of times the master node has sent a proposal to the first node.

[0126] In some embodiments, if the master node records the number of times the master node has sent proposals to each of the N slave nodes in the form of Table 1, then after the master node determines the first node based on the above steps, it obtains the number of times the proposal has been sent corresponding to the first node from Table 1 based on the identifier of the first node.

[0127] In some embodiments, as shown in Table 2 and Table 4, if the master node records the number of times the master node has sent a proposal to each of the N slave nodes by maintaining the consensus status information of each of the N slave nodes, then the master node determines the first node based on the above steps and, based on the identifier of the first node, obtains the number of times the proposal has been sent corresponding to the first node from the consensus status information of the first node shown in Table 2 or Table 4.

[0128] The master node obtains the currently recorded number of times the master node has sent the proposal to the first node, and determines the time interval for the master node to resend the proposal to the first node next time based on the number of times the proposal has been sent to the first node.

[0129] The embodiment of the present application does not limit the specific method for the master node to determine the time interval for the next time the master node resends the proposal to the first node based on the number of times the proposal has been sent corresponding to the first node, as long as the time interval for resending the proposal of the first node is positively correlated with the number of times the proposal has been sent corresponding to the first node.

[0130] In some embodiments, the first value is used as the base and the number of times the first node has sent the proposal is used as the exponent to obtain the time interval for resending the proposal of the first node, where the first value is a positive number greater than 1.

[0131] For example, the master node determines the time interval for the next resend of the proposal to the first node by the following formula (1): ▽t=n c (1)

[0132] Where n is a positive number of the first value, c is the number of times the proposal has been sent, and ▽t is the time interval for reissuing the proposal.

[0133] The embodiment of the present application does not limit the specific value of the above-mentioned first value n. In one example, the above-mentioned n is 2.

[0134] In some embodiments, the master node may determine the time interval for the master node to resend the proposal to the first node next time through the following step S103-A:

[0135] S103-A. The master node determines the time interval for the master node to resend the proposal to the first node next time based on the number of times the first node has sent the proposal and the time interval for the master node to send the proposal to the first node during the number of times the first node has sent the proposal.

[0136] In this implementation, when the master node resends a proposal to the first node, it must determine a resending interval for each proposal. That is, each of the first node's previous transmission counts corresponds to a time interval. Based on this, the master node can determine the next time interval for resending a proposal to the first node based on the first node's previous transmission counts and the time intervals between the master node's proposal transmissions to the first node during these transmission counts.

[0137] For example, suppose the master node has sent three proposals to the first node, with the intervals between these three proposals being 0, ▽t1, and ▽t2, respectively. The proposal sending interval can be understood as the time interval between the last time the master node sent a proposal to the first node and the next time it sent a proposal to the first node. Thus, the master node can determine the time interval for the next proposal to be sent to the first node based on the number of proposals sent to the first node (3) and the intervals between these three times (0, ▽t1, and ▽t2).

[0138] The embodiment of the present application does not limit the specific method for the master node to determine the time interval for the next time the master node resends a proposal to the first node based on the number of times the proposal has been sent corresponding to the first node, and the time interval for the master node to send proposals to the first node during the number of times the proposal has been sent corresponding to the first node.

[0139] In some embodiments, the master node determines the time interval for the master node to resend a proposal to the first node by multiplying the number of times the first node has sent a proposal by the time interval between the master node's last proposal transmission to the first node. Continuing with the above example, assuming the time interval between the master node's last proposal transmission to the first node is ▽t2, the master node determines 3*▽t2 as the time interval for the master node to resend a proposal to the first node.

[0140] In some embodiments, the above S103-A includes the following examples:

[0141] Example 1: If the number of times the first node has sent a proposal is greater than or equal to 2, the master node determines the time interval for the next time the master node sends a proposal to the first node based on the first time interval when the master node last sent a proposal to the first node and the second time interval when the master node last sent a proposal to the first node.

[0142] For example, the master node sent a proposal to the first node three times. The first time, at time t1, the master node broadcast the proposal to every slave node in the blockchain. Therefore, the time interval ▽t0 between the first time the master node sent the proposal to the first node is determined to be 0. If, based on the above steps, the master node determines that the first node has not received the proposal, it will send the proposal to the first node again after the first time (i.e., time t1) and the first time interval ▽t1. However, after sending the proposal to the first node for the second time, if the master node determines that the first node still has not received the proposal, it will send the proposal to the first node again after the second time interval ▽t2. Therefore, the time intervals between the three proposals sent by the master node to the first node are: ▽t0, ▽t1, and ▽t2. However, after the master node sends the proposal to the first node for the third time, it determines that the first node still has not received the proposal. At this time, the master node determines the time interval ▽t3 for the master node to resend the proposal to the first node next time (i.e., the fourth time) based on the time interval ▽t2 between the last time the master node sent the proposal to the first node (i.e., the third time) and the time interval ▽t1 between the last time the master node sent the proposal to the first node (i.e., the second time). For ease of description, in this embodiment of the application, the time interval based on the last time the master node sent the proposal to the first node is recorded as the first time interval, and the time interval based on the last time the master node sent the proposal to the first node is recorded as the second time interval.

[0143] The embodiment of the present application does not limit the specific method for determining the time interval for the master node to resend a proposal to the first node based on the first time interval between the last time the master node sent a proposal to the first node and the second time interval between the last time the master node sent a proposal to the first node.

[0144] In one example, the master node determines the sum of the first time interval and the second time interval as the time interval for the master node to resend the proposal to the first node next time.

[0145] For example, the master node determines the time interval for the next proposal resend to the first node based on the following formula (2): F(n)=F(n-1)+F(n-2)(n≥2) (2)

[0146] Where n is the number of times the master node sends a proposal to the first node, F(n) is the interval between the nth (i.e., next) proposal sent by the master node to the first node, F(n-1) is the interval between the n-1th (i.e., previous) proposal sent by the master node to the first node, and F(n-2) is the interval between the n-1th (i.e., the previous) proposal sent by the master node to the first node. It should be noted that this formula uses F(n) to represent the time interval ▽t.

[0147] In one example, the master node adds the first time interval and the second time interval, and then adds the sum to a preset value to obtain the time interval for the master node to resend the proposal to the first node next time.

[0148] Example 2: If the number of times the first node has sent a proposal is equal to 1, the first time interval of the last time the master node sent a proposal to the first node is determined as the time interval for the master node to send a proposal to the first node next time.

[0149] Continuing with the above example, if the master node sent a proposal to the first node once, the first time being at time t1, when the master node broadcast the proposal to every slave node in the blockchain. Therefore, the time interval ▽t0 between the first time the master node sent the proposal to the first node is determined to be 1 second. Therefore, the master node can determine that the time interval between the next (second) re-send of the proposal to the first node will also be 1 second.

[0150] In some embodiments, the master node can also determine the proposal re-issuance interval by means of the Fibonacci sequence. The Fibonacci sequence, also known as the golden section sequence, refers to a sequence of numbers: 1, 1, 2, 3, 5, 8, 13, .... Mathematically, the Fibonacci sequence is defined recursively as follows: F(0) = 0, F(1) = 1, F(n) = F(n-1) + F(n-2) (n≥2, n∈N*). In an embodiment of the present application, the time interval F(n) for the master node to re-send the proposal to the first node for the nth time can be determined by the recursive method of the Fibonacci sequence above.

[0151] In the embodiment of the present application, based on the above-mentioned method of determining the first node, the master node determines a slave node among the N slave nodes. If the proposal hash value of the slave node is always empty, it means that the slave node has not received any proposal at this height. Therefore, the slave node is determined as the first node and the proposal is resent to the first node. However, the next resend is no longer based on a fixed time interval (for example, 1 second). Instead, the Fibonacci sequence formula is used to calculate the time interval for the next proposal transmission based on the number of transmissions at the same height. Then, the proposal is resent to the first node after the time interval.

[0152] For example, if the first node's height in the blockchain remains constant, for example, always at 1, but the proposal hash remains empty, the master node will resend proposals to it at intervals of 1 second, 1 second, 2 seconds, 3 seconds, 5 seconds, 8 seconds, and so on. The intervals are gradually increased to ensure that proposals are not sent too frequently and network bandwidth is not consumed.

[0153] Based on the above step S103, the master node determines the time interval for the master node to resend the proposal to the first node next time, and then executes the following step S104.

[0154] S104. The master node resends the proposal to the first node based on the time interval.

[0155] Based on the above steps, the master node determines the time interval for the next time the master node resends the proposal to the first node. Based on the time when the master node last sent a proposal to the first node, the master node resends the proposal to the first node when the time interval arrives.

[0156] In some embodiments, to facilitate the master node's determination of the time to resend a proposal to the first node, the consensus state information maintained by the master node also includes the time when the master node last sent a proposal to a slave node. In other words, the master node records the time of the most recent proposal sent to a slave node in the consensus state information of that slave node.

[0157] For example, taking the i-th slave node as an example, the consensus status information of the i-th slave node includes the identifier of the i-th slave node, the number of times the master node has sent proposals to the i-th slave node (i.e., the number of times the proposal has been sent), the last time the master node sent a proposal to the i-th slave node (i.e., the proposal sending time), etc.

[0158] For example, the consensus status information of the i-th slave node is shown in Table 5:

[0159] Table 5: Consensus status information

[0160] Based on the consensus status information shown in Table 5, S104 includes the following steps S104-A1 to S104-A3:

[0161] S104-A1. The master node obtains the time when the master node last sent a proposal to the first node from the consensus status information of the first node.

[0162] S104-A2: The master node determines a first time difference between the current time and the sending time of the proposal corresponding to the first node;

[0163] S104-A3: If the first time difference is greater than or equal to the time interval, the master node resends the proposal to the first node.

[0164] In this embodiment, based on the above steps, when the master node determines the time interval for the next proposal transmission from the master node to the first node, it obtains the time when the master node last transmitted a proposal to the first node from the consensus state information of the first node, and then determines a first time difference between the current time and the time when the proposal was transmitted by the first node. If the first time difference is less than the above time interval, the master node waits and temporarily does not transmit the proposal to the first node. If the first time difference is greater than or equal to the above determined time interval, the master node retransmits the proposal to the first node, thereby reducing the situation of continuously transmitting proposals.

[0165] In an embodiment of the present application, after the master node resends the proposal to the first node, the number of times the proposal has been sent in the consensus status information of the first node is increased by 1, and the sending time of the proposal in the consensus status information of the first node is updated to the current time.

[0166] In some embodiments, the node status information includes the current height of the slave node in the blockchain system. Correspondingly, the consensus status information of the slave node also includes the height of the slave node. This height can be understood as the position of the node in the blockchain. In this case, when the master node updates the consensus status information of the slave node based on the slave node's node status information, it also includes updating the height value in the consensus status information.

[0167] For example, taking the i-th slave node as an example, the node status information of the i-th slave node includes the identifier of the i-th slave node, the height value, and the proposal hash value at the height value.

[0168] For example, the node status information of the i-th slave node is shown in Table 6:

[0169] Table 6: Node status information

[0170] In an embodiment of the present application, the consensus status information of the i-th slave node maintained by the master node includes the identifier of the i-th slave node, the number of times the master node has sent proposals to the i-th slave node (i.e., the number of times the proposal has been sent), the last time the master node sent a proposal to the i-th slave node (i.e., the proposal sending time), the height value of the i-th slave node, the proposal hash value received at the height value, etc.

[0171] For example, the consensus status information of the i-th slave node is shown in Table 7:

[0172] Table 7: Consensus status information

[0173] In the embodiment of the present application, as shown in Table 6, the node status information of the i-th slave node includes the current height value of the i-th slave node and the hash value of the proposal received at the height value, and the consensus status information of the i-th slave node is shown in Table 7. After the master node receives the node status information of the i-th slave node as shown in Table 6 above, the master node uses the height value and proposal hash value in the received node status information of the i-th slave node to update the height value and proposal hash value in the consensus status information of the i-th slave node maintained by the master node.

[0174] In some embodiments, for the i-th slave node among M slave nodes, if the height value in the node status information of the i-th slave node is inconsistent with the height value in the consensus status information of the i-th slave node, the height value in the consensus status information of the i-th slave node is updated to the height value in the node status information, and the number of sending times and sending time are not updated.

[0175] In some embodiments, for the i-th slave node among M slave nodes, if the height value in the node status information of the i-th slave node is inconsistent with the height value in the consensus status information of the i-th slave node, the height value in the consensus status information of the i-th slave node is updated to the height value in the node status information, and the number of times sent and the sending time in the consensus status information of the i-th slave node are reset to 0.

[0176] For example, as shown in Figure 6, the consensus status information of the i-th slave node maintained by the master node at time t0 includes the following information: height 12, proposal hash value 696c4861a, number of proposals sent 2, and proposal sending time 1676970957. At time t1, the master node receives the node status information sent by the i-th slave node, which includes the following information: height 13, proposal hash value NULL. In this way, the master node updates the height value in the consensus status information of the i-th slave node to 13, the proposal hash value to NULL, the number of proposals sent to 0, and the sending time to 0.

[0177] That is to say, in an embodiment of the present application, if the height value of the i-th slave node changes, the i-th slave node will be used as a new slave node, and the number of sending times and sending time in the consensus status information of the i-th slave node will be updated to 0. The next time a proposal is resent to the i-th slave node at the new height, the time interval will be calculated from 0, thereby ensuring the accuracy of the time interval.

[0178] In the above embodiment, the master node determines the time interval for the next resend of the proposal to the first node based on the number of times the proposal has been sent by the first node, and based on the number of times the proposal has been sent by the first node, wherein the time interval is positively correlated with the number of times the proposal has been sent, and then resends the proposal to the first node based on the time interval. In this way, by gradually increasing the time interval for resending proposals, the situation of continuously sending proposals is reduced, which can, on the one hand, alleviate the network congestion of the nodes of both parties, and thus ensure that the proposal can be sent to the nodes that have not received the proposal as soon as possible, and on the other hand, it will not occupy a large amount of network bandwidth, thereby reducing the impact of the master node sending proposals to other normal nodes in the network. Based on this, by gradually increasing the time interval for resending proposals, the network situation of the Byzantine consensus in the face of poor node network and broken link disconnection can be improved, and ultimately the performance of the entire blockchain system.

[0179] In the embodiment of the present application, there is another special case that needs to be considered, that is, a slave node that did not receive a proposal is not due to a network failure, but is directly offline. Then for the master node, if it has not received the consensus status of the node, a situation will arise in which the master node will resend the proposal to this slave node, and the status of this slave node has not been updated. The master node keeps resending the proposal to this slave node, and the number of times it sends increases. The time interval calculated according to the above-mentioned resending time interval calculation method (such as the Fibonacci sequence) will become particularly large. When this slave node comes back online, it will not be able to receive the resent proposal in time, which will also affect the timely reception of the proposal, thereby affecting performance.

[0180] Based on this, in an embodiment of the present application, when the master node has not received the node status information of a slave node within a preset time (for example, 1 minute), it means that the slave node is offline or has a fault, and no proposal will be reissued to it.

[0181] In some embodiments, the master node determines whether the node status information of a node has not been updated for a long time by using the status update time. For example, the consensus status information of the slave node maintained by the master node also includes the status update time of the slave node, and the status update time of the slave node is the time when the master node last received the status information of the slave node.

[0182] For example, taking the i-th slave node as an example, the consensus status information of the i-th slave node includes: the identification of the i-th slave node, the height value, the proposal hash value at the height value, the number of times the master node has sent proposals to the i-th slave node (i.e., the number of times the proposal has been sent), the last time the master node sent a proposal to the i-th slave node (i.e., the proposal sending time), and the status update time.

[0183] For example, the node status information of the i-th slave node is shown in Table 8:

[0184] Table 8: Consensus status information

[0185] In some embodiments, if the consensus status information of the slave node maintained by the master node includes the status update time, the master node first obtains the status update time corresponding to the first node from the consensus status information of the first node before obtaining the number of times the first node has been sent from the consensus status information of the first node; determines the second time difference between the status update time corresponding to the first node and the current time; if the second time difference is less than or equal to the preset value, obtains the number of times the first node has been sent from the consensus status information of the first node, and based on the number of times the first node has been sent, determines the time interval for the next time the master node sends a proposal to the first node.

[0186] In some embodiments, if the second time difference is greater than a preset value, the first node is determined to be a faulty node, and re-issuing the proposal to the first node is stopped.

[0187] That is, when the first node fails, the master node stops resending proposals to the first node. Since there are no resending proposals, the number of resending times will not increase, so the time interval between resending will not be particularly long. When the first node comes back online to restore consensus, the time interval between resending proposals by the master node will not be particularly long, thus ensuring that the offline first node can recover and receive the resent proposal as soon as possible.

[0188] In some embodiments, to further improve the likelihood that a failed first node can receive proposals promptly after it comes back online, the master node, upon determining that the first node is a failed node, sets the number of sent proposals and the send time in the first node's consensus status information to 0. This allows the master node to immediately send proposals to the first node when it comes back online, further improving the consensus performance of the blockchain system.

[0189] The data transmission method provided in the embodiment of the present application is as follows: the master node in the blockchain system sends a generated proposal to N slave nodes in the regional chain system, and records the number of times the master node has sent the proposal to each of the N slave nodes; then, the master node receives node status information sent by M of the N slave nodes, and based on the node status information of each of the M slave nodes, determines the first node among the N slave nodes that has not received the proposal, where M is a positive integer less than or equal to N; then, the master node obtains the currently recorded number of times the master node has sent the proposal to the first node, and based on the number of times the first node has sent the proposal, determines the time interval for the master node to resend the proposal to the first node next time, and the time interval is positively correlated with the number of times it has sent the proposal; finally, the master node resends the proposal to the first node based on the time interval. In the embodiment of the present application, when the master node resends the proposal to the first node, it determines the time interval for the master node to resend the proposal to the first node next time based on the currently recorded number of times the master node has sent the proposal to the first node, and the time interval is positively correlated with the number of times it has sent the proposal. By gradually increasing the resending interval, proposals are resent, reducing the need for continuous proposal transmission. This, on the one hand, alleviates network congestion on both nodes, ensuring that proposals can be sent as quickly as possible to nodes that have not received them. On the other hand, it does not consume a large amount of network bandwidth, thereby reducing the impact of the master node sending proposals to other healthy nodes. Based on this, gradually increasing the resending interval can improve the Byzantine consensus in the face of poor node network conditions and link disconnections, ultimately improving the performance of the entire blockchain system.

[0190] The above is an overall introduction to the data transmission method provided by the embodiment of the present application. The following describes the entire process of the data transmission method provided by the embodiment of the present application in conjunction with FIG7 .

[0191] FIG7 is a flow chart of a data sending method according to an embodiment of the present application, as shown in FIG7 , including:

[0192] S201. The master node sends the generated proposal to N slave nodes in the regional chain system, and records the number of times the master node has sent the proposal to the slave nodes through the consensus status information of the slave nodes.

[0193] Wherein, N is a positive integer.

[0194] In an embodiment of the present application, the master node maintains the consensus status information of each of the N slave nodes.

[0195] For example, the consensus status information of the slave node includes the number of times the master node has sent proposals to the slave node. In this way, the master node records the number of times the master node has sent proposals to the slave node through the consensus status information.

[0196] S202. The master node receives node status information sent by M slave nodes among the N slave nodes, and updates the consensus status information of the M slave nodes based on the node status information sent by the M slave nodes.

[0197] Wherein, M is a positive integer less than or equal to N.

[0198] The embodiments of the present application do not limit the specific content included in the node status information and consensus status information.

[0199] In one example, the node status information of the slave node includes at least one of the following: an identifier of the slave node, a height value, and a proposal hash value at the height value.

[0200] In one example, the consensus status information of the slave node includes at least one of the following: the node's identification, the height value, the proposal hash value at the height value, the number of times the proposal has been sent (i.e., the number of times the master node has sent a proposal to the slave node), the status update time (i.e., the last time the master node received the node status information of the slave node), and the proposal sending time (i.e., the last time the master node sent a proposal to the slave node).

[0201] In this way, after the master node receives the node status information sent by the slave node, it updates the consensus status information of the slave node maintained by the master node based on the node status information of the slave node. For example, as shown in Figure 8, the height value and proposal hash value in the node status information are used to update the height value and proposal hash value in the consensus status information. At the same time, the status update time in the consensus status information is also updated.

[0202] In some embodiments, if the height value in the node status information of a slave node received by the master node is inconsistent with the height value in the consensus status information saved by the master node, the number of proposals sent and the proposal sending time in the consensus status information of the slave node are set to 0. This makes it easier for the master node to send proposals to slave nodes at new heights in a timely manner.

[0203] S203: The master node determines the first node among the N slave nodes that has not received a proposal.

[0204] The embodiment of the present application does not limit the specific method by which the master node determines the first node among N slave nodes that has not received a proposal.

[0205] In some embodiments, the master node determines whether the slave node is the first node based on the proposal hash value corresponding to the slave node. For example, if the proposal hash value corresponding to the slave node is empty, the slave node is determined to be the first node. If the proposal hash value corresponding to the slave node is not empty, it is determined that the slave node has already received the proposal, and the proposal is not reissued to the slave node.

[0206] In an embodiment of the present application, the master node obtains the proposal hash value corresponding to the slave node in at least one of the following ways: first, the master node directly obtains the proposal hash value corresponding to the slave node from the node status information received from the slave node. Second, the master node uses the current proposal hash value in the slave node's node status information to update the proposal hash value in the slave node's consensus status information, and then obtains the proposal hash value corresponding to the slave node from the updated consensus status information.

[0207] In some embodiments, if M is less than N, the master node determines the other nodes among the N slave nodes except the M slave nodes as the first nodes.

[0208] S204. The master node obtains the state update time corresponding to the first node from the consensus state information of the first node, and determines a second time difference between the state update time of the first node and the current time.

[0209] In this embodiment of the present application, after the master node determines the first node based on the above steps, it also needs to determine whether the first node is a faulty node. Specifically, the master node obtains the state update time corresponding to the first node from the consensus state information of the first node and determines a second time difference between the state update time corresponding to the first node and the current time.

[0210] Next, based on the second time difference, it is determined whether the first node is a faulty node. Specifically, the following steps S205 and S206 are executed.

[0211] S205: Determine whether the second time difference is greater than a preset value.

[0212] If the second time difference is greater than the preset value, it means that the master node has not received the node status information sent by the first node for a long time, and then determines that the first node has been offline, that is, determines that the first node is a faulty node, and then executes step S206 to stop reissuing proposals to the first node.

[0213] If the second time difference is less than or equal to the preset value, it means that the master node has not received the node status information sent by the first node for a long time, and then determines that the first node is not offline, that is, determines that the first node is not a faulty node, and then executes step S207 to resend the proposal to the first node.

[0214] S206. If the second time difference is greater than a preset value, the master node determines that the first node is a faulty node and executes step S211 to stop resending the proposal to the first node.

[0215] In the embodiment of the present application, it can be seen from the above description that the time for reissuing a proposal is no longer a fixed value, but a value with gradually increasing time intervals. For example, the time interval for reissuing a proposal is a value calculated based on the Fibonacci sequence. As shown in Figure 9, the value from the first second to X seconds gradually increases.

[0216] If the first node is offline for a period of time, it will be identified as a faulty node and proposals will no longer be resent to it. At this point, the proposal's sent count will no longer increase. This way, when the first node comes online later, the calculated proposal resend interval will not be particularly long, as the proposal's sent count will no longer increase. This allows the master node to quickly resend proposals to it after the node returns to normal and updates its status.

[0217] In some embodiments, to further improve the speed of resending proposals to the first node, if the first node is determined to be a faulty node, the number of times the proposal has been sent and the sending time in the consensus status information of the first node are set to 0. This allows the master node to resend the proposal to the first node as soon as the first node comes online.

[0218] S207. If the second time difference is less than or equal to the preset value, the master node obtains the number of times the first node has sent corresponding to the first node from the consensus status information of the first node.

[0219] S208. The master node determines the time interval for the next resending of the proposal by the master node to the first node based on the number of times the proposal has been sent by the first node.

[0220] Among them, the time interval is positively correlated with the number of times sent.

[0221] The data sending method proposed in the embodiment of the present application can avoid frequent proposal sending when a faulty node is encountered in the blockchain Byzantine consensus. By dynamically adjusting the proposal sending frequency according to the node status of the faulty node, the proposal resending time interval is gradually increased, which can significantly reduce the pressure on the network bandwidth, thereby improving the performance of the Byzantine consensus.

[0222] The embodiment of the present application does not limit the specific manner in which the master node determines the time interval for the next retransmission of the proposal to the first node based on the number of times the proposal has been sent by the first node.

[0223] For example, the master node determines the time interval for the master node to resend a proposal to the first node based on the number of times the first node has sent the proposal and the time interval for the master node to send the proposal to the first node during the number of times the first node has sent the proposal.

[0224] If the number of times the first node has sent a proposal is greater than or equal to 2, the master node determines the next time interval for the master node to resend the proposal to the first node based on the first time interval between the master node's last proposal sending to the first node and the second time interval between the master node's last proposal sending to the first node. For example, the master node determines the sum of the first time interval and the second time interval as the time interval for the master node to resend the proposal to the first node.

[0225] If the number of times the first node has sent a proposal is equal to 1, the master node will use the first time interval when the master node last sent a proposal to the first node as the time interval for the master node to resend the proposal to the first node next time.

[0226] S209. The master node obtains the sending time of the last proposal sent by the master node to the first node from the consensus status information of the first node, and determines a first time difference between the current time and the sending time of the proposal corresponding to the first node.

[0227] Based on the above steps, the master node determines the time interval for the master node to resend the proposal to the first node, and then resends the proposal to the first node based on the time interval. Specifically, the master node obtains the time when the master node last sent the proposal to the first node from the consensus status information of the first node, and determines the first time difference between the current time and the time when the proposal corresponding to the first node was sent.

[0228] S210: Determine whether the first time difference is less than the time interval corresponding to the first node.

[0229] If the first time difference determined above is greater than or equal to the time interval corresponding to the first node, it means that the proposal reissue time of the first node has arrived, and then the following step S211 is executed.

[0230] If the above-mentioned first time difference is less than the time interval corresponding to the first node, it means that the proposal reissue time of the first node has not arrived. The first node executes step S212 and continues to wait. While waiting for the proposal reissue time of the first node to arrive, it executes step S211.

[0231] S211. The master node resends the proposal to the first node.

[0232] S212. The master node suspends reissuing proposals.

[0233] The data transmission method provided in the embodiment of the present application is that the master node maintains the consensus status information of each of the N slave nodes, and records the number of times the master node has sent a proposal to each of the N slave nodes through the consensus status information. In this way, when the master node receives the node status information sent by M of the N slave nodes, and updates the consensus status information based on the node status information, it determines the first node among the N slave nodes that has not received the proposal. Then, the master node obtains the number of times the currently recorded master node has sent a proposal to the first node from the consensus status information, and based on the number of times the first node has sent a proposal, determines the time interval for the master node to resend the proposal to the first node next time, and the time interval is positively correlated with the number of times it has sent a proposal; finally, the master node resends the proposal to the first node based on the time interval. In the embodiment of the present application, the master node records the relevant information of each slave node through the consensus status information, thereby improving the timely and effective control of the status information of each slave node. Then, based on the number of times the master node has sent a proposal to the first node, it determines the time interval for the master node to resend the proposal to the first node next time, and the time interval is positively correlated with the number of times it has sent a proposal. In this way, by gradually increasing the time interval for reissuing proposals, it is not only possible to ensure that proposals can be sent to nodes that have not received them as soon as possible, but also it will not occupy a large amount of network bandwidth, thereby improving the Byzantine consensus in the face of poor node network and chain disconnection, and ultimately improving the performance of the entire blockchain system.

[0234] The method embodiment of the present application is described in detail above in conjunction with Figures 4 to 9 , and the device embodiment of the present application is described in detail below in conjunction with Figures 10 to 11 .

[0235] FIG10 is a schematic block diagram of a data sending device provided in an embodiment of the present application.

[0236] As shown in FIG9 , the data sending device 10 includes:

[0237] a recording unit 11, configured to send the generated proposal to N slave nodes in the blockchain system, and record the number of times the master node has sent the proposal to each of the N slave nodes, where N is a positive integer;

[0238] a first node determining unit 12, configured to receive node status information sent by M slave nodes among the N slave nodes, and determine a first node among the N slave nodes that has not received the proposal based on the node status information of each of the M slave nodes, where M is a positive integer less than or equal to N;

[0239] a time interval determining unit 13, configured to obtain the currently recorded number of times the master node has sent the proposal to the first node, and determine, based on the number of times the master node has sent the proposal to the first node, a time interval for the master node to resend the proposal to the first node next time, wherein the time interval is positively correlated with the number of times the master node has sent the proposal to the first node; the time interval is the time difference between the time when the master node resends the proposal to the slave node next time and the time when the master node last sent the proposal to the slave node;

[0240] The resending unit 14 is configured to resend the proposal to the first node based on the time interval.

[0241] In some embodiments, the time interval determination unit 13 is specifically used to determine the time interval for the master node to resend the proposal to the first node next time based on the number of times the master node has sent the proposal to the first node and the time interval between the master node sending the proposal to the first node among the number of times the master node has sent the proposal to the first node.

[0242] In some embodiments, the time interval determination unit 13 is specifically used to determine the time interval for the master node to resend the proposal to the first node next time based on the first time interval for the master node to send the proposal to the first node last time and the second time interval for the master node to send the proposal to the first node last time, if the number of times the master node has sent the proposal to the first node is greater than or equal to 2; or, if the number of times the master node has sent the proposal to the first node is equal to 1, determine the first time interval for the master node to send the proposal to the first node last time as the time interval for the master node to resend the proposal to the first node next time.

[0243] In some embodiments, the time interval determining unit 13 is specifically configured to determine the sum of the first time interval and the second time interval as the time interval for the master node to resend the proposal to the first node next time.

[0244] In some embodiments, the master node stores consensus status information of each of the N slave nodes. For each of the N slave nodes, the consensus status information of the slave node includes the number of times the master node has sent the proposal to the slave node. The recording unit 11 is specifically used to record the number of times the master node has sent the proposal to the slave node for each of the N slave nodes through the consensus status information of the slave node; the first node determination unit 12 is specifically used to obtain the number of times the master node has sent the proposal to the first node from the consensus status information of the first node.

[0245] In some embodiments, for each of the N slave nodes, the node status information of the slave node includes the current proposal hash value of the slave node, and the consensus status information of the slave node also includes a proposal hash value. The first node determination unit 12 is further used to update the proposal hash value in the consensus status information of the slave node for each of the M slave nodes based on the current proposal hash value in the node status information of the slave node before determining the first node of the N slave nodes that has not received the proposal based on the node status information of each of the M slave nodes; for each of the N slave nodes, if the updated proposal hash value in the consensus status information of the slave node is empty, the slave node is determined to be the first node.

[0246] In some embodiments, the first node determination unit 12 is further configured to, if M is less than N, determine other nodes among the N slave nodes except the M slave nodes as the first nodes.

[0247] In some embodiments, for each of the N slave nodes, the consensus status information of the slave node also includes the sending time when the master node last sent the proposal to the slave node. The reissuing unit 14 is specifically used to obtain the sending time when the master node last sent the proposal to the first node from the consensus status information of the first node; determine the first time difference between the current time and the sending time of the proposal corresponding to the first node; if the first time difference is greater than or equal to the time interval, resend the proposal to the first node.

[0248] In some embodiments, after reissuing the proposal to the first node, the reissuing unit 14 is further used to increase the number of times the proposal has been sent in the consensus status information of the first node by 1, and to update the sending time of the proposal in the consensus status information of the first node to the current time.

[0249] In some embodiments, for each of the N slave nodes, the node status information of the slave node includes the height value of the slave node in the blockchain system at the current moment, and the consensus status information of the slave node also includes the height value of the slave node. The reissuing unit 14 is also used to update the height value in the consensus status information of the i-th slave node to the height value in the node status information of the i-th slave node for the i-th slave node among the M slave nodes, and reset the number of times sent and the sending time in the consensus status information of the i-th slave node to 0.

[0250] In some embodiments, for each of the N slave nodes, the consensus status information of the slave node also includes the status update time of the slave node, and the status update time of the slave node is the time when the master node last received the status information of the slave node. The first node determination unit 12 is further used to obtain the status update time corresponding to the first node from the consensus status information of the first node before obtaining the number of times the master node has sent the proposal to the first node from the consensus status information of the first node; determine the second time difference between the status update time corresponding to the first node and the current time; if the second time difference is less than or equal to a preset value, obtain the number of times the master node has sent the proposal to the first node from the consensus status information of the first node.

[0251] In some embodiments, the first node determination unit 12 is further configured to determine that the first node is a faulty node and stop reissuing the proposal to the first node if the second time difference is greater than the preset value.

[0252] In some embodiments, the first node determination unit 12 is further configured to set the number of times sent and the sending time in the consensus status information of the first node to 0 if the first node is a faulty node.

[0253] It should be understood that the device embodiments and method embodiments may correspond to each other, and similar descriptions may refer to the method embodiments. To avoid repetition, they will not be described in detail here. Specifically, the device shown in FIG10 can perform the above-mentioned method embodiments, and the aforementioned and other operations and / or functions of each module in the device are respectively for implementing the above-mentioned method embodiments. For the sake of brevity, they will not be described in detail here.

[0254] The apparatus of the embodiment of the present application is described above from the perspective of functional modules in conjunction with the accompanying drawings. It should be understood that the functional module can be implemented in hardware form, can be implemented by instructions in software form, or can be implemented by a combination of hardware and software modules. Specifically, the steps of the method embodiment in the embodiment of the present application can be completed by the hardware integrated logic circuit and / or software form instructions in the processor, and the steps of the method disclosed in the embodiment of the present application can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. Optionally, the software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps in the above method embodiment in conjunction with its hardware.

[0255] FIG11 is a schematic block diagram of an electronic device provided in an embodiment of the present application. The electronic device may be the above-mentioned terminal device or a server, and the electronic device is used to execute the above-mentioned method embodiment.

[0256] As shown in FIG11 , the electronic device 50 may include:

[0257] The memory 51 and the processor 52 are configured to store a computer program 53 and transmit the program code 53 to the processor 52. In other words, the processor 52 can call and run the computer program 53 from the memory 51 to implement the method in the embodiment of the present application.

[0258] For example, the processor 52 may be configured to execute the above method steps according to instructions in the computer program 53 .

[0259] In some embodiments of the present application, the processor 52 may include but is not limited to:

[0260] General-purpose processor, Digital Signal Processor (DSP), Application Specific Integrated Circuit (ASIC), Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.

[0261] In some embodiments of the present application, the memory 51 includes but is not limited to:

[0262] Volatile memory and / or non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).

[0263] In some embodiments of the present application, the computer program 53 may be divided into one or more modules, which are stored in the memory 51 and executed by the processor 52 to implement the method provided by the present application. The one or more modules may be a series of computer program instruction segments capable of implementing specific functions, and the instruction segments are used to describe the execution process of the computer program 53 in the electronic device.

[0264] As shown in FIG11 , the electronic device 50 may further include:

[0265] The transceiver 54 may be connected to the processor 52 or the memory 51 .

[0266] The processor 52 may control the transceiver 54 to communicate with other devices. Specifically, the processor 52 may send information or data to other devices or receive information or data sent by other devices. The transceiver 54 may include a transmitter and a receiver. The transceiver 54 may further include one or more antennas.

[0267] It should be understood that the various components in the electronic device 50 are connected via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.

[0268] According to one aspect of the present application, a computer storage medium is provided, on which a computer program is stored. When the computer program is executed by a computer, the computer is enabled to perform the method of the above method embodiment.

[0269] An embodiment of the present application also provides a computer program product comprising instructions, which, when executed by a computer, enables the computer to perform the method of the above method embodiment.

[0270] According to another aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the method of the above method embodiment.

[0271] In other words, when implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (DVD)), or a semiconductor medium (e.g., a solid-state drive (SSD)).

[0272] Those skilled in the art will appreciate that the modules 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 beyond the scope of this application.

[0273] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules is merely a logical function division. In actual implementation, there may be other division methods, such as multiple modules 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 modules, which can be electrical, mechanical or other forms.

[0274] Modules described as separate components may or may not be physically separate, and components displayed as modules may or may not be physical modules, i.e., they may be located in one place or distributed across multiple network elements. Some or all of the modules may be selected based on actual needs to achieve the purpose of the present embodiment. For example, the functional modules in the various embodiments of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into a single module.

[0275] The above content is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A data transmission method, It is characterized in that The method is applied to a master node in a blockchain system, and the method comprises: Send the generated proposal to N slave nodes in the regional chain system, and record the number of times the master node has sent the proposal to each of the N slave nodes, where N is a positive integer; Receiving node status information sent by M slave nodes among the N slave nodes, and determining a first node among the N slave nodes that has not received the proposal based on the node status information of each of the M slave nodes, where M is a positive integer less than or equal to N; Obtain the currently recorded number of times the proposal has been sent by the master node to the first node, and determine the time interval for the master node to resend the proposal to the first node next time based on the number of times the proposal has been sent by the master node to the first node, wherein the time interval is positively correlated with the number of times the proposal has been sent by the master node to the first node; the time interval is the time difference between the time when the master node resends the proposal to the slave node next time and the time when the master node last sent the proposal to the slave node; Based on the time interval, resend the proposal to the first node.

2. The method according to claim 1, It is characterized in that The determining, based on the number of times the proposal has been sent by the master node to the first node, a time interval for the master node to resend the proposal to the first node next time includes: Based on the number of times the master node has sent the proposal to the first node and the time interval between the master node sending the proposal to the first node during the number of times the master node has sent the proposal to the first node, the time interval for the master node to resend the proposal to the first node next time is determined.

3. The method according to claim 2, It is characterized in that The determining, based on the number of times the proposal has been sent by the master node to the first node and the time interval between the master node sending the proposal to the first node during the number of times the proposal has been sent by the master node to the first node, the time interval for the master node to send the proposal to the first node next time comprises: If the number of times the master node has sent the proposal to the first node is greater than or equal to 2, then based on the first time interval when the master node last sent the proposal to the first node and the second time interval when the master node last sent the proposal to the first node, determine the time interval for the master node to resend the proposal to the first node next time; or, If the number of times the master node has sent the proposal to the first node is equal to 1, the first time interval for the last time the master node sent the proposal to the first node is determined as the time interval for the next time the master node resends the proposal to the first node.

4. The method according to claim 3, It is characterized in that The determining, based on a first time interval at which the master node last sent the proposal to the first node and a second time interval at which the master node last sent the proposal to the first node, a time interval for the master node to resend the proposal to the first node next time, includes: The sum of the first time interval and the second time interval is determined as the time interval for the master node to resend the proposal to the first node next time.

5. The method according to any one of claims 1 to 4, It is characterized in that The master node stores the consensus status information of each of the N slave nodes. For each of the N slave nodes, the consensus status information of the slave node includes the number of times the master node has sent the proposal to the slave node. The recording of the number of times the master node has sent the proposal to each of the N slave nodes includes: For each of the N slave nodes, recording the number of times the master node has sent the proposal to the slave node through the consensus status information of the slave node; The obtaining of the currently recorded number of times the proposal has been sent by the master node to the first node includes: The number of times the proposal has been sent by the master node to the first node is obtained from the consensus status information of the first node.

6. The method according to claim 5, It is characterized in that For each of the N slave nodes, the node status information of the slave node includes a current proposal hash value of the slave node, and the consensus status information of the slave node also includes a proposal hash value. Before determining the first node of the N slave nodes that has not received the proposal based on the node status information of each of the M slave nodes, the method further includes: For each of the M slave nodes, based on the current proposal hash value in the node status information of the slave node, updating the proposal hash value in the consensus status information of the slave node; The determining, based on the node status information of each slave node in the M slave nodes, that the N slave nodes have not received the The first node of the proposal includes: For each of the N slave nodes, if the updated proposal hash value in the consensus status information of the slave node is empty, the slave node is determined to be the first node.

7. The method according to claim 6, It is characterized in that The method further comprises: If M is less than N, the other nodes among the N slave nodes except the M slave nodes are determined as the first nodes.

8. The method according to any one of claims 5 to 7, It is characterized in that For each of the N slave nodes, the consensus state information of the slave node also includes the time when the master node last sent the proposal to the slave node, and resending the proposal to the first node based on the time interval includes: Obtaining, from the consensus status information of the first node, the time when the master node last sent the proposal to the first node; Determine a first time difference between a current time and a sending time of the proposal corresponding to the first node; If the first time difference is greater than or equal to the time interval, resending the proposal to the first node.

9. The method according to claim 8, It is characterized in that After resending the proposal to the first node, the method further includes: The number of times the proposal in the consensus status information of the first node has been sent is increased by 1, and the sending time of the proposal in the consensus status information of the first node is updated to the current time.

10. The method according to claim 8 or 9, It is characterized in that For each of the N slave nodes, the node status information of the slave node includes the height value of the slave node in the blockchain system at the current moment, the consensus status information of the slave node also includes the height value of the slave node, and the method further includes: For the i-th slave node among the M slave nodes, if the height value in the node status information of the i-th slave node is inconsistent with the height value in the consensus status information of the i-th slave node, the height value in the consensus status information of the i-th slave node is updated to the height value in the node status information of the i-th slave node, and the number of times sent and the sending time in the consensus status information of the i-th slave node are reset to 0.

11. The method according to claim 8 or 9, It is characterized in that For each of the N slave nodes, the consensus status information of the slave node also includes a status update time of the slave node, and the status update time of the slave node is the time when the master node last received the status information of the slave node. Before obtaining the number of times the master node has sent the proposal to the first node from the consensus status information of the first node, the method further includes: Obtaining a status update time of the first node from the consensus status information of the first node; Determine a second time difference between a state update time of the first node and a current time; The obtaining, from the consensus status information of the first node, the number of times the proposal has been sent by the master node to the first node includes: If the second time difference is less than or equal to a preset value, the number of times the proposal has been sent by the master node to the first node is obtained from the consensus status information of the first node.

12. The method according to claim 11, It is characterized in that The method further comprises: If the second time difference is greater than the preset value, the first node is determined to be a faulty node, and resending the proposal to the first node is stopped.

13. The method according to claim 12, It is characterized in that The method further comprises: If the first node is a faulty node, the number of times the message has been sent and the sending time in the consensus status information of the first node are set to 0.

14. A data transmitting device, It is characterized in that The master nodes used in the blockchain system include: A recording unit, used to send the generated proposal to N slave nodes in the regional chain system, and record the number of times the master node has sent the proposal to each of the N slave nodes, where N is a positive integer; a first node determination unit, configured to receive node status information sent by M slave nodes among the N slave nodes, and determine a first node among the N slave nodes that has not received the proposal based on the node status information of each of the M slave nodes, where M is a positive integer less than or equal to N; a time interval determining unit, configured to obtain a currently recorded number of times the master node has sent the proposal to the first node, And based on the number of times the master node has sent the proposal to the first node, determine the time interval for the master node to resend the proposal to the first node next time, and the time interval is positively correlated with the number of times the master node has sent the proposal to the first node; the time interval is the time difference between the time when the master node resends the proposal to the slave node next time and the time when the master node last sent the proposal to the slave node; A resending unit is used to resend the proposal to the first node based on the time interval.

15. An electronic device, It is characterized in that including a processor and a memory; The memory is used to store computer programs; The processor is used to execute the computer program to implement the method according to any one of claims 1 to 13.

16. A computer-readable storage medium, It is characterized in that Used to store a computer program, wherein the computer program enables a computer to execute the method according to any one of claims 1 to 13.

Citation Information

Patent Citations

  • Image file packet retransmission method

    CN102238206A

  • Consensus mechanism optimization method and system based on Paxos algorithm and block chain network

    CN111930840A

  • Data transmission method, node, electronic equipment and readable storage medium

    CN113746647A

  • Transaction process control system in distributed processing system

    JP2003150465A

  • System and method for sending proposals within a distributed state machine replication system

    US10462218B1