Blockchain group collaborative perception method, processor and storage medium
By using Kautz graphs to build a blockchain communication network in blockchain group collaborative perception, the message delivery path is optimized, and the problems of slow message delivery speed and high cost in the existing technology are solved, and the accuracy and efficiency of perception are improved.
Patent Information
- Application Number
- CN202111358313.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-16
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2041-11-16
AI Technical Summary
In the existing blockchain group collaborative perception technology, the message delivery speed of unstructured networks is slow, costly, and the original consensus method leads to perception accuracy and low efficiency.
The blockchain communication network based on Kautz graph is adopted to generate blockchain nodes through Kautz graph, build message bodies and perform message propagation, and optimize message delivery paths using the topological structure of Kautz graph and greedy algorithm to achieve fast message propagation and efficient consensus.
It improves the efficiency of information exchange at the underlying blockchain, enhances the accuracy and efficiency of perception, and reduces the computing and network costs of automated equipment such as drones.
Smart Images

Figure CN116137626B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information technology, and in particular to a blockchain group collaborative perception method, processor and storage medium. Background Art
[0002] In the existing technology, automated equipment such as drones and unmanned vehicles are generally equipped with blockchain nodes for group collaborative perception. These automated equipment form a group, which perceives specific targets, and then uses the equipped blockchain modules to build a blockchain network to collaboratively identify the perceived results using technologies such as decentralization and consensus.
[0003] However, the current blockchain group collaborative perception generally uses unstructured network connections when exchanging information at the stratum. The topological connections of the nodes that make up the unstructured network are irregular, such as random connections. Moreover, because it does not need to be maintained in a specific structure, the maintenance cost of using an unstructured network topology is low. However, the speed of message transmission is slow, and flooding is often used, which requires a large cost for transmission. Taking drones as an example, after sensing the target, drones will use the flooding principle to spread data for consensus. The use of the flooding principle will cause a large amount of information to be spread, which will increase the cost of drones in terms of computing and networking, and to a certain extent affect the power of drones and the speed of consensus, and the efficiency of perception is low.
[0004] In the current blockchain group collaborative perception technology, most of them use the consensus method of the original blockchain to perceive group collaboration. This original blockchain consensus method generally adopts voting, rotation mechanism and other methods, and does not design a consensus method with strong performance for perception itself, resulting in low perception accuracy and efficiency. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a blockchain group collaborative perception method, processor and storage medium.
[0006] In order to achieve the above-mentioned purpose, the first aspect of the present application provides a blockchain group collaborative perception method, including: constructing a blockchain communication network based on a Kautz graph;
[0007] Determine multiple blockchain nodes generated according to the Kautz graph;
[0008] The target is sensed by each blockchain node to obtain the perception value of each blockchain node;
[0009] For each blockchain node, the blockchain node constructs the message body according to its own perception value and the number of message forwardings;
[0010] Determine the neighbor nodes of each blockchain node based on the Kautz graph and send the message body to the neighbor nodes;
[0011] After receiving the message body, the neighbor node reduces the message forwarding quantity contained in the message body by a preset value to obtain an updated message forwarding quantity;
[0012] When the updated message forwarding quantity is greater than a preset threshold, the neighbor node forwards the message body to the neighbor node of the neighbor node;
[0013] When the number of message forwarding is less than or equal to the preset threshold, the message body forwarding stops.
[0014] Optionally, determining the neighbor nodes of each blockchain node according to the Kautz graph, and sending the message body to the neighbor nodes includes: determining the neighbor nodes of each blockchain node according to the Kautz graph; determining the neighbor node with the highest delivery success rate among the neighbor nodes according to the greedy algorithm as the target neighbor node; and sending the message body to the target neighbor node.
[0015] Optionally, for each blockchain node, the blockchain node constructs a message body according to its own perception value and the number of message forwardings, including: for each blockchain node, the blockchain node randomly generates a corresponding Kautz sequence through a Kautz graph; the blockchain node constructs a corresponding consensus message body according to its own perception value, the number of message forwardings, the round value of the message body and the Kautz sequence.
[0016] Optionally, the method also includes: when the number of updated message forwardings is greater than a preset threshold, the neighbor node records the round value contained in the consensus message body; when the number of times any blockchain node records the round value exceeds a preset number, the blockchain node broadcasts the routing process for the round value to all blockchain nodes; all blockchain nodes review the routing process; when determining whether the transmission path of the route is consistent with the routing process, determine the blockchain node that broadcasts the routing process as the accounting node for the round value; write the routing process for all blockchain nodes where the round value is located into the local ledger through the accounting node, and broadcast the entire routing process to all blockchain nodes.
[0017] Optionally, the method also includes: after broadcasting the entire routing process to all blockchain nodes, the numerical value of the round value is incremented, and the target is perceived again through each blockchain node to obtain the perception value of each blockchain node.
[0018] Optionally, the preset number is half the number of all blockchain nodes.
[0019] Optionally, constructing a blockchain communication network based on a Kautz graph includes: determining a target number of blockchain nodes of the blockchain network to be constructed, an area of the area to be sensed, and a maximum value of the effective communication distance between blockchain nodes; determining a coverage area of the blockchain network to be constructed according to the target number and the maximum value of the effective communication distance; when it is determined that the coverage area is greater than the area of the area, determining a maximum number of hops of the Kautz graph to be constructed according to the area and the target number; determining the degree of each node in the Kautz graph to be constructed according to the maximum number of hops and the target number; and constructing a corresponding Kautz graph according to the maximum number of hops and the degree.
[0020] Optionally, the method also includes: after constructing a corresponding Kautz graph according to the maximum number of hops and the degree, generating a corresponding Kautz assignment sequence through the constructed Kautz graph; for each blockchain node, randomly selecting a value from the assignment sequence to assign a value to the blockchain node to determine the first code of each blockchain node, and deleting the selected value from the assignment sequence; when all blockchain nodes have been assigned, each blockchain node determines the second code of the neighbor node according to its own code and the constructed Kautz graph, and broadcasts the code of the neighbor node; when the blockchain node encoded as the second code receives the broadcast, it establishes a connection with the blockchain node that broadcasts to determine the neighbor relationship.
[0021] A second aspect of the present application provides a processor configured to execute the above-mentioned blockchain group collaborative perception method.
[0022] The third aspect of the present application provides a machine-readable storage medium, on which instructions are stored. When the instructions are executed by a processor, the processor is configured to execute the above-mentioned blockchain group collaborative perception method.
[0023] Through the above technical solutions, the underlying communication network of blockchain can be quickly constructed, making the exchange of underlying information of blockchain more efficient and improving the efficiency of perception to a certain extent. At the same time, when blockchain nodes are connected at a high density, all message propagation of blockchain nodes can be realized, and the message transmission speed is fast, further improving the accuracy and efficiency of perception.
[0024] Other features and advantages of the embodiments of the present application will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present application, but do not constitute a limitation on the embodiments of the present application. In the accompanying drawings:
[0026] Figure 1The flowchart of the blockchain group collaborative perception method according to the embodiment of the present application is schematically shown;
[0027] Figure 2 A schematic diagram of a communication network of a blockchain group collaborative perception method according to an embodiment of the present application is schematically shown;
[0028] Figure 3 A schematic diagram of a message propagation process of a blockchain group collaborative perception method according to an embodiment of the present application is schematically shown;
[0029] Figure 4 The internal structure diagram of a computer device according to an embodiment of the present application is schematically shown. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the specific implementation methods described herein are only used to illustrate and explain the embodiments of the present application, and are not used to limit the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0031] Figure 1 The flowchart of the blockchain group collaborative perception method according to the embodiment of the present application is schematically shown. Figure 1 As shown, in one embodiment of the present application, a blockchain group collaborative perception method is provided, comprising the following steps:
[0032] Step 101, construct a blockchain communication network based on the Kautz graph.
[0033] Step 102, determining multiple blockchain nodes generated according to the Kautz graph.
[0034] Step 103, the target is sensed by each blockchain node to obtain the perception value of each blockchain node.
[0035] Step 104, for each blockchain node, the blockchain node constructs a message body according to its own perception value and the number of message forwardings.
[0036] Step 105, determine the neighbor nodes of each blockchain node according to the Kautz graph, and send the message body to the neighbor nodes.
[0037] Step 106: After receiving the message body, the neighbor node reduces the message forwarding quantity contained in the message body by a preset value to obtain an updated message forwarding quantity.
[0038] Step 107: When the updated message forwarding quantity is greater than a preset threshold, the neighboring node forwards the message body to the neighboring node of the neighboring node.
[0039] Step 108: Stop forwarding the message body until the number of message forwardings is less than or equal to a preset threshold.
[0040] In order to improve the efficiency of blockchain perception and consensus as well as the accuracy of perception, this application uses the Kautz graph to construct a topological communication network structure between blockchain nodes, and uses the Kautz graph to design a consensus algorithm for the perception field.
[0041] Specifically, the processor can build a blockchain communication network based on the Kautz graph. Among them, the Kautz graph can be a graph that takes into account both the balance of node degrees and the minimum network diameter. The node degree can also be expressed as the degree of connectivity or the number of neighbors. The Kautz graph can be simply expressed as Kautz(g,d). Among them, g can represent the degree of each blockchain node in the Kautz graph, and d can represent the maximum value of the minimum number of hops between any two blockchain nodes, that is, the network diameter. The number of blockchain nodes can be determined based on the node degree and the network diameter. Specifically, the number of nodes can be determined based on n=g d +g d-1 The node number can be encoded according to the Kautz sequence. Figure 2 As shown, the Kautz graph may include blockchain node 01, blockchain node 02, blockchain node 10, blockchain node 12, blockchain node 20, and blockchain node 21. The degree of each node in the Kautz graph may be 2, and the minimum number of hops from any node to any other node in the Kautz graph will not exceed 2 hops, which means that the network diameter of this Kautz graph is 2.
[0042] In one embodiment, constructing a blockchain communication network based on a Kautz graph includes: determining a target number of blockchain nodes of a blockchain network to be constructed, an area of an area to be sensed, and a maximum value of an effective communication distance between blockchain nodes; determining a coverage area of the blockchain network to be constructed according to the target number and the maximum value of the effective communication distance; when it is determined that the coverage area is greater than the area of the area, determining a maximum number of hops of the Kautz graph to be constructed according to the area and the target number; determining the degree of each node in the Kautz graph to be constructed according to the maximum number of hops and the target number; and constructing a corresponding Kautz graph according to the maximum number of hops and the degree.
[0043] The processor can determine the target number of blockchain nodes of the blockchain network to be constructed, the area of the area to be sensed, and the maximum value of the effective communication distance between blockchain nodes. The target number of blockchain nodes can be represented by n. The area of the area to be sensed can be represented by A. The maximum value of the effective communication distance between blockchain nodes can be represented by D. If the area to be sensed is regarded as a circle, the diameter of the area to be sensed can be calculated based on Determine, at this time, the area of the area to be sensed can be determined.
[0044] After determining the target number n, the area A, and the maximum value D of the effective communication distance, the processor can determine the coverage area of the blockchain network to be constructed according to the target number n and the maximum value D of the effective communication distance. The coverage area of the blockchain network to be constructed can be calculated by multiplying the target number n by the maximum value D of the effective communication distance.
[0045] When the processor determines that the coverage area of the blockchain network to be constructed is larger than the area of the area to be sensed, the processor can determine the maximum number of hops of the Kautz graph to be constructed based on the area and the target number. That is, if the product of the target number n and the maximum value D of the effective communication distance is larger than the diameter of the area to be sensed, that is, the coverage area of the blockchain network to be constructed at this time is larger than the area of the area to be sensed. In this case, the processor can determine the maximum number of hops of the Kautz graph to be constructed based on the area A and the target number n. Among them, the maximum number of hops of the Kautz graph can be expressed as maxhop, and the maximum number of hops can be calculated by maxhop=[Dia / n]-1.
[0046] When the maximum number of hops of the Kautz graph to be constructed is determined, the processor can determine the degree of each node in the Kautz graph to be constructed according to the maximum number of hops and the target number n. Specifically, the equation n=g can be constructed. maxhop +g maxhop-1 , where g may refer to the degree of each node in the Kautz graph, and maxhop may refer to the maximum number of hops. The degree of each node in the Kautz graph to be constructed may be calculated by solving the above equation. After calculating the degree of each node, the processor may construct a corresponding Kautz graph according to the degree of each node and the maximum number of hops of the Kautz graph.
[0047] In one embodiment, the method further includes: after constructing a corresponding Kautz graph according to the maximum number of hops and the degree, generating a corresponding Kautz assignment sequence through the constructed Kautz graph; for each blockchain node, randomly selecting a value from the assignment sequence to assign a value to the blockchain node to determine the first code of each blockchain node, and deleting the selected value from the assignment sequence; when all blockchain nodes have been assigned, each blockchain node determines the second code of the neighbor node according to its own code and the constructed Kautz graph, and broadcasts the code of the neighbor node; when the blockchain node encoded as the second code receives the broadcast, a connection is established with the blockchain node that broadcasts to determine the neighbor relationship.
[0048] After constructing the corresponding Kautz graph according to the maximum hop count and the degree, the processor can generate the corresponding Kautz assignment sequence through the constructed Kautz graph. The Kautz assignment sequence can be expressed as {k1, k2, k3…, k n}. For each blockchain node, the processor can randomly select a value from the assignment sequence to assign the blockchain node to determine the first code of each blockchain node, and delete the selected value from the assignment sequence. Among them, deleting the selected value from the assignment sequence can prevent repeated assignment. When all blockchain nodes are assigned, each blockchain node determines the second code of the neighbor node based on its own code and the constructed Kautz graph, and broadcasts the code of the neighbor node. When the blockchain node encoded with the second code receives the broadcast, the processor can establish a connection with the blockchain node that broadcasts to determine the neighbor relationship. At this point, it can be considered that the blockchain communication network structure based on the Kautz graph has been constructed.
[0049] After constructing a blockchain communication network based on a Kautz graph, the processor may determine a plurality of blockchain nodes generated according to the Kautz graph. When the plurality of blockchain nodes generated according to the Kautz graph is determined, the processor may sense the target through each blockchain node to obtain a sensed value of each blockchain node. The sensed value of each blockchain node may be represented by Z.
[0050] When the perception value of each blockchain node is obtained, the processor can construct a message body for each blockchain node according to its own perception value and the number of message forwarding. Specifically, in one embodiment, for each blockchain node, the blockchain node constructs a message body according to its own perception value and the number of message forwarding, including: for each blockchain node, the blockchain node randomly generates a corresponding Kautz sequence through a Kautz graph; the blockchain node constructs a corresponding consensus message body according to its own perception value, the number of message forwarding, the round value of the message body, and the Kautz sequence.
[0051] For each blockchain node, it can be preset that each blockchain node perceives the target, and the perception value obtained is Z. In order to ensure absolute randomness, the blockchain node can randomly generate the corresponding Kautz sequence through the Kautz graph. When the Kautz sequence is generated, the blockchain node can construct the corresponding consensus message body according to its own perception value, the number of message forwarding, the round value of the message body, and the Kautz sequence. The consensus message body can be obtained through cMsg=<round,Z,TTL=d> Build. Among them, round can refer to the round value of the message body, and TTL can refer to the number of message forwardings.
[0052] When the message body is constructed, the processor can determine the neighbor nodes of each blockchain node according to the Kautz graph, and send the message body to the neighbor nodes. Specifically, in one embodiment, determining the neighbor nodes of each blockchain node according to the Kautz graph, and sending the message body to the neighbor nodes includes: determining the neighbor nodes of each blockchain node according to the Kautz graph; determining the neighbor node with the highest delivery success rate among the neighbor nodes according to the greedy algorithm as the target neighbor node; and sending the message body to the target neighbor node.
[0053] The processor can determine the neighbor nodes of each blockchain node according to the Kautz graph. The processor can determine the neighbor node with the highest delivery success rate among the neighbor nodes according to the greedy algorithm as the target neighbor node. The greedy algorithm can refer to always making the best choice at the moment when solving a problem, not considering the overall optimal solution, but seeking a local optimal solution in a certain sense. That is, each blockchain node can use the Kautz sequence randomly generated from the Kautz graph by each blockchain node as the target neighbor node for message routing. When the target neighbor node is determined, the processor can send the message body to the target neighbor node.
[0054] After the target neighbor node receives the message body, the processor may reduce the message forwarding number contained in the message body by a preset value to obtain an updated message forwarding number. The preset value may be 1, that is, TTL-1 may be subtracted to obtain an updated message forwarding number. When the updated message forwarding number is greater than a preset threshold, the neighbor node may forward the message body to the neighbor node of the neighbor node. The preset threshold may be set to 0.
[0055] Specifically, Figure 3As shown, it is a message propagation process of a blockchain node based on a Kautz graph. Among them, the Kautz graph may include blockchain node 01, blockchain node 02, blockchain node 10, blockchain node 12, blockchain node 20, and blockchain node 21. According to the Kautz graph, the neighbor nodes of each blockchain node are determined. For example, the neighbor node of blockchain node 21 can be a blockchain node or a blockchain node 12. When the processor determines that the neighbor node with the highest delivery success rate among the neighbor nodes is blockchain node 12 according to the greedy algorithm, blockchain node 12 can be used as the target neighbor node, and the processor sends the message body to blockchain node 12. After blockchain node 12 receives the message body, the processor can reduce the number of message forwardings contained in the message body by a preset value to obtain an updated number of message forwardings. When the updated number of message forwardings is greater than zero, blockchain node 12 can forward the message body to the neighbor nodes of blockchain node 12. Further, for blockchain node 20, when it is determined that the neighbor nodes of blockchain node 20 are blockchain node 01 and blockchain node 02, the processor can determine the neighbor node with the highest delivery success rate among the neighbor nodes according to the greedy algorithm. If the blockchain node 02 has the highest delivery success rate, the blockchain node 02 can be used as the target neighbor node. The processor can continue to send the message body to the blockchain node 02. After the blockchain node 02 receives the message body, the processor can reduce the message forwarding number contained in the message body by one to obtain the updated message forwarding number. When the updated message forwarding number is greater than zero, the blockchain node 02 can continue to forward the message body to its neighbor nodes. The message propagation of other blockchain nodes in the Kautz diagram is similar to the above propagation method, which will not be repeated here.
[0056] When the number of message forwarding is less than or equal to a preset threshold, the processor can stop forwarding the message body. That is, when the number of message forwarding is less than or equal to zero, the processor can stop forwarding the message body. Through the exchange of information between the above blockchain nodes, all message propagation of blockchain nodes can be achieved, improving perception efficiency.
[0057] In one embodiment, the method also includes: when the number of updated message forwardings is greater than a preset threshold, the neighbor node records the round value contained in the consensus message body; when the number of times any blockchain node records the round value exceeds a preset number, the blockchain node broadcasts the routing process for the round value to all blockchain nodes; all blockchain nodes review the routing process; when determining whether the transmission path of the route is consistent with the routing process, determine the blockchain node that broadcasts the routing process as the accounting node for the round value; write the routing process for all blockchain nodes where the round value is located into the local ledger through the accounting node, and broadcast all the routing processes to all blockchain nodes.
[0058] The preset threshold can be set to 0. When the number of updated message forwarding is greater than the preset threshold, the neighbor node can record the round value contained in the consensus message body. Each neighbor node continuously checks and records the round value contained in the consensus message body. When the number of times any blockchain node records the round value exceeds the preset number, the blockchain node broadcasts the routing process for the round value to all blockchain nodes. In one embodiment, the preset number is half of the number of all blockchain nodes. That is, the preset number can be (g maxhop +g maxhop -1 ) / 2. After the blockchain node broadcasts the routing process for the round value to all blockchain nodes, all blockchain nodes can review the routing process, that is, check whether the transmission path of the routing is consistent with the routing process of the blockchain node for the round value contained in the consensus message body. In the case of determining whether the transmission path of the routing is consistent with the routing process, the processor can determine that the blockchain node that broadcasts the routing process is the accounting node of the round value. In the case that the blockchain node that broadcasts the routing process is the accounting node of the round value, the processor can write the routing process for all blockchain nodes where the round value is located into the local ledger through the accounting node, and broadcast all the routing processes to all blockchain nodes.
[0059] In one embodiment, the method further includes: after broadcasting the entire routing process to all blockchain nodes, the numerical value of the round value is incremented, and the target is perceived again through each blockchain node to obtain the perceived value of each blockchain node. After broadcasting the entire routing process to all blockchain nodes, the processor may increment the numerical value of the round value, and the incremented numerical value may be 1, that is, the round value may be increased by one. Simply, it can be represented by round=round+1. After the numerical value of the round value is incremented, the next round of perception may be started, that is, the target may be perceived again through each blockchain node to obtain the perceived value of each blockchain node.
[0060] Through the above technical solution, the underlying communication network can be quickly constructed, and under the premise of ensuring the consistency of the degree of each blockchain node, the information exchange of the underlying blockchain is more efficient. At the same time, the fast routing mechanism of the Kautz graph can quickly select accounting nodes with strong randomness, further improving the efficiency of perception. In addition, the topological structure of the blockchain node is designed using the Kautz graph, so that the blockchain nodes can achieve the maximum regional coverage under high-density connection, and improve the accuracy of perception to a certain extent.
[0061] Figure 1 FIG. 1 is a flow chart of a blockchain group collaborative perception method in one embodiment. It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0062] The processor contains a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the blockchain group collaborative perception method can be realized by adjusting the kernel parameters.
[0063] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0064] An embodiment of the present application provides a storage medium on which a program is stored, and when the program is executed by a processor, the above-mentioned blockchain group collaborative perception method is implemented.
[0065] An embodiment of the present application provides a processor, which is used to run a program, wherein the above-mentioned blockchain group collaborative perception method is executed when the program is running.
[0066] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 4As shown. The computer device includes a processor A01, a network interface A02, a memory (not shown in the figure) and a database (not shown in the figure) connected via a system bus. Among them, the processor A01 of the computer device is used to provide computing and control capabilities. The memory of the computer device includes an internal memory A03 and a non-volatile storage medium A04. The non-volatile storage medium A04 stores an operating system B01, a computer program B02 and a database (not shown in the figure). The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 in the non-volatile storage medium A04. The database of the computer device is used to store perception values and message forwarding quantities. The network interface A02 of the computer device is used to communicate with an external terminal through a network connection. When the computer program B02 is executed by the processor A01, a blockchain group collaborative perception method is implemented.
[0067] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0068] An embodiment of the present application provides a device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the following steps are implemented: constructing a blockchain communication network based on a Kautz graph; determining multiple blockchain nodes generated according to the Kautz graph; perceiving a target through each blockchain node to obtain a perception value of each blockchain node; for each blockchain node, the blockchain node constructs a message body according to its own perception value and the number of message forwardings; determining the neighbor nodes of each blockchain node according to the Kautz graph, and sending the message body to the neighbor nodes; after receiving the message body, the neighbor nodes reduce the number of message forwardings contained in the message body by a preset value to obtain an updated number of message forwardings; when the updated number of message forwardings is greater than a preset threshold, the neighbor nodes forward the message body to the neighbor nodes of the neighbor nodes; and stopping forwarding the message body until the number of message forwardings is less than or equal to the preset threshold.
[0069] In one embodiment, determining the neighbor nodes of each blockchain node according to the Kautz graph, and sending the message body to the neighbor nodes includes: determining the neighbor nodes of each blockchain node according to the Kautz graph; determining the neighbor node with the highest delivery success rate among the neighbor nodes according to the greedy algorithm as the target neighbor node; and sending the message body to the target neighbor node.
[0070] In one embodiment, for each blockchain node, the blockchain node constructs a message body according to its own perception value and message forwarding quantity, including: for each blockchain node, the blockchain node randomly generates a corresponding Kautz sequence through a Kautz graph; the blockchain node constructs a corresponding consensus message body according to its own perception value, message forwarding quantity, round value of the message body and Kautz sequence.
[0071] In one embodiment, the method also includes: when the number of updated message forwardings is greater than a preset threshold, the neighbor node records the round value contained in the consensus message body; when the number of times any blockchain node records the round value exceeds a preset number, the blockchain node broadcasts the routing process for the round value to all blockchain nodes; all blockchain nodes review the routing process; when determining whether the transmission path of the route is consistent with the routing process, determine the blockchain node that broadcasts the routing process as the accounting node for the round value; write the routing process for all blockchain nodes where the round value is located into the local ledger through the accounting node, and broadcast all the routing processes to all blockchain nodes.
[0072] In one embodiment, the method further includes: after broadcasting the entire routing process to all blockchain nodes, the numerical value of the round value is incremented, and the target is perceived again through each blockchain node to obtain the perception value of each blockchain node.
[0073] In one embodiment, the preset number is half of the number of all blockchain nodes.
[0074] In one embodiment, constructing a blockchain communication network based on a Kautz graph includes: determining a target number of blockchain nodes of a blockchain network to be constructed, an area of an area to be sensed, and a maximum value of an effective communication distance between blockchain nodes; determining a coverage area of the blockchain network to be constructed according to the target number and the maximum value of the effective communication distance; when it is determined that the coverage area is greater than the area of the area, determining a maximum number of hops of the Kautz graph to be constructed according to the area and the target number; determining the degree of each node in the Kautz graph to be constructed according to the maximum number of hops and the target number; and constructing a corresponding Kautz graph according to the maximum number of hops and the degree.
[0075] In one embodiment, the method further includes: after constructing a corresponding Kautz graph according to the maximum number of hops and the degree, generating a corresponding Kautz assignment sequence through the constructed Kautz graph; for each blockchain node, randomly selecting a value from the assignment sequence to assign a value to the blockchain node to determine the first code of each blockchain node, and deleting the selected value from the assignment sequence; when all blockchain nodes have been assigned, each blockchain node determines the second code of the neighbor node according to its own code and the constructed Kautz graph, and broadcasts the code of the neighbor node; when the blockchain node encoded as the second code receives the broadcast, a connection is established with the blockchain node that broadcasts to determine the neighbor relationship.
[0076] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that initializes the following method steps: constructing a blockchain communication network based on a Kautz graph; determining multiple blockchain nodes generated according to the Kautz graph; perceiving a target through each blockchain node to obtain a perception value of each blockchain node; for each blockchain node, the blockchain node constructs a message body according to its own perception value and the number of message forwardings; determining the neighbor nodes of each blockchain node according to the Kautz graph, and sending the message body to the neighbor nodes; after receiving the message body, the neighbor nodes reduce the number of message forwardings contained in the message body by a preset value to obtain an updated number of message forwardings; when the updated number of message forwardings is greater than a preset threshold, the neighbor nodes forward the message body to the neighbor nodes of the neighbor nodes; and stop forwarding the message body until the number of message forwardings is less than or equal to the preset threshold.
[0077] In one embodiment, determining the neighbor nodes of each blockchain node according to the Kautz graph, and sending the message body to the neighbor nodes includes: determining the neighbor nodes of each blockchain node according to the Kautz graph; determining the neighbor node with the highest delivery success rate among the neighbor nodes according to the greedy algorithm as the target neighbor node; and sending the message body to the target neighbor node.
[0078] In one embodiment, for each blockchain node, the blockchain node constructs a message body according to its own perception value and message forwarding quantity, including: for each blockchain node, the blockchain node randomly generates a corresponding Kautz sequence through a Kautz graph; the blockchain node constructs a corresponding consensus message body according to its own perception value, message forwarding quantity, round value of the message body and Kautz sequence.
[0079] In one embodiment, the method also includes: when the number of updated message forwardings is greater than a preset threshold, the neighbor node records the round value contained in the consensus message body; when the number of times any blockchain node records the round value exceeds a preset number, the blockchain node broadcasts the routing process for the round value to all blockchain nodes; all blockchain nodes review the routing process; when determining whether the transmission path of the route is consistent with the routing process, determine the blockchain node that broadcasts the routing process as the accounting node for the round value; write the routing process for all blockchain nodes where the round value is located into the local ledger through the accounting node, and broadcast all the routing processes to all blockchain nodes.
[0080] In one embodiment, the method further includes: after broadcasting the entire routing process to all blockchain nodes, the numerical value of the round value is incremented, and the target is perceived again through each blockchain node to obtain the perception value of each blockchain node.
[0081] In one embodiment, the preset number is half of the number of all blockchain nodes.
[0082] In one embodiment, constructing a blockchain communication network based on a Kautz graph includes: determining a target number of blockchain nodes of a blockchain network to be constructed, an area of an area to be sensed, and a maximum value of an effective communication distance between blockchain nodes; determining a coverage area of the blockchain network to be constructed according to the target number and the maximum value of the effective communication distance; when it is determined that the coverage area is greater than the area of the area, determining a maximum number of hops of the Kautz graph to be constructed according to the area and the target number; determining the degree of each node in the Kautz graph to be constructed according to the maximum number of hops and the target number; and constructing a corresponding Kautz graph according to the maximum number of hops and the degree.
[0083] In one embodiment, the method further includes: after constructing a corresponding Kautz graph according to the maximum number of hops and the degree, generating a corresponding Kautz assignment sequence through the constructed Kautz graph; for each blockchain node, randomly selecting a value from the assignment sequence to assign a value to the blockchain node to determine the first code of each blockchain node, and deleting the selected value from the assignment sequence; when all blockchain nodes have been assigned, each blockchain node determines the second code of the neighbor node according to its own code and the constructed Kautz graph, and broadcasts the code of the neighbor node; when the blockchain node encoded as the second code receives the broadcast, a connection is established with the blockchain node that broadcasts to determine the neighbor relationship.
[0084] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0085] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0086] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0087] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0088] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0089] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0090] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0091] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0092] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A blockchain group collaborative perception method, characterized in that: The method comprises: Build a blockchain communication network based on Kautz graph; Determine a plurality of blockchain nodes generated according to the Kautz graph; The target is sensed by each blockchain node to obtain the perception value of each blockchain node; For each blockchain node, the blockchain node constructs a message body according to its own perception value and message forwarding quantity; Determine the neighbor nodes of each blockchain node according to the Kautz graph, and send the message body to the neighbor nodes; After receiving the message body, the neighbor node reduces the message forwarding quantity contained in the message body by a preset value to obtain an updated message forwarding quantity; When the updated message forwarding quantity is greater than a preset threshold, the neighbor node forwards the message body to a neighbor node of the neighbor node; Until the number of message forwardings is less than or equal to the preset threshold, stop forwarding the message body.
2. The method according to claim 1, characterized in that Determining the neighbor nodes of each blockchain node according to the Kautz graph and sending the message body to the neighbor nodes includes: Determine the neighbor nodes of each blockchain node according to the Kautz graph; Determine, according to a greedy algorithm, a neighbor node with the highest delivery success rate among the neighbor nodes as a target neighbor node; The message body is sent to the target neighbor node.
3. The method according to claim 1, characterized in that For each blockchain node, the blockchain node constructs a message body according to its own perception value and message forwarding quantity, including: For each blockchain node, the blockchain node randomly generates a corresponding Kautz sequence through the Kautz graph; The blockchain node constructs a corresponding consensus message body according to its own perception value, the number of message forwardings, the round value of the message body and the Kautz sequence.
4. The method according to claim 3, characterized in that The method further comprises: When the updated message forwarding number is greater than a preset threshold, the neighbor node records the round value contained in the consensus message body; When the number of times any blockchain node records the round value exceeds a preset number, the blockchain node broadcasts the routing process for the round value to all blockchain nodes; All blockchain nodes review the routing process; In the case of determining whether the transmission path of the route is consistent with the routing process, determining the blockchain node that broadcasts the routing process as the accounting node of the round value; The accounting node writes the routing process for all blockchain nodes where the round value is located into the local account book, and broadcasts the entire routing process to all blockchain nodes.
5. The method according to claim 4, characterized in that The method further comprises: After the entire routing process is broadcast to all blockchain nodes, the round value is incremented, and the target is sensed again through each blockchain node to obtain the perception value of each blockchain node.
6. The method according to claim 4, characterized in that The preset number is half of the number of all blockchain nodes.
7. The method according to claim 1, characterized in that The construction of a blockchain communication network based on a Kautz graph includes: Determine the target number of blockchain nodes of the blockchain network to be constructed, the area of the area to be sensed, and the maximum value of the effective communication distance between the blockchain nodes; Determining the coverage area of the blockchain network to be constructed according to the maximum value of the target number and the effective communication distance; In the case where it is determined that the coverage area is greater than the area of the region, determining a maximum number of hops of a Kautz graph to be constructed according to the area of the region and the target number; Determining the degree of each node in the Kautz graph to be constructed according to the maximum number of hops and the target number; A corresponding Kautz graph is constructed according to the maximum number of hops and the degree.
8. The method according to claim 7, characterized in that The method further comprises: After constructing a corresponding Kautz graph according to the maximum number of hops and the degree, generating a corresponding Kautz assignment sequence through the constructed Kautz graph; For each blockchain node, randomly select a value from the assignment sequence to assign a value to the blockchain node to determine a first code of each blockchain node, and delete the selected value from the assignment sequence; When all blockchain nodes have been assigned values, each blockchain node determines the second code of the neighbor node based on its own code and the constructed Kautz graph, and broadcasts the code of the neighbor node; When the blockchain node encoded with the second code receives the broadcast, a connection is established with the blockchain node that broadcasts to determine the neighbor relationship.
9. A processor, characterized in that: It is configured to execute the blockchain group collaborative perception method according to any one of claims 1 to 8.
10. A machine-readable storage medium having instructions stored thereon, characterized in that: When the instruction is executed by a processor, the processor is configured to perform the blockchain group collaborative perception method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Wireless sensor and actuator network reliable efficient routing method
CN107484220A
Network message transmission method and device based on block chain and electronic equipment
CN111711567A