A message propagation method and device in a blockchain based on an internet of things

By constructing the network topology and neighbor relationships of the IoT blockchain system and optimizing the node adjacency relationship using a neighbor recommendation algorithm, the data transmission latency and security issues when combining traditional blockchain networks with the Internet of Things are solved, thereby improving transmission efficiency and robustness.

CN119906710BActive Publication Date: 2025-12-26COMP NETWORK INFORMATION CENT CHINESE ACADEMY OF SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510118752.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-24
Publication Date
2025-12-26
Estimated Expiration
2045-01-24

AI Technical Summary

Technical Problem

When traditional blockchain networks are combined with the Internet of Things (IoT), there are risks such as data transmission delays, insufficient bandwidth, and network security. Existing centralized or semi-decentralized solutions are unable to balance data transmission efficiency with the need for decentralization, making it difficult for the IoT to be integrated with the traditional blockchain network layer.

Method used

By constructing the network topology and neighbor relationships of the IoT blockchain system, a neighbor recommendation algorithm is used to select more valuable neighbor nodes, and an efficient data transmission mechanism is adopted to broadcast transactions to the entire network, thereby optimizing the adjacency relationship between nodes to improve transmission efficiency and system robustness.

Benefits of technology

It improves the transmission efficiency and system robustness of IoT devices accessing the blockchain network, reduces data transmission latency and loss risks, and enhances the network's flexibility and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119906710B_ABST
    Figure CN119906710B_ABST
Patent Text Reader

Abstract

The application provides a message propagation method in a blockchain based on Internet of Things, comprising: determining nodes included in a target blockchain and initial adjacent relations between the nodes, the nodes being Internet of Things devices; determining optimized adjacent relations between the nodes based on a preset neighbor recommendation algorithm and the initial adjacent relations; and delivering a blockchain message between the nodes according to the optimized adjacent relations.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of blockchain and Internet of Things, and particularly relates to a message propagation method and device in a blockchain based on Internet of Things. BACKGROUND

[0002] In the Internet of Things, the access of a large number of devices and the dynamic change of nodes bring challenges to data transmission efficiency, trust management, security, etc. Therefore, the introduction of the blockchain technology provides a technical basis for the trust and reliability of the Internet of Things. However, in practice, the combination of the traditional blockchain network and the Internet of Things still faces problems such as data transmission delay of randomly selected nodes, insufficient bandwidth, and network security risks. The existing centralized or semi-decentralized solutions are difficult to balance the data transmission efficiency and the decentralization demand, resulting in the difficulty of combining the Internet of Things with the traditional blockchain network layer.

[0003] Therefore, there is a need for a message propagation method and device in a blockchain based on Internet of Things. SUMMARY

[0004] The purpose of the present application is to provide a message propagation method and device in a blockchain based on Internet of Things, which focuses on the key points of network topology construction and data transmission, and improves the transmission efficiency and system robustness of the Internet of Things devices accessing the blockchain network.

[0005] To achieve the above-mentioned purpose, in a first aspect, the present application provides a message propagation method in a blockchain based on Internet of Things, comprising:

[0006] determining nodes included in a target blockchain and initial adjacent relationships between the nodes, the nodes being Internet of Things devices;

[0007] determining optimized adjacent relationships between the nodes based on a preset neighbor recommendation algorithm and the initial adjacent relationships;

[0008] transferring blockchain messages between the nodes according to the optimized adjacent relationships.

[0009] Specifically, determining the optimized adjacent relationships between the nodes based on the preset neighbor recommendation algorithm and the initial adjacent relationships comprises:

[0010] each node determines the round-trip time of a target node having an initial adjacent relationship with the node, recommends a candidate neighbor node of the target node to the target node according to the round-trip time, the target node merges all the candidate neighbor nodes recommended to the target node to obtain a total candidate neighbor node set, and determines whether to transform each node in the total candidate neighbor node set into a neighbor node of the target node according to the number of outgoing connections of the target node and the number of incoming connections of each node in the total candidate neighbor node set.

[0011] Specifically, the blockchain message is a blockchain transaction;

[0012] According to the optimized adjacent relationship, a blockchain message is transmitted between the nodes, including:

[0013] The first node in the blockchain transmits a blockchain transaction initiated by the first node to a number of N second nodes and with a propagation phase identifier, each second node transmits the blockchain transaction to a third node according to the propagation phase identifier and updates the propagation phase identifier, and the third node selects a fourth node through a preset screening condition and transmits the blockchain transaction to the fourth node.

[0014] Preferably, the Internet of Things device includes an edge device and a cloud device of the Internet of Things.

[0015] Preferably, the round trip time is calculated by the following formula:

[0016]

[0017] Wherein, i represents the first node, j represents the second node, t is the measurement times, RTT i,j represents the round trip time, T St is the sending time, T Rt is the receiving time.

[0018] Specifically, the first node transmits a blockchain transaction to a number of N second nodes and with a propagation phase identifier, the second node transmits the blockchain transaction to a third node according to the propagation phase identifier, the third node selects a fourth node through a preset screening condition and transmits the blockchain transaction to the fourth node, including:

[0019] The first node generates a blockchain transaction, the blockchain transaction has a propagation phase identifier, the propagation phase identifier is used to identify the propagation phase of the blockchain transaction, the propagation phase identifier is set to 1 to indicate that the node receiving the propagation phase identifier equal to 1 performs a second stage; the first node transmits the blockchain transaction to a number of N second nodes;

[0020] The second node accepts the blockchain transaction and determines whether the propagation phase identifier of the blockchain transaction is 1, and if the propagation phase identifier is equal to 1, the second node forwards the blockchain transaction to a third node;

[0021] The third node receives the blockchain transaction and forwards the blockchain transaction from x nodes with the smallest round trip time and y nodes with the largest round trip time in the neighbor nodes of the third node.

[0022] Preferably, x nodes with minimum round-trip time and y nodes with maximum round-trip time are randomly selected from the neighbor nodes of the third node, which can be represented as:

[0023]

[0024] wherein, is a connection ascendingly ordered neighbor node set of the third node, is an intermediate index, RandomSelect x represents randomly selecting x nodes with minimum round-trip time, N RTT-min represents a set of x nodes with minimum round-trip time;

[0025]

[0026] wherein, is a connection ascendingly ordered neighbor node set of the third node, is an intermediate index, RandomSelect y represents randomly selecting y nodes with maximum round-trip time, is a total connection number of the third node, N RTT-max represents a set of y nodes with maximum round-trip time.

[0027] Specifically, it further comprises:

[0028] According to a preset inter-node trust optimization model, a trust score between nodes of the blockchain is determined, and an optimized adjacent relationship between the nodes of the blockchain is updated according to the trust score.

[0029] Preferably, the nodes of the blockchain include a first node and a second node;

[0030] The trust score of the first node to the second node can be represented as:

[0031]

[0032] wherein, i represents the first node, j represents the second node, α RTT , β stability , γ history are weights, is a round-trip time delay score, is a network stability score, is a historical interaction record score, RTT ij is a round-trip time of the first node and the second node, α is a stability adjustment factor, P loss is a packet loss rate, exp is an exponential function, H ijThe number of times of sending messages from the first node to the second node is max(H), and max(H) represents the total number of transactions of the first node in a period;

[0033] updating the optimized neighbor relationship between the nodes of the blockchain according to the trust score, comprising:

[0034] a threshold value θ of the trust score is set, if S ij <θ, the second node is removed from the neighbor list.

[0035] In a second aspect, the present application provides a message propagation device in a blockchain based on the Internet of Things, comprising:

[0036] a determination unit configured to determine an initial neighbor relationship between a node included in a target blockchain and the node, the node being an Internet of Things device;

[0037] an optimization unit configured to determine an optimized neighbor relationship between the nodes based on a preset neighbor recommendation algorithm and the initial neighbor relationship;

[0038] a propagation unit configured to propagate a blockchain message between the nodes according to the optimized neighbor relationship. BRIEF DESCRIPTION OF DRAWINGS

[0039] Figure 1 A flowchart of a message propagation method in a blockchain based on the Internet of Things is provided for the embodiments of the present application;

[0040] Figure 2 A neighbor node recommendation flowchart is provided for the embodiments of the present application;

[0041] Figure 3 An early outbreak optimization schematic flowchart is provided for the embodiments of the present application;

[0042] Figure 4 A structure diagram of a message propagation device in a blockchain based on the Internet of Things is provided for the embodiments of the present application. DETAILED DESCRIPTION

[0043] The technical solutions of the present application will be further described in detail below with the aid of the accompanying drawings and embodiments.

[0044] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below with the aid of the accompanying drawings. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so that once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.

[0045] In the description of embodiments of the present application, the words "exemplary", "for example", or "e.g." are used to mean serving as an example, instance, or illustration. Any embodiment or design presented as "exemplary", "for example", or "e.g." in embodiments of the present application should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of "exemplary", "for example", or "e.g." is intended to present concepts in a concrete manner.

[0046] In the prior art, in a centralized scheme, the data of all Internet of Things devices is usually aggregated to a central server for processing. This architecture can achieve efficient data transmission and management when the data volume is small and the number of devices is limited. However, with the explosive growth of Internet of Things devices, a large number of devices simultaneously transmitting data to the central server will cause network congestion. For example, in a large-scale intelligent city traffic monitoring system, if all traffic sensor data is transmitted to a data center, the data transmission delay will increase dramatically during the rush hour, affecting the real-time performance of the data. The processing capacity of the central server will also become a bottleneck. It needs to store, analyze and forward a large amount of Internet of Things data, and when the data traffic exceeds the processing limit of the server, data will be queued for processing, further reducing data transmission efficiency.

[0047] The semi-decentralized scheme usually introduces some intermediate nodes or proxy servers to assist data transmission and management. Although these intermediate nodes can alleviate the pressure of the central server to some extent, they also increase the links of data transmission. For example, in some Internet of Things data sharing platforms, data needs to be converted in format and preliminarily screened by proxy servers before being transmitted to target nodes, which increases the risk of additional delay and data loss. The communication between nodes in the semi-decentralized scheme may not be flexible enough. Since part of the power is still concentrated in a few nodes, the data transmission path may be limited and unable to make the optimal path selection according to the real-time conditions of the network (such as node load, link quality, etc.), thereby affecting the data transmission efficiency.

[0048] In order to overcome the deficiencies in the prior art, a message propagation method and device in a blockchain based on Internet of Things are proposed. The present application constructs the network topology and neighbor relationship of the Internet of Things blockchain system, takes the randomly set neighbor as the starting point, uses a unique method based on neighbor recommendation to carry out topology construction work, selects more valuable neighbor nodes through the mutual recommendation mechanism between neighbors, and broadcasts transactions to the whole network through an efficient data transmission mechanism.

[0049] Figure 1 A flowchart of a message propagation method based on Internet of Things in a blockchain provided by an embodiment of the present application is shown in FIG. 1. Figure 1As shown, the method at least includes the following steps:

[0050] S101: Determine the initial adjacent relationship between the nodes included in the target blockchain and the nodes, which are Internet of Things devices.

[0051] In different embodiments, the nodes can be different devices. In a specific embodiment, the nodes are Internet of Things devices, including edge devices of Internet of Things and cloud devices.

[0052] For example, under a cloud-edge architecture, edge devices (Internet of Things access devices) and cloud devices full nodes in the network are determined as nodes for networking, and the Internet of Things end devices are only responsible for collecting data. In an embodiment of the present application, it can be assumed that there are 2000 edge devices and cloud devices as full nodes participating in networking. First, the initial network topology and the neighbor relationship between nodes are constructed through traditional network configuration means, that is, each node randomly selects 8 nodes as its neighbors.

[0053] S102: Determine the optimized adjacent relationship between the nodes based on the preset neighbor recommendation algorithm and the initial adjacent relationship.

[0054] In an embodiment, the optimized adjacent relationship between the nodes can be determined by the following method: measuring all round trip times of each first node and the second node in the initial adjacent relationship, obtaining a first candidate set of all node sets recommended by the first node to the second node according to the preset neighbor recommendation algorithm, merging all first candidate sets recommended by all neighbor nodes in the initial adjacent relationship of the second node to obtain a second candidate set; judging whether the connection number of the second node and the connection number of the nodes in the second candidate set are both less than a preset connection number N, if both are less than the preset connection number N, adding the nodes in the second candidate set to the connection set of the second node, otherwise discarding, when all nodes in the second candidate set are judged, but the connection number of the second node is still less than the connection number N, randomly selecting a node from the blockchain as a neighbor node of the second node until the connection number of the second node is equal to the connection number N.

[0055] In an embodiment, the round trip time is calculated by the following formula:

[0056]

[0057] Wherein, i represents the first node, j represents the second node, t is the measurement times, RTT i,j represents the round trip time, T St is the sending time, T Rt is the receiving time.

[0058] Figure 2A neighbor node recommendation flowchart provided for the embodiment of the present application is shown in Figure 2 As shown, the target outgoing connection number of each node in the embodiment of the present application is set to 64, and the maximum access connection number of each node is also 64. After the initial connection of neighbors, each node starts to perform RTT (Round-Trip Time) measurement to obtain network delay information of each neighbor. Taking node i as an example, the measurement number T is set to 10. For node i and its neighbor j, the RTT value is calculated using the following formula:

[0059]

[0060] Wherein, i represents node i, j represents neighbor j, t is the measurement number, RTT i,j represents the round-trip time, T St represents the sending time, and T Rt represents the receiving time. Each node calculates the corresponding RTT value for all its neighbors in this way.

[0061] Firstly, the similarity range can be set to 80%-120% of RTT. For another neighbor k of node i, if the RTT i,k between neighbor k and node i satisfies:

[0062] RTT i,k ∈ [80%·RTT i,j , 120%·RTT i,j ]

[0063] That is, the RTT i,k value of node k is between 80%-120% of the RTT i,j value between i and j, and it is considered that the RTT of k is similar to that of i. If k is not in (the candidate neighbor set recommended by node i to node j) at this time, k is added, otherwise, k is skipped.

[0064] Through the above steps, each neighbor of node j returns a similar neighbor candidate set to node j. All neighbors of node j are traversed, and the total similar neighbor candidate set of node j is obtained according to the following formula:

[0065]

[0066] Wherein, N j is the neighbor set of j, is the candidate neighbor set recommended by node i to j, is the total similar neighbor candidate set of j.

[0067] The candidate nodes in are traversed, Given that the target outgoing connection number n for node j is 64, and each candidate node n i The maximum number of incoming connections, m, is 64. If the number of outgoing connections of node j is less than 64, and node n... i The number of incoming neighbors is less than 64, and n i If node j is not in the neighbor set of node n, then node j will move to the neighbor set of node n. i Add it to its own neighbor set, otherwise discard it.

[0068] After node j has added recommended neighbors through the above steps, if the number of neighbors has not reached the target of 64, a cyclic recommendation process will begin. This involves using the neighbors newly added to the neighbor list in previous steps to recommend similar neighbors. If no new recommended neighbors are generated in this round, a node is randomly selected from the DNS as a neighbor, and the recommendation process is repeated until the target number of connections (64) is finally reached.

[0069] S103: Based on the optimized adjacency relationship, transmit blockchain messages between the nodes.

[0070] In different embodiments, the specific type of blockchain message can be different. In one embodiment, the blockchain message can be a blockchain transaction.

[0071] Specifically, in one embodiment, a first node in the blockchain can propagate blockchain transactions initiated by itself to N second nodes, attaching a propagation stage identifier. Each second node then propagates the blockchain transactions to a third node based on the propagation stage identifier and updates the propagation stage identifier. The third node selects a fourth node based on pre-set filtering conditions and propagates the blockchain transactions to the fourth node. In this process, the first node propagates the blockchain transactions to N second nodes with propagation stage identifiers, the second nodes propagate the blockchain transactions to the third nodes based on the propagation stage identifiers, and the third nodes select a fourth node based on pre-set filtering conditions and propagate the blockchain transactions to the fourth node.

[0072] Figure 3 A schematic flowchart illustrating early burst optimization provided in an embodiment of the present invention, such as... Figure 3 As shown, in the first stage, at the initial stage of the transaction, when node i generates a transaction, the transaction not only includes the transaction itself, but also comes with a propagation record Stage(T). i Stage(T) is used to identify the stage of transaction propagation. i Setting it to 1 indicates that Stage(T) has been received. i The node needs to go through the second phase.

[0073] At this time, node i has 64 outgoing neighbors after the recommendation, denoted as {N1, N2, N3, …, N 64}, node i broadcasts the generated transaction to all its outgoing neighbors The broadcast of node i can be represented by the following formula:

[0074]

[0075] The goal of this stage is to minimize the propagation delay and quickly spread the message, so that the transaction can quickly cover the entire network.

[0076] After completing the initial full push, enter the second stage, and the node only selects a part of the neighbors for message propagation. After node j receives the transaction T i , it needs to judge the propagation record of the transaction. If Stage(T i ) = 1, it indicates that it has entered the second stage, and node j decides whether to forward the transaction according to the following judgment.

[0077] When node j selects neighbors for propagation, it avoids sending messages to the same nodes as the outgoing neighbors of node i. Let node k be a candidate sending neighbor, and the outgoing neighbor set of node i. The propagation strategy of node j can be represented as:

[0078]

[0079] Compare whether node k is in the outgoing neighbor set of node i. If not, send it, otherwise skip it.

[0080] In the third stage, node k will continue to propagate the message, but only a part of the neighbors will be selected for push. The strategy is to select a part of the neighbors with small delay for push, and a part of the neighbors with large delay for push.

[0081] Specifically, 4 RTT small neighbors (i.e. x = 4) are selected: the RTT small neighbors are preferentially selected for propagation to ensure that the message can be quickly delivered to the local network and the propagation efficiency is improved.

[0082] In different embodiments, the selection method can be different formulas. In a specific embodiment, the random selection of x fourth nodes with the smallest round-trip time and y fourth nodes with the largest round-trip time is as follows:

[0083]

[0084] wherein, is the sorted neighbor node set of the third node in ascending order of connection, is the middle index, and RandomSelect x represents the random selection of x nodes with the smallest round-trip time, NRTT-min denotes a set of x nodes with minimum round trip time;

[0085]

[0086] wherein, denotes a set of connection ascending order sorted neighbor nodes of the third node, is the middle index, RandomSelect y denotes randomly selecting y nodes with maximum round trip time, denotes the total number of connections of the third node, N RTT-max denotes a set of y nodes with maximum round trip time.

[0087] For example, it can be set that RTT k,l denotes the RTT value between node k and neighbor l, and the node will take the middle index from the ascending order sorted set of its neighbors , RandomSelect 4 denotes randomly selecting 4 nodes with minimum round trip time, x denotes randomly selecting x neighbor nodes, by the formula:

[0088]

[0089] wherein, denotes a set of connection ascending order sorted neighbor nodes of the k node, RandomSelect4 denotes randomly selecting 4 nodes with minimum round trip time, N RTT-min denotes a set of 4 nodes with minimum round trip time;

[0090]

[0091] wherein, denotes a set of connection ascending order sorted neighbor nodes of the k node, is the middle index, RandomSelect y denotes randomly selecting y nodes with maximum round trip time, denotes the total number of connections of the k node, N RTT-max denotes a set of y nodes with maximum round trip time

[0092] In the embodiment of the application, 4 nodes with minimum RTT are randomly selected for propagation.

[0093] At the same time, 4 nodes with larger RTT (i.e. y=4) are selected for propagation to ensure that the message can cover a wider area and avoid forming an information island in a local area. The formula for node selection is:

[0094]

[0095] In an embodiment, the method can further determine a trust score between the nodes of the blockchain according to a preset inter-node trust optimization model, and update the optimized adjacent relationship between the nodes of the blockchain according to the trust score.

[0096] The nodes of the blockchain are composed of a first node and a second node.

[0097] The trust score of the first node to the second node can be expressed as:

[0098]

[0099] Wherein, i represents the first node, j represents the second node, α RTT , β stability , and γ history are weights, is a round-trip time delay score, is a network stability score, is a historical interaction record score, RTT ij is the round-trip time of the first node and the second node, α is a stability adjustment factor, P loss is the packet loss rate, exp is the exponential function, H ij is the number of times that the second node sends messages to the first node, and max(H) represents the total number of transactions of the first node in a period.

[0100] Updating the optimized adjacent relationship between the nodes of the blockchain according to the trust score can include:

[0101] A threshold θ of the trust score is set, and if S ij < θ, the second node is removed from the neighbor list.

[0102] For example, a dynamic trust score S ij can be defined for each neighbor node, where i represents the current node and j represents the neighbor node. Taking the score of node i to a neighbor j as an example, the trust score model considers the following factors:

[0103] RTT delay score Neighbors with low latency get higher scores, and the weight factor is inversely proportional to RTT. For example, if RTT ij = 500ms, then

[0104] Network stability score The packet loss rate P loss of node j in a period (set to 2 hours) is combined.Assuming the packet loss rate is 0.1) and connection stability. Set the stability adjustment factor a = 0.5 (which can be adjusted according to the actual network situation), and define as follows:

[0105]

[0106] Historical interaction record score The more transactions node i receives from node j, the higher the trust score, assuming that within a period (set to 2 hours), H ij represents the number of times j sends transactions to i (assuming 500 times), and max(H) represents the total number of transactions i has within a period (assuming 5000 times), and the formula is:

[0107]

[0108] The comprehensive score formula is: assuming a RTT = 0.4, b stability = 0.3, (the weights can be adjusted according to actual needs), then the comprehensive score formula of node i to a neighbor j is:

[0109]

[0110] Eliminate low-score neighbors: set the trust score threshold a = 0.8, if S ij <0.8, then node j is removed from the neighbor list.

[0111] According to an embodiment of the present application, a device for message propagation in a blockchain based on Internet of Things is provided. Figure 4 The structure diagram of the device for message propagation in a blockchain based on Internet of Things provided by the embodiment of the present application is shown in Figure 4 The device 400 comprises:

[0112] A determination unit 401 is configured to determine nodes included in a target blockchain and initial adjacent relationships between the nodes, the nodes being Internet of Things devices.

[0113] An optimization unit 402 is configured to determine optimized adjacent relationships between the nodes based on a preset neighbor recommendation algorithm and the initial adjacent relationships.

[0114] A propagation unit 403 is configured to propagate blockchain messages between the nodes according to the optimized adjacent relationships.

[0115] The above detailed description of the specific embodiments of the present application has been given to understand the purpose, technical solutions and beneficial effects of the present application. It should be understood that the above description is only a specific embodiment of the present application and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A message propagation method in an Internet of Things (IoT) based blockchain, comprising: determining initial adjacent relationships between nodes included in a target blockchain and the nodes, the nodes being IoT devices; determining optimized adjacent relationships between the nodes based on a preset neighbor recommendation algorithm and the initial adjacent relationships, comprising: each node determining a round trip time (RTT) of a target node having an initial adjacent relationship with the node, recommending candidate neighbor nodes of the target node to the target node according to the RTT, the target node merging all the candidate neighbor nodes recommended to the target node to obtain a total candidate neighbor node set, and determining whether to transform each node in the total candidate neighbor node set into a neighbor node of the target node according to a number of outgoing connections of the target node and a number of incoming connections of each node in the total candidate neighbor node set; determining optimized adjacent relationships between the nodes based on a preset neighbor recommendation algorithm and the initial adjacent relationships, and delivering a blockchain message between the nodes according to the optimized adjacent relationships, comprising: a first node generating a blockchain transaction, the blockchain transaction having a propagation phase identifier, the propagation phase identifier being used to identify a blockchain transaction propagation phase, the propagation phase identifier being set to 1 to indicate that a node receiving the propagation phase identifier equal to 1 performs a second phase, and the first node propagating the blockchain transaction to a number N of second nodes; the second node accepting the blockchain transaction, determining whether the propagation phase identifier of the blockchain transaction is 1, and forwarding the blockchain transaction to a third node if the propagation phase identifier is equal to 1; the third node receiving the blockchain transaction and forwarding the blockchain transaction to x nodes with minimum RTT and y nodes with maximum RTT from neighbor nodes of the third node; determining trust scores between nodes of the blockchain according to a preset inter-node trust optimization model, and updating the optimized adjacent relationships between the nodes of the blockchain according to the trust scores; the nodes of the blockchain including the first node and the second node; the trust score of the first node to the second node being represented as: wherein i represents a first node, j represents a second node, a RTT , b stability , g history are weights, is a round-trip time delay score, is a network stability score, is a historical interaction record score, RTT ij is a round-trip time between the first node and the second node, a is a stability adjustment factor, P loss is a packet loss rate, exp is an exponential function, H ij is a number of times that the second node sends a message to the first node, and max(H) represents a total number of transactions of the first node in a period. updating the optimized adjacent relationships between the nodes of the blockchain according to the trust scores, comprising: A threshold value θ of the trust score is set, and if S ij < θ, the second node is removed from the neighbor list.

2. The method of claim 1, wherein, the IoT devices including edge devices and cloud devices of the IoT.

3. The method of claim 1, wherein, the RTT being calculated by the following formula: wherein i represents a first node, j represents a second node, t is a measurement number, RTT i,j represents a round-trip time, T St represents a transmission time, T Rt represents a reception time.

4. The method of claim 1, wherein, randomly selecting x nodes with minimum RTT and y nodes with maximum RTT from the neighbor nodes of the third node, which can be represented as: wherein, sort the set of neighbor nodes in ascending order of connection to the third node, is an intermediate index, RandomSelect x represents randomly selecting x nodes with the smallest round-trip time, N RTT-min represents a set of x nodes with the smallest round-trip time; wherein, ordering the set of neighbor nodes of the third node in ascending order of connections, is an intermediate index, RandomSelect y denotes randomly selecting y nodes with the largest round-trip times, is the total number of connections of the third node, N RTT-max denotes the set of y nodes with the largest round-trip times.

5. A message propagation apparatus in an IoT based blockchain, comprising: a determination unit configured to determine initial adjacent relationships between nodes included in a target blockchain and the nodes, the nodes being IoT devices; an optimization unit configured to determine optimized adjacent relationships between the nodes based on a preset neighbor recommendation algorithm and the initial adjacent relationships, comprising: Each node determines a round trip time of a target node having an initial adjacent relationship with the node, recommends candidate neighbor nodes of the target node to the target node according to the round trip time, the target node combines all the candidate neighbor nodes recommended to the target node into a total candidate neighbor node set; according to the number of outgoing connections of the target node and the number of incoming connections of each node in the total candidate neighbor node set, it is determined whether each node in the total candidate neighbor node set is converted into a neighbor node of the target node; The propagation unit is configured to determine the optimized adjacent relationship between the nodes based on the preset neighbor recommendation algorithm and the initial adjacent relationship, and to propagate the blockchain message between the nodes according to the optimized adjacent relationship, including: The first node generates a blockchain transaction, the blockchain transaction has a propagation phase identifier, the propagation phase identifier is used to identify a blockchain transaction propagation phase, and the propagation phase identifier is set to 1 to indicate that the node receiving the propagation phase identifier equal to 1 performs a second stage; the first node propagates the blockchain transaction to a second node in an amount of N; The second node accepts the blockchain transaction, determines whether the propagation phase identifier of the blockchain transaction is 1, and forwards the blockchain transaction to a third node if the propagation phase identifier is equal to 1; The third node receives the blockchain transaction and forwards the blockchain transaction to x nodes with the smallest round trip time and y nodes with the largest round trip time from the neighbor nodes of the third node; According to a preset inter-node trust optimization model, determine the trust score between the nodes of the blockchain, and update the optimized adjacent relationship between the nodes of the blockchain according to the trust score; the nodes of the blockchain include the first node and the second node; the trust score of the first node to the second node can be expressed as: wherein i represents a first node, j represents a second node, a RTT , b stability , g history are weights, is a round-trip time delay score, is a network stability score, is a historical interaction record score, RTT ij is a round-trip time between the first node and the second node, a is a stability adjustment factor, P loss is a packet loss rate, exp is an exponential function, H ij is a number of times that the second node sends messages to the first node, and max(H) represents a total number of transactions of the first node in a period. According to the trust score, update the optimized adjacent relationship between the nodes of the blockchain, including: A threshold value θ of the trust score is set, and if S ij < θ, the second node is removed from the neighbor list.

Citation Information

Patent Citations

  • Method and device for sending information in block chain

    CN110875938A

  • Block chain network topology dynamic establishment and data transmission optimization method

    CN115314391A