WO2019140555A1 - Blockchain construction method and blockchain node - Google Patents
Blockchain construction method and blockchain node Download PDFInfo
- Publication number
- WO2019140555A1 WO2019140555A1 PCT/CN2018/072885 CN2018072885W WO2019140555A1 WO 2019140555 A1 WO2019140555 A1 WO 2019140555A1 CN 2018072885 W CN2018072885 W CN 2018072885W WO 2019140555 A1 WO2019140555 A1 WO 2019140555A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- blockchain
- node
- transaction message
- block
- blockchain network
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/40—Network security protocols
Definitions
- the present application relates to the field of storage, and in particular, to a blockchain construction method and a blockchain node.
- blockchains can be used to record transaction data.
- the transaction data is organized into blocks in order, and the plurality of blocks may constitute a blockchain.
- Data uses distributed and chained storage mechanisms in the blockchain to achieve tamper-proof purposes. The more distributed the data is, the more resistant the blockchain network is to attacks.
- the blockchain is stored in the blockchain node, and the plurality of blockchain nodes may constitute a blockchain network.
- the accounting node (that is, the node that constructs the block) is determined by a certain consensus mechanism to ensure that the malicious node does not always obtain the accounting right, and the security of the blockchain network is largely guaranteed.
- all the blockchain nodes can determine the blockchain node that is the first to calculate Nonce (number used once) as the accounting node by the proof of work (POW).
- the block constructed by the accounting node is valid, that is, only the block constructed by the accounting node can be added to the blockchain, that is, the accounting node has the right to write data in the blockchain.
- the Internet of Things can store transaction data via a blockchain network.
- the POW algorithm calculates the Nonce as a process that consumes a lot of computing resources.
- the embodiment of the invention provides a blockchain construction method and a blockchain node, which can improve the distribution of the blockchain network, thereby improving the anti-attack capability of the blockchain network.
- a blockchain construction method including: a first blockchain node in a blockchain network acquires a transaction message sent by a device; the transaction message carries device information of the device; the device does not belong to The blockchain network; when the first block chain node determines that the transaction message has been added to the blockchain in the blockchain network, sends an acknowledgement message to the device, and the acknowledgement message is used to indicate that the transaction message has been added to the blockchain network.
- Blockchain a first blockchain node in a blockchain network acquires a transaction message sent by a device; the transaction message carries device information of the device; the device does not belong to The blockchain network; when the first block chain node determines that the transaction message has been added to the blockchain in the blockchain network, sends an acknowledgement message to the device, and the acknowledgement message is used to indicate that the transaction message has been added to the blockchain network.
- a first blockchain node (which may be a billing node) in a blockchain network acquires a transaction message sent by a device, where the transaction message includes device information, and then, each blockchain node A block is constructed based on the collected transaction data, and the block constructed by the accounting node therein can be added to the blockchain.
- the first blockchain node may also notify the device that the transaction message has been added to the blockchain of the blockchain network by using an acknowledgement message, and the device information of the device is not easily falsified, and the device may be considered to be trusted.
- the first block chain node acquiring the transaction message sent by the device includes: receiving the transaction message sent by the device; or receiving the second in the blockchain network The transaction message forwarded by the blockchain node.
- the transaction message obtained by the first blockchain may be directly sent by the device, or may be forwarded by other blockchain nodes.
- the first blockchain node determines that the transaction message has been added to the block in the blockchain network
- the chain specifically includes: the first block chain node constructs a first block including a transaction message, and determines that the first block is added to a blockchain of the blockchain network; or the first block chain node determines the blockchain
- the second block constructed by the other blockchain nodes except the first blockchain node in the network is added to a blockchain of the blockchain network; the second block contains the transaction message.
- the first blockchain node may be a billing node, and the transaction message is stored in the block packed by the first blockchain node.
- the first blockchain node may not be a billing node.
- the first blockchain node can ultimately determine which blockchain node the transaction message is stored in.
- the transaction message further includes authentication data for authenticating the device, the authentication data including At least one excitation signal, a response result corresponding to each of the at least one excitation signal, or a hash value of a response result corresponding to each of the at least one excitation signal.
- the authentication data may be stored in the block packed by the accounting node, so that the device authentication data is persistently written into the blockchain.
- the device can be authenticated according to the authentication data to ensure the security of the blockchain network.
- the method further includes: the first incentive sent by the first blockchain node to the authentication device a signal, a first response result corresponding to the first excitation signal or a first hash value, so that the authentication device sends the first excitation signal to the device and determines whether the response result sent by the device to the authentication device is the first response result or the first A hash value.
- the first hash value is a hash value calculated according to the first response result.
- the transaction message further includes: attribute information of the device, where the attribute information includes credit information of the device, Credit information is used to indicate the level of trust of the device.
- the method further includes: receiving, by the first blockchain node, the device a second transaction message, the second transaction message carrying the second device information of the device; determining that the first device information in the blockchain network has been updated to the second device information, sending a second confirmation to the device And a second confirmation message is used to indicate that the first device information in the blockchain network has been updated to the second device information.
- a blockchain node is disclosed.
- the blockchain node is a first blockchain node, and includes: an acquiring unit, configured to acquire a transaction message sent by the device; the transaction message carries device information of the device; the device does not belong to a blockchain network; a processing unit, configured to determine, by the processing unit, that the transaction message acquired by the acquiring unit has been added to the blockchain in the blockchain network; and the sending unit, configured to determine, in the processing unit, that the transaction message has been added to the zone in the blockchain network After the blockchain, an acknowledgment message is sent to the device to indicate that the transaction message has been added to the blockchain in the blockchain network.
- the acquiring unit is specifically configured to: receive the transaction message sent by the device; or receive the transaction forwarded by the second blockchain node in the blockchain network Message.
- the processing unit is specifically configured to: construct a first block that includes a transaction message, determine A block is added to a blockchain of the blockchain network; or, a second block constructed by determining other blockchain nodes other than the first blockchain node in the blockchain network is added to the blockchain network In a blockchain; the second block contains transaction messages.
- the transaction message further includes authentication data for authenticating the device, the authentication data including at least one An excitation signal, a response result corresponding to each of the at least one excitation signal, or a hash value of a response result corresponding to each of the at least one excitation signal.
- the hash value corresponding to the excitation signal is a hash value calculated according to the response corresponding to the excitation signal.
- the sending unit is further configured to: send, to the authentication device, the first The first response result or the first hash value corresponding to the excitation signal, so that the authentication device sends the first excitation signal to the device and determines whether the response result sent by the device to the authentication device is the first response result or the first hash value.
- the transaction message further includes: attribute information of the device, where the attribute information includes credit information of the device, Credit information is used to indicate the level of trust of the device.
- a computer readable storage medium having stored therein instructions; when it is run on a device as described in the second aspect above and any of its possible implementations, The apparatus performs a blockchain construction method as described in the second aspect above and its various possible implementations.
- the acquiring unit is further configured to acquire, by using the second transaction message that is sent by the device, The second transaction message carries the second device information of the device; the processing unit is further configured to: determine that the first device information has been updated to the second device information; the sending unit is further configured to send the second confirmation message to the device, The second confirmation message is used to indicate that the first device information in the blockchain network has been updated to the second device information.
- Figure 1 is a schematic diagram of a blockchain network and an Internet of Things
- FIG. 2 is a schematic structural diagram of a blockchain node according to an embodiment of the present invention.
- FIG. 3 is a schematic flowchart diagram of a method for constructing a blockchain according to an embodiment of the present invention
- FIG. 4 is a schematic diagram of a consensus algorithm according to an embodiment of the present invention.
- FIG. 5 is a schematic flowchart of a method for updating device information according to an embodiment of the present disclosure
- FIG. 6 is another schematic flowchart of a method for constructing a blockchain according to an embodiment of the present invention.
- FIG. 7 is another schematic flowchart of a method for constructing a blockchain according to an embodiment of the present invention.
- FIG. 8 is another schematic structural diagram of a blockchain node according to an embodiment of the present disclosure.
- FIG. 9 is another schematic structural diagram of a blockchain node according to an embodiment of the present invention.
- the Internet of Things is a network that extends and expands on the Internet to enable communication between items and items.
- the Internet of Things can store transaction data via a blockchain network.
- the blockchain network includes a communication node and a blockchain node, wherein the communication node is a device having only a communication function, such as forwarding information, and the blockchain node is a device having a communication function and a storage function, such as storing a blockchain.
- a blockchain can also be thought of as a database, for example: it can be used to store transaction data.
- the blockchain network adopts a distributed storage mechanism to improve its ability to resist attacks.
- the same data is stored in the block of the blockchain stored in at least two blockchain nodes.
- the malicious node needs to tamper with all the blocks storing the data, and also needs to The subsequent blocks of the block in the blockchain have been tampered with, which is difficult. In this way, the ability of the blockchain network to resist attacks is improved.
- the blockchain node in the blockchain network can determine the blockchain node that first calculated Nonce as the accounting node by using the POW comparison power.
- the blockchain node collects transaction data and builds blocks based on the collected transaction data.
- a block consists of a block header and a block body.
- the size of the block header is 80 bytes, including the 4-byte version number, the 32-byte hash value of the previous block, and the 32-byte Merkel Root Hash.
- the block body consists of a list of transactions. Table 1 shows an implementation possibility of the block.
- the structure of the block is not limited to the one shown in Table 1, and the values of the respective structures are not limited to those shown in Table 1.
- the blockchain node After the transaction data size collected by the blockchain node reaches the limit, the blockchain node starts to calculate the Merkel root hash value in the block header according to the collected transaction data.
- the collected transaction data constitutes a block.
- the blockchain node constructs the block
- the hash value is calculated according to the constructed block header, and the hash value is continuously calculated by continuously adjusting the random number in the block header until the hash value satisfying the target difficulty is calculated.
- the constructed block is then broadcast to other blockchain nodes in the blockchain network.
- the blockchain node that calculates the hash value that satisfies the target difficulty is determined as the accounting node.
- the embodiment of the present invention provides a blockchain construction method and a blockchain node.
- the first blockchain node (which may be a billing node) in the blockchain network acquires a transaction message sent by the device, and the transaction message includes the device. Information, then, each blockchain node constructs a block based on the collected transaction data, and the block constructed by the accounting node can be added to the blockchain.
- the first blockchain node may also notify the device that the transaction message has been added to the blockchain of the blockchain network by using an acknowledgement message, and the device information of the device is not easily falsified, and the device may be considered to be trusted.
- the blockchain construction method provided by the embodiment of the present invention can be applied to the blockchain node shown in FIG. 2, and the blockchain node can be a blockchain node in the system shown in FIG. As shown in FIG. 2, the blockchain node may include at least one processor 11, a memory 12, a transceiver 13, and a communication bus 14.
- the processor 11 is a control center of the block chain node, and may be a processor or a collective name of a plurality of processing elements.
- the processor 11 is a central processing unit (CPU), may be an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.
- CPU central processing unit
- ASIC Application Specific Integrated Circuit
- DSPs digital signal processors
- FPGAs Field Programmable Gate Arrays
- the processor 11 can perform various functions of the blockchain node by running or executing a software program stored in the memory 12 and calling data stored in the memory 12.
- processor 11 may include one or more CPUs, such as CPU0 and CPU1 shown in FIG.
- the blockchain node may include multiple processors, such as processor 11 and processor 15 shown in FIG. Each of these processors can be a single core processor (CPU) or a multi-core processor (multi-CPU).
- processors herein may refer to one or more blockchain nodes, circuits, and/or processing cores for processing data, such as computer program instructions.
- the memory 12 can be a read-only memory (ROM) or other type of static blockchain node that can store static information and instructions, a random access memory (RAM) or can store information and instructions.
- Other types of dynamic blockchain nodes may also be Electrically Erasable Programmable Read-Only Memory (EEPROM), Compact Disc Read-Only Memory (CD-ROM) or other optical discs. Storage, optical storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), disk storage media or other magnetic blockchain nodes, or capable of carrying or storing desired programs in the form of instructions or data structures Code and any other medium that can be accessed by a computer, but is not limited thereto.
- the memory 12 can be stand-alone and connected to the processor 11 via a communication bus 14.
- the memory 12 can also be integrated with the processor 11.
- the memory 12 is used to store a software program that executes the solution of the present invention, and is controlled by the processor 11.
- the transceiver 13 uses devices such as any transceiver for communication with other nodes in the system of Fig. 1, such as communication nodes or blockchain nodes in FIG. It can also be used to communicate with a communication network, such as Ethernet, radio access network (RAN), Wireless Local Area Networks (WLAN), and the like.
- the transceiver 13 may include an acquisition unit that implements a receiving function, and a transmitting unit that implements a transmitting function.
- the communication bus 14 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus.
- ISA Industry Standard Architecture
- PCI Peripheral Component
- EISA Extended Industry Standard Architecture
- the bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in Figure 2, but it does not mean that there is only one bus or one type of bus.
- the blockchain node structure shown in FIG. 2 does not constitute a definition of a blockchain node, and may include more or fewer components than those illustrated, or some components may be combined, or different component arrangements.
- An embodiment of the present invention provides a method for constructing a blockchain. As shown in FIG. 3, the method includes the following steps:
- the device sends a transaction message to a node in the blockchain network, where the transaction message includes device information of the device.
- the node may be a communication node or a blockchain node in a blockchain network.
- the node may be a communication node or a blockchain node in a blockchain network.
- the second blockchain node in FIG. 3 of the embodiment of the present invention is shown in FIG. 3 of the embodiment of the present invention.
- FIG. 3 only shows the case where the device sends a transaction message to the blockchain node, and the device can also send the transaction message to the communication node, which is not limited in this embodiment of the present invention.
- the device may be an Internet of Things device.
- the device information may include identification and/or information of each device of the device, such as: identification of the CPU, operation speed, manufacturer, etc.; identification, size, manufacturer, etc. of the memory.
- the identifier of the device device may be determined according to relevant standards; the format of the identifier may also be defined, and the identifier of the device may be generated according to the defined format.
- the node forwards the transaction message to other nodes in the blockchain network.
- any node (blockchain node or communication node) in the blockchain network broadcasts the transaction message after receiving the transaction message, and ensures each blockchain node in the blockchain network as much as possible. All transaction messages from the device can be obtained.
- the first blockchain node may receive the broadcast of the node (such as the second blockchain node in FIG. 3). Trading news.
- the first blockchain node can also receive the transaction message broadcast by any one of the communication nodes in the blockchain network.
- the blockchain node or the communication node receives the transaction message from the device, the received transaction message will be broadcast to other nodes in the blockchain network, and each node in the final blockchain network will receive. To the transaction message from the device.
- the blockchain node collects transaction data, and constructs a block according to the collected transaction data and transaction message.
- the first blockchain node described in the embodiment of the present invention continuously collects transaction data of the device to construct respective blocks.
- the block constructed by the blockchain node includes a block header and a block body.
- the blockchain node calculates the Merkel tree hash value based on the collected transaction data.
- the block header is constructed according to the obtained Merkel tree hash value, version number, hash value of the previous block, time suffix (current time), current difficulty value, and a random number.
- a block body is constructed based on the collected transaction data.
- Each blockchain node in the blockchain network implements a consensus algorithm after constructing its own block.
- the so-called consensus algorithm refers to which block constructed by the specific node is finally written to the blockchain as an effective block, and all blockchain nodes need to form a consensus. The following two steps are included in the consensus algorithm:
- the blockchain node calculates a hash value according to the block header of the block that it constructs.
- the blockchain node can continuously calculate the hash value by continuously adjusting the random number in the block header.
- the blockchain node determines that the calculated hash value satisfies the target difficulty, and broadcasts the block constructed by itself to other blockchain nodes in the blockchain network.
- the blockchain node continuously calculates the hash value until a hash value that satisfies the target difficulty is calculated.
- the hash value satisfying the target difficulty is zero for the first n bits and N bits for the length.
- the hash value calculated by the first block chain node is smaller than the target difficulty value, it is considered to be calculated.
- the hash value satisfies the target difficulty.
- the target difficulty value is 0000011.
- the first block chain node calculates a 7-bit binary value of 0 in the first 5 bits and is less than 0000011, it is considered that the first block chain node calculates a hash value that satisfies the target difficulty.
- the block constructed by itself is broadcasted to other blockchain nodes in the blockchain network.
- the blockchain node that first calculates the hash value satisfying the target difficulty is finally determined as the accounting node, and the block constructed by the further accounting node is recorded as the effective area.
- the transaction message is received by the blockchain node, and then the device information is packaged into the block by executing the consensus algorithm, thereby writing the block. chain.
- the first blockchain node determines that the block containing the transaction message has been added to the blockchain in the blockchain network.
- a blockchain node cannot determine whether it is a billing node, that is, it cannot be determined whether the block itself is a valid block. Because each blockchain node executes the consensus algorithm independently to calculate the hash value. Only after all the blockchain nodes have sent out the blocks they have built can they determine which blockchain node is the accounting node. In addition, the transaction message has been added to the blockchain in the blockchain network, specifically that the device information in the transaction message is added to the blockchain network.
- the blockchain node A in the blockchain network constructs the block 1, and the blockchain node B constructs the block 2.
- the blockchain node A broadcasts the block 1 to other blockchain nodes in the blockchain network after calculating the hash value satisfying the target difficulty, and the blockchain node B calculates the hash value satisfying the target difficulty.
- Block 2 is broadcast to other blockchain nodes in the blockchain network.
- some blockchain nodes eg, blockchain node C
- receive block 1 subsequent collection of transaction data, construction of new blocks along block 1, and some blockchains.
- the node eg, blockchain node D
- receives block 2 and subsequently collects transaction data to build a new block along block 2.
- the first blockchain node as described in the embodiment of the present invention can determine which block is a valid block by using the following two features, so that the block will be constructed.
- the blockchain node is determined to be a billing node. specifically:
- a block that is likely to be a valid block is determined according to the length of the block chain branch constructed by each block chain node based on the received block.
- the blockchain branch can be regarded as a branch in which a part of a blockchain is connected in series.
- the effective block is the block constructed by the blockchain node that satisfies the target difficulty hash value
- the time of the block chain node broadcasting block is also the earliest, so the block chain constructed based on the effective block is The branch should be the longest.
- the blockchain constructed by the blockchain node C based on the block 1 includes the block 1, the block 11, the block 12, the block 13, the block 14, the block 15, and the block 16;
- the blockchain constructed by the blockchain node D based on the block 2 includes the block 2, the block 21, the block 22, the block 23, and the block 24. Then it can be determined that the branch of block 1 is the longest, and it is initially determined that block 1 may be a valid block.
- verification of 6 blocks can be performed.
- the above process determines that the block 1 is likely to be a valid block, and then the block 1 and the 5 blocks connected in series after the block 1 are verified, that is, the block 11, the block 12, the block 13, and the block 14
- the block 15 performs verification. Once the block 1 and the block 11, the block 12, the block 13, the block 14, and the block 15 pass the verification, it indicates that the block 1 is an effective block.
- the effective block is finally determined.
- the first blockchain node can determine which blockchain node the effective block is after determining the effective block. This valid block is constructed, that is, which block chain node is determined as a billing node.
- the block containing the transaction message is written to the blockchain. Further, the device information is also written into the blockchain. For example, the transaction message in FIG. 4 is written into the block 1, the block 11, the block 12, the block 13, the block 14, the block 15, and the like. The blockchain where it is located.
- the first blockchain node may determine that the first block that is constructed by itself and includes the transaction message is a valid block, and is added to a block of the blockchain network. In the chain.
- the first blockchain node may determine that a second block constructed by other blockchain nodes other than the first blockchain node in the blockchain network is added to the blockchain network.
- the second block contains the transaction message.
- the first blockchain node can confirm that a transaction message from the device has been added to the blockchain of the blockchain network.
- the information contained in the block may be a transaction message of the device, or may be a device information included in the transaction message.
- the invention is not limited. Since distributed consensus and storage are used in the blockchain network, it is ensured that the device information is not easily falsified, and the reliability of the device is high.
- the first blockchain node sends an acknowledgement message to the device, where the acknowledgement message is used to indicate that the transaction message has been added to a blockchain in the blockchain network.
- the device information may be sent as a transaction to a blockchain node in the blockchain network, so that the device information is added to a blockchain of the device blockchain network, which may be the device in the future. Be prepared to join other blockchain networks.
- the device can join some of the simpler blockchain networks of consensus algorithms, participate in the consensus process of these block networks, and also store the blockchains of these blockchain networks, thus improving the blockchain network.
- the distribution also improves the anti-aggression of the blockchain network to a certain extent and improves data security.
- the transaction message in steps 101-105 is the first transaction message in the embodiment of the present invention
- the confirmation message in step 105 is the first confirmation message in the embodiment of the present invention
- steps 101-105 are involved.
- the device information is the first device information of the device.
- the device information may be added to the device blockchain network according to steps 101-105 above.
- the effective blocks of the blockchain node information also increase, and the effective blocks of the blockchain node information can form a blockchain, which is recorded as a device blockchain.
- a device chain can be built for devices of different devices, such as a CPU device chain, a memory device chain, before building a device blockchain.
- the device sends device information (such as CPU information) as a separate transaction message to the blockchain network, and performs the above steps 101-105 to determine the accounting node, which will carry the device information (valid area) Block) writes to the blockchain.
- device information such as CPU information
- the accounting node which will carry the device information (valid area) Block) writes to the blockchain.
- the device information valid area
- the device information can reference the corresponding device blockchain.
- information about the CPU of the device in the device blockchain can refer to the corresponding block in the CPU blockchain where the CPU is located.
- the transaction message may further include attribute information of the device, such as credit information of the device.
- attribute information of the device such as credit information of the device.
- the so-called device credit information is used to indicate the credibility of the device.
- a credit blockchain can be constructed to record and maintain credit information for the device.
- the credit information of the device in the device blockchain can refer to the information in the credit blockchain.
- the credit status of the device may be determined by referring to the credit block chain in which the device is located, or the credit of the device stored in the device blockchain in which the device was previously located may be referred to. The information determines the credit status of the device.
- the information of the malicious node can be notified to all relevant blockchains. And initiate related transactions, which are used to modify the credit information of related devices in the device blockchain, such as: changing the credit information to a low degree of credibility or untrustworthy.
- the device information in the blockchain may also be updated.
- the update method may further include the following steps:
- the device sends a transaction message to a node in a blockchain network, where the transaction message includes device information that is updated by the device.
- the updated device information is the second device information of the device.
- the node may be a communication node or a blockchain node in a blockchain network.
- the second blockchain node in FIG. 5 of the embodiment of the present invention is a communication node or a blockchain node in a blockchain network.
- FIG. 5 only shows the case where the device sends a transaction message to the blockchain node, and the device can also send the transaction message to the communication node, which is not limited in this embodiment of the present invention.
- the node forwards the transaction message to other nodes in the blockchain network.
- any node (blockchain node or communication node) in the blockchain network broadcasts the transaction message after receiving the transaction message, and ensures each blockchain node in the blockchain network as much as possible. All transaction messages from the device can be obtained.
- the first blockchain node may receive the broadcast of the node (such as the second blockchain node in FIG. 5). Trading news.
- the first blockchain node can also receive the transaction message broadcast by any one of the communication nodes in the blockchain network.
- the blockchain node or the communication node receives the transaction message from the device, the received transaction message will be broadcast to other nodes in the blockchain network, and each node in the final blockchain network will receive. To the transaction message from the device.
- the blockchain node performs a consensus algorithm to determine a billing node.
- any blockchain node of the blockchain network transaction data is continuously collected, and blocks are constructed according to the collected transaction data and transaction messages.
- each blockchain node in the blockchain network will also execute a consensus algorithm after determining the respective blocks, and determine the accounting node, which is determined only in the process.
- the billing node may be different from the billing node determined in step 103.
- the block constructed by the further accounting node is recorded as a valid block and can be written into the blockchain, that is, the block containing the device transaction message is added to the blockchain network.
- the accounting node updates the device information in the valid block to the updated device information carried in the transaction message.
- the first device information of the device is added to the valid block, and the accounting node updates the device information in the valid block to the device information in the transaction message described in step 201.
- the first device information in the valid block is updated to the second device information in the transaction message described in step 201.
- the accounting node determined in step 203 may modify the block, so in the process of updating the device information, the device information in the effective block is modified by the accounting node.
- the first blockchain node in the embodiment of the present invention may be the foregoing billing node.
- the first blockchain node may determine that the device information stored in the blockchain network has been updated to The new device information included in the received transaction message, therefore, the first blockchain node can send an acknowledgement message to the device confirming that the new device information has been added to the blockchain network, that is, in the blockchain network The device information has been updated.
- the billing node sends an acknowledgement message to the device, where the acknowledgement message is used to indicate that the device information in the blockchain has been updated.
- the transaction message in steps 201-205 is the second transaction message in the embodiment of the present invention
- the confirmation message in step 105 is the second confirmation message in the embodiment of the present invention
- steps 201-205 are involved.
- the device information is the second device information of the device, that is, the updated device information of the device.
- the device may also be authenticated based on a physical unclonable function (PUF).
- PEF physical unclonable function
- the device may send the stimulus response record as an attribute of the device in the transaction message of step 101 and send it to the blockchain network.
- the device may also send the device's stimulus response record to the blockchain network through an independent transaction message.
- the device's stimulus response record is added to a blockchain. Specifically, as shown in FIG. 6, the following steps are included:
- the control device sends an excitation signal to the device.
- the excitation signal is also the input signal and can be a pulse signal.
- the device sends a response result to the control device.
- the device after receiving the excitation signal, the device outputs a response result according to the excitation signal.
- the excitation signal is an input signal and the response is an output signal corresponding to the excitation signal.
- the physical unclonable function uses the physical structure inherent in the object to uniquely identify the object, and inputting any excitation signal will output a unique and unpredictable response result.
- the built-in memory of the device outputs a unique and unpredictable response result for any excitation signal, so the response result can be used to distinguish different devices.
- the control device stores the authentication data of the device.
- the steps 301-303 are repeatedly performed, and the control device inputs a plurality of excitation signals to the device, and correspondingly obtains a plurality of response results, and the control device stores a plurality of pairs of excitation signals and response results.
- the authentication data of the device may be generated according to the stored excitation signal and the response result, including the identifier of the device, the at least one excitation signal, and the response result corresponding to each of the at least one excitation signal.
- control device may further calculate a hash value of the response result according to the response result of the excitation signal.
- authentication data of the device may be generated according to the excitation signal and the hash value of the response result. Specifically, the authentication data generated at this time includes the identifier of the device, the at least one excitation signal, and the at least one excitation signal. Each of the excitation signals corresponds to a hash value of the response result.
- the authentication data of the device and the identifier of the device are correspondingly stored in the blockchain.
- step 304 may be further included. ⁇ 305.
- the control device sends a transaction message to a node in the blockchain network, where the transaction message carries the authentication data and an identifier of the device.
- the node may be a communication node or a blockchain node in a blockchain network.
- the second blockchain node in FIG. 6 of the embodiment of the present invention is a communication node or a blockchain node in a blockchain network.
- FIG. 6 only shows a case where the device sends a transaction message to the blockchain node, and the device can also send the transaction message to the communication node, which is not limited by the embodiment of the present invention.
- the node forwards the transaction message to other nodes in the blockchain network.
- any node (blockchain node or communication node) in the blockchain network broadcasts the transaction message after receiving the transaction message, and ensures each blockchain node in the blockchain network as much as possible. All transaction messages from the device can be obtained.
- the first blockchain node may receive the broadcast of the node (such as the second blockchain node in FIG. 6). Trading news.
- the first blockchain node can also receive the transaction message broadcast by any one of the communication nodes in the blockchain network.
- the blockchain node or the communication node receives the transaction message from the device, the received transaction message will be broadcast to other nodes in the blockchain network, and each node in the final blockchain network will receive. To the transaction message from the device.
- the blockchain node in the blockchain network executes a consensus algorithm to determine the accounting node.
- each blockchain node of the blockchain network the transaction data is continuously collected, and the block is constructed according to the collected transaction data and the transaction message, that is, each blockchain node constructs the device incentive including the device. A block that responds to the record and the identity of the device.
- each blockchain node in the blockchain network after constructing the respective block, also executes a consensus algorithm to determine the accounting node, but only the accounting determined in the process. The node may be different from the accounting node determined in step 103.
- the block constructed by the accounting node in this process is added as a valid block to the blockchain, that is, the device stimulus response record and the identifier of the device are written in the blockchain.
- the device may also generate an excitation signal by itself without requiring the control device to input an excitation signal to the device.
- the device may output a response result according to the excitation signal generated by itself, and generate an excitation response record, and record a plurality of excitation response pairs (ie, an excitation signal and a corresponding response result).
- the device also sends a transaction message carrying the stimulus response record and the identity of the device to the first blockchain node, so that the first blockchain node stores the stimulus in the first block Correspondence between the response record and the identity of the device.
- control device or the device itself sends a hash to the blockchain corresponding to the response, rather than the response itself.
- the accounting node can use the PUF to authenticate the device, as shown in FIG. 7, which specifically includes the following steps:
- the authentication device acquires an excitation response pair from the accounting node, including the first excitation signal and the first response result.
- the authentication device may obtain a first excitation signal and a hash value of the first response result.
- the authentication device sends the identifier of the device to be authenticated to the billing node, and the billing node queries the incentive response record in the valid block with the identifier of the device to be authenticated as an index, and determines an incentive response record corresponding to the identifier of the device to be authenticated. A pair of stimulus responses in the stimulus response record is then sent to the authentication device.
- the authentication data sent to the blockchain is a hash of the stimulus signal and the response corresponding to the stimulus, rather than the response itself, then the first blockchain node also acquires May be a (incentive, response hash) pair.
- the authentication device sends the first excitation signal to the device to be authenticated.
- the device generates a response result according to the first excitation signal, and sends the generated response result to the authentication device.
- the authentication device determines whether the received response result is the same as the first response result obtained in step 401.
- the authentication device determines whether the hash value of the received response result is the same as the hash value of the first response result obtained in step 401.
- the device to be authenticated outputs a unique and unpredictable response result for any excitation signal
- the first response result is a response result of the device to be authenticated according to the first excitation signal, so if the authentication device receives The response result and the first response result, or if the hash value of the response result received by the authentication device is the same as the hash value of the first response result, it may be proved that the device to be authenticated is the device itself identified by the device identifier, Not other devices.
- step 405 is performed; if the authentication device determines the received response result and the step 401 is obtained, If the hash value of the first response result or the first response result is not the same, step 406 is performed.
- the authentication device determines that the device passes the authentication.
- the authentication device determines that the device authentication fails.
- the above steps 301-305 can be performed, and finally, for each device, there is an active block storing the identifier of the device and the stimulus response record of the device, and the different effective areas.
- a block can form a chain of authentication information blocks.
- Embodiments of the present invention provide a blockchain node.
- FIG. 8 shows a possible structural diagram of the above-described blockchain node.
- the blockchain node includes an obtaining unit 501, a processing unit 502, and a transmitting unit 503.
- the obtaining unit 501 is configured to support the blockchain node to perform step 101 in the above embodiment, and/or other processes for the techniques described herein.
- Processing unit 502 configured to support the blockchain node to perform steps 102, 103 in the above embodiments, and/or other processes for the techniques described herein;
- a sending unit 503 configured to support the blockchain node to perform step 104 in the foregoing embodiment, and/or other processes for the techniques described herein;
- the blockchain node includes a processing module 601 and a communication module 602.
- the processing module 601 is for controlling management of the actions of the blockchain nodes, for example, performing the steps performed by the processing unit 502 described above, and/or other processes for performing the techniques described herein.
- the communication module 602 is configured to support interaction between the blockchain node and other devices, for example, performing the steps performed by the obtaining unit 501 and the transmitting unit 503 described above.
- the blockchain node may further include a storage module 603 for storing program codes and data of the blockchain node.
- the processing module 601 is a processor
- the communication module 602 is a transceiver
- the storage module 603 is a memory
- the blockchain node may be the blockchain node shown in FIG. 2. If the transceiver is a receiver and a transmitter, the receiver performs the steps performed by the acquisition unit 501 described above, and the transmitter performs the steps performed by the transmitting unit 503.
- the computer program product includes one or more computer instructions.
- the computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable device.
- the computer instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be from a website site, computer, server or data center Transfer to another website site, computer, server, or data center by wire (eg, coaxial cable, fiber optic, digital subscriber line (DSL), or wireless (eg, infrared, wireless, microwave, etc.).
- the computer readable storage medium can be any available media that can be accessed by a computer or a data storage device such as a server, data center, or the like that includes one or more available media.
- the usable medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (such as a solid state disk (SSD)).
- the disclosed apparatus and method may be implemented in other manners.
- the device embodiments described above are merely illustrative.
- the division of the modules or units is only a logical function division.
- there may be another division manner for example, multiple units or components may be used.
- the combination may be integrated into another device, or some features may be ignored or not performed.
- the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
- the units described as separate components may or may not be physically separated, and the components displayed as units may be one physical unit or multiple physical units, that is, may be located in one place, or may be distributed to multiple different places. . Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
- each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
- the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
- the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a readable storage medium.
- the technical solution of the embodiments of the present application may be embodied in the form of a software product in the form of a software product in essence or in the form of a contribution to the prior art, and the software product is stored in a storage medium.
- a number of instructions are included to cause a device (which may be a microcontroller, chip, etc.) or a processor to perform all or part of the steps of the methods described in various embodiments of the present application.
- the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes. .
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
Abstract
Description
本申请涉及存储领域,尤其涉及一种区块链构建方法及区块链节点。The present application relates to the field of storage, and in particular, to a blockchain construction method and a blockchain node.
目前,可以采用区块链来记录有交易数据。具体地,将交易数据按序整理成区块,多个区块可以构成区块链。数据在区块链中采用分布式和链式存储机制以达到防篡改的目的,数据存储地越分布,区块链网络越能抵抗攻击。进一步,区块链存储在区块链节点中,多个区块链节点可以构成区块链网络。Currently, blockchains can be used to record transaction data. Specifically, the transaction data is organized into blocks in order, and the plurality of blocks may constitute a blockchain. Data uses distributed and chained storage mechanisms in the blockchain to achieve tamper-proof purposes. The more distributed the data is, the more resistant the blockchain network is to attacks. Further, the blockchain is stored in the blockchain node, and the plurality of blockchain nodes may constitute a blockchain network.
区块链网络中,通过一定的共识机制来确定记账节点(即构建区块的节点),保证并不总是恶意节点获得记账权,在很大程度上保证区块链网络的安全性,具体地,所有区块链节点可以通过工作量证明算法(proof of work,POW)比拼算力,将最早计算出Nonce(number used once)的区块链节点确定为记账节点。记账节点构建的区块是有效的,也就是说只有记账节点构建的区块可以加入区块链,即记账节点拥有在区块链写入数据的权限。In the blockchain network, the accounting node (that is, the node that constructs the block) is determined by a certain consensus mechanism to ensure that the malicious node does not always obtain the accounting right, and the security of the blockchain network is largely guaranteed. Specifically, all the blockchain nodes can determine the blockchain node that is the first to calculate Nonce (number used once) as the accounting node by the proof of work (POW). The block constructed by the accounting node is valid, that is, only the block constructed by the accounting node can be added to the blockchain, that is, the accounting node has the right to write data in the blockchain.
物联网可以借助区块链网络存储交易数据。但是,POW算法比拼算力计算Nonce是一个极其消耗计算资源的过程,一些算力比较低的设备,尤其是低能力的物联网设备,无法参与到上述共识过程中,也就无法加入到区块链网络中。这就在一定程度上限制了区块链网络的分布性,进而也限制了区块链网络的抗攻击能力。The Internet of Things can store transaction data via a blockchain network. However, the POW algorithm calculates the Nonce as a process that consumes a lot of computing resources. Some devices with low computing power, especially low-power IoT devices, cannot participate in the above consensus process and cannot be added to the block. In the chain network. This limits the distribution of the blockchain network to a certain extent, and thus limits the anti-attack capability of the blockchain network.
发明内容Summary of the invention
本发明实施例提供一种区块链构建方法及区块链节点,能够提高区块链网络的分布性,从而可以提高区块链网络的抗攻击能力。The embodiment of the invention provides a blockchain construction method and a blockchain node, which can improve the distribution of the blockchain network, thereby improving the anti-attack capability of the blockchain network.
第一方面,公开了一种区块链构建方法,包括:区块链网络中的第一区块链节点获取设备发送的交易消息;该交易消息携带了这个设备的设备信息;这个设备不属于上述区块链网络;当第一区块链节点确定交易消息已加入区块链网络中的区块链,则向该设备发送确认消息,确认消息用于指示交易消息已加入区块链网络中的区块链。In a first aspect, a blockchain construction method is disclosed, including: a first blockchain node in a blockchain network acquires a transaction message sent by a device; the transaction message carries device information of the device; the device does not belong to The blockchain network; when the first block chain node determines that the transaction message has been added to the blockchain in the blockchain network, sends an acknowledgement message to the device, and the acknowledgement message is used to indicate that the transaction message has been added to the blockchain network. Blockchain.
本发明实施例提供的方法中,区块链网络中的第一区块链节点(可以是记账节点)获取设备发送的交易消息,所述交易消息包含设备信息,随后,各个区块链节点根据收集到的交易数据构建区块,并且其中的记账节点所述构建的区块可以加入区块链中。第一区块链节点还可以通过确认消息通知设备交易消息已被加入区块链网络的区块链中如此,该设备的设备信息是不易被篡改的,进而可以认为该设备是可信的,如此使得海量低能力的物联网设备可以参与到区块链网络中,比如参与共识过程,参与区块链存储等,进而提供高区块链网络的分布性,在一定程度上提高了区块链网络的抗攻击性。In the method provided by the embodiment of the present invention, a first blockchain node (which may be a billing node) in a blockchain network acquires a transaction message sent by a device, where the transaction message includes device information, and then, each blockchain node A block is constructed based on the collected transaction data, and the block constructed by the accounting node therein can be added to the blockchain. The first blockchain node may also notify the device that the transaction message has been added to the blockchain of the blockchain network by using an acknowledgement message, and the device information of the device is not easily falsified, and the device may be considered to be trusted. In this way, a large number of low-power IoT devices can participate in the blockchain network, such as participating in the consensus process, participating in blockchain storage, etc., thereby providing the distribution of high blockchain networks and improving the blockchain to some extent. The anti-aggressiveness of the network.
结合第一方面,在第一方面的第一种可能的实现中,第一区块链节点获取设备发送的交易消息包括:接收设备发送的交易消息;或,接收区块链网络中的第二区块链节点转发的交易消息。With reference to the first aspect, in a first possible implementation of the first aspect, the first block chain node acquiring the transaction message sent by the device includes: receiving the transaction message sent by the device; or receiving the second in the blockchain network The transaction message forwarded by the blockchain node.
也就是说,第一区块链获取到的交易消息可以是设备直接发送的,也可以是由其他区块链节点转发的。That is to say, the transaction message obtained by the first blockchain may be directly sent by the device, or may be forwarded by other blockchain nodes.
结合第一方面或第一方面的第一种可能的实现方式中,在第一方面的第二种可能的实现中,第一区块链节点确定交易消息已加入区块链网络中的区块链具体包括:第一区块链节点构建包含交易消息的第一区块,确定第一区块被加入区块链网络的一个区块链中;或,第一区块链节点确定区块链网络中除第一区块链节点外的其他区块链节点构建的第二区块被加入区块链网络的一个区块链中;第二区块包含交易消息。In conjunction with the first aspect or the first possible implementation of the first aspect, in a second possible implementation of the first aspect, the first blockchain node determines that the transaction message has been added to the block in the blockchain network The chain specifically includes: the first block chain node constructs a first block including a transaction message, and determines that the first block is added to a blockchain of the blockchain network; or the first block chain node determines the blockchain The second block constructed by the other blockchain nodes except the first blockchain node in the network is added to a blockchain of the blockchain network; the second block contains the transaction message.
具体实现中,第一区块链节点可以是记账节点,那么交易消息存储在了第一区块链节点所打包的区块中,当然,第一区块链节点也可以不是记账节点,但是第一区块链节点最终可以确定交易消息存储在了哪个区块链节点所打包的区块中。In a specific implementation, the first blockchain node may be a billing node, and the transaction message is stored in the block packed by the first blockchain node. Of course, the first blockchain node may not be a billing node. However, the first blockchain node can ultimately determine which blockchain node the transaction message is stored in.
结合第一方面以及以上第一方面的任意一种可能的实现方式中,在第一方面的第三种可能的实现中,交易消息还包括用于认证上述设备的认证数据,所述认证数据包括至少一个激励信号、与至少一个激励信号中的每一个激励信号对应的响应结果或与所述至少一个激励信号中的每一个激励信号对应的响应结果的哈希值。In combination with the first aspect and any one of the foregoing possible implementations of the first aspect, in a third possible implementation of the first aspect, the transaction message further includes authentication data for authenticating the device, the authentication data including At least one excitation signal, a response result corresponding to each of the at least one excitation signal, or a hash value of a response result corresponding to each of the at least one excitation signal.
如果交易消息中包含了认证数据,在各个区块链节点经历共识算法后,可以将认证数据存储在记账节点打包的区块中,如此,将设备的认证数据持久化地写入区块链网络中,后续就可以根据认证数据对设备进行认证,保证区块链网络的安全性。If the transaction message contains the authentication data, after each blockchain node experiences the consensus algorithm, the authentication data may be stored in the block packed by the accounting node, so that the device authentication data is persistently written into the blockchain. In the network, the device can be authenticated according to the authentication data to ensure the security of the blockchain network.
结合第一方面以及以上第一方面的任意一种可能的实现方式中,在第一方面的第四种可能的实现中,方法还包括:第一区块链节点向认证设备发送的第一激励信号、与所述第一激励信号对应的第一响应结果或第一哈希值,以便认证设备向设备发送第一激励信号并判断设备发送给认证设备的响应结果是否为第一响应结果或第一哈希值。其中,第一哈希值是根据第一响应结果计算所得的哈希值。In combination with the first aspect and any one of the foregoing possible implementation manners, in a fourth possible implementation of the first aspect, the method further includes: the first incentive sent by the first blockchain node to the authentication device a signal, a first response result corresponding to the first excitation signal or a first hash value, so that the authentication device sends the first excitation signal to the device and determines whether the response result sent by the device to the authentication device is the first response result or the first A hash value. The first hash value is a hash value calculated according to the first response result.
结合第一方面以及以上第一方面的任意一种可能的实现方式中,在第一方面的第五种可能的实现中,交易消息还包括:设备的属性信息,属性信息包括设备的信用信息,信用信息用于指示设备的可信程度。In combination with the first aspect and any one of the foregoing possible implementation manners, in a fifth possible implementation of the first aspect, the transaction message further includes: attribute information of the device, where the attribute information includes credit information of the device, Credit information is used to indicate the level of trust of the device.
结合第一方面以及以上第一方面的任意一种可能的实现方式中,在第一方面的第六种可能的实现中,所述方法还包括:第一区块链节点接收所述设备发送的第二交易消息,所述第二交易消息携带所述设备的第二设备信息;确定已将区块链网络中的第一设备信息更新为第二设备信息,则向所述设备发送第二确认消息,第二确认消息用于指示已将所述区块链网络中的第一设备信息更新为第二设备信息。With reference to the first aspect, and any one of the foregoing possible implementation manners, in a sixth possible implementation of the first aspect, the method further includes: receiving, by the first blockchain node, the device a second transaction message, the second transaction message carrying the second device information of the device; determining that the first device information in the blockchain network has been updated to the second device information, sending a second confirmation to the device And a second confirmation message is used to indicate that the first device information in the blockchain network has been updated to the second device information.
第二方面,公开了一种区块链节点,区块链节点为第一区块链节点,包括:获取单元,用于获取设备发送的交易消息;交易消息携带设备的设备信息;设备不属于区块链网络;处理单元,用于确定获取单元获取到的交易消息已加入区块链网络中的区块链;发送单元,用于在处理单元确定交易消息已加入区块链网络中的区块链之后,向设备发送确认消息,确认消息用于指示交易消息已加入区块链网络中的区块链。In a second aspect, a blockchain node is disclosed. The blockchain node is a first blockchain node, and includes: an acquiring unit, configured to acquire a transaction message sent by the device; the transaction message carries device information of the device; the device does not belong to a blockchain network; a processing unit, configured to determine, by the processing unit, that the transaction message acquired by the acquiring unit has been added to the blockchain in the blockchain network; and the sending unit, configured to determine, in the processing unit, that the transaction message has been added to the zone in the blockchain network After the blockchain, an acknowledgment message is sent to the device to indicate that the transaction message has been added to the blockchain in the blockchain network.
结合第二方面,在第二方面的第一种可能的实现方式中,获取单元具体用于,接收设备发送的交易消息;或,接收区块链网络中的第二区块链节点转发的交易消息。With reference to the second aspect, in a first possible implementation manner of the second aspect, the acquiring unit is specifically configured to: receive the transaction message sent by the device; or receive the transaction forwarded by the second blockchain node in the blockchain network Message.
结合第二方面以及以上第二方面的任意一种可能实现方式中,在第二方面的第二种可能的实现方式中,处理单元具体用于,构建包含交易消息的第一区块,确定第一 区块被加入区块链网络的一个区块链中;或,确定区块链网络中除第一区块链节点外的其他区块链节点构建的第二区块被加入区块链网络的一个区块链中;第二区块包含交易消息。With reference to the second aspect and any one of the foregoing possible implementation manners, in a second possible implementation manner of the second aspect, the processing unit is specifically configured to: construct a first block that includes a transaction message, determine A block is added to a blockchain of the blockchain network; or, a second block constructed by determining other blockchain nodes other than the first blockchain node in the blockchain network is added to the blockchain network In a blockchain; the second block contains transaction messages.
结合第二方面以及以上第二方面的任意一种可能实现方式中,在第二方面的第三种可能的实现方式中,交易消息还包括用于认证设备的认证数据,该认证数据包括至少一个激励信号、与至少一个激励信号中的每一个激励信号对应的响应结果或与所述至少一个激励信号中的每一个激励信号对应的响应结果的哈希值。其中,激励信号对应的哈希值是根据激励信号对应的响应计算出的哈希值。In combination with the second aspect and any one of the foregoing possible implementation manners, in a third possible implementation of the second aspect, the transaction message further includes authentication data for authenticating the device, the authentication data including at least one An excitation signal, a response result corresponding to each of the at least one excitation signal, or a hash value of a response result corresponding to each of the at least one excitation signal. The hash value corresponding to the excitation signal is a hash value calculated according to the response corresponding to the excitation signal.
结合第二方面以及以上第二方面的任意一种可能实现方式中,在第二方面的第四种可能的实现方式中,发送单元还用于,向认证设备发送的第一激励信号、与第一激励信号对应的第一响应结果或第一哈希值,以便认证设备向设备发送第一激励信号并判断设备发送给认证设备的响应结果是否为第一响应结果或第一哈希值。With reference to the second aspect, and any one of the foregoing possible implementation manners, in a fourth possible implementation manner of the second aspect, the sending unit is further configured to: send, to the authentication device, the first The first response result or the first hash value corresponding to the excitation signal, so that the authentication device sends the first excitation signal to the device and determines whether the response result sent by the device to the authentication device is the first response result or the first hash value.
结合第二方面以及以上第二方面的任意一种可能实现方式中,在第二方面的第五种可能的实现方式中,交易消息还包括:设备的属性信息,属性信息包括设备的信用信息,信用信息用于指示设备的可信程度。In combination with the second aspect and any one of the foregoing possible implementation manners, in a fifth possible implementation manner of the second aspect, the transaction message further includes: attribute information of the device, where the attribute information includes credit information of the device, Credit information is used to indicate the level of trust of the device.
第三方面,公开了一种计算机可读存储介质,该计算机可读存储介质中存储有指令;当其在上述第二方面及其任意一项可能的实现方式所述的设备上运行时,使得该设备执行如上述第二方面及其各种可能的实现方式所述的区块链构建方法。In a third aspect, a computer readable storage medium is disclosed having stored therein instructions; when it is run on a device as described in the second aspect above and any of its possible implementations, The apparatus performs a blockchain construction method as described in the second aspect above and its various possible implementations.
结合第一方面以及以上第一方面的任意一种可能的实现方式中,在第一方面的第六种可能的实现中,获取单元还用于,获取所述设备发送的第二交易消息,第二交易消息携带所述设备的第二设备信息;处理单元还用于,确定已将第一设备信息更新为第二设备信息;发送单元还用于,向所述设备发送第二确认消息,第二确认消息用于指示已将所述区块链网络中的第一设备信息更新为第二设备信息。With reference to the first aspect and any one of the foregoing possible implementation manners, in a sixth possible implementation of the first aspect, the acquiring unit is further configured to acquire, by using the second transaction message that is sent by the device, The second transaction message carries the second device information of the device; the processing unit is further configured to: determine that the first device information has been updated to the second device information; the sending unit is further configured to send the second confirmation message to the device, The second confirmation message is used to indicate that the first device information in the blockchain network has been updated to the second device information.
图1为区块链网络和物联网的示意图;Figure 1 is a schematic diagram of a blockchain network and an Internet of Things;
图2为本发明实施例提供的区块链节点的结构示意图;2 is a schematic structural diagram of a blockchain node according to an embodiment of the present invention;
图3为本发明实施例提供的区块链构建方法的流程示意图;FIG. 3 is a schematic flowchart diagram of a method for constructing a blockchain according to an embodiment of the present invention;
图4为本发明实施例提供的共识算法的示意图;4 is a schematic diagram of a consensus algorithm according to an embodiment of the present invention;
图5为本发明实施例提供的设备信息更新方法的流程示意图;FIG. 5 is a schematic flowchart of a method for updating device information according to an embodiment of the present disclosure;
图6为本发明实施例提供的区块链构建方法的另一流程示意图;6 is another schematic flowchart of a method for constructing a blockchain according to an embodiment of the present invention;
图7为本发明实施例提供的区块链构建方法的另一流程示意图;FIG. 7 is another schematic flowchart of a method for constructing a blockchain according to an embodiment of the present invention;
图8为本发明实施例提供的区块链节点的另一结构示意图;FIG. 8 is another schematic structural diagram of a blockchain node according to an embodiment of the present disclosure;
图9为本发明实施例提供的区块链节点的另一结构示意图。FIG. 9 is another schematic structural diagram of a blockchain node according to an embodiment of the present invention.
物联网(internet of things,IoT)是在互联网基础上延伸和扩展的网络,可以实现物品与物品之间的通信。参考图1,物联网可以借助区块链网络存储交易数据。区块链网络包括通信节点和区块链节点,其中,通信节点为仅仅有通信功能的设备,如:转发信息,区块链节点为具有通信功能以及存储功能的设备,如存储有区块链。区块链也可以认为是一种数据库,例如:能够用来存储交易数据。The Internet of Things (IoT) is a network that extends and expands on the Internet to enable communication between items and items. Referring to Figure 1, the Internet of Things can store transaction data via a blockchain network. The blockchain network includes a communication node and a blockchain node, wherein the communication node is a device having only a communication function, such as forwarding information, and the blockchain node is a device having a communication function and a storage function, such as storing a blockchain. . A blockchain can also be thought of as a database, for example: it can be used to store transaction data.
区块链网络采用分布式存储机制来提高自身抗攻击的能力,数据存储地越分布区块链网络越能抗攻击。例如:将同样的数据分别存储在至少两个区块链节点所存储区块链的区块中,恶意节点要篡改这个数据,就需要将所有存储该数据的区块篡改,并且还需要将每个区块链中该区块的后续区块都篡改,这是有一定难度的。如此,也就提高了区块链网络抗攻击的能力。The blockchain network adopts a distributed storage mechanism to improve its ability to resist attacks. The more distributed the blockchain network is, the more resistant it is to attacks. For example, the same data is stored in the block of the blockchain stored in at least two blockchain nodes. To tamper with the data, the malicious node needs to tamper with all the blocks storing the data, and also needs to The subsequent blocks of the block in the blockchain have been tampered with, which is difficult. In this way, the ability of the blockchain network to resist attacks is improved.
具体实现中,区块链网络中的区块链节点可以通过POW比拼算力,将最早计算出Nonce的区块链节点确定为记账节点。以下以比特币为例详细介绍在区块链网络中如何通过共识过程确定记账节点。In a specific implementation, the blockchain node in the blockchain network can determine the blockchain node that first calculated Nonce as the accounting node by using the POW comparison power. The following takes Bitcoin as an example to describe in detail how to determine the accounting node through the consensus process in the blockchain network.
首先,区块链节点收集交易数据,根据收集到的交易数据构建区块。示例的,比特币领域中,区块由区块头及区块体组成。其中,区块头的大小为80字节,包括4字节的版本号、32字节的上一个区块的哈希值、32字节的默克尔树哈希值(Merkel Root Hash)、4字节的时间缀(当前时间)、4字节的当前难度值以及4字节的随机数组成。区块体由交易列表构成。表1给出了区块的一种实现可能,当然,区块的结构不仅仅局限于表1所示,且各个结构的取值也不仅仅局限于表1所示。First, the blockchain node collects transaction data and builds blocks based on the collected transaction data. For example, in the field of bitcoin, a block consists of a block header and a block body. The size of the block header is 80 bytes, including the 4-byte version number, the 32-byte hash value of the previous block, and the 32-byte Merkel Root Hash. The time suffix of the byte (current time), the current difficulty value of 4 bytes, and the random number of 4 bytes. The block body consists of a list of transactions. Table 1 shows an implementation possibility of the block. Of course, the structure of the block is not limited to the one shown in Table 1, and the values of the respective structures are not limited to those shown in Table 1.
表1Table 1
需要说明的是,区块链节点收集到的交易数据大小达到限值后,区块链节点开始根据收集到的交易数据计算区块头中的默克尔树根哈希值。另外,收集到的交易数据构成区块体。It should be noted that after the transaction data size collected by the blockchain node reaches the limit, the blockchain node starts to calculate the Merkel root hash value in the block header according to the collected transaction data. In addition, the collected transaction data constitutes a block.
其次,区块链节点构建好区块之后,根据构建的区块头计算哈希值,并通过不断的调整区块头中的随机数持续计算哈希值,直至计算出满足目标难度的哈希值,则将构建的区块广播给区块链网络中的其他区块链节点。最终将最快计算出满足目标难度的哈希值的区块链节点确定为记账节点。Secondly, after the blockchain node constructs the block, the hash value is calculated according to the constructed block header, and the hash value is continuously calculated by continuously adjusting the random number in the block header until the hash value satisfying the target difficulty is calculated. The constructed block is then broadcast to other blockchain nodes in the blockchain network. Finally, the blockchain node that calculates the hash value that satisfies the target difficulty is determined as the accounting node.
但是,计算满足目标难度的哈希值对设备的计算能力有很高的要求,一些算力比较低的设备,尤其是低能力的物联网设备,无法参与到上述共识过程中,也就无法加入区块链网络。这就限制了区块链网络的分布性,进而也限制了区块链网络的抗攻击能力。However, calculating the hash value that meets the target difficulty has high requirements on the computing power of the device. Some devices with low computing power, especially low-power IoT devices, cannot participate in the above consensus process and cannot join. Blockchain network. This limits the distribution of the blockchain network and, in turn, limits the anti-attack capability of the blockchain network.
本发明实施例提供一种区块链构建方法及区块链节点,区块链网络中的第一区块链节点(可以是记账节点)获取设备发送的交易消息,所述交易消息包含设备信息,随后,各个区块链节点根据收集到的交易数据构建区块,并且其中的记账节点所述构建的区块可以加入区块链中。第一区块链节点还可以通过确认消息通知设备交易消息已被加入区块链网络的区块链中如此,该设备的设备信息是不易被篡改的,进而可以认为该设备是可信的,如此使得海量低能力的物联网设备可以参与到区块链网络中,比如参与共识过程,参与区块链存储等,进而提供高区块链网络的分布性,在一定程度上提高了区块链网络的抗攻击性。The embodiment of the present invention provides a blockchain construction method and a blockchain node. The first blockchain node (which may be a billing node) in the blockchain network acquires a transaction message sent by the device, and the transaction message includes the device. Information, then, each blockchain node constructs a block based on the collected transaction data, and the block constructed by the accounting node can be added to the blockchain. The first blockchain node may also notify the device that the transaction message has been added to the blockchain of the blockchain network by using an acknowledgement message, and the device information of the device is not easily falsified, and the device may be considered to be trusted. In this way, a large number of low-power IoT devices can participate in the blockchain network, such as participating in the consensus process, participating in blockchain storage, etc., thereby providing the distribution of high blockchain networks and improving the blockchain to some extent. The anti-aggressiveness of the network.
本发明实施例提供的区块链构建方法可以应用于图2所示的区块链节点,所述区块链节点可以是图1所示系统中的区块链节点。如图2所示,所述区块链节点可以包括至少一个处理器11,存储器12、收发器13以及通信总线14。The blockchain construction method provided by the embodiment of the present invention can be applied to the blockchain node shown in FIG. 2, and the blockchain node can be a blockchain node in the system shown in FIG. As shown in FIG. 2, the blockchain node may include at least one
下面结合图2对该区块链节点的各个构成部件进行具体的介绍:The following describes the components of the blockchain node in detail with reference to FIG. 2:
处理器11是区块链节点的控制中心,可以是一个处理器,也可以是多个处理元件的统称。例如,处理器11是一个中央处理器(central processing unit,CPU),也可以是特定集成电路(Application Specific Integrated Circuit,ASIC),或者是被配置成实施本发明实施例的一个或多个集成电路,例如:一个或多个微处理器(digital signal processor,DSP),或,一个或者多个现场可编程门阵列(Field Programmable Gate Array,FPGA)。The
其中,处理器11可以通过运行或执行存储在存储器12内的软件程序,以及调用存储在存储器12内的数据,执行区块链节点的各种功能。Among other things, the
在具体的实现中,作为一种实施例,处理器11可以包括一个或多个CPU,例如图2中所示的CPU0和CPU1。In a particular implementation, as an embodiment,
在具体实现中,作为一种实施例,区块链节点可以包括多个处理器,例如图2中所示的处理器11和处理器15。这些处理器中的每一个可以是一个单核处理器(single-CPU),也可以是一个多核处理器(multi-CPU)。这里的处理器可以指一个或多个区块链节点、电路、和/或用于处理数据(例如计算机程序指令)的处理核。In a particular implementation, as an embodiment, the blockchain node may include multiple processors, such as
存储器12可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态区块链节点,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态区块链节点,也可以是电可擦可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、只读光盘(Compact Disc Read-Only Memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁区块链节点、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器12可以是独立存在,通过通信总线14与处理器11相连接。存储器12也可以和处理器11集成在一起。The
其中,所述存储器12用于存储执行本发明方案的软件程序,并由处理器11来控制执行。The
收发器13,使用任何收发器一类的装置,用于与图1系统中的其他节点之间的通信,如图1中的通信节点或区块链节点等。还可以用于与通信网络通信,如以太网, 无线接入网(radio access network,RAN),无线局域网(Wireless Local Area Networks,WLAN)等。收发器13可以包括获取单元实现接收功能,以及发送单元实现发送功能。The
通信总线14,可以是工业标准体系结构(Industry Standard Architecture,ISA)总线、外部区块链节点互连(Peripheral Component,PCI)总线或扩展工业标准体系结构(Extended Industry Standard Architecture,EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。为便于表示,图2中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The
图2中示出的区块链节点结构并不构成对区块链节点的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。The blockchain node structure shown in FIG. 2 does not constitute a definition of a blockchain node, and may include more or fewer components than those illustrated, or some components may be combined, or different component arrangements.
本发明实施例提供一种区块链构建方法,如图3所示,所述方法包括以下步骤:An embodiment of the present invention provides a method for constructing a blockchain. As shown in FIG. 3, the method includes the following steps:
101、设备向区块链网络中的节点发送交易消息,所述交易消息包括该设备的设备信息。101. The device sends a transaction message to a node in the blockchain network, where the transaction message includes device information of the device.
其中,所述节点可以是区块链网络中的一个通信节点或区块链节点。如:本发明实施例图3中的第二区块链节点。当然,图3仅示出了设备将交易消息发送给区块链节点的情况,设备还可以将交易消息发送给通信节点,本发明实施例对此不作限定。The node may be a communication node or a blockchain node in a blockchain network. For example, the second blockchain node in FIG. 3 of the embodiment of the present invention. Of course, FIG. 3 only shows the case where the device sends a transaction message to the blockchain node, and the device can also send the transaction message to the communication node, which is not limited in this embodiment of the present invention.
具体地,所述设备可以是物联网设备。设备信息可以包括设备每个器件的标识和/或信息,如:CPU的标识,运算速度,厂家等;内存的标识,大小,厂家等。Specifically, the device may be an Internet of Things device. The device information may include identification and/or information of each device of the device, such as: identification of the CPU, operation speed, manufacturer, etc.; identification, size, manufacturer, etc. of the memory.
进一步的,设备器件的标识可以是根据相关标准制定的;也可以定义标识的格式,再根据定义的格式生成器件的标识。Further, the identifier of the device device may be determined according to relevant standards; the format of the identifier may also be defined, and the identifier of the device may be generated according to the defined format.
102、所述节点向区块链网络中的其他节点转发所述交易消息。102. The node forwards the transaction message to other nodes in the blockchain network.
具体实现中,区块链网络中的任意一个节点(区块链节点或通信节点)接收到交易消息后,都会将交易消息广播出去,尽可能保证区块链网络中的每一个区块链节点都可以获取到来自所述设备的交易消息。In a specific implementation, any node (blockchain node or communication node) in the blockchain network broadcasts the transaction message after receiving the transaction message, and ensures each blockchain node in the blockchain network as much as possible. All transaction messages from the device can be obtained.
如此,对于区块链网络中的任意一个区块链节点,如本发明实施例所述的第一区块链节点,可以接收所述节点(如图3中的第二区块链节点)广播的交易消息。当然,第一区块链节点也可以接收区块链网络中的任意一个通信节点广播的交易消息。As such, for any one of the blockchain nodes in the blockchain network, the first blockchain node according to the embodiment of the present invention may receive the broadcast of the node (such as the second blockchain node in FIG. 3). Trading news. Of course, the first blockchain node can also receive the transaction message broadcast by any one of the communication nodes in the blockchain network.
需要说明的是,不论是区块链节点还是通信节点收到设备发送交易消息都会将接收到的交易消息广播给区块链网络中的其他节点,最终区块链网络中的每一个节点都会收到来自该设备的交易消息。It should be noted that whether the blockchain node or the communication node receives the transaction message from the device, the received transaction message will be broadcast to other nodes in the blockchain network, and each node in the final blockchain network will receive. To the transaction message from the device.
103、区块链节点收集交易数据,根据收集到的交易数据和交易消息构建区块。103. The blockchain node collects transaction data, and constructs a block according to the collected transaction data and transaction message.
需要说明的是,对于区块链网络的任意一个区块链节点,如:本发明实施例所述的第一区块链节点,会持续收集设备的交易数据,以构建各自的区块。It should be noted that, for any blockchain node of the blockchain network, for example, the first blockchain node described in the embodiment of the present invention continuously collects transaction data of the device to construct respective blocks.
具体实现中,区块链节点构建的区块包括区块头和区块体。其中,区块链节点根据收集到的交易数据计算默克尔树哈希值。进一步,根据得到的默克尔树哈希值、版本号、上一个区块的哈希值、时间缀(当前时间)、当前难度值以及一个随机数构建区块头。另外,根据收集到的交易数据构建区块体。In a specific implementation, the block constructed by the blockchain node includes a block header and a block body. The blockchain node calculates the Merkel tree hash value based on the collected transaction data. Further, the block header is constructed according to the obtained Merkel tree hash value, version number, hash value of the previous block, time suffix (current time), current difficulty value, and a random number. In addition, a block body is constructed based on the collected transaction data.
区块链网络中的各个区块链节点在构建好各自的区块后,都会执行共识算法。所谓共识算法指的是具体哪个节点构建的区块作为有效区块最终写入到区块链,需要所有区块链节点形成一个共识。以下详细介绍共识算法包括的两个步骤:Each blockchain node in the blockchain network implements a consensus algorithm after constructing its own block. The so-called consensus algorithm refers to which block constructed by the specific node is finally written to the blockchain as an effective block, and all blockchain nodes need to form a consensus. The following two steps are included in the consensus algorithm:
第一、区块链节点根据自身所构建区块的区块头计算哈希值。First, the blockchain node calculates a hash value according to the block header of the block that it constructs.
具体地,区块链节点可以通过不断地调整区块头中的随机数,以持续不断地计算哈希值。Specifically, the blockchain node can continuously calculate the hash value by continuously adjusting the random number in the block header.
第二、所述区块链节点确定计算出的哈希值满足目标难度,则把自身所构建的区块广播给区块链网络中的其它区块链节点。Second, the blockchain node determines that the calculated hash value satisfies the target difficulty, and broadcasts the block constructed by itself to other blockchain nodes in the blockchain network.
具体实现中,区块链节点会持续计算哈希值,直至计算出满足目标难度的哈希值。In a specific implementation, the blockchain node continuously calculates the hash value until a hash value that satisfies the target difficulty is calculated.
另外,以PoW算法为例,假设满足目标难度的哈希值为前n位为零,长度为N比特,一旦第一区块链节点计算出的哈希值小于目标难度值,则认为计算出的哈希值满足目标难度。示例的,目标难度值为0000011,第一区块链节点一旦计算出前5位为0的7位二进制数值并且小于0000011,则认为第一区块链节点计算出了满足目标难度的哈希值。进一步,第一区块链节点计算出满足目标难度的哈希值之后,会将自身构建的区块广播给区块链网络中的其他区块链节点。In addition, taking the PoW algorithm as an example, it is assumed that the hash value satisfying the target difficulty is zero for the first n bits and N bits for the length. Once the hash value calculated by the first block chain node is smaller than the target difficulty value, it is considered to be calculated. The hash value satisfies the target difficulty. For example, the target difficulty value is 0000011. Once the first block chain node calculates a 7-bit binary value of 0 in the first 5 bits and is less than 0000011, it is considered that the first block chain node calculates a hash value that satisfies the target difficulty. Further, after the first blockchain node calculates the hash value that satisfies the target difficulty, the block constructed by itself is broadcasted to other blockchain nodes in the blockchain network.
需要说明的是,通过以上两个步骤完成共识过程后,最终将最早计算出满足目标难度的哈希值的区块链节点确定为记账节点,进一步记账节点构建的区块记为有效区块,可以被写入区块链中,即将包含所述设备交易消息的区块加入区块链网络中。It should be noted that after the consensus process is completed through the above two steps, the blockchain node that first calculates the hash value satisfying the target difficulty is finally determined as the accounting node, and the block constructed by the further accounting node is recorded as the effective area. A block, which can be written into the blockchain, joins the block containing the device transaction message to the blockchain network.
也就是说,如果设备发起了包含设备信息的交易消息,那么这个交易消息就会被区块链节点收到,随后通过执行共识算法,设备信息就会被打包进区块,从而写入区块链。That is, if the device initiates a transaction message containing device information, the transaction message is received by the blockchain node, and then the device information is packaged into the block by executing the consensus algorithm, thereby writing the block. chain.
104、第一区块链节点确定已将包含所述交易消息的区块加入所述区块链网络中的区块链。104. The first blockchain node determines that the block containing the transaction message has been added to the blockchain in the blockchain network.
需要说的是,一个区块链节点并不能确定自己是不是记账节点,即不能确定自己构建的区块是不是有效区块。因为每一个区块链节点都在独立地执行共识算法计算哈希值。只有所有区块链节点把自己构建的区块发出去之后,才能确定哪个区块链节点是记账节点。另外,所述交易消息已加入所述区块链网络中的区块链,具体是指交易消息中的设备信息加入了区块链网络。It should be said that a blockchain node cannot determine whether it is a billing node, that is, it cannot be determined whether the block itself is a valid block. Because each blockchain node executes the consensus algorithm independently to calculate the hash value. Only after all the blockchain nodes have sent out the blocks they have built can they determine which blockchain node is the accounting node. In addition, the transaction message has been added to the blockchain in the blockchain network, specifically that the device information in the transaction message is added to the blockchain network.
以POW算法为例,参考图4,假设区块链网络中的区块链节点A构建了区块1,区块链节点B构建了区块2。区块链节点A在计算出满足目标难度的哈希值后将区块1广播给区块链网络中的其他区块链节点,区块链节点B在计算出满足目标难度的哈希值后将区块2广播给区块链网络中的其他区块链节点。Taking the POW algorithm as an example, referring to FIG. 4, it is assumed that the blockchain node A in the blockchain network constructs the block 1, and the blockchain node B constructs the block 2. The blockchain node A broadcasts the block 1 to other blockchain nodes in the blockchain network after calculating the hash value satisfying the target difficulty, and the blockchain node B calculates the hash value satisfying the target difficulty. Block 2 is broadcast to other blockchain nodes in the blockchain network.
如此,区块链网络中有一些区块链节点(如:区块链节点C)收到区块1,后续收集交易数据,沿着区块1构建新的区块,还有一些区块链节点(如:区块链节点D)接收到区块2,后续收集交易数据沿着区块2构建新的区块。Thus, some blockchain nodes (eg, blockchain node C) in the blockchain network receive block 1, subsequent collection of transaction data, construction of new blocks along block 1, and some blockchains. The node (eg, blockchain node D) receives block 2, and subsequently collects transaction data to build a new block along block 2.
对于区块链网络中的任意一个区块链节点,如本发明实施例所述的第一区块链节点,可以通过以下两个特征确定哪个区块是有效区块,以便将构建该区块的区块链节点确定为记账节点。具体地:For any one of the blockchain nodes in the blockchain network, the first blockchain node as described in the embodiment of the present invention can determine which block is a valid block by using the following two features, so that the block will be constructed. The blockchain node is determined to be a billing node. specifically:
(1)根据各个区块链节点基于接收到的区块构建的区块链分支的长度来确定有可能是有效区块的区块。(1) A block that is likely to be a valid block is determined according to the length of the block chain branch constructed by each block chain node based on the received block.
需要说明的是,区块链分支可以认为是某个区块链的一部分区块串联而成的分支。通常,由于有效区块是最早计算出满足目标难度哈希值的区块链节点构建的区块,该 区块链节点广播区块的时间也是最早的,因此基于有效区块构建的区块链分支应该是最长的。示例的,参考图4,区块链节点C基于区块1构建的区块链包括区块1、区块11、区块12、区块13、区块14、区块15、区块16;区块链节点D基于区块2构建的区块链包括区块2、区块21、区块22、区块23、区块24。那么可以确定区块1所在分支是最长的,初步确定区块1有可能是有效区块。It should be noted that the blockchain branch can be regarded as a branch in which a part of a blockchain is connected in series. Generally, since the effective block is the block constructed by the blockchain node that satisfies the target difficulty hash value, the time of the block chain node broadcasting block is also the earliest, so the block chain constructed based on the effective block is The branch should be the longest. For example, referring to FIG. 4, the blockchain constructed by the blockchain node C based on the block 1 includes the block 1, the
(2)对上一步骤确定的“有可能是有效区块的区块”所在的区块链分支进行“N个区块的验证”,即对上述有可能是有效区块的区块以及串联在其后的N-1个区块进行验证。(2) Perform "N-block verification" on the blockchain branch where the "block that may be a valid block" determined in the previous step, that is, the above-mentioned block that may be a valid block and the concatenation Verification is performed in the following N-1 blocks.
示例的,可以进行6个区块的验证。上述过程确定区块1有可能是有效区块,那么在此对区块1以及区块1后串联的5个区块进行验证,即区块11、区块12、区块13、区块14、区块15进行验证,一旦区块1以及区块11、区块12、区块13、区块14、区块15通过验证,则表明区块1是有效区块。For example, verification of 6 blocks can be performed. The above process determines that the block 1 is likely to be a valid block, and then the block 1 and the 5 blocks connected in series after the block 1 are verified, that is, the
经过以上两个步骤最终确定了有效区块。另外,对于区块链网络中的任意一个区块链节点,如本发明实施例所述的第一区块链节点,在确定有效区块后,还可以确定有效区块是哪个区块链节点构建的这个有效区块,即确定哪个区块链节点是记账节点。After the above two steps, the effective block is finally determined. In addition, for any one of the blockchain nodes in the blockchain network, the first blockchain node according to the embodiment of the present invention can determine which blockchain node the effective block is after determining the effective block. This valid block is constructed, that is, which block chain node is determined as a billing node.
完成共识之后,包含交易消息的区块被写入区块链。进而,设备信息也被写入区块链中,示例的,图4中交易消息被写入区块1、区块11、区块12、区块13、区块14、区块15等区块所在的区块链。After the consensus is completed, the block containing the transaction message is written to the blockchain. Further, the device information is also written into the blockchain. For example, the transaction message in FIG. 4 is written into the block 1, the
也就是说,在本发明实施例中所述第一区块链节点可以确定自身构建的包含所述交易消息的第一区块为有效区块,被加入所述区块链网络的一个区块链中。That is, in the embodiment of the present invention, the first blockchain node may determine that the first block that is constructed by itself and includes the transaction message is a valid block, and is added to a block of the blockchain network. In the chain.
或者,所述第一区块链节点可以确定所述区块链网络中除所述第一区块链节点外的其他区块链节点构建的第二区块被加入所述区块链网络的一个区块链中。当然,所述第二区块包含所述交易消息。Alternatively, the first blockchain node may determine that a second block constructed by other blockchain nodes other than the first blockchain node in the blockchain network is added to the blockchain network. In a blockchain. Of course, the second block contains the transaction message.
进而,第一区块链节点可以确认来自所述设备的交易消息已加入所述区块链网络的区块链中。Further, the first blockchain node can confirm that a transaction message from the device has been added to the blockchain of the blockchain network.
需要说明的是,包含在区块中的可以是设备的交易消息,也可以是交易消息中包含的设备信息。本发明不做限定。由于区块链网络中采用分布式共识和存储,因此可以保证设备信息是不易被篡改的,那么所述设备的可信度就高。It should be noted that the information contained in the block may be a transaction message of the device, or may be a device information included in the transaction message. The invention is not limited. Since distributed consensus and storage are used in the blockchain network, it is ensured that the device information is not easily falsified, and the reliability of the device is high.
105、第一区块链节点向所述设备发送确认消息,所述确认消息用于指示所述交易消息已加入所述区块链网络中的区块链。105. The first blockchain node sends an acknowledgement message to the device, where the acknowledgement message is used to indicate that the transaction message has been added to a blockchain in the blockchain network.
本发明实施例中,可以把设备信息作为一个交易发送给区块链网络中的区块链节点,以将所述设备信息加入设备区块链网络的一个区块链中,可以为未来该设备加入其他区块链网络做好准备。另外,该设备就可以加入一些共识算法那较为简单的区块链网络,参与这些区块网络的共识过程,也可以存储这些区块链网络的区块链,如此就提高了区块链网络的分布性,也就在一定程度上提高了区块链网络的抗攻击性,提升了数据安全。In the embodiment of the present invention, the device information may be sent as a transaction to a blockchain node in the blockchain network, so that the device information is added to a blockchain of the device blockchain network, which may be the device in the future. Be prepared to join other blockchain networks. In addition, the device can join some of the simpler blockchain networks of consensus algorithms, participate in the consensus process of these block networks, and also store the blockchains of these blockchain networks, thus improving the blockchain network. The distribution also improves the anti-aggression of the blockchain network to a certain extent and improves data security.
需要说明的是,步骤101~105中的交易消息即本发明实施例所述的第一交易消息,步骤105中的确认消息即本发明实施例所述的第一确认消息,步骤101~105涉及的设备信息是所述设备的第一设备信息。It should be noted that the transaction message in steps 101-105 is the first transaction message in the embodiment of the present invention, and the confirmation message in step 105 is the first confirmation message in the embodiment of the present invention, and steps 101-105 are involved. The device information is the first device information of the device.
在一些实施例中,针对每一个要加入设备区块链网络的设备,都可以按照上述步骤101~105把设备信息加入设备区块链网络。随着想加入区块链的设备的增多,区块链节点信息的有效区块也会增加,区块链节点信息的这些有效区块可以构成一个区块链,记为设备区块链。In some embodiments, for each device to be added to the device blockchain network, the device information may be added to the device blockchain network according to steps 101-105 above. As the number of devices that want to join the blockchain increases, the effective blocks of the blockchain node information also increase, and the effective blocks of the blockchain node information can form a blockchain, which is recorded as a device blockchain.
在一些实施例中,在构建设备区块链之前,可以针对不同设备的器件构建器件链,如:CPU器件链、内存器件链。示例的,设备将器件信息(如:CPU的信息)作为一个独立的交易消息发送给区块链网络,执行上述步骤101-105,确定记账节点,将携带有器件信息的区块(有效区块)写入区块链。针对每一个设备都有一个有效区块存储有该设备的CPU信息,这些不同的有效区块可以构成一个区块链,记为CPU器件链。In some embodiments, a device chain can be built for devices of different devices, such as a CPU device chain, a memory device chain, before building a device blockchain. For example, the device sends device information (such as CPU information) as a separate transaction message to the blockchain network, and performs the above steps 101-105 to determine the accounting node, which will carry the device information (valid area) Block) writes to the blockchain. For each device, there is a valid block in which the CPU information of the device is stored. These different valid blocks can form a blockchain, which is recorded as a CPU device chain.
进一步的,在构建器件链之后,设备信息可以引用相应的器件区块链。如:设备区块链中关于设备的CPU的信息,可以引用CPU所在的CPU区块链中的相应区块。Further, after building the device chain, the device information can reference the corresponding device blockchain. For example, information about the CPU of the device in the device blockchain can refer to the corresponding block in the CPU blockchain where the CPU is located.
在一些实施例中,交易消息中还可以包括设备的属性信息,如:设备的信用信息。所谓设备信用信息,用于指示设备的可信程度。In some embodiments, the transaction message may further include attribute information of the device, such as credit information of the device. The so-called device credit information is used to indicate the credibility of the device.
可选的,也可以构建信用区块链来记录和维护设备的信用信息。此时,设备区块链中设备的信用信息,可以引用信用区块链中的信息。Alternatively, a credit blockchain can be constructed to record and maintain credit information for the device. At this time, the credit information of the device in the device blockchain can refer to the information in the credit blockchain.
进一步,当一个设备加入一个新的设备区块链时,可以参考该设备所在的信用区块链确定设备的信用状况,也可以参考该设备之前所在的设备区块链中存储的该设备的信用信息确定设备的信用状况。Further, when a device joins a new device blockchain, the credit status of the device may be determined by referring to the credit block chain in which the device is located, or the credit of the device stored in the device blockchain in which the device was previously located may be referred to. The information determines the credit status of the device.
在一些实施例中,一旦发现恶意节点,可以将恶意节点的信息通知所有相关区块链。并发起相关交易,用于修改设备区块链中相关设备的信用信息,如:将信用信息改为可信程度低或不可信。In some embodiments, once a malicious node is discovered, the information of the malicious node can be notified to all relevant blockchains. And initiate related transactions, which are used to modify the credit information of related devices in the device blockchain, such as: changing the credit information to a low degree of credibility or untrustworthy.
在一些实施例中还可以对区块链中的设备信息进行更新,如图5所示,所述更新方法还可以包括以下步骤:In some embodiments, the device information in the blockchain may also be updated. As shown in FIG. 5, the update method may further include the following steps:
201、所述设备向区块链网络中的节点发送交易消息,所述交易消息包括所述设备更新后的设备信息。201. The device sends a transaction message to a node in a blockchain network, where the transaction message includes device information that is updated by the device.
其中,更新后的设备信息即所述设备的第二设备信息。The updated device information is the second device information of the device.
同样,所述节点可以是区块链网络中的一个通信节点或区块链节点。如:本发明实施例图5中的第二区块链节点。当然,图5仅示出了设备将交易消息发送给区块链节点的情况,设备还可以将交易消息发送给通信节点,本发明实施例对此不作限定。Also, the node may be a communication node or a blockchain node in a blockchain network. For example, the second blockchain node in FIG. 5 of the embodiment of the present invention. Of course, FIG. 5 only shows the case where the device sends a transaction message to the blockchain node, and the device can also send the transaction message to the communication node, which is not limited in this embodiment of the present invention.
202、所述节点向区块链网络中的其他节点转发所述交易消息。202. The node forwards the transaction message to other nodes in the blockchain network.
具体实现中,区块链网络中的任意一个节点(区块链节点或通信节点)接收到交易消息后,都会将交易消息广播出去,尽可能保证区块链网络中的每一个区块链节点都可以获取到来自所述设备的交易消息。In a specific implementation, any node (blockchain node or communication node) in the blockchain network broadcasts the transaction message after receiving the transaction message, and ensures each blockchain node in the blockchain network as much as possible. All transaction messages from the device can be obtained.
如此,对于区块链网络中的任意一个区块链节点,如本发明实施例所述的第一区块链节点,可以接收所述节点(如图5中的第二区块链节点)广播的交易消息。当然,第一区块链节点也可以接收区块链网络中的任意一个通信节点广播的交易消息。As such, for any one of the blockchain nodes in the blockchain network, the first blockchain node according to the embodiment of the present invention may receive the broadcast of the node (such as the second blockchain node in FIG. 5). Trading news. Of course, the first blockchain node can also receive the transaction message broadcast by any one of the communication nodes in the blockchain network.
需要说明的是,不论是区块链节点还是通信节点收到设备发送交易消息都会将接收到的交易消息广播给区块链网络中的其他节点,最终区块链网络中的每一个节点都会收到来自该设备的交易消息。It should be noted that whether the blockchain node or the communication node receives the transaction message from the device, the received transaction message will be broadcast to other nodes in the blockchain network, and each node in the final blockchain network will receive. To the transaction message from the device.
203、区块链节点进行共识算法,确定记账节点。203. The blockchain node performs a consensus algorithm to determine a billing node.
需要说明的是,对于区块链网络的任意一个区块链节点,会持续收集交易数据,根据收集到的交易数据和交易消息构建区块。同样,在更新设备信息的过程中,区块链网络中的各个区块链节点在构建好各自的区块后,也会会执行共识算法,确定为记账节点,只是在此过程中确定的记账节点与步骤103确定的记账节点可能不同。It should be noted that for any blockchain node of the blockchain network, transaction data is continuously collected, and blocks are constructed according to the collected transaction data and transaction messages. Similarly, in the process of updating the device information, each blockchain node in the blockchain network will also execute a consensus algorithm after determining the respective blocks, and determine the accounting node, which is determined only in the process. The billing node may be different from the billing node determined in step 103.
进一步记账节点构建的区块记为有效区块,可以被写入区块链中,即将包含所述设备交易消息的区块加入区块链网络中。The block constructed by the further accounting node is recorded as a valid block and can be written into the blockchain, that is, the block containing the device transaction message is added to the blockchain network.
204、记账节点将有效区块中的设备信息更新为交易消息所携带的更新后的设备信息。204. The accounting node updates the device information in the valid block to the updated device information carried in the transaction message.
具体实现中,步骤101~105之后所述设备的第一设备信息被加入了有效区块中,记账节点将有效区块中的设备信息更新为步骤201所述的交易消息中的设备信息,即将有效区块中的第一设备信息更新为步骤201所述的交易消息中的第二设备信息。In a specific implementation, after the steps 101-105, the first device information of the device is added to the valid block, and the accounting node updates the device information in the valid block to the device information in the transaction message described in step 201. The first device information in the valid block is updated to the second device information in the transaction message described in step 201.
需要说明的是,在步骤203确定的记账节点可以对区块进行修改,因此更新设备信息的过程中,由记账节点修改有效区块中的设备信息。It should be noted that the accounting node determined in step 203 may modify the block, so in the process of updating the device information, the device information in the effective block is modified by the accounting node.
在一些实施例中本发明实施例所述的第一区块链节点可以是上述记账节点,通过步骤204,第一区块链节点可以确定已将区块链网络中存储的设备信息更新为接收到的交易消息中包括的新的设备信息,因此,第一区块链节点可以向设备发送确认消息,确认已将新的设备信息加入区块链网络,即已将区块链网络中的设备信息进行了更新。205、记账节点向所述设备发送确认消息,所述确认消息用于指示已将区块链中的设备信息进行更新。In some embodiments, the first blockchain node in the embodiment of the present invention may be the foregoing billing node. In step 204, the first blockchain node may determine that the device information stored in the blockchain network has been updated to The new device information included in the received transaction message, therefore, the first blockchain node can send an acknowledgement message to the device confirming that the new device information has been added to the blockchain network, that is, in the blockchain network The device information has been updated. 205. The billing node sends an acknowledgement message to the device, where the acknowledgement message is used to indicate that the device information in the blockchain has been updated.
需要说明的是,步骤201~205中的交易消息即本发明实施例所述的第二交易消息,步骤105中的确认消息即本发明实施例所述的第二确认消息,步骤201~205涉及的设备信息是所述设备的第二设备信息,即所述设备更新后的设备信息。It should be noted that the transaction message in steps 201-205 is the second transaction message in the embodiment of the present invention, and the confirmation message in step 105 is the second confirmation message in the embodiment of the present invention, and steps 201-205 are involved. The device information is the second device information of the device, that is, the updated device information of the device.
在一些实施例,还可以基于物理不可克隆函数(physical unclonable function,PUF)对设备进行认证。In some embodiments, the device may also be authenticated based on a physical unclonable function (PUF).
首先,在区块链网络中区块链节点的激励响应记录。具体地,设备可以将激励响应记录作为设备的一个属性携带在步骤101的交易消息中发送给区块链网络,当然,也可以通过一个独立交易消息将设备的激励响应记录发送给区块链网络,参考上述101至105的过程将设备的激励响应记录加入一个区块链中。具体地,如图6所示,包括以下步骤:First, the stimulus response record of the blockchain node in the blockchain network. Specifically, the device may send the stimulus response record as an attribute of the device in the transaction message of step 101 and send it to the blockchain network. Of course, the device may also send the device's stimulus response record to the blockchain network through an independent transaction message. Referring to the procedures of 101 to 105 above, the device's stimulus response record is added to a blockchain. Specifically, as shown in FIG. 6, the following steps are included:
301、控制设备向所述设备发送激励信号。301. The control device sends an excitation signal to the device.
激励信号也就是输入信号,可以是脉冲信号。The excitation signal is also the input signal and can be a pulse signal.
302、所述设备向控制设备发送响应结果。302. The device sends a response result to the control device.
具体实现中,所述设备接收激励信号后,会根据该激励信号输出响应结果。对于所述设备来说,激励信号是输入信号,响应结果是与激励信号对应的输出信号。In a specific implementation, after receiving the excitation signal, the device outputs a response result according to the excitation signal. For the device, the excitation signal is an input signal and the response is an output signal corresponding to the excitation signal.
需要说明的是,物理不可克隆函数利用物体内在的物理构造来对物体进行唯一性标识,输入任意激励信号都会输出一个唯一且不可预测的响应结果。在本发明实施例中,比如,设备内置的内存对于任意激励信号都会输出一个唯一且不可预测的响应结果,因此可以利用响应结果来区分不同的设备。It should be noted that the physical unclonable function uses the physical structure inherent in the object to uniquely identify the object, and inputting any excitation signal will output a unique and unpredictable response result. In the embodiment of the present invention, for example, the built-in memory of the device outputs a unique and unpredictable response result for any excitation signal, so the response result can be used to distinguish different devices.
303、控制设备存生成设备的认证数据。303. The control device stores the authentication data of the device.
进一步,重复执行述步骤301~303,控制设备向所述设备输入多个激励信号,相应地会获取到多个响应结果,进而控制设备会存储很多对激励信号、响应结果。进而可以根据存储的激励信号、响应结果,生成设备的认证数据,包括所述设备的标识、至少一个激励信号、与所述至少一个激励信号中的每一个激励信号对应的响应结果。Further, the steps 301-303 are repeatedly performed, and the control device inputs a plurality of excitation signals to the device, and correspondingly obtains a plurality of response results, and the control device stores a plurality of pairs of excitation signals and response results. Further, the authentication data of the device may be generated according to the stored excitation signal and the response result, including the identifier of the device, the at least one excitation signal, and the response result corresponding to each of the at least one excitation signal.
在一些实施例中,控制设备还可以根据激励信号的响应结果计算响应结果的哈希值。进一步,可以根据激励信号、响应结果的哈希值生成所述设备的认证数据,具体地,此时生成的认证数据包括所述设备的标识、至少一个激励信号、与所述至少一个激励信号中的每一个激励信号对应的响应结果的哈希值。In some embodiments, the control device may further calculate a hash value of the response result according to the response result of the excitation signal. Further, the authentication data of the device may be generated according to the excitation signal and the hash value of the response result. Specifically, the authentication data generated at this time includes the identifier of the device, the at least one excitation signal, and the at least one excitation signal. Each of the excitation signals corresponds to a hash value of the response result.
为了实现第一区块链节点对所述设备的认证,还需要将设备的认证数据以及设备的标识对应存储在区块链中,如图6所示,在步骤303之后,还可以包括步骤304~305。In order to implement the authentication of the device by the first blockchain node, the authentication data of the device and the identifier of the device are correspondingly stored in the blockchain. As shown in FIG. 6, after step 303, step 304 may be further included. ~ 305.
304、控制设备向区块链网络中的节点发送交易消息,该交易消息携带所述认证数据以及所述设备的标识。304. The control device sends a transaction message to a node in the blockchain network, where the transaction message carries the authentication data and an identifier of the device.
同样,所述节点可以是区块链网络中的一个通信节点或区块链节点。如:本发明实施例图6中的第二区块链节点。当然,图6仅示出了设备将交易消息发送给区块链节点的情况,设备还可以将交易消息发送给通信节点,本发明实施例对此不作限定。Also, the node may be a communication node or a blockchain node in a blockchain network. For example, the second blockchain node in FIG. 6 of the embodiment of the present invention. Of course, FIG. 6 only shows a case where the device sends a transaction message to the blockchain node, and the device can also send the transaction message to the communication node, which is not limited by the embodiment of the present invention.
305、所述节点向区块链网络中的其他节点转发所述交易消息。305. The node forwards the transaction message to other nodes in the blockchain network.
具体实现中,区块链网络中的任意一个节点(区块链节点或通信节点)接收到交易消息后,都会将交易消息广播出去,尽可能保证区块链网络中的每一个区块链节点都可以获取到来自所述设备的交易消息。In a specific implementation, any node (blockchain node or communication node) in the blockchain network broadcasts the transaction message after receiving the transaction message, and ensures each blockchain node in the blockchain network as much as possible. All transaction messages from the device can be obtained.
如此,对于区块链网络中的任意一个区块链节点,如本发明实施例所述的第一区块链节点,可以接收所述节点(如图6中的第二区块链节点)广播的交易消息。当然,第一区块链节点也可以接收区块链网络中的任意一个通信节点广播的交易消息。As such, for any one of the blockchain nodes in the blockchain network, the first blockchain node according to the embodiment of the present invention may receive the broadcast of the node (such as the second blockchain node in FIG. 6). Trading news. Of course, the first blockchain node can also receive the transaction message broadcast by any one of the communication nodes in the blockchain network.
需要说明的是,不论是区块链节点还是通信节点收到设备发送交易消息都会将接收到的交易消息广播给区块链网络中的其他节点,最终区块链网络中的每一个节点都会收到来自该设备的交易消息。It should be noted that whether the blockchain node or the communication node receives the transaction message from the device, the received transaction message will be broadcast to other nodes in the blockchain network, and each node in the final blockchain network will receive. To the transaction message from the device.
306、区块链网络中的区块链节点执行共识算法,确定记账节点。306. The blockchain node in the blockchain network executes a consensus algorithm to determine the accounting node.
需要说明的是,对于区块链网络的任意一个区块链节点,会持续收集交易数据,根据收集到的交易数据和交易消息构建区块,即各个区块链节点构建了包含所述设备激励响应记录和所述设备的标识的区块。同样,在更新设备信息的过程中,区块链网络中的各个区块链节点在构建好各自的区块后,也会执行共识算法,确定记账节点,只是在此过程中确定的记账节点与步骤103确定的记账节点可能不同。另外,在此过程中记账节点所构建的区块作为有效区块加入区块链中,也就是说所述设备激励响应记录和所述设备的标识被写入了区块链中。It should be noted that for any blockchain node of the blockchain network, the transaction data is continuously collected, and the block is constructed according to the collected transaction data and the transaction message, that is, each blockchain node constructs the device incentive including the device. A block that responds to the record and the identity of the device. Similarly, in the process of updating the device information, each blockchain node in the blockchain network, after constructing the respective block, also executes a consensus algorithm to determine the accounting node, but only the accounting determined in the process. The node may be different from the accounting node determined in step 103. In addition, the block constructed by the accounting node in this process is added as a valid block to the blockchain, that is, the device stimulus response record and the identifier of the device are written in the blockchain.
在一些实施例中,也可以是所述设备自己生成激励信号,无需控制设备向所述设备输入激励信号。所述设备可以根据自己生成的激励信号输出响应结果,并生成激励响应记录,记录多个激励响应对(即一个激励信号和对应的一个响应结果)。最后,所述设备还会向第一区块链节点发送携带所述激励响应记录以及所述设备的标识的交易消息,以便第一区块链节点在所述第一区块中存储所述激励响应记录和所述设备的 标识之间的对应关系。In some embodiments, the device may also generate an excitation signal by itself without requiring the control device to input an excitation signal to the device. The device may output a response result according to the excitation signal generated by itself, and generate an excitation response record, and record a plurality of excitation response pairs (ie, an excitation signal and a corresponding response result). Finally, the device also sends a transaction message carrying the stimulus response record and the identity of the device to the first blockchain node, so that the first blockchain node stores the stimulus in the first block Correspondence between the response record and the identity of the device.
可选的,为安全起见,控制设备或者设备自身,向所述区块链发送的是与激励对应的响应的Hash,而不是响应本身。Optionally, for security reasons, the control device or the device itself sends a hash to the blockchain corresponding to the response, rather than the response itself.
基于此,可以记账节点可以利用PUF对所述设备进行认证,如图7所示,具体包括以下步骤:Based on this, the accounting node can use the PUF to authenticate the device, as shown in FIG. 7, which specifically includes the following steps:
401、认证设备从记账节点获取一个激励响应对,包括第一激励信号和第一响应结果。401. The authentication device acquires an excitation response pair from the accounting node, including the first excitation signal and the first response result.
可选的,认证设备获取的可能是第一激励信号,和第一响应结果的哈希值。Optionally, the authentication device may obtain a first excitation signal and a hash value of the first response result.
具体地,认证设备向记账节点发送待认证设备的标识,记账节点以待认证设备的标识为索引查询有效区块中的激励响应记录,确定与待认证设备的标识对应的激励响应记录,随后再将该激励响应记录中的一个激励响应对发送给认证设备。Specifically, the authentication device sends the identifier of the device to be authenticated to the billing node, and the billing node queries the incentive response record in the valid block with the identifier of the device to be authenticated as an index, and determines an incentive response record corresponding to the identifier of the device to be authenticated. A pair of stimulus responses in the stimulus response record is then sent to the authentication device.
在一些实施例中,如果控制设备或者设备自身,向所述区块链发送的认证数据是激励信号以及与激励对应的响应的Hash,而不是响应本身,那么第一区块链节点获取的也可能是一个(激励,响应哈希值)对。In some embodiments, if the control device or the device itself, the authentication data sent to the blockchain is a hash of the stimulus signal and the response corresponding to the stimulus, rather than the response itself, then the first blockchain node also acquires May be a (incentive, response hash) pair.
402、认证设备将第一激励信号发送给待认证设备。402. The authentication device sends the first excitation signal to the device to be authenticated.
403、所述设备根据所述第一激励信号生成响应结果,并将生成的响应结果发送给认证设备。403. The device generates a response result according to the first excitation signal, and sends the generated response result to the authentication device.
404、认证设备判断接收到的响应结果与步骤401获取到的第一响应结果是否相同。404. The authentication device determines whether the received response result is the same as the first response result obtained in step 401.
或者,认证设备判断接收到的响应结果的哈希值,与步骤401获取到的第一响应结果哈希值是否相同。Alternatively, the authentication device determines whether the hash value of the received response result is the same as the hash value of the first response result obtained in step 401.
需要说明的是,根据PUF可知,待认证设备对于任意激励信号都会输出一个唯一且不可预测的响应结果,且第一响应结果是待认证设备根据第一激励信号的响应结果,因此如果认证设备接收到的响应结果与第一响应结果,或者,如果认证设备接收到的响应结果的哈希值,与第一响应结果的哈希值相同,可以证明待认证设备是设备标识所标识的设备本身,而不是其它设备。It should be noted that, according to the PUF, the device to be authenticated outputs a unique and unpredictable response result for any excitation signal, and the first response result is a response result of the device to be authenticated according to the first excitation signal, so if the authentication device receives The response result and the first response result, or if the hash value of the response result received by the authentication device is the same as the hash value of the first response result, it may be proved that the device to be authenticated is the device itself identified by the device identifier, Not other devices.
若认证设备判断接收到的响应结果与步骤401获取到的第一响应结果或第一响应结果的哈希值相同,则执行步骤405;若认证设备判断接收到的响应结果与步骤401获取到的第一响应结果或者第一响应结果的哈希值不相同,则执行步骤406。If the authentication device determines that the received response result is the same as the hash value of the first response result or the first response result obtained in step 401, step 405 is performed; if the authentication device determines the received response result and the step 401 is obtained, If the hash value of the first response result or the first response result is not the same, step 406 is performed.
405、认证设备确定所述设备通过认证。405. The authentication device determines that the device passes the authentication.
406、认证设备确定所述设备认证失败。406. The authentication device determines that the device authentication fails.
在一些实施例中,针对每一个设备,都可以执行上述步骤301~305,最终针对每一个设备都有一个有效区块存储有该设备的标识以及该设备的激励响应记录,这些不同的有效区块可以构成一个认证信息区块链。In some embodiments, for each device, the above steps 301-305 can be performed, and finally, for each device, there is an active block storing the identifier of the device and the stimulus response record of the device, and the different effective areas. A block can form a chain of authentication information blocks.
本发明实施例提供一种区块链节点。在采用对应各个功能划分各个功能模块的情况下,图8示出了上述区块链节点的一种可能的结构示意图。如图8所示,所述区块链节点包括获取单元501、处理单元502以及发送单元503。Embodiments of the present invention provide a blockchain node. In the case where each functional module is divided by corresponding functions, FIG. 8 shows a possible structural diagram of the above-described blockchain node. As shown in FIG. 8, the blockchain node includes an obtaining
获取单元501,用于支持所述区块链节点执行上述实施例中的步骤101,和/或用于本文所描述的技术的其它过程。The obtaining
处理单元502,用于支持所述区块链节点执行上述实施例中的步骤102、103,和/ 或用于本文所描述的技术的其它过程;
发送单元503,用于支持所述区块链节点执行上述实施例中的步骤104,和/或用于本文所描述的技术的其它过程;a sending
需要说明的是,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。It should be noted that all the related content of the steps involved in the foregoing method embodiments may be referred to the functional descriptions of the corresponding functional modules, and details are not described herein again.
示例性的,在采用集成的单元的情况下,本申请实施例提供的区块链节点的结构示意图如图9所示。在图9中,该区块链节点包括:处理模块601和通信模块602。处理模块601用于对区块链节点的动作进行控制管理,例如,执行上述处理单元502执行的步骤,和/或用于执行本文所描述的技术的其它过程。通信模块602用于支持区块链节点与其他设备之间的交互,例如,执行上述获取单元501和发送单元503执行的步骤。如图9所示,区块链节点还可以包括存储模块603,存储模块603用于存储区块链节点的程序代码和数据。Exemplarily, in the case of adopting an integrated unit, a schematic structural diagram of a blockchain node provided by an embodiment of the present application is shown in FIG. 9. In FIG. 9, the blockchain node includes a
当处理模块601为处理器,通信模块602为收发器,存储模块603为存储器时,区块链节点可以为图2所示的区块链节点。如果收发器为接收器和发射器,接收器执行上述获取单元501所执行的步骤,发射器执行发送单元503执行的步骤。When the
在上述实施例中,可以全部或部分的通过软件,硬件,固件或者其任意组合来实现。当使用软件程序实现时,可以全部或部分地以计算机程序产品的形式出现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。该可用介质可以是磁性介质,(例如,软盘,硬盘、磁带)、光介质(例如,DVD)或者半导体介质(例如固态硬盘Solid State Disk(SSD))等。In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, it may occur in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in accordance with embodiments of the present application are generated in whole or in part. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be from a website site, computer, server or data center Transfer to another website site, computer, server, or data center by wire (eg, coaxial cable, fiber optic, digital subscriber line (DSL), or wireless (eg, infrared, wireless, microwave, etc.). The computer readable storage medium can be any available media that can be accessed by a computer or a data storage device such as a server, data center, or the like that includes one or more available media. The usable medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (such as a solid state disk (SSD)).
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and brevity of the description, only the division of the above functional modules is illustrated. In practical applications, the above functions can be allocated according to needs. It is completed by different functional modules, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be used. The combination may be integrated into another device, or some features may be ignored or not performed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显 示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may be one physical unit or multiple physical units, that is, may be located in one place, or may be distributed to multiple different places. . Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a readable storage medium. Based on such understanding, the technical solution of the embodiments of the present application may be embodied in the form of a software product in the form of a software product in essence or in the form of a contribution to the prior art, and the software product is stored in a storage medium. A number of instructions are included to cause a device (which may be a microcontroller, chip, etc.) or a processor to perform all or part of the steps of the methods described in various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes. .
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The foregoing is only a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present application should be covered by the scope of the present application. . Therefore, the scope of protection of the present application should be determined by the scope of the claims.
Claims (14)
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201880086806.3A CN111615818B (en) | 2018-01-16 | 2018-01-16 | A blockchain construction method and blockchain node |
| PCT/CN2018/072885 WO2019140555A1 (en) | 2018-01-16 | 2018-01-16 | Blockchain construction method and blockchain node |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2018/072885 WO2019140555A1 (en) | 2018-01-16 | 2018-01-16 | Blockchain construction method and blockchain node |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2019140555A1 true WO2019140555A1 (en) | 2019-07-25 |
Family
ID=67301658
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2018/072885 Ceased WO2019140555A1 (en) | 2018-01-16 | 2018-01-16 | Blockchain construction method and blockchain node |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN111615818B (en) |
| WO (1) | WO2019140555A1 (en) |
Cited By (12)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110599180A (en) * | 2019-09-26 | 2019-12-20 | 腾讯科技(深圳)有限公司 | Block chain-based vaccine circulation management method and device |
| CN110650097A (en) * | 2019-09-20 | 2020-01-03 | 腾讯科技(深圳)有限公司 | Data broadcasting method and device and computer readable storage medium |
| CN110969524A (en) * | 2019-11-28 | 2020-04-07 | 中国建设银行股份有限公司 | Block chain-based fund service processing method, device, equipment and medium |
| CN111182510A (en) * | 2020-01-09 | 2020-05-19 | 重庆邮电大学 | Industrial Internet of things node consensus method based on block chain |
| CN111538791A (en) * | 2020-05-07 | 2020-08-14 | 深圳创客区块链技术有限公司 | Block chain multiple cross-chain mutual protection method, device and storage medium |
| CN111598567A (en) * | 2020-05-07 | 2020-08-28 | 深圳创客区块链技术有限公司 | Method, device and storage medium for preventing block chain large computing power attack |
| CN111917774A (en) * | 2020-07-31 | 2020-11-10 | 平安科技(深圳)有限公司 | Anti-attack method and device for block chain, electronic equipment and medium |
| CN112036880A (en) * | 2020-08-28 | 2020-12-04 | 阚嘉 | Method for realizing real time block chain |
| CN115131167A (en) * | 2022-06-16 | 2022-09-30 | 国网山西省电力公司经济技术研究院 | Data processing method and device in power grid project cost construction scene based on block chain technology |
| CN115329008A (en) * | 2022-09-02 | 2022-11-11 | 中国银行股份有限公司 | Block chain information processing method and device, electronic equipment and storage medium |
| CN116628083A (en) * | 2023-04-27 | 2023-08-22 | 中国人民解放军战略支援部队信息工程大学 | Block chain transaction data expansion storage method and system |
| CN117478301A (en) * | 2023-12-27 | 2024-01-30 | 湖南天河国云科技有限公司 | Block chain consensus achieving method and device based on directed acyclic graph |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113098693B (en) * | 2021-04-08 | 2022-08-16 | 太原理工大学 | Memory verification method based on physical unclonable function algorithm |
| CN119011361B (en) * | 2024-10-21 | 2025-01-24 | 中国星网网络创新研究院有限公司 | Blockchain network management method, device, equipment and first blockchain network |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106130779A (en) * | 2016-07-18 | 2016-11-16 | 布比(北京)网络技术有限公司 | A kind of Internet of Things equipment and with the Internet of Things construction method of this equipment |
| US20170163733A1 (en) * | 2015-12-02 | 2017-06-08 | Olea Networks, Inc. | System and method for data management structure using auditable delta records in a distributed environment |
| CN107135661A (en) * | 2016-12-26 | 2017-09-05 | 深圳前海达闼云端智能科技有限公司 | Data processing method, device, system and information collection equipment |
| US20170324738A1 (en) * | 2016-05-03 | 2017-11-09 | Alcatel-Lucent Usa Inc. | Internet security |
| CN107528856A (en) * | 2017-09-27 | 2017-12-29 | 福建实达电脑设备有限公司 | Internet of Things mist end equipment based on block chain platform access authentication method beyond the clouds |
Family Cites Families (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10679215B2 (en) * | 2016-02-22 | 2020-06-09 | Bank Of America Corporation | System for control of device identity and usage in a process data network |
| US20170302663A1 (en) * | 2016-04-14 | 2017-10-19 | Cisco Technology, Inc. | BLOCK CHAIN BASED IoT DEVICE IDENTITY VERIFICATION AND ANOMALY DETECTION |
| WO2018112946A1 (en) * | 2016-12-23 | 2018-06-28 | 深圳前海达闼云端智能科技有限公司 | Registration and authorization method, device and system |
| CN107317672A (en) * | 2017-05-10 | 2017-11-03 | 广东网金控股股份有限公司 | A kind of light weight terminating machine block catenary system |
| CN107332826B (en) * | 2017-06-09 | 2019-12-03 | 中国联合网络通信集团有限公司 | The communication means and device of block chain agent node |
| CN112865982A (en) * | 2017-07-26 | 2021-05-28 | 创新先进技术有限公司 | Digital certificate management method and device and electronic equipment |
| CN107249009B (en) * | 2017-08-02 | 2020-02-21 | 广东工业大学 | A method and system for data verification based on blockchain |
-
2018
- 2018-01-16 WO PCT/CN2018/072885 patent/WO2019140555A1/en not_active Ceased
- 2018-01-16 CN CN201880086806.3A patent/CN111615818B/en active Active
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20170163733A1 (en) * | 2015-12-02 | 2017-06-08 | Olea Networks, Inc. | System and method for data management structure using auditable delta records in a distributed environment |
| US20170324738A1 (en) * | 2016-05-03 | 2017-11-09 | Alcatel-Lucent Usa Inc. | Internet security |
| CN106130779A (en) * | 2016-07-18 | 2016-11-16 | 布比(北京)网络技术有限公司 | A kind of Internet of Things equipment and with the Internet of Things construction method of this equipment |
| CN107135661A (en) * | 2016-12-26 | 2017-09-05 | 深圳前海达闼云端智能科技有限公司 | Data processing method, device, system and information collection equipment |
| CN107528856A (en) * | 2017-09-27 | 2017-12-29 | 福建实达电脑设备有限公司 | Internet of Things mist end equipment based on block chain platform access authentication method beyond the clouds |
Cited By (21)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110650097A (en) * | 2019-09-20 | 2020-01-03 | 腾讯科技(深圳)有限公司 | Data broadcasting method and device and computer readable storage medium |
| CN110650097B (en) * | 2019-09-20 | 2022-05-31 | 腾讯科技(深圳)有限公司 | Data broadcasting method and device and computer readable storage medium |
| CN110599180B (en) * | 2019-09-26 | 2023-06-27 | 腾讯科技(深圳)有限公司 | Vaccine circulation management method and device based on blockchain |
| CN110599180A (en) * | 2019-09-26 | 2019-12-20 | 腾讯科技(深圳)有限公司 | Block chain-based vaccine circulation management method and device |
| CN110969524A (en) * | 2019-11-28 | 2020-04-07 | 中国建设银行股份有限公司 | Block chain-based fund service processing method, device, equipment and medium |
| CN111182510B (en) * | 2020-01-09 | 2022-05-20 | 重庆邮电大学 | A blockchain-based consensus method for industrial IoT nodes |
| CN111182510A (en) * | 2020-01-09 | 2020-05-19 | 重庆邮电大学 | Industrial Internet of things node consensus method based on block chain |
| CN111598567A (en) * | 2020-05-07 | 2020-08-28 | 深圳创客区块链技术有限公司 | Method, device and storage medium for preventing block chain large computing power attack |
| CN111538791A (en) * | 2020-05-07 | 2020-08-14 | 深圳创客区块链技术有限公司 | Block chain multiple cross-chain mutual protection method, device and storage medium |
| CN111538791B (en) * | 2020-05-07 | 2023-09-22 | 深圳创客区块链技术有限公司 | Block chain multiple-cross-chain mutual protection method, device and storage medium |
| CN111598567B (en) * | 2020-05-07 | 2023-11-10 | 深圳创客区块链技术有限公司 | Method, device and storage medium for preventing blockchain powerful attack |
| CN111917774A (en) * | 2020-07-31 | 2020-11-10 | 平安科技(深圳)有限公司 | Anti-attack method and device for block chain, electronic equipment and medium |
| CN111917774B (en) * | 2020-07-31 | 2022-02-08 | 平安科技(深圳)有限公司 | Anti-attack method and device for block chain, electronic equipment and medium |
| CN112036880B (en) * | 2020-08-28 | 2024-02-23 | 阚嘉 | Method for realizing real-time block chain |
| CN112036880A (en) * | 2020-08-28 | 2020-12-04 | 阚嘉 | Method for realizing real time block chain |
| CN115131167A (en) * | 2022-06-16 | 2022-09-30 | 国网山西省电力公司经济技术研究院 | Data processing method and device in power grid project cost construction scene based on block chain technology |
| CN115329008A (en) * | 2022-09-02 | 2022-11-11 | 中国银行股份有限公司 | Block chain information processing method and device, electronic equipment and storage medium |
| CN116628083A (en) * | 2023-04-27 | 2023-08-22 | 中国人民解放军战略支援部队信息工程大学 | Block chain transaction data expansion storage method and system |
| CN116628083B (en) * | 2023-04-27 | 2024-05-24 | 中国人民解放军战略支援部队信息工程大学 | Blockchain transaction data expansion storage method and system |
| CN117478301A (en) * | 2023-12-27 | 2024-01-30 | 湖南天河国云科技有限公司 | Block chain consensus achieving method and device based on directed acyclic graph |
| CN117478301B (en) * | 2023-12-27 | 2024-04-09 | 湖南天河国云科技有限公司 | Block chain consensus achieving method and device based on directed acyclic graph |
Also Published As
| Publication number | Publication date |
|---|---|
| CN111615818A (en) | 2020-09-01 |
| CN111615818B (en) | 2021-12-14 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2019140555A1 (en) | Blockchain construction method and blockchain node | |
| JP7372434B2 (en) | Script-based blockchain interaction | |
| JP7408619B2 (en) | Computer-implemented system and method for managing large-scale distributed memory pools in blockchain networks | |
| JP7680461B2 (en) | Attestation services used with blockchain networks | |
| JP7703549B2 (en) | Distributed Database | |
| US11502828B2 (en) | Authenticating chaincode to chaincode invocations of a blockchain | |
| TWI727467B (en) | Trustworthiness verification method, system, device and equipment of alliance chain | |
| CN111713088B (en) | Method for processing data, apparatus for processing data and apparatus for processing data | |
| CN109218348B (en) | A method and node device for determining blocks in a blockchain | |
| US20190156332A1 (en) | Optimization of high volume transaction performance on a blockchain | |
| WO2020028589A1 (en) | Techniques for expediting processing of blockchain transactions | |
| CN111460458B (en) | Data processing method, related device and computer storage medium | |
| EP3817333B1 (en) | Method and system for processing requests in a consortium blockchain | |
| JP2024505692A (en) | Data processing methods, devices and computer equipment based on blockchain networks | |
| TWI712972B (en) | Trustworthiness verification method, system, device and equipment of alliance chain | |
| WO2022121538A1 (en) | Data synchronization method and system based on blockchain, and related device | |
| US12321646B1 (en) | Systems and methods for a content-addressable peer-to-peer storage network | |
| CN104756128A (en) | Private third party validation of hardware identification for offer enrollment | |
| CN115996122A (en) | Access control method, device and system | |
| JP2023513950A (en) | layered network | |
| JP2023513951A (en) | Adapting connections in hierarchical networks | |
| US20220046028A1 (en) | Method and system for determining a state of an account in a network device running a light client protocol of a distributed ledger technology network | |
| CN115428400A (en) | Revoking access rights to a network | |
| CN113497762A (en) | Data message transmission method and device | |
| Dai et al. | Towards Trustworthy IoT: A Blockchain‐Edge Computing Hybrid System with Proof‐of‐Contribution Mechanism |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18900901 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 18900901 Country of ref document: EP Kind code of ref document: A1 |