WO2018126344A1 - 一种数据处理方法及相关设备 - Google Patents

一种数据处理方法及相关设备 Download PDF

Info

Publication number
WO2018126344A1
WO2018126344A1 PCT/CN2017/000082 CN2017000082W WO2018126344A1 WO 2018126344 A1 WO2018126344 A1 WO 2018126344A1 CN 2017000082 W CN2017000082 W CN 2017000082W WO 2018126344 A1 WO2018126344 A1 WO 2018126344A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
network node
hash value
node
blockchain
Prior art date
Application number
PCT/CN2017/000082
Other languages
English (en)
French (fr)
Inventor
张亮亮
张臣雄
冯淑兰
常俊仁
Original Assignee
华为技术有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2017/000082 priority Critical patent/WO2018126344A1/zh
Priority to CN201780074039.XA priority patent/CN110023944B/zh
Publication of WO2018126344A1 publication Critical patent/WO2018126344A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Definitions

  • the present application relates to the field of communications technologies, and in particular, to a data processing method and related devices.
  • a block chain is a distributed database. It can be understood as a chained data structure in which data blocks are sequentially connected in a chronological order, and is guaranteed by cryptography. Tampered and unforgeable distributed ledgers.
  • the blockchain generated by the network node is a data structure that is linked by a block containing transaction information in a certain order.
  • the block is composed of a block header containing metadata and tight. It is composed of one or more transaction information constituting the main body of the block, wherein one or more transaction information is generated according to data generated by the device node.
  • the prior art solution For a data generated by a device node, the prior art solution generates a transaction information based on the data, and generates a block in the blockchain through a consensus algorithm. Thus, if the unscrupulous person replaces and falsifies the transaction information of the data in the blockchain, the correctness of the blockchain cannot be verified through the blockchain, and the validity of the data storage is reduced.
  • the embodiment of the present application provides a data processing method and related device, which can effectively verify the stored data by storing the hash value of the data and the data, improve the validity of the data storage, and improve the data.
  • an embodiment of the present application provides a data processing method, including:
  • the central node acquires a first hash value of the first data from the first network node
  • the central node acquires the first data from a second network node, and calculates a second hash value of the first data
  • the central node compares the first hash value with the second hash value
  • the central node determines that the first data is trusted data; or determines that the first data has not been tampered with; or The first hash value of the first data is a trusted hash value.
  • the central node acquires a first hash value of the first data of the first network node, acquires first data of the second network node, and calculates a second hash value of the first data, where the first hash is The column value is compared with the hash value to determine whether the first data is trusted data.
  • the method further includes: if the first hash value is different from the second hash value, determining, by the central node, that the first data is untrusted data; or determining The first data has been tampered with; or the first hash value of the first data is determined to be an untrusted hash value.
  • the acquiring, by the central node, the first hash value of the first data from the first network node is specifically acquiring the first data corresponding to the second blockchain of the first network node. a hash value; wherein the second blockchain is comprised of blocks generated from transaction information including hash value entries of data.
  • the acquiring, by the central node, the first data from the second network node is to obtain the first data from a first blockchain of the second network node, where The first blockchain is composed of blocks generated from transaction information containing data items.
  • the method further includes: the central node acquiring first hash value association information of the first data from a first network node, where the association information includes at least one of the following: An index value of data, time information of the first data, a device node identifier for transmitting the first data, an address for transmitting the first data, and an address for receiving the first data.
  • the method further includes: the central node acquiring association information of the first data from a second network node, where the association information includes at least one of: an index value of the first data And time information of the first data, a device node identifier that sends the first data, an address that sends the first data, and an address that receives the first data.
  • the method before the central node acquires the first hash value of the first data from the first network node, the method further includes: the central node selecting a first network node to determine the target first network And obtaining, by the central node, the first hash value of the first data from the first network node, where the first hash value of the first data is obtained from the second blockchain of the target first network node.
  • the central node selects a first network node to be the target first network node, and the central node selects one of the at least one first network node that meets the first legal condition.
  • the first network node is the target first network node; the first legal condition is: The number of nodes having the same first hash value of the first data of the second blockchain of the target first network node exceeds a first threshold.
  • the method before the central node acquires the first data from the second network node, the method further includes:
  • the central node selects a second network node to determine as the target second network node. And obtaining, by the central node, the first data from the second network node, that: the central node acquires first data from a first blockchain of the target second network node.
  • the central node selects a second network node to determine that the target second network node is specifically selecting, from the at least one second network node, a network node that satisfies the second legal condition as the second a target network node; the second legal condition is that the number of network nodes that are the same as the first data of the first blockchain of the target second network node exceeds a second threshold.
  • the method further includes: if it is determined that the first data is trusted data, the central node determines that the i th transaction information of the third block chain satisfies a generation condition, and generates a third area.
  • the i-th transaction information of the blockchain or, if it is determined that the first data is untrusted data, the central node determines that the i-th transaction information of the third blockchain does not satisfy the generating condition, Generating an i-th transaction information of the third blockchain; or, if it is determined that the first data is untrusted data, the central node determines that the jth transaction information of the third blockchain satisfies Condition, generating the jth transaction information of the third blockchain.
  • an embodiment of the present application provides a data processing method, including:
  • the network node generates a block of the blockchain based on the at least one first transaction information.
  • the first transaction information includes at least one of the following corresponding information: a transaction identifier item, a node identifier item that generates the first transaction information, a data item, an index value item of the data, a hash value item of the data, and a time Information item, sender item of data, and receiver item of data.
  • the device node sends the transaction information to the network node, which can alleviate the storage pressure of the device node.
  • the network node generates a blockchain about the transaction information, which improves the validity of the data storage.
  • the method before the generating, by the network node, the block of the blockchain according to the at least one first transaction information, the method further includes: the network node receiving the data information sent by the at least one device node; The network node generates at least one first transaction information based on the data information. As can be seen, The first transaction information of the network node is generated by the network node.
  • the data information includes at least one of: first data, a first hash value of the first data, an index value of the first data, the first data Time information, an identification of a device node that sent the data information, an address of the device node, and an address of the network node.
  • first transaction information is generated according to the data information
  • information of one or more items included in the first transaction information is also determined by the data information.
  • the network node calculates a first hash value of the first data; And generating, by the network node, the at least one first transaction information according to the data information, where the at least one first transaction information is generated according to the data information and the first hash value.
  • the first transaction information may be related to the first data, or the first transaction information may also be related to the first hash value.
  • the network node sends the at least one first transaction information to another network node or at least one device node. For example, the network node broadcasts the at least one first transaction information.
  • the method further includes: the network node receiving at least one second transaction information sent by another network node or at least one device node; wherein the second transaction information includes at least one of the following corresponding Information: a transaction identification item, a node identification item generating the second transaction information, a data item, an index value item of data, a hash value item of data, a time information item, a sender item of the data, and the data Receive party item.
  • the second transaction information includes at least one of the following corresponding Information: a transaction identification item, a node identification item generating the second transaction information, a data item, an index value item of data, a hash value item of data, a time information item, a sender item of the data, and the data Receive party item.
  • the method further includes: if the at least one first transaction information includes a data item, the network node generates the first region according to the first algorithm according to the at least one first transaction information Block of blockchain.
  • the method further includes: if the at least one first transaction information includes a data item, and the at least one second transaction information includes a data item, the network node is according to the at least one A transaction block and/or the at least one second transaction information, based on the second algorithm, generating a block of the first blockchain.
  • the method further includes: if the at least one first transaction information includes a hash value item of data, the network node is based on the at least one first transaction information, based on a third algorithm, A block of the second blockchain is generated.
  • the method further includes: if the at least one first transaction information includes a hash value item of data, and the at least one second transaction information includes a hash value item of data, The network node generates a block of the second blockchain based on the fourth algorithm based on the at least one first transaction information and/or the at least one second transaction information.
  • the network node if the at least one first transaction information includes a data item, the network node generates a first blockchain based on the at least one first transaction information based on the fifth algorithm. a block; and, if the at least one first transaction information includes a hash value item of data, and the at least one second transaction information includes a hash value item of data, the network node according to the at least one a transaction information and/or the at least one second transaction information, based on a sixth algorithm, generating a block of the second blockchain; or
  • the network node is based on the at least one first transaction information and/or the at least one second transaction Information, based on the seventh algorithm, generating a block of the first blockchain; and, the at least one first transaction information includes a hash value item of data, and the network node is based on the at least one first transaction information, Based on the eighth algorithm, a block of the second blockchain is generated.
  • the network node acquires the first data if the network node generates a first blockchain containing the first data and stores a hash value of the first data. a first hash value; acquiring the first data from the first blockchain and calculating a second hash value of the first data; and the first hash value and the second hash The column values are compared; if the first hash value is the same as the second hash value, determining that the first data is trusted data; or determining that the first data has not been tampered with; or Determining that the first hash value of the first data is a trusted hash value; or, if the first hash value is different from the second hash value, determining that the first data is untrusted Data; or, determining that the first data has been tampered with; or determining that the first hash value of the first data is an untrusted hash value.
  • the network node if the network node generates a second blockchain containing a first hash value of the first data and stores the first data, from the second region Blockchain acquisition Determining a first hash value of the first data; acquiring the stored first data, and calculating a second hash value of the first data; and the first hash value and the second hash value Performing an alignment; if the first hash value is the same as the second hash value, determining that the first data is trusted data; or determining that the first data has not been tampered with; or determining The first hash value of the first data is a trusted hash value; or, if the first hash value is different from the second hash value, determining that the first data is untrusted data; Alternatively, determining that the first data has been tampered with; or determining that the first hash value of the first data is an untrusted hash value.
  • the network node in the case where the network node generates a first blockchain containing the first data and generates a second blockchain containing the hash value of the first data, Obtaining a first hash value of the first data from the second blockchain; acquiring the first data from the first blockchain, and calculating a second hash value of the first data; Comparing the first hash value with the second hash value; if the first hash value is the same as the second hash value, determining that the first data is trusted data; Or determining that the first data has not been tampered with; or determining that the first hash value of the first data is a trusted hash value; or, if the first hash value and the second hash If the values are different, determining that the first data is untrusted data; or determining that the first data has been tampered with; or determining that the first hash value of the first data is an untrusted hash value.
  • the method further includes: the network node sending the data information or the block of the blockchain to the central node.
  • the network node may send the data information or the block of the blockchain after receiving the data information of the central node or the acquisition request of the block.
  • the method further includes: the network node sending the first notification message to the at least one device node.
  • the first notification message is used to notify the device that the node has generated a message of the block of the blockchain.
  • the device information is processed correspondingly, for example, deleted.
  • the method further includes: the network node sending the first deletion to the device node The message, the first deletion message is an indication message for instructing the device node to delete the data information or delete a block.
  • the method further includes: the network node receiving a second deletion message sent by the at least one device node, where the second deletion message is used by the at least one device node to request to delete the Data information or delete blocks.
  • the network node determines, according to the second deletion message, the deletable data information or the deletable block for the device node, or the network node may send a delete permission message to the device node to indicate The device node itself determines the data information that can be deleted or the block that can be deleted.
  • the method further includes: determining, by the network node, a to-be-deleted block from a target blockchain, where the target blockchain is any one of the blockchains stored by the network node.
  • the method further includes: the network node sending, by the network node, the plurality of transaction information included in the block of the blockchain to the upper-level network node. For example, in a case where the storage pressure of the network node is large, a plurality of transaction information may be transferred to the network node of the upper level for storage to reduce the storage pressure of the network node.
  • the method further includes: deleting, by the network node, the to-be-deleted block in the target blockchain.
  • the network node records the block header content of the to-be-deleted block, so as to determine the node stored by the deleted block when receiving the query information about the deleted block.
  • an embodiment of the present application provides a data processing method, including:
  • the network node generates at least one first transaction information based on the one or more data information.
  • the first transaction information includes at least one of the following corresponding information: a transaction identifier item, a node identifier item that generates the first transaction information, a data item, an index value item of the data, a hash value item of the data, and a time information item. , the sender of the data and the recipient of the data.
  • the data information includes at least one of the following: data, a first hash value of the data, an index value of the data, a time when the data is generated, an identifier of the device node, and a location of the device node.
  • the address and the address of the network node includes at least one of the following: data, a first hash value of the data, an index value of the data, a time when the data is generated, an identifier of the device node, and a location of the device node.
  • the first transaction information is generated according to the data information
  • information of one or more items included in the first transaction information is also determined by the data information.
  • the device node transmits the data information to the network node, which can alleviate the storage pressure of the device node.
  • the network node can generate transaction information according to the data information for storage.
  • the method further includes: if the data information includes the first data and does not include the first hash value, the network node calculates a first hash of the first data And generating, by the network node, the at least one first transaction information according to the data information, where the at least one first transaction information is generated according to the data information and the first hash value.
  • the method further includes: the network node sending the at least one first transaction information to another network node or at least one device node. For example, the network node broadcasts the at least one first transaction information.
  • the method further includes: the network node receiving at least one second transaction information sent by another network node or at least one device node; wherein the second transaction information includes at least one of the following corresponding Information: a transaction identification item, a node identification item generating the second transaction information, a data item, an index value item of data, a hash value item of data, a time information item, a sender item of the data, and the data Receive party item.
  • the second transaction information includes at least one of the following corresponding Information: a transaction identification item, a node identification item generating the second transaction information, a data item, an index value item of data, a hash value item of data, a time information item, a sender item of the data, and the data Receive party item.
  • the method further includes: if the at least one first transaction information includes a data item, the network node generates the first region according to the first algorithm according to the at least one first transaction information Block of blockchain.
  • the method further includes: if the at least one first transaction information includes a data item, and the at least one second transaction information includes a data item, the network node is according to the at least one A transaction block and/or the at least one second transaction information, based on the second algorithm, generating a block of the first blockchain.
  • the method further includes: if the at least one first transaction information includes a hash value item of data, the network node is based on the at least one first transaction information, based on a third algorithm, A block of the second blockchain is generated.
  • the method further includes: if the at least one first transaction information includes a hash value item of data, and the at least one second transaction information includes a hash value item of data, The network node generates a block of the second blockchain based on the fourth algorithm based on the at least one first transaction information and/or the at least one second transaction information.
  • the network node if the at least one first transaction information includes a data item, the network node generates a first blockchain based on the at least one first transaction information based on the fifth algorithm. a block; and, if the at least one first transaction information includes a hash value item of data, and the at least one second transaction information includes a hash value item of data, the network node according to the at least one a transaction information and/or the at least one second transaction information, based on a sixth algorithm, generating a block of the second blockchain; or
  • the network node is based on the at least one first transaction information and/or the at least one second transaction Information, based on the seventh algorithm, generating a block of the first blockchain; and, the at least one first transaction information includes a hash value item of data, and the network node is based on the at least one first transaction information, Based on the eighth algorithm, a block of the second blockchain is generated.
  • the network node generates a block of the second blockchain based on the at least one first transaction information based on the eighth algorithm
  • the eighth algorithm may be an algorithm for determining which network node generates a block, or may be used by the network node to generate a block by using the eighth algorithm.
  • the eighth algorithm may be that the network node generates all of the second blockchain blocks by itself. No other network node participates in generating the block of the second blockchain.
  • the first algorithm, the third algorithm, and the fifth algorithm may be: The network node generates all blocks of the blockchain.
  • the network node generates a block of the first blockchain based on the at least one first transaction information based on the fifth algorithm
  • the network node may be equivalent to "the network node according to the at least one first transaction information Generating a block of the first blockchain”; or, "if the at least one first transaction information includes a hash value item of data, the network node is based on the at least one first transaction information, based on the third
  • the algorithm, generating a block of the second blockchain may be equivalent to "if the at least one first transaction information Include a hash value item of data, the network node generates a block of the second block chain according to the at least one first transaction information; or “the network node is configured according to the at least one first transaction information,
  • generating a block of the first blockchain may be equivalent to "the network node generates a block of the first blockchain according to the at least one first transaction information.”
  • the fourth algorithm is also a network node generates all blockchains. Block. And so on.
  • the algorithm can be used to decide who generated the block. For example, if the default is that the network node generates, then the network node can directly generate a block without having to judge the algorithm once each time.
  • the method further includes: acquiring, for the network node, a first blockchain that includes the first data and storing a hash value of the first data, acquiring the first data. a first hash value; acquiring the first data from the first blockchain and calculating a second hash value of the first data; and the first hash value and the second hash Comparing values; if the first hash value is the same as the second hash value, determining that the first data is trusted data; or determining that the first data has not been tampered with; or determining The first hash value of the first data is a trusted hash value; or, if the first hash value is different from the second hash value, determining that the first data is untrusted data Or determining that the first data has been tampered with; or determining that the first hash value of the first data is an untrusted hash value.
  • the method further includes: if the network node generates a second blockchain that includes a first hash value of the first data, and stores the first data, Obtaining, by the second blockchain, a first hash value of the first data; acquiring the stored first data, and calculating a second hash value of the first data; and the first hash value and The second hash value is compared; if the first hash value is the same as the second hash value, determining that the first data is trusted data; or determining that the first data is not Tampered; or determining that the first hash value of the first data is a trusted hash value; or, if the first hash value is not the same as the second hash value, determining the first One of the data is untrusted data; or it is determined that the first data has been tampered with; or the first hash value of the first data is determined to be an untrusted hash value.
  • the method further includes: generating, for the network node, a first blockchain that includes the first data and generating a second blockchain that includes a hash value of the first data.
  • a first hash value of the first data is obtained from the second blockchain; the first data is obtained from the first blockchain, and the second data of the first data is calculated a column value; comparing the first hash value with the second hash value; if the first hash value is the same as the second hash value, determining that the first data is Data data; or, determining that the first data has not been tampered with; or determining that the first hash value of the first data is a trusted hash value; or, if the first hash value and the first If the two hash values are different, determining that the first data is untrusted data; or determining that the first data has been tampered with; or determining that the first hash value of the first data is an untrusted hash value.
  • the method further includes: the network node sending the data information or the block of the blockchain to the central node.
  • the network node may send the data information or the block of the blockchain after receiving the data information of the central node or the acquisition request of the block.
  • the method further includes: the network node sending the first notification message to the at least one device node.
  • the first notification message is used to notify the device that the node has generated a message of the block of the blockchain.
  • the device information is processed correspondingly, for example, deleted.
  • the method further includes: the network node sending a first deletion message to the device node, where the first deletion message is used to instruct the device node to delete the data information or delete a block. Indicate the message.
  • the method further includes: the network node receiving a second deletion message sent by the at least one device node, where the second deletion message is used by the at least one device node to request to delete the Data information or delete blocks.
  • the network node determines, according to the second deletion message, the deletable data information or the deletable block for the device node, or the network node may send a delete permission message to the device node to indicate The device node itself determines the number that can be deleted According to information or blocks that can be deleted.
  • the method further includes: determining, by the network node, a to-be-deleted block from a target blockchain, where the target blockchain is any one of the blockchains stored by the network node.
  • the method further includes: the network node sending, by the network node, the plurality of transaction information included in the block of the blockchain to the upper-level network node. For example, in a case where the storage pressure of the network node is large, a plurality of transaction information may be transferred to the network node of the upper level for storage to reduce the storage pressure of the network node.
  • the method further includes: deleting, by the network node, the to-be-deleted block in the target blockchain.
  • the network node records the block header content of the to-be-deleted block, so as to determine the node stored by the deleted block when receiving the query information about the deleted block.
  • the determining, by the network node, the to-be-deleted block from the target blockchain comprising: determining a to-be-deleted block from the target blockchain according to a preset deletion rule;
  • the preset deletion rule is: the number of the blocks in which the network node stores the target blockchain is greater than a preset threshold, or the block to be deleted is a block whose generation time duration exceeds a time threshold, or The deleted block is a block whose block number is smaller than the serial number threshold.
  • an embodiment of the present application provides a data processing method, including:
  • the device node sends one or more pieces of data information to the network node, the data information including at least one of: first data, a first hash value of the first data, an index value of the first data, the Time information of the first data, an identifier of the device node that sent the data information, an address of the device node, and an address of the network node; the data information is used by the network node to generate first transaction information.
  • the device node can reduce the storage pressure of the device node by sending data information to the network node.
  • the device node generates at least one second transaction information according to the one or more data information, and sends the at least one second transaction information to the network node;
  • the second transaction information includes at least one of the following corresponding information: The data item, the index value item of the data, the hash value item of the data, the time information item, the sender item of the data, and the receiver item of the data.
  • the device node can also reduce the storage pressure of the device node by sending the transaction information to the network node.
  • the device node receives the first link of the blockchain sent by the network node. Knowing the message, the first notification message is used to notify the network node that a message of a block of the blockchain has been generated according to the data information.
  • the device node receives a block transmitted by a network node.
  • the method further includes: the device node receiving, by the network node, a first deletion message, where the first deletion message is used to instruct the device node to delete the data information or delete The indication message of the block.
  • the device node may perform a deletion process on the data information or the block if the first deletion message is received.
  • the method further includes: a second deletion message sent by the device node to the network node, where the second deletion message is used to request to delete the data information or delete a block.
  • the device node may send a second delete message to the network node.
  • the method further includes: the device node deleting the data information.
  • the deleting the data information by the device node specifically deletes the data information whose generation time exceeds the first time threshold, so that the storage pressure of the device node can be reduced.
  • an embodiment of the present application provides a central node, including:
  • An obtaining module configured to acquire a first hash value of the first data from the first network node
  • a calculating module configured to acquire the first data from the second network node, and calculate a second hash value of the first data
  • a comparison module configured to compare the first hash value with the second hash value
  • a determining module configured to determine that the first data is trusted data if the first hash value is the same as the second hash value; or determine that the first data has not been tampered with; or The first hash value of the first data is a trusted hash value.
  • the central node provided in the fifth aspect of the present application is used to perform the data processing method provided by the first aspect of the present application.
  • the central node provided in the fifth aspect of the present application is used to perform the data processing method provided by the first aspect of the present application.
  • the structure of the central node includes a processor and a transceiver for performing the data processing method provided by the first aspect of the present application.
  • a memory may be further included, where the memory is used to store application code that supports the central node to execute the above method, and the processor is configured to execute an application stored in the memory.
  • the embodiment of the present application provides a network node, including:
  • a block generating module configured to generate a block of the blockchain according to the at least one first transaction information.
  • the first transaction information includes at least one of the following corresponding information: a transaction identifier item, a node identifier item that generates the first transaction information, a data item, an index value item of the data, a hash value item of the data, and a time information item. , the sender of the data and the recipient of the data.
  • the network node provided in the sixth aspect of the present application is used to perform the data processing method provided by the second aspect of the present application.
  • the network node provided in the sixth aspect of the present application is used to perform the data processing method provided by the second aspect of the present application.
  • the embodiment of the present application provides another network node, including:
  • a receiving module configured to receive one or more data information sent by at least one device node
  • the first transaction information includes at least one of the following corresponding information: a transaction identifier item, a node identifier item that generates the first transaction information, a data item, an index value item of the data, a hash value item of the data, and a time information item. , the sender of the data and the recipient of the data.
  • the network node provided in the seventh aspect of the present application is used to perform the data processing method provided by the third aspect of the present application.
  • the network node provided in the seventh aspect of the present application is used to perform the data processing method provided by the third aspect of the present application.
  • the structure of the network node includes a processor and a transceiver for performing the data processing method provided by the second or third aspect of the present application.
  • a memory may be further included, where the memory is used to store application code that supports a network node to execute the above method, and the processor is configured to execute an application stored in the memory.
  • the embodiment of the present application provides a device node, including:
  • a sending module configured to send one or more pieces of data information to the network node, where the data information includes at least one of: first data, a first hash value of the first data, and an index value of the first data And time information of the first data, an identifier of a device node that sends the data information, an address of the device node, and an address of the network node;
  • the data information is used by the network node to generate first transaction information
  • a generating module configured to generate at least one second transaction information according to one or more pieces of data information, and send the at least one second transaction information to a network node;
  • the second transaction information includes at least one of the following corresponding information: a data item, an index value item of the data, a hash value item of the data, a time information item, a sender item of the data, and a receiver item of the data.
  • the device node provided in the eighth aspect of the present application is used to perform the data processing method provided by the fourth aspect of the present application.
  • the device node provided in the eighth aspect of the present application is used to perform the data processing method provided by the fourth aspect of the present application.
  • the structure of the device node includes a processor and a transceiver for performing the data processing method provided by the fourth aspect of the present application.
  • a memory may be further included, where the memory is used to store application code that supports the device node to perform the above method, and the processor is configured to execute an application stored in the memory.
  • the embodiment of the present application provides a computer storage medium for storing computer software instructions used by the central node, which includes a program designed to perform the above aspects.
  • the embodiment of the present application provides a computer storage medium for storing computer software instructions used by the network node, which includes a program designed to perform the above aspects.
  • the embodiment of the present application provides a computer storage medium for storing computer software instructions used by the device node, which includes a program designed to perform the above aspects.
  • the names of the central node, the network node, the device node, the first network node, and the second network node are not limited to the device itself. In actual implementation, the devices may appear under other names. As long as the functions of the respective devices are similar to the present application, they are within the scope of the claims and their equivalents.
  • the storage pressure of the device node can be alleviated, and in addition, the data and the hash value can be separately stored in the network node. Even if the data is tampered with, the data can be verified by the stored hash value, thus improving the tamper resistance of the data.
  • FIG. 1 is a schematic structural diagram of a network provided by an embodiment of the present application.
  • FIG. 2 is a schematic diagram of another possible network structure provided by an embodiment of the present application.
  • FIG. 3 is a schematic flowchart diagram of a data processing method according to an embodiment of the present disclosure
  • FIG. 4 is a schematic flowchart diagram of another data processing method according to an embodiment of the present disclosure.
  • FIG. 5 is a schematic flowchart diagram of another data processing method according to an embodiment of the present disclosure.
  • FIG. 6 is a schematic flowchart diagram of another data processing method according to an embodiment of the present disclosure.
  • FIG. 7 is a schematic flowchart diagram of another data processing method according to an embodiment of the present disclosure.
  • FIG. 8 is a schematic diagram of a modularization of a central node according to an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of another central node according to an embodiment of the present application.
  • FIG. 10 is a schematic diagram of a modularization of a network node according to an embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of another network node according to an embodiment of the present application.
  • FIG. 12 is a schematic diagram of a modularization of a device node according to an embodiment of the present application.
  • FIG. 13 is a schematic diagram of a modularization of another device node according to an embodiment of the present application.
  • FIG. 14 is a schematic structural diagram of a device node according to an embodiment of the present application.
  • the network architecture described in FIG. 1 includes a first network node, a second network node, and a device node.
  • the device node is a source for collecting data or generating data
  • the first network node may be used to store data transmitted by the device node
  • the second network node may be used to store a hash value generated by data in the device node.
  • the storage capacity of the device node is limited, the storage may be performed by other network nodes, thereby alleviating the storage pressure of the device node.
  • the first network node and the second network node may each generate a respective blockchain.
  • the first network node may generate a second blockchain according to a hash value of data sent by the device node, where the second network node may The first blockchain is generated based on the data sent by the device node.
  • the data and the hash value are separately stored by the blockchain, and even if all the data of the first blockchain generated by the data is tampered with, the hash value of the second blockchain can be used to the first block.
  • the data in the chain is verified, thus increasing the tamper resistance of the data.
  • FIG. 2 is another possible network architecture diagram according to an embodiment of the present application.
  • the network architecture described in FIG. 2 includes a first network node and a device node.
  • the device node functions the same as the device node shown in FIG. 1, and the first network node shown in FIG. 2 can store both the data transmitted by the device node and the hash value generated by the data in the device node.
  • the storage pressure of the device node can be alleviated by storing the data and the hash value by the first network node in the case where the storage capacity of the device node is limited.
  • the first network node may generate a first blockchain according to the data sent by the device node, and generate a second blockchain according to the hash value of the data sent by the device node. It is realized that the data and the hash value are separately stored by the blockchain, and even if all the data of the first blockchain generated by the data is tampered with, the hash value of the second blockchain can be first The data in the blockchain is verified, thus increasing the tamper resistance of the data.
  • the device nodes involved in the present application may include industrial equipment nodes, various industrial sensors, control units, and the like; and may also include wearable devices, household appliances, home sensors, home control units, etc.; and may also include user equipment, including mobile phones. , intelligent terminals, multimedia devices, streaming media devices, etc. This application does not impose any restrictions on the form and type of device nodes. Device nodes have the ability to collect data and/or send data.
  • the network node referred to in the present application is a device having a storage and communication function, for example, having data or data hash values of a receiving device node, and the ability to receive data or hash values from other network nodes.
  • the network node can be a base station, a gateway, a network storage unit, a cloud server, a computer device, and the like.
  • FIG. 3 is a schematic flowchart of a data processing method according to an embodiment of the present application.
  • the embodiment of the present application relates to a first network node, a second network node, a device node, and a central node.
  • the data processing method is executed by the central node.
  • the central node For details, refer to the following.
  • the central node acquires a first hash value of the first data from the first network node.
  • the first network node may directly store the first hash value of the first data, or the first hash value of the first data is stored in a second one of the first network nodes.
  • the second blockchain is composed of blocks generated by transaction information including hash value items of data.
  • the central node acquires first hash value association information of the first data from the first network node, where the association information includes at least one of: an index value of the first data, the first Time information of a data, a device node identifier for transmitting the first data, an address for transmitting the first data, and an address for receiving the first data.
  • the central node acquires the first data from a second network node, and calculates a second hash value of the first data.
  • the second network node may directly store the first data, or the first data is stored in a first blockchain in the second network node, where the first blockchain Consists of blocks generated from transaction information that contains data items.
  • the central node acquires the association information of the first data from the second network node, where the association information includes at least one of: an index value of the first data, time information of the first data, and sending the a device node identifier of the first data, an address to transmit the first data, and an address to receive the first data.
  • the blockchain storing the first data is set as the first blockchain
  • the network node storing the first blockchain is set as the second network node.
  • the blockchain, and the first hash value of the first data are stored in the second blockchain, which is not limited in the embodiment of the present application.
  • the first hash value of the first data is not stored in the second blockchain of the first network node, but is directly stored by the first network node; and the first data is stored in The first blockchain of the second network node.
  • the central node directly obtains the first hash value of the first data from the first network node; the central node acquires the first data through the first blockchain of the second network node, and calculates the The second hash value of the first data. Then, the central node performs step 103 to compare the first hash value with the second hash value, and obtains the comparison result as step 104 or step 105.
  • the first hash value of the first data is stored in the second blockchain of the first network node; and the first data is not stored in the first blockchain of the second network node, Instead, it is stored directly by the second network node.
  • the central node obtains a first hash value of the first data through the first blockchain of the first network node; the central node directly acquires the first data to the second network node, and calculates the first data. The second hash value. Then, the central node performs step 103 to compare the first hash value with the second hash value, and obtains the comparison result as step 104 or step 105.
  • the first hash value of the first data is stored in the second blockchain of the first network node; the first data is stored in the first blockchain of the second network node.
  • the central node obtains the first hash value of the first data through the second blockchain of the first network node; The point acquires the first data through a first blockchain of the second network node, and calculates a second hash value of the first data. Then, the central node performs step 103 to compare the first hash value with the second hash value, and obtains the comparison result as step 104 or step 105.
  • the central node compares the first hash value with the second hash value.
  • the central node determines that the first data is trusted data; or determines that the first data is not tampering; or Determining that the first hash value of the first data is a trusted hash value.
  • the central node determines that the i th transaction information of the third blockchain satisfies a generation condition, and generates an i th transaction information of the third blockchain.
  • the central node may set whether the first data is feasible data, and set the generating condition that the central node determines whether to generate the i-th transaction information of the third blockchain, so that the first After the data is the trusted data, it is determined that the i-th transaction information of the third blockchain satisfies the generation condition, and generates the i-th transaction information.
  • the central node determines that the first data is untrusted data; or determines that the first data has been tampered with; or Determining that the first hash value of the first data is an untrusted hash value.
  • the central node determines that the i th transaction information of the third blockchain does not satisfy the generating condition, and does not generate the third blockchain.
  • the i-th transaction information is not generated.
  • step 106 in combination with the setting of the generation condition of the ith transaction information of the third blockchain generated by the central node in step 106, after determining that the first data is untrusted data, determining the third The i-th transaction information of the blockchain does not satisfy the generation condition, and the i-th transaction information of the third blockchain is not generated.
  • the central node determines that the jth transaction information of the third blockchain satisfies a generation condition, and generates a third blockchain. j transaction information.
  • step 106 For the scheme of step 106 and step 107, an example is illustrated:
  • Step 106 For example, generating a condition of the i-th transaction of the third blockchain is determining that the first data is trusted data, and when the first data is trusted data, using the first data to process certain things, example For example, the first data is retrieved for big data analysis, and various data analysis and extraction are performed, and no limitation is imposed here.
  • the first data is a measured value of PM2.5, extracting first data for a period of time (for example, 1 week), and calculating a plurality of first data according to the first data to calculate a PM2.5 concentration during the period of time, Thereby obtaining the air quality this week.
  • the first data is a meter measurement data value of the industrial device, and the first data is extracted within a period of time (for example, 1 week), and the measurement data value exceeding the threshold 1 is obtained according to the first data, and the number and correspondence of the data passing through Time to determine the instrument failure rate.
  • the first data is a hospital medical record, a government agency or a third party institution (reimbursement unit) or a foreign hospital, and the first data is called when the first data is trusted data.
  • the i-th transaction information is: calling the first data
  • the transaction information specifically includes at least one of: a user identifier for calling the first data, a time for calling the first data, a permission for calling the first data, and an index value of the first data. , the source of the first data (sender address) and so on.
  • the condition for generating the i-th transaction is: when the trusted data of the first data is used, the first data is called.
  • the first data can be called for big data analysis, the first data can be viewed, and the like.
  • the jth transaction information for step 107 is similar.
  • the jth transaction can be: calling the first data.
  • the jth transaction information may be that the central node sends a data error message to the device 1. Therefore, the condition for generating the jth transaction information is: when the first data is trusted data, the first data is invoked; or the condition for generating the jth transaction information is: when the first data is untrusted data, the central node Send a data error message to device 1;
  • the transaction information forming the blockchain may be various.
  • the content and format of the third blockchain transaction are not limited in this application.
  • the transaction information of the third blockchain is not limited to calling the first data.
  • the transaction is that sender A gives recipient B a sum of money (for example, $10).
  • the action performed by the device is a transaction message.
  • device A sends a message to device B.
  • calling the data of device A is a kind of transaction information.
  • Steps 106 and 107 are optional steps.
  • the central node, the first network node, and the second network node are not limited in terms of whether they are different devices having communication or storage functions. Next, the implementable manners of the central node, the first network node, and the second network node are described.
  • the central node, the first network node, and the second network node are physically separated.
  • a device having a communication or storage function for example, the first network node is a base station, the second network node is a storage device, and the central node is a third-party device.
  • the first data may be data that is sent by the device node to the second network node; the first hash value of the first data may be a hash value of data sent by the device node to the first network node, or The first hash value of a data is generated by the first network node based on the first data transmitted by the device node.
  • the system shown in FIG. 1 includes multiple device nodes, multiple first network nodes, and multiple second network nodes.
  • the second blockchain is the plurality of first network nodes, and is generated based on an algorithm (for example, a consensus algorithm), where the central node obtains the first data from the second blockchain of the first network node. Before a hash value, one of the plurality of first network nodes may be selected as the target first network node. In an optional solution, the central node may arbitrarily select one of the first network nodes to determine the target first network node.
  • the central node selects, from the at least one first network node, a first network node that satisfies the first legal condition as the target first network node.
  • the first legal condition is that the number of nodes that are the same as the first hash value of the first data of the second blockchain of the target first network node exceeds a first threshold.
  • the central node acquires the first hash value of the first data in the block in which the first data is stored, if multiple If there is a first hash value of the first data of three values in a network node, the number of the first hash value of the first data of each value is separately counted, and if the number of the first hash value of the same value exceeds 5. Select one of the first network nodes in which the first hash value of the value is located as the target first network node.
  • the first blockchain is the plurality of second network nodes, and the first blockchain is generated from the second network node at the central node based on an algorithm.
  • one of the plurality of second network nodes may be selected as the target second network node.
  • the central node may arbitrarily select a second network node to determine the target second network node.
  • the central node selects, from the at least one second network node, a second network node that satisfies the second legal condition as the target second network node.
  • the second legal condition is that the number of nodes that are the same as the first data of the first blockchain of the target second network node exceeds a second threshold.
  • the central node acquires the location in the block in which the first data is stored.
  • the first data if there are three types of first data in the plurality of second network nodes, the number of the first data of each value is separately counted, and if the number of the first data having the same value exceeds 5, One of the second network nodes in which the first data of the value is located is determined to be the target second network node.
  • the first network node and the second network node are physically separated devices with communication or storage functions, and the central node is any one of the first network node or the second network node.
  • the first data may be data that is sent by the device node to the second network node; the first hash value of the first data may be a hash value of data sent by the device node to the first network node, or The first hash value of a data is generated by the first network node based on the first data transmitted by the device node.
  • the system architecture shown in FIG. 1 is described by using a first network node as a base station, a second network node as a storage device, and a central node as a first network node.
  • the central node is the first network node
  • the first network node may select one of the plurality of second network nodes to determine the target second network node.
  • the first network node may select one of the plurality of second network nodes to determine the target second network node.
  • the first network node may select one of the plurality of second network nodes to determine the target second network node.
  • the first network node may select one of the plurality of second network nodes to determine the target second network node.
  • the first network node may select one of the plurality of second network nodes to determine the target second network node.
  • the first network node may select one of the plurality of second network nodes to determine the target second network node.
  • the first network node may select one of the plurality of second network nodes to determine the target second
  • the first network node and the second network node are the same device with communication or storage function, and the central node is a third-party device.
  • the first hash value of the first data and the first data are stored in the first network node, and the first network node may receive the first data sent by the device node.
  • the first network node calculates a first hash value of the first data according to the received first data and stores or generates a second block The block of the chain.
  • the first blockchain is generated by the first network node that receives the first data
  • the second blockchain is based on an algorithm of multiple first network nodes (eg, consensus The algorithm) is generated based on the first hash value of the first data.
  • the first blockchain is generated by the plurality of first network nodes based on an algorithm (for example, a consensus algorithm) and according to the first data; the second blockchain is obtained by first network nodes that receive the first data The first hash value is in turn generated.
  • the first blockchain is a first network node that receives the first data.
  • the generated, and the second blockchain is generated by the plurality of first network nodes based on an algorithm (for example, a consensus algorithm) and generated according to the first hash value of the first data, when the central node performs step 101, Determining a target first network node from the plurality of first network nodes, and acquiring a first hash value of the first data in the second blockchain from the target first network node; the central node performing step 102 may Obtained directly from the first network node where the first data is located.
  • an algorithm for example, a consensus algorithm
  • the first block chain is a plurality of first network nodes based on an algorithm (such as a consensus algorithm) and generated according to the first data; the second block chain is the first data received
  • the first network node first calculates and obtains the first hash value, and when the central node performs step 101, the first network node that receives the first data and calculates the first hash value may be calculated.
  • One data is a plurality of first network nodes based on an algorithm (such as a consensus algorithm) and generated according to the first data; the second block chain is the first data received
  • the first network node first calculates and obtains the first hash value, and when the central node performs step 101, the first network node that receives the first data and calculates the first hash value may be calculated
  • the central node, the first network node, and the second network node are the same device with communication or storage function.
  • the specific implementation of the specific central node in the step 101 and the step 102 may be specifically described in the alternative solution C, and details are not described herein again.
  • the central node acquires a first hash value of the first data of the first network node, acquires first data of the second network node, and calculates a second hash value of the first data, where A hash value is compared with the hash value to determine whether the first data is trusted data.
  • This solution can effectively verify the stored data, thereby improving the effectiveness of data storage.
  • the scenario of generating a blockchain for the first data and a blockchain for the first hash value of the first data respectively, even if the data of the first blockchain generated based on the data is tampered with The data in the first blockchain can be verified by the hash value of the second blockchain, thus improving the tamper resistance of the data.
  • FIG. 4 is a schematic flowchart of a data processing method according to an embodiment of the present application.
  • the embodiment of the present application relates to a first network node, other first network nodes, a second network node, and others.
  • Second network node and device node wherein the first network node and the second network node are For the different communication devices, refer to the network architecture shown in FIG. 1.
  • the data processing method is jointly performed by the foregoing nodes, where the device node performs the steps 201 to 210, and the device node is Any one of a plurality of device nodes establishing a communication connection with the second network node. Further, the device node may perform step 211 to step 216 to the first network node establishing the communication connection. Please refer to the detailed description below for the specific implementation process.
  • the device node sends one or more data information to the second network node.
  • the data information includes the first data, and may further include at least one of: an index value of the first data, time information of the first data, and sending the The identity of the device node of the data information, the address of the device node, and the address of the network node.
  • the time information of the first data may be the sending time of the first data or the generating time of the first data, which is not limited in this embodiment of the present application.
  • step 201 the device node sends the first data to the second network node; in step 211, the device node sends the hash value of the first data to the first network node. Steps 201 and 211 are performed in no particular order.
  • the second network node receives one or more data information sent by the device node.
  • the second network node generates at least one first transaction information according to the one or more pieces of data information.
  • the second network node may generate a first transaction information. If the data information is multiple, the second network node may generate a first transaction. Information, or generating a plurality of first transaction information not greater than the amount of the data information.
  • the first transaction information includes at least one of the following corresponding information: a transaction identifier, a data item, a hash value of the data, a node identifier item that generates the first transaction information, an index value item of the data, and a time Information item, sender item of data, and receiver item of data.
  • the time information item may refer to the sending time of the data or the generating time of the transaction, which is not limited by the embodiment of the present application.
  • the first transaction information is transaction information indicating the first data
  • the information corresponding to the data item is the first data
  • the information corresponding to the hash value item of the data is the hash value of the first data
  • the information corresponding to the index value item of the data is the index value of the data
  • the information corresponding to the data transmission item is the sender address of the data
  • the receiver of the data The information corresponding to the item is the address of the receiver of the data
  • the information corresponding to the identifier of the device node is the identifier of the device node
  • the information corresponding to the node identifier of the first transaction information is the identifier of the network node.
  • the second network node in a case where the second network node generates one first transaction information according to the plurality of data information, the second network node generates a data packet by packing a plurality of data information, and further A packet generates a first transaction message.
  • the embodiment of the present application does not limit the number of first transaction information that is less than the amount of data information generated by multiple pieces of data information. Since the embodiment of the present application relates to other transaction information, whether the one or more first transaction information generated by the second network node is represented by A1 to distinguish.
  • the second network node can generate three transaction information, as shown in Table 2.
  • the transaction information includes a hash value item, please refer to Table 2A.
  • Table 2 can also be identified in the form of Table 2B.
  • the data item refers to the first data
  • the index value item of the data refers to the index value of the first data
  • the data transmission item refers to the sender address of the data
  • the receiver item of the data refers to the receiver of the data.
  • the identifier of the device node refers to the identifier of the device node
  • the network node identifier refers to the network node identifier.
  • the second network node can generate two transaction information, as shown in Table 3.
  • data 1 in the data item of transaction 1 is the first data
  • 100 in the data index value item is the index value item of data 1.
  • the second network node can generate two transaction information, as shown in Table 4.
  • the second network node sends the generated at least one first transaction information to another second network node.
  • the second network node involved in the embodiment of the present application is any one of the plurality of second network nodes, and the other second network node is other than the second network node of the plurality of second network nodes.
  • the second network node is any one of the plurality of second network nodes, and the other second network node is other than the second network node of the plurality of second network nodes. The second network node.
  • any one of the other second network nodes receives the at least one first transaction information A1.
  • the second network node may perform step 204, and generate a block in the first blockchain according to the received at least one first transaction information.
  • the first blockchain in this step is denoted by L1.
  • L1 For example, as shown in Table 5, an optional block generated by the at least one first transaction information is given, and the first transaction information shown in Table 5 is generated from one piece of data information. If the first transaction information is generated by a plurality of first transaction information, it can be seen in Table 6.
  • the second transaction information sent by the other second network node is represented by A2.
  • the second transaction information A2 and the first transaction information A1 herein both contain data items, and thus can be implemented.
  • Generating transaction information generated by the data item generates a block in the first blockchain.
  • the second network node is, for example, the network node A, and based on the data information sent by the device node A it receives, the data information includes a first data, and the first data is, for example, data A.
  • the network node A Based on the data A, the network node A generates the first transaction information A1 according to the manner in which the first transaction is generated in step 303.
  • the other second network node is, for example, the data information sent by the network node B based on the device node B it receives.
  • the data information includes a first data
  • the first data is, for example, data B.
  • the network node B Based on the data B, the network node B generates the second transaction information A2 according to the manner in which the first transaction is generated in the above step 303.
  • the method for generating the second transaction information is the same as the method for generating the first transaction information in the embodiment of the present application.
  • the method for generating the second transaction information is the same as the method for generating the first transaction information in the embodiment of the present application.
  • the second network node receives the at least one second transaction information sent by the other second network node.
  • the second network node generates a block in the first blockchain according to the first transaction information and/or the second transaction information.
  • the second network node broadcasts the generated first blockchain block to other network nodes.
  • the first blockchain block is generated by the second network node as an example.
  • other network nodes e.g., network node B
  • other second network nodes broadcast the generated first blockchain block to other second network nodes (other network nodes than the network node B, the second network node).
  • the second network node generates a block
  • the other network node generates a block.
  • the second network node and other network nodes may determine who generates the i-th block (i is a natural number greater than or equal to 1) according to an algorithm.
  • the network node and the other network nodes form a first blockchain.
  • the first blockchain of step 206 and the first blockchain of step 204 are both composed of blocks generated by transaction information including data items, but the first block chain of the two steps According to the transaction information, it is distinguished by the first blockchain L1 and the first blockchain L2.
  • the second network node and other second network nodes need to determine which network is based on a preset mechanism or algorithm (for example, a consensus algorithm).
  • the node generates a block in the first blockchain L2.
  • the preset consensus algorithm is to calculate which of the plurality of second network nodes, the second network node has an algorithm for writing the block in the first blockchain L2, if one of the targets is Two network nodes obtained in the first zone Transmitting the right of the block in the block chain L2, the target second network node sends the block to the block other than the target second network node among the plurality of second network nodes, so that After each of the second networks receives the block, the block is saved in the respective first blockchain L2.
  • the consensus algorithm can be, but is not limited to, a practical Byzantine fault tolerant (PBFT) consensus algorithm, a Paxos/Raft algorithm, a Proof-of-Work (PoW) proof of proof, and a Proof-of-Stake (PoS) proof of equity holding.
  • PBFT Byzantine fault tolerant
  • Paxos/Raft Paxos/Raft algorithm
  • PoW Proof-of-Work
  • PoS Proof-of-Stake
  • the algorithm in this application may also be a mechanism, and the algorithm may be a consensus algorithm or other algorithms, which is not limited in this application. This application mostly uses a consensus algorithm to illustrate the application content.
  • the preset mechanism or algorithm may be a consensus mechanism or a consensus algorithm, which is used to determine which network node has the right to generate a block, and the preset mechanism or algorithm may also be used to generate a network node. Block algorithm.
  • the present invention is not intended to be limiting as to the specific definition and use of the mechanism or algorithm. The above applies to the full text.
  • the consensus algorithm may be equivalent to a consensus mechanism, and the algorithm may be equivalent to a mechanism.
  • the two algorithms may be the same algorithm, or may be different algorithms. There is no limitation in the embodiment of the present application.
  • the algorithm may be a consensus algorithm or a consensus algorithm.
  • a consensus algorithm we use a consensus algorithm to illustrate the problem, but this application does not make any algorithmic restrictions.
  • the second network node After generating the first blockchain, the second network node sends a first notification message to the device node.
  • the first notification message is used to notify the device node that the second network node has generated a message of the block of the blockchain according to the data information.
  • the first notification message may be sent after generating the first blockchain L1 and generating any one of the second blockchains L2. It should be noted that step 207 is an optional step.
  • the device node receives the first notification message sent by the second network node.
  • the device node After generating the first blockchain, the device node deletes the data information.
  • the device node may delete data information that generates a time duration that exceeds a first time threshold.
  • the device node can record the duration of the data information by generating the duration If the first time threshold is exceeded, delete it.
  • the second network node performs step 209 to send a first deletion message to the device node.
  • the device node after receiving the first deletion message sent by the second network node, the device node performs step 210.
  • the first deletion message is an indication message used to instruct the device node to delete data information.
  • the second network node may indicate the data information to be deleted in the first deletion message.
  • the second network node may also not specify the deleted data information, and is determined by the device node, so that the function of the first deletion message is to notify the device node to perform deletion of the data information.
  • the second network node performs step 209, and may be a first deletion message sent to the device node after the second network node receives the second deletion message sent by the device node.
  • the second deletion message is used by the at least one device node to request deletion of data information.
  • the second deletion message may be a message that the device node requests the second network node whether to allow deletion of one or more pieces of data information, so that the second network node may feed back a first deletion message that includes the permission or Messages that are not allowed to be deleted.
  • the second deletion message may also request, for the device node, a message to the second network node to determine data information that can be deleted for the device node, so that the second network node may determine a data to be deleted. Information is added to the first delete message and sent to the device node.
  • the manner in which the second deletion message is used in the embodiment of the present application is not limited.
  • the device node sends one or more pieces of data information to the first network device.
  • the data information includes a hash value of the first data, where the first data is the content included in the data information in step 201.
  • the device node sends the hash value of the first data to the first network node by sending the first data to the second network node, so that the hash values of the first data and the first data are separately stored, and the first data is immediately After being tampered with, the first data can be verified by the hash value to improve the tamper resistance of the data.
  • the data information may further include at least one of: an index value of the first data, time information of the first data, an identifier of a device node that sends the data information, an address of the device node, and the The address of the network node.
  • the time information of the first data may be a sending time of a hash value of the first data or a generating time of a hash value of the first data or a generating time of the first data, The application embodiment does not limit this.
  • the first network node receives one or more data information sent by the device node.
  • the first network node generates at least one first transaction information according to the one or more pieces of data information.
  • the first transaction information here is generated at the first network node, and is represented by B1 to distinguish.
  • the method for generating the first transaction information B1 is the same as the method for generating the first transaction information A1.
  • the method for generating the first transaction information B1 is the same as the method for generating the first transaction information A1.
  • the first network node sends the generated at least one first transaction information to other first network nodes.
  • the first network node may perform step 204, and generate a block in the second blockchain according to the received at least one first transaction information.
  • the second blockchain in this step is denoted by L3.
  • L3 For the generation of the block of the second blockchain L3, reference may be made to the method for generating the L1 in the first blockchain in step 203, and details are not described herein again.
  • the at least one second transaction information that is sent by the other first network node to the first network node.
  • the second transaction information in this step is represented by B2.
  • the first network node generates a block in the second blockchain according to the first transaction information and/or the second transaction information.
  • the first network node broadcasts the generated second blockchain block to other network nodes.
  • the first network node is used to generate the second blockchain block as an example.
  • other network nodes e.g., network node B
  • other network nodes broadcast the generated second blockchain block to other network nodes (other network nodes than the network node B, the first network node).
  • the first network node generates a block
  • other network nodes generate a block.
  • the first network node and other network nodes may determine who generated the i-th block (i is a natural number greater than or equal to 1) according to an algorithm (eg, a consensus algorithm).
  • the first network node forms a second blockchain with other network nodes.
  • the second blockchain in this step is represented by L4.
  • the first network node generates the second blockchain L4 according to the first transaction information B1 and/or the second transaction information B2, and the second network node according to the first transaction information A1 and/or the second transaction information.
  • A2 generates the square of the first blockchain L2
  • the first network node may send, after generating the second blockchain, a first notification message to the device node, to notify the device node that the first network node has generated according to the data information.
  • the message of the block of the blockchain may be sent, after generating the second blockchain, to notify the device node that the first network node has generated according to the data information.
  • the first network node may send a hash value of the first data to the central node, where the second network node may send the first data to the central node, so that the central node calculates the first data.
  • the second hash value is compared, and the second hash value is compared with the first hash value to check whether the first data is falsified, whether it is trusted data, etc., and the specific implementation process can be implemented as shown in FIG. The specific description of the examples will not be repeated here.
  • the first network node or the second network node may determine the to-be-deleted block from the target blockchain.
  • the target blockchain is the second blockchain L3 or the second blockchain L4 of the first network node; for the second network node, the target The blockchain is the first blockchain L1 or the first blockchain L2 of the second network node.
  • the optional manner of the first network node or the second network node determining the to-be-deleted block may be: taking the second network node as an example, the second network node may determine from the target blockchain according to a preset deletion rule.
  • the block to be deleted may include, but is not limited to, the number of the blocks in which the second network node stores the target blockchain is greater than a preset threshold, or the time interval in which the to-be-deleted block is generated exceeds a time.
  • the block of the threshold, or the block to be deleted is a block whose block number is smaller than the sequence number threshold.
  • the first network node or the second network node may send the multiple transaction information included in the generated block of the blockchain to the upper-level network node.
  • the first network node or the second network node may send the at least one transaction information included in the to-be-deleted block to the upper-level network node.
  • the original storage location information of the at least one transaction information may be recorded in the upper-level network node.
  • the upper-layer network node of the first network node and the upper-level network node of the second network node may be the same or different, which is not limited in this embodiment.
  • the device node performs the first hash value of the first data in the one or more data information sent to the first network node in step 211, specifically, the device node according to the first A data calculation acquires a first hash value of the first data, and transmits data information including the first hash value of the first data to the first network node.
  • the one or more pieces of data information that the device node may send to the first network data node includes first data, and after the first network node receives the data information, according to the first data included in the data information, Calculating a first hash value of the first data.
  • the one or more data information that the device node may send to the first network data node includes the first data and the first hash value of the first data, which is not limited in this embodiment of the present application.
  • the first network node forms a second blockchain with other first network nodes
  • the second network node and the other second network node form a first blockchain as an example to describe the content of the present application.
  • the device node may be a plurality of device nodes performing steps 201 and 211.
  • the embodiment shown in FIG. 4 may also be that only the second network node forms a first blockchain with other second network nodes, and after the first network node receives the data information of the device node (step 211), It is only necessary to continuously store the received data information without forming a second blockchain.
  • the embodiment shown in FIG. 4 may be that only the first network node forms a second blockchain with other first network nodes, and the second network node may receive only the data information of the device node (step 201). Continuously store the received data information without forming the first blockchain.
  • the storage pressure of the device node can be alleviated, and in addition, the first network node and the second network node respectively Generating a blockchain for the first data and a blockchain for the first hash value of the first data, respectively, by storing the data and the hash value separately through the blockchain, even if the first region is generated according to the data
  • the data in the first blockchain can be verified by the hash value of the second blockchain, thus improving the tamper resistance of the data.
  • FIG. 5 is a schematic flowchart of another data processing method according to an embodiment of the present application.
  • the embodiment of the present application relates to a first network node, other first network nodes, and device nodes.
  • the data processing method is jointly performed by the foregoing nodes, where the device node is in the process of performing step 301 to step 312, the device node is the first
  • the network node establishes any one of a plurality of device nodes of the communication connection.
  • the steps performed by the first network node and other first network nodes may also be performed by using the second network node and other second network nodes, and the embodiment shown in FIG. 5 is The description is made by taking the first network node as an example. Please refer to the detailed description below for the specific implementation process.
  • the device node sends one or more data information to the first network node.
  • the device node may send data information including the first data to the first network node.
  • the device node may send data information including the first hash value of the first data and the first data to the first network node.
  • the data information may further include at least one of: an index value of the first data, time information of the first data, and a device that sends the data information.
  • the time information of the first data may be the sending time of the first data or the generating time of the first data, which is not limited in this embodiment of the present application.
  • step 201 in the embodiment shown in FIG. 4 may be omitted, and details are not described herein again.
  • the first network node calculates a first hash value of the first data.
  • the first network node performs step 302.
  • the first network node may calculate a first hash value of the first data, and compare according to the carried first hash value to determine the first Whether a data is tampered with during the transmission process, if the two are different, determining that the first data has been tampered with, notifying the device node that the first data has been tampered with the notification message, and not performing the subsequent steps of the embodiment of the present application, The security of the first data transmission is enhanced.
  • the first network node may obtain or calculate a first hash value corresponding to each first data from the data information. It can be understood that the first network node can receive one or more pieces of data information sent by other device nodes in addition to receiving one or more pieces of data information sent by the device node.
  • the data index value may be an index value of the first data, or may be an index value of the first hash value corresponding to the index value of the first data.
  • the index value of the first data, or the index value of the first data and the first hash value may be passed.
  • the first hash value corresponding to the first data and the first data can be found.
  • the first network node generates first transaction information B1 according to the first hash value.
  • the first transaction information is generated by using a hash value.
  • the first transaction information generated in this step is represented by using B1 to distinguish.
  • the first network node may generate a first transaction information B1.
  • the first data may be data 1, data 2, and data 3. . . Or data n.
  • Different data have different hash values, then for example the hash value of data 1 is a hash value of 1, the hash value of data 2 is a hash value of 2, and so on.
  • the first network node may generate at least one first transaction information B1.
  • the first transaction information includes at least one of the following corresponding information: a transaction identifier, a data item, a hash value of the data, a node identifier item that generates the first transaction information, an index value item of the data, and a time Information item, sender item of data, and receiver item of data.
  • the time information item may be, for example, a data transmission time or a transaction generation time, which is not limited by the embodiment of the present application.
  • the first network node may generate the first transaction information B1 as shown in Table 8.
  • the first network node may generate the first transaction information B1 as shown in Table 9.
  • the Tx may be the time when the data packet 1 is generated or the time when the transaction 1 is generated, which is not limited by the embodiment of the present application.
  • the first network node uses the data hash value of the plurality of data as one data packet, and the data packet serves as the data item content of the transaction.
  • the recipient address for example, may be the first network node address
  • the sender address for example, the data hash value of the data packet 1 is all from the device node 1, that is, Let the sender address be the address of device node 1.
  • the content of the data packet can be seen in Table 10.
  • the first network node sends the at least one first transaction information to other first network nodes.
  • the first network node involved in the embodiment of the present application is any one of the plurality of first network nodes, and the other first network node is the first network node except the first network node. Other first network nodes.
  • any one of the other first network nodes receives the at least one first transaction information B1.
  • the second transaction information sent by the other first network node is represented by B2.
  • the second transaction information B2 and the first transaction information B1 herein both contain the hash value of the data.
  • the first network node is, for example, the network node A, and based on the data information sent by the device node A it receives, the data information includes a first data, and the first data is, for example, data A.
  • the network node A obtains the hash value A of the data A based on the data A (for example, the hash value A is calculated using the data A).
  • the first transaction information B1 is generated according to the manner in which the first transaction is generated in the above step 303.
  • the other first network node is, for example, the data information sent by the network node B based on the device node B it receives.
  • the data information includes a first data
  • the first data is, for example, data B.
  • the network node B obtains the hash value B of the data B based on the data B (the hash value B is calculated using the data B).
  • the second transaction information B2 is generated in accordance with the manner in which the first transaction is generated in the above step 303.
  • the method for generating the second transaction information is the same as the method for generating the first transaction information in the embodiment of the present application.
  • the method for generating the second transaction information is the same as the method for generating the first transaction information in the embodiment of the present application.
  • the steps 301 to 203 and details are not described herein.
  • the first network node receives at least one second transaction information sent by the other first network node.
  • the first network node generates a block in the second blockchain according to the first transaction information and/or the second transaction information.
  • the first network node generates a block in the second blockchain according to the first transaction information B1 and the received second transaction information B2.
  • the first network node broadcasts the generated second blockchain block to other network nodes.
  • the first network node is used to generate the second blockchain block as an example.
  • other network nodes e.g., network node B
  • other network nodes such as network node B
  • the first network node generates first transaction information A1 according to the first data.
  • Step 307 and step 302 are parallel steps, and the execution order is in no particular order.
  • the first network node generates a block of the first blockchain L1 according to the first transaction information A1.
  • Step 307 and step 308 are: the first network node generates first transaction information according to the first data included in the data information of the received device node.
  • the specific implementation may be, for example, generating a first transaction A1(1) according to the first data 1 sent by the device node 1, and generating a first transaction A1(2) according to the first data 2 sent by the device node 2, according to the first data 3.
  • a first transaction A2(3) is generated.
  • the first network node generates the first transaction A1 according to the data packet composed of the first data 1, the first data 2, and the first data 3.
  • the first network node generates at least one first transaction information according to the first data included in the one or more data information, and generates a process of the block of the first blockchain according to the generated at least one transaction information.
  • first transaction information for a specific implementation, reference may be made to the detailed description of the steps 212 to 214 in the embodiment shown in FIG. 4, and details are not described herein again.
  • the first network node independently generates all the blocks of the first blockchain, and independently forms a first blockchain.
  • the network node may send the block to itself and/or save the block that it continuously generates.
  • the first network node of the first network node generates a block of the first blockchain based on the first algorithm according to the at least one first transaction information A1.
  • the first algorithm may be identical to the first mechanism.
  • the first algorithm may be used to determine which network node generates the first blockchain block. Therefore, the first algorithm may be: the first network node is the only one that generates the first blockchain block. node.
  • the first algorithm may also be used for an algorithm of how the first network node generates the block.
  • the algorithm is equivalent to a mechanism, and the algorithm may be a specific algorithm or a very simple mechanism.
  • a node is specified as a unique node that generates a block of the blockchain, or the network node directly generates a block according to a transaction, and the like.
  • the present invention is not intended to be limiting as to the specific definition and use of the mechanism or algorithm.
  • the first network node After the first network node generates the blockchain, send a first notification message to the device node.
  • the first notification message is used to notify the device node that the first network node has generated a message of a block of the blockchain according to the data information.
  • the first notification message may be sent after generating the first blockchain L1 and generating any one of the second blockchains L4. It should be noted that step 309 is an optional step.
  • the device node receives the first notification message sent by the first network node.
  • the device node sends the second deletion message to the first network device.
  • the second deletion message is used by the at least one device node to request deletion of data information.
  • the first network node sends a first deletion message to the device node.
  • the first deletion message is an indication message used to instruct the device node to delete data information.
  • the device node deletes the data information.
  • the device node deletes the data information, and may delete the data information according to the deletion condition. For example, the data information whose time exceeds the threshold 1 is deleted. For example, the device node deletes the data information whose storage time exceeds the threshold 1.
  • step 310, step 311, and step 312 are optional steps.
  • step 208, step 209, and step 210 in the embodiment shown in FIG. 4, and details are not described herein again.
  • the first network node may determine the to-be-deleted block from the target blockchain.
  • the target blockchain is the first blockchain L1 or the second blockchain L4 in the first network node.
  • the first network node may determine that the to-be-deleted block is determined by using the first network node as an example, and the first network node may determine the to-be-deleted block from the target blockchain according to a preset deletion rule.
  • the preset deletion rule may include, but is not limited to, the number of the blocks in which the first network node stores the target blockchain is greater than a preset threshold, or the time interval in which the to-be-deleted block is generated exceeds a time.
  • the block of the threshold, or the block to be deleted is a block whose block number is smaller than the sequence number threshold.
  • the first network node may record the block header content of the to-be-deleted block.
  • the first network node may send, to the upper-level network node, multiple transaction information included in the generated block of the blockchain.
  • the first network node or the first network node may send the at least one transaction information included in the to-be-deleted block to the upper-level network node.
  • the original storage location information of the at least one transaction information may be recorded in the upper-level network node.
  • the first network node may send the hash value of the first data and the first data to the central node, so that the central node calculates a second hash value of the first data, and the second hash The value is compared with the first hash value to check whether the first data is falsified, whether it is trusted data or the like.
  • the first network node forms a second blockchain with the other first network nodes, and the first network node generates a first transaction according to the received data information to form a first blockchain.
  • the device node may be at least one device node performing step 301.
  • only the first network node and the other first network node may form a second blockchain, and the first network node receives the device. After the data information of the node (step 301), steps 307 and 308 are not executed, and the received data information can be continuously stored, and the first blockchain is not formed.
  • the storage pressure of the device node can be alleviated, and in addition, the first network node generates the A blockchain of data and a blockchain of first hash values for the first data enable storage of data and hash values by blockchain, even if data of the first blockchain generated from the data In the case of being tampered with, the data in the first blockchain can be verified by the hash value of the second blockchain, thus improving the tamper resistance of the data.
  • FIG. 6 is a schematic flowchart diagram of another data processing method according to an embodiment of the present application.
  • the embodiment of the present application relates to a first network node, other first network nodes, device nodes, and other device nodes.
  • the data processing method is jointly performed by the foregoing nodes, where the device node is in the process of performing step 401 to step 413, the device node is the first
  • the network node establishes any one of a plurality of device nodes of the communication connection. Please refer to the detailed description below for the specific implementation process.
  • the device node generates at least one second transaction information according to one or more data information.
  • the second transaction information includes information corresponding to the data item, such as the first data.
  • the second transaction information may further include at least one corresponding information: an index value item of the data, a hash value item of the data, a time information item, a sender item of the data, and a receiver item of the data.
  • the information corresponding to the item is the first hash value calculated by the device node for the first data.
  • the time information item may refer to the generation time of the first data or the generation time of the second transaction information, which is not limited by the embodiment of the present application.
  • the second transaction information generated by the device node in the embodiment of the present application is represented by C1 to be distinguished.
  • the device node sends the at least one second transaction information to a first network node.
  • the first network node receives the at least one second transaction information.
  • the other device node sends the second transaction information to the first network node.
  • the network node has a plurality of device nodes
  • the first network node in step 402 receives the second transaction information (represented by C1) sent by the device node, and the first network node may further receive the A network node establishes second transaction information sent by other device nodes of the communication connection, and second transaction information sent by other devices is represented by C2 to distinguish.
  • the first network node generates a block of the first blockchain according to the at least one second transaction information.
  • the first control node generates a blockchain according to the second transaction information sent by the multiple device nodes connected thereto.
  • the first network node may generate a block of the first blockchain L1 based on the second transaction information including the data item.
  • the first network node independently generates all the blocks of the first blockchain, and independently forms a first blockchain.
  • the network node may send the block to itself and/or save the block that it continuously generates.
  • the first network node of the first network node generates a block of the first blockchain based on the first algorithm according to the at least one second transaction information.
  • the first algorithm may be identical to the first mechanism.
  • the first algorithm is used to determine which network node generates the first blockchain block. Therefore, the first algorithm may be: the first network node is the only node that generates the first blockchain block. .
  • the first network node determines the included at least one first data according to the at least one second transaction information. Specifically, the first network node determines, according to the first second transaction information (C1), the first first data C1 from the first data C1 included in the second transaction information C1; the first network The network node determines a second first data C2 according to the second second transaction information (C2); the first network node determines the third first data C3 according to the third second transaction information (C3) analogy. In summary, the first network node determines the included at least one first data according to the at least one second transaction information.
  • the first network node may determine, according to the transaction information sent by the device node, a plurality of data information, where the data information includes the first data, and may further include at least one of the following: An index value, time information of the first data, an identifier of a device node that transmits the data information, an address of the device node, and an address of the network node.
  • the first network node calculates a first hash value of the first data.
  • the first network node may not perform step 405.
  • the first network node generates first transaction information B1 according to the first hash value.
  • Step 405 and step 403 may be parallel steps without limiting the order.
  • step 406 and step 403 can be parallel steps without limiting the order.
  • the first network node determines a plurality of data information from the transaction information sent by the device node. After the first network node calculates the first hash value of the first data in the data information by using the step 405, the time information item and the data may be determined according to other information in the data information corresponding to the first data.
  • the index value item, the sender item of the data, and the receiver item of the data are examples of the data information.
  • the first network node sends the generated at least one first transaction information B1 to other first network nodes.
  • the first network node may further receive at least one second transaction information B2 sent by another first network node.
  • the first network node generates a block of the second blockchain L4 according to the at least one first transaction information B1 and/or the at least one second transaction information B2.
  • the first network node and the other first network node generate a second blockchain L4 based on the at least one first transaction information B1 and/or the at least one second transaction information B2 based on an algorithm.
  • the first network node generates a block of the second blockchain L4 according to the at least one first transaction information B1 and/or the at least one second transaction information B2.
  • the first network node generates a first blockchain block as an example.
  • other network nodes eg, network node B
  • Block e.g.
  • other first network nodes eg, network node B
  • the first network node generates a block
  • other network nodes generate a block.
  • the first network node and other network nodes may determine, based on an algorithm, who generated the i-th block (i is a natural number greater than or equal to one).
  • the network node and the other network nodes form the first blockchain L4. Therefore, the first network node and the other first network nodes generate a second blockchain L4 based on the at least one first transaction information B1 and/or the at least one second transaction information B2 based on an algorithm.
  • the first network node After the “generating the block of the second blockchain L4” is completed, the first network node broadcasts the generated first blockchain block to other network nodes.
  • Step 407 to step 409 are to generate a second blockchain with respect to a hash value item, and are generated by a plurality of first network nodes based on an algorithm, where L4 represents a second blockchain, and specifically generates a second block.
  • L4 represents a second blockchain, and specifically generates a second block.
  • the first network node After the first network node generates the blockchain, send a first notification message to the device node.
  • the first notification message is used to notify the device node that the first network node has generated a message of a block of the blockchain according to the data information.
  • the first notification message may be sent after generating the first blockchain L1 and generating any one of the second blockchains L4. It should be noted that step 410 is an optional step.
  • the device node receives the first notification message sent by the first network node.
  • the device node sends the second deletion message to the first network device.
  • the second deletion message is used by the at least one device node to request deletion of data information.
  • the first network node sends a first deletion message to the device node.
  • the first deletion message is an indication message used to instruct the device node to delete data information.
  • the device node deletes the data information.
  • step 411, step 412, and step 413 are all optional steps.
  • step 208, step 209, and step 210 in the embodiment shown in FIG. I will not repeat them here.
  • the first network node may determine the to-be-deleted block from the target blockchain.
  • the target blockchain is the first blockchain L1 or the second blockchain L4 in the first network node.
  • the optional manner of the first network node determining the to-be-deleted block may be: the first network node may determine the to-be-deleted block from the target blockchain according to a preset deletion rule.
  • the preset deletion rule may include, but is not limited to, the number of the blocks in which the first network node stores the target blockchain is greater than a preset threshold, or the time interval in which the to-be-deleted block is generated exceeds a time.
  • the block of the threshold, or the block to be deleted is a block whose block number is smaller than the sequence number threshold.
  • the first network node may send, to the upper-level network node, multiple transaction information included in the generated block of the blockchain.
  • the first network node or the first network node may send the at least one transaction information included in the to-be-deleted block to the upper-level network node.
  • the original storage location information of the at least one transaction information may be recorded in the upper-level network node.
  • the first network node may send the hash value of the first data and the first data to the central node, so that the central node calculates a second hash value of the first data, and the second hash The value is compared with the first hash value to check whether the first data is falsified, whether it is trusted data or the like.
  • the first network node acquires a first hash value of the first data from the second blockchain; the first network node acquires the first block from the first blockchain a data, and calculating a second hash value of the first data; the first network node comparing the first hash value with the second hash value; if the first hash The value is the same as the second hash value, the first network node determines that the first data is trusted data; or determines that the first data has not been tampered with; or determines the first data The first hash value is a trusted hash value; or, if the first hash value is not the same as the second hash value, the first network node determines that the first data is untrusted data Or determining that the first data has been tampered with; or determining that the first hash value of the first data is an untrusted hash value.
  • the device node may send one or more transaction information about the data information to the first network node for storage, and generate the first number on the first network node respectively.
  • the blockchain and the blockchain of the first hash value of the first data data and hash values are respectively stored through the blockchain, even if all data of the first blockchain generated by the data is generated.
  • the data in the first blockchain can be verified by the hash value of the second blockchain, thus improving the tamper resistance of the data.
  • FIG. 7 is a schematic flowchart diagram of another data processing method according to an embodiment of the present application.
  • the embodiment of the present application relates to a first network node, other first network nodes, device nodes, and other device nodes.
  • the data processing method is jointly performed by the foregoing nodes, where the device node is in the process of performing step 501 to step 514, the device node is the first
  • the network node establishes any one of a plurality of device nodes of the communication connection. Please refer to the detailed description below for the specific implementation process.
  • the device node generates at least one second transaction information according to one or more data information.
  • the second transaction information includes information corresponding to the data item, such as the first data.
  • the optional second transaction information may further include at least one corresponding information: an index value item of the data, a hash value item of the data, a time information item, a sender item of the data, and a receiver item of the data.
  • the information corresponding to the item is the first hash value calculated by the device node for the first data.
  • the time information item may refer to the generation time of the first data or the generation time of the second transaction information, which is not limited by the embodiment of the present application.
  • the second transaction information generated by the device node in the embodiment of the present application is represented by C1 to be distinguished.
  • the device node sends the at least one second transaction information to a first network node and other device nodes.
  • the first network node receives the at least one second transaction information C1.
  • the other device node receives the at least one second transaction information C1.
  • the other device nodes and the device nodes each establish a communication connection with the first network node, and each device node can also communicate with each other.
  • the other device node sends at least one second transaction information C2 to the device node and the first network node.
  • the device node receives at least one second transaction information C2 sent by another device node.
  • the first network node receives at least one second transaction information C2 sent by another device node.
  • the other device node may broadcast the second transaction information C2, whereby the device node receives the second transaction information C2, and the first network node receives the second transaction information C2.
  • the device node receives at least one second transaction information C2 sent by another device node.
  • the device node may receive the second transaction information sent by the other device node, and the second transaction information sent by the other device is represented by C2.
  • the second transaction information sent by the other device is represented by C2.
  • the device node generates a block of the second blockchain L2 according to the at least one second transaction information.
  • the device node, the other device node, and the first network node generate a first blockchain L2 according to the second transaction information based on an algorithm.
  • the second blockchain block is generated by the device node.
  • the device node may be another device node (e.g., device node B) or the first network node may generate a block of the second blockchain based on the second transaction information.
  • the other device node for example, the network node B
  • the first network node broadcasts the generated second blockchain block to other device nodes (other network nodes than the network node B, the device) node).
  • the device node generates a block
  • another device node generates a block or a first network node generates a block.
  • the device node, the other device node, and the first network node may determine, according to an algorithm, who generated the i-th block (i is a natural number greater than or equal to 1).
  • the device node, other device nodes, and the first network node form a second blockchain L2. Therefore, the device node, the other device node and the first network node generate a first blockchain L2 based on the at least one second transaction information C1 and/or the at least one first transaction information C2 based on an algorithm.
  • the device node After the “generating the block of the second blockchain L2” is completed, the device node broadcasts the generated first blockchain block to the other device node and the first network node.
  • step 216 For a specific process of generating the second blockchain L2, refer to the detailed description of step 216 in the embodiment shown in FIG. 4, and details are not described herein again.
  • the first network node determines the included at least one first data according to the at least one second transaction information.
  • the first network node may perform step 505.
  • the first network node calculates a first hash value of the first data.
  • the first network node generates first transaction information B1 according to the first hash value.
  • the first network node sends the generated at least one first transaction information B1 to other first network nodes.
  • the first network node may further receive at least one second transaction information B2 sent by another first network node.
  • the first network node and the other first network node generate a block of the second blockchain L4 according to the algorithm according to the at least one first transaction information B1 and/or the at least one second transaction information B2.
  • the first blockchain block is generated by the first network node as an example.
  • other network nodes e.g., network node B
  • other first network nodes broadcast the generated first blockchain block to other first network nodes (other network nodes than the network node B, the first network node).
  • the first network node generates the block
  • the other network node generates the block.
  • the first network node and other network nodes may determine, based on an algorithm, who generated the i-th block (i is a natural number greater than or equal to one).
  • the network node and the other network nodes form the first blockchain L4.
  • An optional step after "generating a block” optionally, the first network node broadcasts the generated first blockchain block to other network nodes.
  • the steps 505 to 510 are the same as the content of the steps 404 to 409 in the embodiment shown in FIG. 6. For details, refer to the specific description of the embodiment shown in FIG.
  • the first network node After the first network node generates a blockchain, send a first notification message to the device node.
  • the device node receives the first notification message sent by the first network node.
  • the device node sends the second deletion message to the first network device.
  • the second deletion message is used by the at least one device node to request to delete a block.
  • the first network node deletes a to-be-deleted block.
  • the first network node may determine the to-be-deleted block and delete the to-be-deleted block.
  • the first network node may determine the to-be-deleted block from the target blockchain according to a preset deletion rule.
  • the target blockchain is the first blockchain L2 or the second blockchain L4.
  • the preset deletion rule may include, but is not limited to, the number of the blocks in which the first network node stores the target blockchain is greater than a preset threshold.
  • the value, or the to-be-deleted block is a block whose generation time duration exceeds a time threshold, or the block to be deleted is a block whose block number is smaller than a sequence number threshold.
  • the first network node or the first network node may record the block header content of the to-be-deleted block.
  • the first network node may send, to the upper-level network node, multiple transaction information included in the generated block of the blockchain.
  • the first network node or the second network node may send the at least one transaction information included in the to-be-deleted block to the upper-level network node.
  • the original storage location information of the at least one transaction information may be recorded in the upper-level network node.
  • the first network node may further perform step 513 after receiving the second deletion message.
  • the first network node sends a first deletion message to the device node.
  • the first deletion message is an indication message used to instruct the device node to delete a block.
  • the first network node may indicate, in the first deletion message, the block to be deleted, and the optional block to be deleted may be the to-be-deleted area deleted by the first network node in step 513. Piece.
  • the first network node may also not indicate the deleted block, and the device node determines the block to be deleted by itself, so that the function of the first deletion message is to notify the device node to perform deletion of data. The message is fine.
  • the device node will delete the block.
  • the device node may perform the step of deleting the block in the first blockchain L2 without performing step 512 and receiving the first delete message in step 514.
  • the to-be-deleted block may be determined from the first blockchain L2 according to a preset deletion rule.
  • the preset deletion rule may include, but is not limited to, the number of the blocks in which the first network node stores the target blockchain is greater than a preset threshold, or the time interval in which the to-be-deleted block is generated exceeds a time.
  • the block of the threshold, or the block to be deleted is a block whose block number is smaller than the sequence number threshold.
  • the device node may perform step 515 after receiving the first deletion message in step 514. If the first deletion message carries the block to be deleted, the device node may delete the carried block; if the first deletion message does not carry the block to be deleted, the The device node can determine the block to be deleted according to the first alternative.
  • the device node may record the block header content of the to-be-deleted block.
  • the device node may include at least one included in the to-be-deleted block.
  • the transaction information is sent to the upper node.
  • the original storage location information of the at least one transaction information may be recorded in the upper-level node.
  • the upper-level node may be the first network node, and may be other nodes, which is not limited in this embodiment of the present application.
  • step 515 By performing step 515 to delete a block in the blockchain, the storage pressure of the device node can be reduced.
  • the first network node or the device node may send the first data to the central node, and the first network node may send the hash value of the first data to the central node, so that the central node calculates the Determining a second hash value of the first data, and comparing the second hash value with the first hash value to check whether the first data is tampered with, whether it is trusted data, etc.
  • the specific implementation process may refer to A detailed description of an embodiment of the system shown in FIG. 2 is omitted here.
  • the device node acquires a first hash value of the first data from the second blockchain; the device node acquires the first data from the first blockchain, and Computing a second hash value of the first data; the device node comparing the first hash value with the second hash value; if the first hash value and the second If the hash value is the same, the device node determines that the first data is trusted data; or determines that the first data has not been tampered with; or determines that the first hash value of the first data is trusted a hash value; or, if the first hash value is different from the second hash value, the device node determines that the first data is untrusted data; or, determining that the first data has been Tampered; or, determining that the first hash value of the first data is an untrusted hash value.
  • the first network node acquires a first hash value of the first data from the second blockchain; the first network node acquires the first block from the first blockchain a data, and calculating a second hash value of the first data; the first network node comparing the first hash value with the second hash value; if the first hash The value is the same as the second hash value, the first network node determines that the first data is trusted data; or determines that the first data has not been tampered with; or determines the first data The first hash value is a trusted hash value; or, if the first hash value is not the same as the second hash value, the first network node determines that the first data is untrusted data Or determining that the first data has been tampered with; or determining that the first hash value of the first data is an untrusted hash value.
  • the device node may send one or more transaction information about the data information to the first network node for storage, and can generate a blockchain for the first data together with the first network node, and Generating, at the first network node, a blockchain of first hash values for the first data, respectively, storing data and hash values by the blockchain, even if the first region generated by the data In the case where all the data of the blockchain has been tampered with, the data in the first blockchain can be verified by the hash value of the second blockchain, thus improving the tamper resistance of the data.
  • FIG. 8 is a schematic diagram of a modularization of a central node according to an embodiment of the present application.
  • the central node in the embodiment of the present application may be the central node described in any of the method embodiments shown in FIG. Therefore, the content in the method embodiment shown in FIG. 3 is repeated, and the present embodiment may not be described again.
  • the central node 1 of the embodiment of the present application may include: an obtaining module 11, a calculating module 12, a comparing module 13, and a determining module 14.
  • the central node 1 further includes a generating module 15 .
  • the obtaining module 11 is configured to obtain a first hash value of the first data from the first network node
  • the calculating module 12 is configured to acquire the first data from the second network node, and calculate a second hash value of the first data
  • the comparison module 13 is configured to compare the first hash value acquired by the obtaining module 11 with the second hash value calculated by the calculating module 12;
  • a determining module 14 configured to determine that the first data is trusted data if the comparison module 13 determines that the first hash value is the same as the second hash value; or determine the first The data has not been tampered with; or, the first hash value of the first data is determined to be a trusted hash value.
  • the determining module 14 is further configured to: if the comparing module 13 determines that the first hash value is different from the second hash value, determining that the first data is untrusted data Or determining that the first data has been tampered with; or determining that the first hash value of the first data is an untrusted hash value.
  • the obtaining module 11 is configured to: obtain a first hash value corresponding to the first data from the second blockchain of the first network node; where the second blockchain is included in the data
  • the hash value item is composed of the blocks generated by the transaction information.
  • the calculating module 12 is specifically configured to: use the first data in a first blockchain of a second network node, where the first blockchain is generated by transaction information including a data item.
  • the block is composed of.
  • the obtaining module 11 is further configured to acquire, from the first network node, the following at least one piece of association information of the first data: an index value of the first data, time information of the first data, Transmitting a device node identifier of the first data, transmitting an address of the first data, and receiving the first The address of the data.
  • the obtaining module 11 is further configured to acquire, from the second network node, at least one of the following information of the first hash value of the first data: an index value of the first data, the first Time information of a data, a device node identifier for transmitting the first data, an address for transmitting the first data, and an address for receiving the first data.
  • the determining module 14 is further configured to select a first network node to determine the target first network node;
  • the obtaining module 11 is specifically configured to obtain a first hash value of the first data from a second blockchain of the target first network node.
  • the determining module 14 is specifically configured to select, from the at least one first network node, a first network node that meets the first legal condition.
  • the first legal condition is that the number of nodes that are the same as the first hash value of the first data of the second blockchain of the target first network node exceeds a first threshold.
  • the determining module 14 is further configured to select a second network node to determine the target second network node.
  • the obtaining module 11 is specifically configured to acquire first data from a first blockchain of the target second network node.
  • the determining module is configured to select, from the at least one second network node, a network node that meets the second legal condition as the second target network, in selecting a second network node to be the target second network node. node;
  • the second legal condition is that the number of network nodes that are the same as the first data of the first blockchain of the target second network node exceeds a second threshold.
  • the method further includes: a generating module 15, configured to: if it is determined that the first data is trusted data, determine that the i th transaction information of the third blockchain satisfies a generation condition, and generate a third blockchain i transaction information; or
  • the generating module 15 is further configured to: if it is determined that the first data is untrusted data, determine that the i th transaction information of the third blockchain does not satisfy the generating condition, and the third region is not generated.
  • the i-th transaction information of the blockchain or
  • the generating module 15 is further configured to: if it is determined that the first data is untrusted data, determine the location The jth transaction information of the third blockchain satisfies the generation condition, and generates the jth transaction information of the third blockchain.
  • the central node in the embodiment shown in Fig. 8 can be implemented as the central node shown in Fig. 9.
  • FIG. 9 a schematic diagram of a structure of a central node is provided in the embodiment of the present application.
  • the central node 1000 shown in FIG. 9 includes: a processor 1001 and a transceiver 1004.
  • the processor 1001 is connected to the transceiver 1004, such as through the bus 1002.
  • the central node 1000 may further include a memory 1003. It should be noted that, in the actual application, the transceiver 1004 is at least one, and the structure of the central node 1000 does not constitute a limitation on the embodiments of the present application.
  • the processor 1001 is applied to implement the functions of the calculation module 12, the comparison module 13, the determination module 14, and the generation module 15 shown in FIG. 8 in the embodiment of the present application.
  • the transceiver 1004 includes a receiver and a transmitter. In an optional solution, the transceiver 1004 is used in the embodiment of the present application to implement the function of the obtaining module 11 shown in FIG. 8.
  • the processor 1001 may be a central processing unit (CPU), a general-purpose processor, a digital signal processing (DSP), an application specific integrated circuit (ASIC), and a field programmable logic gate array (Field). - Programmable Gate Array, FPGA) or other programmable logic device, transistor logic device, hardware component, or any combination thereof. It is possible to implement or carry out the various illustrative logical blocks, modules and circuits described in connection with the present disclosure.
  • the processor 1001 may also be a combination of computing functions, such as one or more microprocessor combinations, a combination of a DSP and a microprocessor, and the like.
  • Bus 1002 can include a path for communicating information between the components described above.
  • the bus 1002 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus.
  • PCI Peripheral Component Interconnect
  • EISA Extended Industry Standard Architecture
  • the bus 1002 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 9, but it does not mean that there is only one bus or one type of bus.
  • the memory 1003 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type that can store information and instructions.
  • the dynamic storage device can also be an Electrically Erasable Programmable Read-Only Memory (EEPROM) or a Compact Disc Read-Only Memory (CD-ROM). Or other disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), disk storage media or other magnetic storage devices, or can be used to carry or store expectations in the form of instructions or data structures Program code and any other medium that can be accessed by a computer, but is not limited thereto.
  • EEPROM Electrically Erasable Programmable Read-Only Memory
  • CD-ROM Compact Disc Read-Only Memory
  • the memory 1003 is configured to store application code for executing the solution of the present application, and is controlled by the processor 1001 for execution.
  • the processor 1001 is configured to execute application code stored in the memory 1003 to implement the actions of the central node provided by any of the embodiments shown in FIG.
  • Also provided in the embodiment of the present application is a computer storage medium for storing computer software instructions used by the central node, which includes a program designed to perform the above aspects as a central node.
  • FIG. 10 is a schematic diagram of a modularization of a network node according to an embodiment of the present application.
  • the network node in the embodiment of the present application may be the network node described in any of the method embodiments shown in FIG. 3-7. Therefore, the content in any of the method embodiments shown in FIG. 3 to FIG. 7 is repeated, and the present embodiment may not be described again.
  • the network node 2 of the embodiment of the present application may include: a block generating unit 2001.
  • the network node 2 may further include a first information receiving module 2002, an information generating module 2003, a first information sending module 2004, a block sending module 2005, a second information receiving module 2006, a notification message receiving module 2007, At least one module of the message receiving module 2008, the deleted block determining module 2009, the deleted message sending module 2010, the deleting module 2011, and the recording module 2012 is deleted.
  • the block generation module 2001 is configured to generate a block of the blockchain according to the at least one first transaction information.
  • the first transaction information includes at least one of the following corresponding information: a data item, an index value item of the data, a hash value item of the data, a time information item, a sender item of the data, and a receiver item of the data.
  • it also includes:
  • the first information receiving module 2002 is configured to receive data information sent by at least one device node;
  • the information generating module 2003 is configured to generate at least one first transaction information according to the data information received by the first information receiving module 2002.
  • the data information includes at least one of: first data, a first hash value of the first data, an index value of the first data, time information of the first data, and a sending station.
  • the method further includes: a calculating module, configured to: if the data information includes the first data, and And including the first hash value, calculating a first hash value of the first data; the information generating module 2003 is specifically configured to generate at least one first according to the data information and the first hash value Trading Information.
  • a calculating module configured to: if the data information includes the first data, and And including the first hash value, calculating a first hash value of the first data
  • the information generating module 2003 is specifically configured to generate at least one first according to the data information and the first hash value Trading Information.
  • it also includes:
  • the first information sending module 2004 is configured to send the at least one first transaction information generated by the information generating module 2003 to another network node or at least one device node.
  • the method further includes: a second information receiving module 2006, configured to receive at least one second transaction information sent by another network node or at least one device node; wherein the second transaction information includes at least one of the following corresponding information : a data item, an index value item of data, a hash value item of data, a time information item, a sender item of the data, and a receiver item of the data.
  • a second information receiving module 2006 configured to receive at least one second transaction information sent by another network node or at least one device node; wherein the second transaction information includes at least one of the following corresponding information : a data item, an index value item of data, a hash value item of data, a time information item, a sender item of the data, and a receiver item of the data.
  • the block generating module 2001 is further configured to: if the at least one first transaction information generated by the information generating module 2003 includes a data item, according to the at least one first transaction information, based on the first algorithm, A block of the first blockchain is generated.
  • the block generating module 2001 is further configured to: if the at least one first transaction information generated by the information generating module 2003 includes a data item, and the at least one received by the second information receiving module 2006 The second transaction information includes a data item, and based on the at least one first transaction information and/or the at least one second transaction information, generating a block of the first blockchain based on the second algorithm.
  • it also includes:
  • the block generating module is further configured to: if the at least one first transaction information generated by the information generating module 2003 includes a hash value item of data, generate, according to the at least one first transaction information, based on the third algorithm The block of the second blockchain.
  • it also includes:
  • the block generating module is further configured to: if the at least one first transaction information generated by the information generating module 2003 includes a hash value item of data, and the at least one second transaction received by the second information receiving module 2006 The information includes a hash value item of the data, and the block of the second blockchain is generated based on the fourth algorithm based on the at least one first transaction information and/or the at least one second transaction information.
  • the block generating module is further configured to generate, according to the at least one first transaction information, based on the fifth algorithm, if the at least one first transaction information generated by the information generating module 2003 includes a data item. a block of the first blockchain; and, if the at least one first transaction information generated by the information generating module 2003 includes a hash value item of data, and the second information receiving module 2006 receives And the at least one second transaction information includes a hash value item of the data, and generating a second blockchain based on the sixth algorithm according to the at least one first transaction information and/or the at least one second transaction information Block
  • the block generating module is further configured to: if the at least one first transaction information generated by the information generating module 2003 includes a data item, and the at least one second transaction information received by the second information receiving module 2006 includes a data item And generating, according to the seventh algorithm, a block of the first blockchain according to the at least one first transaction information and/or the at least one second transaction information; and at least one generated by the information generating module 2003
  • the first transaction information includes a hash value item of the data
  • the block of the second blockchain is generated based on the at least one first transaction information based on the eighth algorithm.
  • the network node 2 further includes:
  • a first acquiring module configured to acquire a first hash value of the first data
  • the first obtaining module is further configured to acquire the first data from the first blockchain, and calculate a second hash value of the first data
  • a first comparison module configured to compare the first hash value with the second hash value
  • a first determining module configured to determine that the first data is trusted data if the first hash value is the same as the second hash value; or determine that the first data has not been tampered with; or Determining that the first hash value of the first data is a trusted hash value; or
  • the first determining module is further configured to: if the first hash value is different from the second hash value, determine that the first data is untrusted data; or determine that the first data has been Tampered; or, determining that the first hash value of the first data is an untrusted hash value.
  • the network node 2 further includes:
  • a second acquiring module configured to acquire, from the second blockchain, a first hash value of the first data
  • the second obtaining module is further configured to acquire the stored first data, and calculate a second hash value of the first data
  • a second comparison module configured to compare the first hash value with the second hash value
  • a second determining module configured to determine that the first data is trusted data if the first hash value is the same as the second hash value; or determine that the first data has not been tampered with; or Determining that the first hash value of the first data is a trusted hash value; or
  • the second determining module is further configured to: if the first hash value is different from the second hash value, Determining that the first data is untrusted data; or determining that the first data has been tampered with; or determining that the first hash value of the first data is an untrusted hash value.
  • the network node 2 further includes:
  • a third obtaining module configured to acquire, from the second blockchain, a first hash value of the first data
  • the third obtaining module is further configured to acquire the first data from the first blockchain, and calculate a second hash value of the first data
  • a third comparison module configured to compare the first hash value with the second hash value
  • a third determining module configured to determine that the first data is trusted data if the first hash value is the same as the second hash value; or determine that the first data has not been tampered with; or Determining that the first hash value of the first data is a trusted hash value; or
  • the third determining module is further configured to: if the first hash value is different from the second hash value, determine that the first data is untrusted data; or determine that the first data has been Tampered; or, determining that the first hash value of the first data is an untrusted hash value.
  • the method further includes: a block sending module 2005, configured to send the data information or the block of the blockchain to the central node.
  • the method further includes: a notification message sending module 2007, configured to send, to the at least one device node, a first notification message, where the first notification message is used to notify the device node that the message of the block of the blockchain has been generated.
  • a notification message sending module 2007, configured to send, to the at least one device node, a first notification message, where the first notification message is used to notify the device node that the message of the block of the blockchain has been generated.
  • the method further includes: a deletion message sending module 2010, configured to send a first deletion message to the device node, where the first deletion message is an indication message used to instruct the device node to delete the data information or delete a block .
  • a deletion message sending module 2010, configured to send a first deletion message to the device node, where the first deletion message is an indication message used to instruct the device node to delete the data information or delete a block .
  • the method further includes: deleting the message receiving module 2008, further configured to receive a second deletion message sent by the at least one device node, where the second deletion message is used by the at least one device node to request to delete the data Information or delete a block.
  • the deleting block determining module 2009 is configured to determine, from the target blockchain, a block to be deleted, where the target blockchain is any one of the blockchains stored by the network node.
  • the second information sending module 2013 is further configured to send the multiple transaction information included in the block of the blockchain to the upper-level network node.
  • the method further includes: deleting the module 2011, configured to delete the to-be-deleted block in the target blockchain.
  • the deleting module 2011 is specifically configured to determine, according to a preset deletion rule, a to-be-deleted block from a target blockchain, where the preset deletion rule is: the network node stores the target zone.
  • the block number of the block chain is greater than a preset threshold, or the block to be deleted is a block whose generation time duration exceeds a time threshold, or the block to be deleted is a block whose block number is smaller than the serial number threshold.
  • the recording module 2012 is configured to record the block header content of the to-be-deleted block.
  • the network node in the embodiment shown in FIG. 10 can be implemented by the network node shown in FIG.
  • FIG. 11 a schematic diagram of a structure of a network node is provided in the embodiment of the present application.
  • the network node 4000 shown in FIG. 11 includes: a processor 4001 and a transceiver 4004.
  • the processor 4001 is connected to the transceiver 4004, such as through the bus 4002.
  • the network node 4000 may further include a memory 4003.
  • the transceiver 4004 is at least one, and the structure of the network node 4000 does not constitute a limitation on the embodiment of the present application.
  • the processor 4001 is applied to implement the functions of the block generating unit 2001, the information generating module 2003, the deleting block determining module 2009, the deleting module 2011, and the recording module 2012 shown in FIG. 10 in the embodiment of the present application.
  • the transceiver 4004 includes a receiver and a transmitter.
  • the transceiver 4004 is used in the embodiment of the present application to implement the first information receiving module 2002, the first information sending module 2004, the block sending module 2005, and the first embodiment shown in FIG.
  • the processor 4001 can be a CPU, a general purpose processor, a DSP, an ASIC, an FPGA or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. It is possible to implement or carry out the various illustrative logical blocks, modules and circuits described in connection with the present disclosure.
  • the processor 4001 can also be a combination of computing functions, such as one or more microprocessor combinations, a combination of a DSP and a microprocessor, and the like.
  • Bus 4002 can include a path for communicating information between the components described above.
  • the bus 4002 may be a PCI bus or an EISA bus or the like.
  • the bus 4002 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 11, but it does not mean that there is only one bus or one type of bus.
  • the memory 4003 can be a ROM or other type of static storage device that can store static information and instructions, RAM or other types of dynamic storage devices that can store information and instructions, or EEPROM, CD-ROM or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), disk storage media or other magnetic storage devices, or capable of being carried or stored with instructions
  • ROM read-only memory
  • RAM random access memory
  • EEPROM electrically erasable programmable read-only memory
  • CD-ROM or other optical disc storage including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.
  • disk storage media or other magnetic storage devices or capable of being carried or stored with instructions
  • the desired program code in the form of a data structure and any other medium that can be accessed by a computer, but is not limited thereto.
  • the memory 4003 is configured to store application code for executing the solution of the present application, and is controlled by the processor 4001 for execution.
  • the processor 4001 is configured to execute the application code stored in the memory 4003 to implement the actions of the network node in any of the embodiments shown in FIGS. 3 to 7.
  • Also provided in the embodiment of the present application is a computer storage medium for storing computer software instructions used by the network node, which includes a program designed to perform the above aspects for a network node.
  • FIG. 12 is a schematic diagram of a modularity of a device node according to an embodiment of the present application.
  • the device node in the embodiment of the present application may be the device node described in any of the method embodiments shown in FIG. 3-7. Therefore, the content in any of the method embodiments shown in FIG. 3 to FIG. 7 is repeated, and the present embodiment may not be described again.
  • the device node 3 in this embodiment of the present application may include: a sending module 30.
  • the device node 3 may further include a first receiving module 31, a second receiving module 32, a third receiving module 33, and a deleting module 34.
  • the sending module 30 is configured to send one or more pieces of data information to the network node, where the data information includes at least one of: first data, a first hash value of the first data, an index of the first data a value, time information of the first data, an identifier of a device node that sends the data information, an address of the device node, and an address of the network node; the data information is used by the network node to generate a first transaction information;
  • the first receiving module 31 is configured to receive a blockchain first notification message sent by the network node, where the first notification message is used to notify the network node that the block has been generated according to the data information.
  • the message of the block of the chain is configured to receive a blockchain first notification message sent by the network node, where the first notification message is used to notify the network node that the block has been generated according to the data information.
  • the message of the block of the chain is configured to receive a blockchain first notification message sent by the network node, where the first notification message is used to notify the network node that the block has been generated according to the data information.
  • the method further includes: a second receiving module 32, configured to receive a block sent by the network node.
  • the method further includes: a third receiving module 33, configured to receive, by the network node, a first deletion message, where the first deletion message is used to instruct the device node to delete the data information or delete a block Instructions message.
  • a third receiving module 33 configured to receive, by the network node, a first deletion message, where the first deletion message is used to instruct the device node to delete the data information or delete a block Instructions message.
  • the sending module 30 is further configured to send, to the network node, a second delete message,
  • the second delete message is used to request to delete the data information or delete a block.
  • the method further includes: a deleting module 34, configured to delete the data information.
  • the deleting module 34 is specifically configured to delete the data information whose generation duration exceeds the first time threshold.
  • FIG. 13 is a schematic diagram of modularization of another device node according to an embodiment of the present application.
  • the device node in the embodiment of the present application may be the device node described in any of the method embodiments shown in FIG. 3-7. Therefore, the content in any of the method embodiments shown in FIG. 3 to FIG. 7 is repeated, and the present embodiment may not be described again.
  • the device node 3 of the embodiment of the present application may include: a generating module 35.
  • the device node 3 may further include a sending module 36, a second receiving module 37, a third receiving module 38, and a deleting module 39.
  • a generating module 35 configured to generate at least one second transaction information according to one or more pieces of data information, and send the at least one second transaction information to a network node;
  • the second transaction information includes at least one of the following Information: data item, index value item of data, hash value item of data, time information item, sender item of data, and receiver item of data.
  • the method further includes: a second receiving module 37, configured to receive a block sent by the network node.
  • the method further includes: a third receiving module 38, configured to receive, by the network node, a first deletion message, where the first deletion message is used to instruct the device node to delete the data information or delete a block Instructions message.
  • a third receiving module 38 configured to receive, by the network node, a first deletion message, where the first deletion message is used to instruct the device node to delete the data information or delete a block Instructions message.
  • the method further includes: a sending module 36, configured to send a second delete message to the network node, where the second delete message is used to request to delete the data information or delete a block.
  • a sending module 36 configured to send a second delete message to the network node, where the second delete message is used to request to delete the data information or delete a block.
  • the method further includes: a deleting module 39, configured to delete the data information.
  • the deleting module 39 is specifically configured to delete data information whose generation duration exceeds a first time threshold.
  • the device node in the embodiment shown in Fig. 12 or Fig. 13 can be implemented by the device node shown in Fig. 14.
  • FIG. 14 a schematic diagram of a device node is provided in the embodiment of the present application.
  • the device node 3000 shown in FIG. 14 includes: a processor 3001 and a transceiver 3004.
  • the processor 3001 is connected to the transceiver 3004, such as through the bus 3002.
  • the device node 3000 may further include a memory 3003.
  • the transceiver 3004 is at least one, and the structure of the device node 3000 does not constitute a limitation on the embodiment of the present application.
  • the transceiver 1004 includes a receiver and a transmitter.
  • the processor 1001 is applied to the embodiment of the present application for implementing the function of the deleting module 34 shown in FIG.
  • the transceiver 1004 is used in the embodiment of the present application to implement the functions of the sending module 30, the first receiving module 31, the second receiving module 32, and the third receiving module 33 shown in FIG.
  • the processor 1001 is applied to implement the functions of the generating module 35 and the deleting module 39 shown in FIG. 13 in the embodiment of the present application.
  • the transceiver 1004 is used in the embodiment of the present application to implement the functions of the sending module 36, the second receiving module 37, and the third receiving module 38 shown in FIG.
  • the processor 3001 can be a CPU, a general purpose processor, a DSP, an ASIC, an FPGA or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. It is possible to implement or carry out the various illustrative logical blocks, modules and circuits described in connection with the present disclosure.
  • the processor 3001 can also be a combination of computing functions, for example, including one or more microprocessor combinations, a combination of a DSP and a microprocessor, and the like.
  • Bus 3002 can include a path for communicating information between the components described above.
  • the bus 3002 may be a PCI bus or an EISA bus or the like.
  • the bus 3002 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 14, but it does not mean that there is only one bus or one type of bus.
  • the memory 3003 can be a ROM or other type of static storage device that can store static information and instructions, RAM or other types of dynamic storage devices that can store information and instructions, or can be an EEPROM, CD-ROM or other optical disk storage, optical disk. Storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired program code in the form of instructions or data structures and can be Any other medium accessed by the computer, but is not limited to this.
  • the memory 3003 is configured to store application code for executing the solution of the present application, and is controlled by the processor 3001 for execution.
  • the processor 3001 is configured to execute the application code stored in the memory 3003 to implement the actions of the device node in any of the embodiments shown in FIGS. 3 to 7.
  • Also provided in the embodiment of the present application is a computer storage medium for storing computer software instructions used by the device node, which includes a process for performing the above aspects for the device node. sequence.
  • embodiments of the present application can be provided as a method, apparatus (device), or computer program product.
  • the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment in combination of software and hardware.
  • the application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • the computer program is stored/distributed in a suitable medium, provided with other hardware or as part of the hardware, or in other distributed forms, such as over the Internet or other wired or wireless telecommunication systems.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Abstract

一种数据处理方法及相关设备,其中方法包括如下步骤:中心节点从第一网络节点获取第一数据的第一散列值;所述中心节点从第二网络节点获取所述第一数据,并计算所述第一数据的第二散列值;所述中心节点将所述第一散列值与所述第二散列值进行比对;若所述第一散列值与所述第二散列值相同,则所述中心节点确定所述第一数据是可信数据;或者,确定所述第一数据未被篡改;或者,确定所述第一数据的第一散列值是可信散列值。采用本申请,通过分别存储数据和数据的散列值的方式,能够实现对所存储数据的有效验证,提高了数据存储的有效性,也提高了数据的防篡改能力。

Description

一种数据处理方法及相关设备 技术领域
本申请涉及通信技术领域,尤其涉及一种数据处理方法及相关设备。
背景技术
区块链(block chain)是一种分布式数据库,可以理解为是一种按照时间顺序将数据区块以顺序相连的方式组合成的一种链式数据结构,并以密码学方式保证的不可篡改和不可伪造的分布式账本。在现有技术方案中,网络节点生成的区块链是由包含交易信息的区块按照一定顺序链接起来的数据结构,在这一数据结构中,区块是由包含元数据的区块头和紧跟其后的构成区块主体的一个或者多个交易信息组成的,其中,一个或者多个交易信息是根据设备节点所产生的数据生成的。
对于设备节点生成的一个数据,现有技术方案是根据该数据生成了一个交易信息,并通过共识算法,将该交易生成区块链中的一个区块。这样若不法人员将这一区块链中的所述数据的交易信息都替换并篡改了,通过该区块链也无法验证这一区块链的正确性,降低了数据存储的有效性。
发明内容
本申请实施例提供了一种数据处理方法及相关设备,通过分别存储数据和数据的散列值的方式,能够实现对所存储数据的有效验证,提高了数据存储的有效性,也提高了数据的防篡改能力。
第一方面,本申请实施例提供了一种数据处理方法,包括:
中心节点从第一网络节点获取第一数据的第一散列值;
所述中心节点从第二网络节点获取所述第一数据,并计算所述第一数据的第二散列值;
所述中心节点将所述第一散列值与所述第二散列值进行比对;
若所述第一散列值与所述第二散列值相同,则所述中心节点确定所述第一数据是可信数据;或者,确定所述第一数据未被篡改;或者,确定所述第一数据的第一散列值是可信散列值。
在第一方面,中心节点获取第一网络节点的第一数据的第一散列值,并获取第二网络节点的第一数据,并计算第一数据的第二散列值,将第一散列值和散列值进行比对,进而确定第一数据是否为可信数据。这种方案实现了对所存储数据的有效验证,进而提高了数据存储的有效性。
在一种可选的实施例中,还包括若所述第一散列值与所述第二散列值不相同,则所述中心节点确定所述第一数据是不可信数据;或者,确定所述第一数据已被篡改;或者,确定所述第一数据的第一散列值是不可信散列值。
在一种可选的实施例中,所述中心节点从第一网络节点获取第一数据的第一散列值具体是从第一网络节点的第二区块链中获取第一数据对应的第一散列值;其中,所述第二区块链为由包含数据的散列值项的交易信息生成的区块组成的。
在一种可选的实施例中,所述中心节点从第二网络节点获取所述第一数据具体是从第二网络节点的第一区块链中获取所述第一数据,其中,所述第一区块链为由包含数据项的交易信息生成的区块组成的。
在一种可选的实施例中,还包括:所述中心节点从第一网络节点获取所述第一数据的第一散列值关联信息,所述关联信息包括以下至少一项:所述第一数据的索引值、所述第一数据的时间信息、发送所述第一数据的设备节点标识、发送所述第一数据的地址和接收所述第一数据的地址。
在一种可选的实施例中,还包括:所述中心节点从第二网络节点获取所述第一数据的关联信息,所述关联信息包括以下至少一项:所述第一数据的索引值、所述第一数据的时间信息、发送所述第一数据的设备节点标识、发送所述第一数据的地址和接收所述第一数据的地址。
在一种可选的实施例中,所述中心节点从第一网络节点获取第一数据的第一散列值之前,还包括:所述中心节点选择一个第一网络节点确定为目标第一网络节点;而所述中心节点从第一网络节点获取第一数据的第一散列值具体是从目标第一网络节点的第二区块链中获取第一数据的第一散列值。
在一种可选的实施例中,所述中心节点选择一个第一网络节点确定为目标第一网络节点,包括:所述中心节点从至少一个第一网络节点中选择一个满足第一合法条件的第一网络节点为目标第一网络节点;所述第一合法条件为:与 所述目标第一网络节点的第二区块链的第一数据的第一散列值相同的节点数量超过第一阈值。
在一种可选的实施例中,所述中心节点从第二网络节点获取所述第一数据之前,还包括:
所述中心节点选择一个第二网络节点确定为目标第二网络节点。而所述中心节点从第二网络节点获取所述第一数据,包括:所述中心节点从所述目标第二网络节点的第一区块链中获取第一数据。
在一种可选的实施例中,所述中心节点选择一个第二网络节点确定为目标第二网络节点具体是从至少一个第二网络节点中选择一个满足第二合法条件的网络节点为第二目标网络节点;所述第二合法条件为:与所述目标第二网络节点的第一区块链的第一数据相同的网络节点的数量超过第二阈值。
在一种可选的实施例中,还包括:若确定所述第一数据是可信数据,则所述中心节点确定第三区块链的第i个交易信息满足生成条件,生成第三区块链的第i个交易信息;或者,若确定所述第一数据是不可信数据,则所述中心节点确定所述第三区块链的第i个交易信息不满足所述生成条件,不生成所述第三区块链的第i个交易信息;或者,若确定所述第一数据是不可信数据,则所述中心节点确定所述第三区块链的第j个交易信息满足生成条件,生成所述第三区块链的第j个交易信息。
第二方面,本申请实施例提供了一种数据处理方法,包括:
网络节点根据至少一个第一交易信息,生成区块链的区块。其中,所述第一交易信息包括以下至少一项对应的信息:交易标识项、生成所述第一交易信息的节点标识项、数据项、数据的索引值项、数据的散列值项、时间信息项、数据的发送方项和数据的接收方项。
在第二方面,设备节点将交易信息发送至网络节点,能够缓解设备节点的存储压力,另外,在网络节点生成了关于交易信息的区块链,提高了数据存储的有效性。
在一种可选的实施例中,所述网络节点根据至少一个第一交易信息,生成区块链的区块之前,还包括:所述网络节点接收至少一个设备节点发送的数据信息;所述网络节点根据所述数据信息生成至少一个第一交易信息。可以看出, 该网络节点的第一交易信息是由网络节点生成的。
在一种可选的实施例中,所述数据信息包括以下至少一项:第一数据、所述第一数据的第一散列值、所述第一数据的索引值、所述第一数据的时间信息、发送所述数据信息的设备节点的标识、所述设备节点的地址和所述网络节点的地址。可选的,在第一交易信息为根据所述数据信息生成的情况下,第一交易信息中所包含一项或者多项的信息也是通过所述数据信息而确定的。
在一种可选的实施例中,若所述数据信息包括所述第一数据且未包括所述第一散列值,则所述网络节点计算所述第一数据的第一散列值;所述网络节点根据所述数据信息生成至少一个第一交易信息具体是根据所述数据信息和所述第一散列值生成至少一个第一交易信息。可选的,所述第一交易信息可以是关于所述第一数据的,或者,所述第一交易信息也可以是关于所述第一散列值的。
在一种可选的实施例中,所述网络节点向其他网络节点或至少一个设备节点发送所述至少一个第一交易信息。例如,所述网络节点广播所述至少一个第一交易信息。
在一种可选的实施例中,还包括:所述网络节点接收其他网络节点或者至少一个设备节点发送的至少一个第二交易信息;其中,所述第二交易信息包括以下至少一项对应的信息:交易标识项、生成所述第二交易信息的节点标识项、数据项、数据的索引值项、数据的散列值项、时间信息项、所述数据的发送方项和所述数据的接收方项。
在一种可选的实施例中,还包括:若所述至少一个第一交易信息包含数据项,则所述网络节点根据所述至少一个第一交易信息,基于第一算法,生成第一区块链的区块。
在一种可选的实施例中,还包括:若所述至少一个第一交易信息包含数据项,且所述至少一个第二交易信息包含数据项,则所述网络节点根据所述至少一个第一交易信息和/或所述至少一个第二交易信息,基于第二算法,生成第一区块链的区块。
在一种可选的实施例中,还包括:若所述至少一个第一交易信息包含数据的散列值项,则所述网络节点根据所述至少一个第一交易信息,基于第三算法, 生成第二区块链的区块。
在一种可选的实施例中,还包括:若所述至少一个第一交易信息包含数据的散列值项,且所述至少一个第二交易信息包含数据的散列值项,则所述网络节点根据所述至少一个第一交易信息和/或所述至少一个第二交易信息,基于第四算法,生成第二区块链的区块。
在一种可选的实施例中,若所述至少一个第一交易信息包含数据项,则所述网络节点根据所述至少一个第一交易信息,基于第五算法,生成第一区块链的区块;和,若所述至少一个第一交易信息包含数据的散列值项,且所述至少一个第二交易信息包含数据的散列值项,则所述网络节点根据所述至少一个第一交易信息和/或所述至少一个第二交易信息,基于第六算法,生成第二区块链的区块;或者,
若所述至少一个第一交易信息包含数据项,且所述至少一个第二交易信息包含数据项,则所述网络节点根据所述至少一个第一交易信息和/或所述至少一个第二交易信息,基于第七算法,生成第一区块链的区块;和,所述至少一个第一交易信息包含数据的散列值项,则所述网络节点根据所述至少一个第一交易信息,基于第八算法,生成第二区块链的区块。
在一种可选的实施例中,对于所述网络节点生成了关于包含第一数据的第一区块链且存储了第一数据的散列值的情况下,所述网络节点获取第一数据的第一散列值;从所述第一区块链获取所述第一数据,并计算所述第一数据的第二散列值;将所述第一散列值与所述第二散列值进行比对;若所述第一散列值与所述第二散列值相同,则确定所述第一数据是可信数据;或者,确定所述第一数据未被篡改;或者,确定所述第一数据的第一散列值是可信散列值;或,若所述第一散列值与所述第二散列值不相同,则确定所述第一数据是不可信数据;或者,确定所述第一数据已被篡改;或者,确定所述第一数据的第一散列值是不可信散列值。通过分别存储数据和数据的散列值的方式,即使数据被篡改了,能够实现对所存储数据的有效验证,提高了数据存储的有效性,也提高了数据的防篡改能力。
在一种可选的实施例中,对于所述网络节点生成了关于包含第一数据的第一散列值的第二区块链且存储了第一数据的情况下,从所述第二区块链获取所 述第一数据的第一散列值;获取存储的所述第一数据,并计算所述第一数据的第二散列值;将所述第一散列值与所述第二散列值进行比对;若所述第一散列值与所述第二散列值相同,则确定所述第一数据是可信数据;或者,确定所述第一数据未被篡改;或者,确定所述第一数据的第一散列值是可信散列值;或,若所述第一散列值与所述第二散列值不相同,则确定所述第一数据是不可信数据;或者,确定所述第一数据已被篡改;或者,确定所述第一数据的第一散列值是不可信散列值。通过分别存储数据和数据的散列值的方式,即使数据被篡改了,能够实现对所存储数据的有效验证,提高了数据存储的有效性,也提高了数据的防篡改能力。
在一种可选的实施例中,对于所述网络节点生成了关于包含第一数据的第一区块链且生成了关于包含第一数据的散列值的第二区块链的情况下,从所述第二区块链获取所述第一数据的第一散列值;从所述第一区块链获取所述第一数据,并计算所述第一数据的第二散列值;将所述第一散列值与所述第二散列值进行比对;若所述第一散列值与所述第二散列值相同,则确定所述第一数据是可信数据;或者,确定所述第一数据未被篡改;或者,确定所述第一数据的第一散列值是可信散列值;或,若所述第一散列值与所述第二散列值不相同,则确定所述第一数据是不可信数据;或者,确定所述第一数据已被篡改;或者,确定所述第一数据的第一散列值是不可信散列值。通过分别存储数据和数据的散列值的方式,即使数据被篡改了,能够实现对所存储数据的有效验证,提高了数据存储的有效性,也提高了数据的防篡改能力。
在一种可选的实施例中,还包括:所述网络节点向中心节点发送所述数据信息或者区块链的区块。可选的,所述网络节点可以在接收到中心节点的数据信息或者区块的获取请求之后发送数据信息或区块链的区块。
在一种可选的实施例中,所述网络节点根据至少一个第一交易信息,生成区块链的区块之后,还包括:所述网络节点向所述至少一个设备节点发送第一通知消息,所述第一通知消息用于通知设备节点已生成区块链的区块的消息。可选的,这样设备节点在接收到第一通知消息之后,对数据信息进行相应的处理,例如,删除。
在一种可选的实施例中,还包括:所述网络节点向设备节点发送第一删除 消息,所述第一删除消息为用于指示所述设备节点删除所述数据信息或者删除区块的指示消息。
在一种可选的实施例中,还包括:所述网络节点接收所述至少一个设备节点发送的第二删除消息,所述第二删除消息为所述至少一个设备节点用于请求删除所述数据信息或者删除区块。可选的,所述网络节点根据所述第二删除消息为所述设备节点确定可删除的数据信息或者可删除的区块,或者,所述网络节点可以向设备节点发送删除允许消息,以指示设备节点自身确定可删除的数据信息或可删除的区块。
在一种可选的实施例中,还包括:所述网络节点从目标区块链中确定待删除区块,所述目标区块链为所述网络节点所存储的任意一个区块链。
在一种可选的实施例中,还包括:所述网络节点将所述区块链的区块包含的多个交易信息发送至上一级网络节点。例如,在网络节点存储压力较大的情况下,可以将多个交易信息转移至上一级的网络节点进行存储,以减少该网络节点的存储压力。
在一种可选的实施例中,还包括:所述网络节点将所述目标区块链中的所述待删除区块进行删除。可选的,网络节点从目标区块链中确定待删除区块具体是按照预设删除规则,从目标区块链中确定待删除区块;其中,所述预设删除规则为:所述网络节点存储所述目标区块链的区块个数大于预设阈值,或者所述待删除区块为生成时间时长超过时间阈值的区块,或者,所述待删除区块为区块序号小于序号阈值的区块。可选的,所述网络节点记录所述待删除区块的区块头内容,以便于在接收到关于所删除的区块的查询信息时,确定所删除的区块所存储过的节点。
第三方面,本申请实施例提供了一种数据处理方法,包括:
所述网络节点接收至少一个设备节点发送的一个或多个数据信息;
所述网络节点根据所述一个或多个数据信息,生成至少一个第一交易信息。
所述第一交易信息包括以下至少一项对应的信息:交易标识项、生成所述第一交易信息的节点标识项、数据项、数据的索引值项、数据的散列值项、时间信息项、数据的发送方项和数据的接收方项。
可选的,所述数据信息所述数据信息包括以下至少一项:数据、数据的第一散列值、数据的索引值、数据生成的时间、所述设备节点的标识、所述设备节点的地址和所述网络节点的地址。
可选的,在第一交易信息为根据所述数据信息生成的情况下,第一交易信息中所包含一项或者多项的信息也是通过所述数据信息而确定的。
在第二方面,设备节点将数据信息发送至网络节点,能够缓解设备节点的存储压力,另外,在网络节点能够根据数据信息生成交易信息,以进行存储。
在一种可选的实施例中,还包括:若所述数据信息包括所述第一数据且未包括所述第一散列值,则所述网络节点计算所述第一数据的第一散列值;所述网络节点根据所述数据信息生成至少一个第一交易信息具体是根据所述数据信息和所述第一散列值生成至少一个第一交易信息。
在一种可选的实施例中,还包括:所述网络节点向其他网络节点或至少一个设备节点发送所述至少一个第一交易信息。例如,所述网络节点广播所述至少一个第一交易信息。
在一种可选的实施例中,还包括:所述网络节点接收其他网络节点或者至少一个设备节点发送的至少一个第二交易信息;其中,所述第二交易信息包括以下至少一项对应的信息:交易标识项、生成所述第二交易信息的节点标识项、数据项、数据的索引值项、数据的散列值项、时间信息项、所述数据的发送方项和所述数据的接收方项。
在一种可选的实施例中,还包括:若所述至少一个第一交易信息包含数据项,则所述网络节点根据所述至少一个第一交易信息,基于第一算法,生成第一区块链的区块。
在一种可选的实施例中,还包括:若所述至少一个第一交易信息包含数据项,且所述至少一个第二交易信息包含数据项,则所述网络节点根据所述至少一个第一交易信息和/或所述至少一个第二交易信息,基于第二算法,生成第一区块链的区块。
在一种可选的实施例中,还包括:若所述至少一个第一交易信息包含数据的散列值项,则所述网络节点根据所述至少一个第一交易信息,基于第三算法,生成第二区块链的区块。
在一种可选的实施例中,还包括:若所述至少一个第一交易信息包含数据的散列值项,且所述至少一个第二交易信息包含数据的散列值项,则所述网络节点根据所述至少一个第一交易信息和/或所述至少一个第二交易信息,基于第四算法,生成第二区块链的区块。
在一种可选的实施例中,若所述至少一个第一交易信息包含数据项,则所述网络节点根据所述至少一个第一交易信息,基于第五算法,生成第一区块链的区块;和,若所述至少一个第一交易信息包含数据的散列值项,且所述至少一个第二交易信息包含数据的散列值项,则所述网络节点根据所述至少一个第一交易信息和/或所述至少一个第二交易信息,基于第六算法,生成第二区块链的区块;或者,
若所述至少一个第一交易信息包含数据项,且所述至少一个第二交易信息包含数据项,则所述网络节点根据所述至少一个第一交易信息和/或所述至少一个第二交易信息,基于第七算法,生成第一区块链的区块;和,所述至少一个第一交易信息包含数据的散列值项,则所述网络节点根据所述至少一个第一交易信息,基于第八算法,生成第二区块链的区块。
其中,“所述网络节点根据所述至少一个第一交易信息,基于第八算法,生成第二区块链的区块”可以等同于“所述网络节点根据所述至少一个第一交易信息,生成第二区块链的区块”。具体地,所述第八算法,可以是用于确定哪个网络节点生成区块的算法,也可以是用于所述网络节点使用所述第八算法来生成区块。例如所述第八算法可以是所述网络节点自己生成所有的第二区块链区块。没有其他网络节点参与生成所述第二区块链的区块。
同理,当网络节点没有和其他网络节点共同形成区块链,而只是网络节点自己独立生成所有区块,形成区块链的话,那么第一算法,第三算法,第五算法,可以就是:网络节点生成区块链所有区块。
总之,“所述网络节点根据所述至少一个第一交易信息,基于第五算法,生成第一区块链的区块”,可以等同于“所述网络节点根据所述至少一个第一交易信息,生成第一区块链的区块”;或者,“若所述至少一个第一交易信息包含数据的散列值项,则所述网络节点根据所述至少一个第一交易信息,基于第三算法,生成第二区块链的区块”可等同于“若所述至少一个第一交易信息 包含数据的散列值项,则所述网络节点根据所述至少一个第一交易信息,生成第二区块链的区块”;或者“所述网络节点根据所述至少一个第一交易信息,基于第一算法,生成第一区块链的区块”可等同于“所述网络节点根据所述至少一个第一交易信息,生成第一区块链的区块”。
针对所述网络节点与其他网络节点,如果只是所述网络节点单独生成所有区块链的区块,其他网络节点不生成区块的话,那么例如所述第四算法也是网络节点生成所有区块链区块。如此类推。所述算法可以是用于决定谁生成区块。例如,如果默认就是所述网络节点生成,那么所述网络节点就可以直接生成区块,不需要每次判断一次算法。
在一种可选的实施例中,还包括:对于所述网络节点生成了关于包含第一数据的第一区块链且存储了第一数据的散列值的情况下,获取第一数据的第一散列值;从所述第一区块链获取所述第一数据,并计算所述第一数据的第二散列值;将所述第一散列值与所述第二散列值进行比对;若所述第一散列值与所述第二散列值相同,则确定所述第一数据是可信数据;或者,确定所述第一数据未被篡改;或者,确定所述第一数据的第一散列值是可信散列值;或,若所述第一散列值与所述第二散列值不相同,则确定所述第一数据是不可信数据;或者,确定所述第一数据已被篡改;或者,确定所述第一数据的第一散列值是不可信散列值。通过分别存储数据和数据的散列值的方式,即使数据被篡改了,能够实现对所存储数据的有效验证,提高了数据存储的有效性,也提高了数据的防篡改能力。
在一种可选的实施例中,还包括:对于所述网络节点生成了关于包含第一数据的第一散列值的第二区块链且存储了第一数据的情况下,从所述第二区块链获取所述第一数据的第一散列值;获取存储的所述第一数据,并计算所述第一数据的第二散列值;将所述第一散列值与所述第二散列值进行比对;若所述第一散列值与所述第二散列值相同,则确定所述第一数据是可信数据;或者,确定所述第一数据未被篡改;或者,确定所述第一数据的第一散列值是可信散列值;或,若所述第一散列值与所述第二散列值不相同,则确定所述第一数据是不可信数据;或者,确定所述第一数据已被篡改;或者,确定所述第一数据的第一散列值是不可信散列值。通过分别存储数据和数据的散列值的方式,即 使数据被篡改了,能够实现对所存储数据的有效验证,提高了数据存储的有效性,也提高了数据的防篡改能力。
在一种可选的实施例中,还包括:对于所述网络节点生成了关于包含第一数据的第一区块链且生成了关于包含第一数据的散列值的第二区块链的情况下,从所述第二区块链获取所述第一数据的第一散列值;从所述第一区块链获取所述第一数据,并计算所述第一数据的第二散列值;将所述第一散列值与所述第二散列值进行比对;若所述第一散列值与所述第二散列值相同,则确定所述第一数据是可信数据;或者,确定所述第一数据未被篡改;或者,确定所述第一数据的第一散列值是可信散列值;或,若所述第一散列值与所述第二散列值不相同,则确定所述第一数据是不可信数据;或者,确定所述第一数据已被篡改;或者,确定所述第一数据的第一散列值是不可信散列值。通过分别存储数据和数据的散列值的方式,即使数据被篡改了,能够实现对所存储数据的有效验证,提高了数据存储的有效性,也提高了数据的防篡改能力。
在一种可选的实施例中,还包括:所述网络节点向中心节点发送所述数据信息或者区块链的区块。可选的,所述网络节点可以在接收到中心节点的数据信息或者区块的获取请求之后发送数据信息或区块链的区块。
在一种可选的实施例中,所述网络节点根据至少一个第一交易信息,生成区块链的区块之后,还包括:所述网络节点向所述至少一个设备节点发送第一通知消息,所述第一通知消息用于通知设备节点已生成区块链的区块的消息。可选的,这样设备节点在接收到第一通知消息之后,对数据信息进行相应的处理,例如,删除。
在一种可选的实施例中,还包括:所述网络节点向设备节点发送第一删除消息,所述第一删除消息为用于指示所述设备节点删除所述数据信息或者删除区块的指示消息。
在一种可选的实施例中,还包括:所述网络节点接收所述至少一个设备节点发送的第二删除消息,所述第二删除消息为所述至少一个设备节点用于请求删除所述数据信息或者删除区块。可选的,所述网络节点根据所述第二删除消息为所述设备节点确定可删除的数据信息或者可删除的区块,或者,所述网络节点可以向设备节点发送删除允许消息,以指示设备节点自身确定可删除的数 据信息或可删除的区块。
在一种可选的实施例中,还包括:所述网络节点从目标区块链中确定待删除区块,所述目标区块链为所述网络节点所存储的任意一个区块链。
在一种可选的实施例中,还包括:所述网络节点将所述区块链的区块包含的多个交易信息发送至上一级网络节点。例如,在网络节点存储压力较大的情况下,可以将多个交易信息转移至上一级的网络节点进行存储,以减少该网络节点的存储压力。
在一种可选的实施例中,还包括:所述网络节点将所述目标区块链中的所述待删除区块进行删除。可选的,所述网络节点记录所述待删除区块的区块头内容,以便于在接收到关于所删除的区块的查询信息时,确定所删除的区块所存储过的节点。
在一种可选的实施例中,所述网络节点从目标区块链中确定待删除区块,包括:按照预设删除规则,从目标区块链中确定待删除区块;其中,所述预设删除规则为:所述网络节点存储所述目标区块链的区块个数大于预设阈值,或者所述待删除区块为生成时间时长超过时间阈值的区块,或者,所述待删除区块为区块序号小于序号阈值的区块。
第四方面,本申请实施例提供了一种数据处理方法,包括:
设备节点向网络节点发送一个或者多个数据信息,所述数据信息包括以下至少一项:第一数据、所述第一数据的第一散列值、所述第一数据的索引值、所述第一数据的时间信息、发送所述数据信息的设备节点的标识、所述设备节点的地址和所述网络节点的地址;所述数据信息用于所述网络节点生成第一交易信息。这样所述设备节点通过将数据信息发送至网络节点的方式,能够减少设备节点的存储压力。
或者,设备节点根据一个或者多个数据信息,生成至少一个第二交易信息,并将所述至少一个第二交易信息发送至网络节点;所述第二交易信息包括以下至少一项对应的信息:数据项、数据的索引值项、数据的散列值项、时间信息项、数据的发送方项和数据的接收方项。这样所述设备节点通过将交易信息发送至网络节点的方式,也能够减少设备节点的存储压力。
在一种可选的实施例中,所述设备节点接收网络节点发送的区块链第一通 知消息,所述第一通知消息用于通知所述网络节点已经根据所述数据信息生成区块链的区块的消息。
在一种可选的实施例中,所述设备节点接收网络节点发送的区块。
在一种可选的实施例中,还包括:所述设备节点接收到所述网络节点发送第一删除消息,所述第一删除消息为用于指示所述设备节点删除所述数据信息或者删除区块的指示消息。所述设备节点可以在接收到第一删除消息的情况下,对数据信息或者区块执行删除处理。
在一种可选的实施例中,还包括:所述设备节点向所述网络节点发送的第二删除消息,所述第二删除消息用于请求删除所述数据信息或者删除区块。例如,在存储压力较大的情况下,设备节点可以向网络节点发送第二删除消息。
在一种可选的实施例中,还包括:所述设备节点删除所述数据信息。
在一种可选的实施例中,所述设备节点删除数据信息具体是将生成时长超过第一时间阈值的数据信息进行删除,这样可以减少设备节点的存储压力。
在一种可选的实施例中,
第五方面,本申请实施例提供了一种中心节点,包括:
获取模块,用于从第一网络节点获取第一数据的第一散列值;
计算模块,用于从第二网络节点获取所述第一数据,并计算所述第一数据的第二散列值;
比对模块,用于将所述第一散列值与所述第二散列值进行比对;
确定模块,用于若所述第一散列值与所述第二散列值相同,则确定所述第一数据是可信数据;或者,确定所述第一数据未被篡改;或者,确定所述第一数据的第一散列值是可信散列值。
本申请实施例第五方面提供的中心节点用于执行本申请第一方面提供的数据处理方法,具体的可参见本申请实施例第一方面的描述,在此不再赘述。
在一个可能的设计中,中心节点的结构中包括处理器和收发器,所述处理器用于执行本申请第一方面提供的数据处理方法。可选的,还可以包括存储器,所述存储器用于存储支持中心节点执行上述方法的应用程序代码,所述处理器被配置为用于执行所述存储器中存储的应用程序。
第六方面,本申请实施例提供了一种网络节点,包括:
区块生成模块,用于根据至少一个第一交易信息,生成区块链的区块。
所述第一交易信息包括以下至少一项对应的信息:交易标识项、生成所述第一交易信息的节点标识项、数据项、数据的索引值项、数据的散列值项、时间信息项、数据的发送方项和数据的接收方项。
本申请实施例第六方面提供的网络节点用于执行本申请第二方面提供的数据处理方法,具体的可参见本申请实施例第二方面的描述,在此不再赘述。
第七方面,本申请实施例提供了另一种网络节点,包括:
接收模块,用于接收至少一个设备节点发送的一个或多个数据信息;
生成模块,用于根据所述一个或多个数据信息,生成至少一个第一交易信息。所述第一交易信息包括以下至少一项对应的信息:交易标识项、生成所述第一交易信息的节点标识项、数据项、数据的索引值项、数据的散列值项、时间信息项、数据的发送方项和数据的接收方项。
本申请实施例第七方面提供的网络节点用于执行本申请第三方面提供的数据处理方法,具体的可参见本申请实施例第三方面的描述,在此不再赘述。
在一个可能的设计中,网络节点的结构中包括处理器和收发器,所述处理器用于执行本申请第二方面或第三方面提供的数据处理方法。可选的,还可以包括存储器,所述存储器用于存储支持网络节点执行上述方法的应用程序代码,所述处理器被配置为用于执行所述存储器中存储的应用程序。
第八方面,本申请实施例提供了一种设备节点,包括:
发送模块,用于向网络节点发送一个或者多个数据信息,所述数据信息包括以下至少一项:第一数据、所述第一数据的第一散列值、所述第一数据的索引值、所述第一数据的时间信息、发送所述数据信息的设备节点的标识、所述设备节点的地址和所述网络节点的地址;
所述数据信息用于所述网络节点生成第一交易信息;
或者,
生成模块,用于根据一个或者多个数据信息,生成至少一个第二交易信息,并将所述至少一个第二交易信息发送至网络节点;
所述第二交易信息包括以下至少一项对应的信息:数据项、数据的索引值项、数据的散列值项、时间信息项、数据的发送方项和数据的接收方项。
本申请实施例第八方面提供的设备节点用于执行本申请第四方面提供的数据处理方法,具体的可参见本申请实施例第四方面的描述,在此不再赘述。
在一个可能的设计中,设备节点的结构中包括处理器和收发器,所述处理器用于执行本申请第四方面提供的数据处理方法。可选的,还可以包括存储器,所述存储器用于存储支持设备节点执行上述方法的应用程序代码,所述处理器被配置为用于执行所述存储器中存储的应用程序。
第九方面,本申请实施例提供了一种计算机存储介质,用于储存为上述中心节点所用的计算机软件指令,其包含用于执行上述方面所设计的程序。
第十方面,本申请实施例提供了一种计算机存储介质,用于储存为上述网络节点所用的计算机软件指令,其包含用于执行上述方面所设计的程序。
第十一方面,本申请实施例提供了一种计算机存储介质,用于储存为上述设备节点所用的计算机软件指令,其包含用于执行上述方面所设计的程序。
本申请实施例中,中心节点、网络节点、设备节点、第一网络节点、第二网络节点的名字对设备本身不构成限定,在实际实现中,这些设备可以以其他名称出现。只要各个设备的功能和本申请类似,属于本申请权利要求及其等同技术的范围之内。
在本申请实施例中,通过将设备节点中的一个或者多个第一数据发送至其他网络节点进行存储,能够缓解设备节点的存储压力,另外,在网络节点中能够分别存储数据和散列值,即使根据数据都被篡改的情况下,能够通过存储的散列值对数据进行验证,因此这样提高了数据的防篡改能力。
附图说明
图1为本申请实施例提供的一种可能的网络结构图;
图2为本申请实施例提供的另一种可能的网络结构图;
图3为本申请实施例提供的一种数据处理方法的流程示意图;
图4为本申请实施例提供的另一种数据处理方法的流程示意图;
图5为本申请实施例提供的另一种数据处理方法的流程示意图;
图6为本申请实施例提供的另一种数据处理方法的流程示意图;
图7为本申请实施例提供的另一种数据处理方法的流程示意图;
图8为本申请实施例提供了一种中心节点的模块化示意图;
图9为本申请实施例提供了另一种中心节点的结构示意图;
图10为本申请实施例提供了一种网络节点的模块化示意图;
图11为本申请实施例提供了另一种网络节点的结构示意图;
图12为本申请实施例提供了一种设备节点的模块化示意图;
图13为本申请实施例提供了另一种设备节点的模块化示意图;
图14为本申请实施例提供了一种设备节点的结构示意图。
具体实施方式
下面结合附图,对本申请的实施例进行描述。
请参见图1,为本申请实施例提供了一种可能的网络架构图。图1所述的网络架构中包括第一网络节点、第二网络节点和设备节点。设备节点是采集数据或者生成数据的来源,第一网络节点可以用于存储设备节点发送的数据,第二网络节点可以用于存储由设备节点中的数据生成的散列值。这样在设备节点的存储能力有限的情况下,还可以通过其他网络节点进行存储,缓解了设备节点的存储压力。
进一步的,第一网络节点和第二网络节点均可以生成各自的区块链,例如,第一网络节点可以根据设备节点发送的数据的散列值生成第二区块链,第二网络节点可以根据设备节点发送的数据生成第一区块链。通过区块链来分别存储数据和散列值,即使由数据所生成的第一区块链的全部数据都被篡改的情况下,能够通过第二区块链的散列值对第一区块链中的数据进行验证,因此这样提高了数据的防篡改能力。
进一步的,请参见图2,为本申请实施例提供了另一种可能的网络架构图。图2所述的网络架构中包括第一网络节点和设备节点。设备节点与图1所示的设备节点功能相同,而图2中所示的第一网络节点既可以存储设备节点发送的数据,还可以用于存储由设备节点中的数据生成的散列值。在图2所示的网络架构下依旧可以在设备节点的存储能力有限的情况下,通过第一网络节点存储数据和散列值的方式缓解设备节点的存储压力。
进一步的,第一网络节点可以根据设备节点发送的数据生成第一区块链,并根据设备节点发送的数据的散列值生成第二区块链。实现了通过区块链来分别存储数据和散列值,即使由数据所生成的第一区块链的全部数据都被篡改的情况下,能够通过第二区块链的散列值对第一区块链中的数据进行验证,因此这样提高了数据的防篡改能力。
本申请中所涉及的设备节点可以包括工业设备节点、各类工业传感器、控制单元等等;还可以包括可穿戴设备,家用电器,家居传感器,家居控制单元等;还可以包括用户设备,包含手机、智能终端、多媒体设备、流媒体设备等。本申请对设备节点的形式和类型不做任何限制。设备节点具备数据采集和/或数据发送的能力。
本申请中所涉及的网络节点为具备存储、通信功能的设备,例如,具备接收设备节点的数据或者数据散列值,以及接收来自其他网络节点的数据或者散列值的能力。网络节点可以是基站,网关(gateway),网络存储单元,云服务器,计算机设备等等。
请参见图3,为本申请实施例提供了一种数据处理方法的流程示意图,如图3所示,本申请实施例中涉及第一网络节点、第二网络节点和、设备节点和中心节点,其中数据处理方法是由中心节点在执行的,具体的执行过程请参见以下详细介绍。
101,中心节点从第一网络节点获取第一数据的第一散列值。
可选的,所述第一网络节点可以直接存储所述第一数据的第一散列值,或者,所述第一数据的第一散列值存储于所述第一网络节点中的第二区块链中,其中,第二区块链为由包含数据的散列值项的交易信息生成的区块组成的。
可选的,所述中心节点从第一网络节点获取所述第一数据的第一散列值关联信息,所述关联信息包括以下至少一项:所述第一数据的索引值、所述第一数据的时间信息、发送所述第一数据的设备节点标识、发送所述第一数据的地址和接收所述第一数据的地址。
102,所述中心节点从第二网络节点获取所述第一数据,并计算所述第一数据的第二散列值。
可选的,所述第二网络节点可以直接存储所述第一数据,或者,所述第一数据存储于所述第二网络节点中的第一区块链中,其中,第一区块链为由包含数据项的交易信息生成的区块组成的。
所述中心节点从第二网络节点获取所述第一数据的关联信息,所述关联信息包括以下至少一项:所述第一数据的索引值、所述第一数据的时间信息、发送所述第一数据的设备节点标识、发送所述第一数据的地址和接收所述第一数据的地址。
需要说明的是,在本申请的实施例中,将存储第一数据的区块链设定为第一区块链,存储第一区块链的网络节点设定为第二网络节点。将存储第一数据的第一散列值的区块链设定为第二区块链,存储第二区块链的网络节点设定为第一网络节点,但第一数据是否存储于第一区块链,以及第一数据的第一散列值是否存储于第二区块链,本申请实施例并不限定。接下来,基于以上设定,完成对本申请实施例的描述。
第一可选的方案中,第一数据的第一散列值并非存储于第一网络节点的第二区块链中,而是由第一网络节点直接存储的;而第一数据是存储于第二网络节点的第一区块链中。在这一方案中,中心节点向第一网络节点直接获取第一数据的第一散列值;中心节点通过第二网络节点的第一区块链来获取所述第一数据,并计算所述第一数据的第二散列值。接着所述中心节点执行步骤103将所述第一散列值与所述第二散列值进行比对,并得到如步骤104或者步骤105的比对结果。
第二可选的方案中,第一数据的第一散列值存储于第一网络节点的第二区块链中;而第一数据并非存储于第二网络节点的第一区块链中,而是由第二网络节点直接存储的。在这一方案中,中心节点通过第一网络节点的第一区块链来获取第一数据的第一散列值;中心节点向第二网络节点直接获取第一数据,并计算第一数据的第二散列值。接着所述中心节点执行步骤103将所述第一散列值与所述第二散列值进行比对,并得到如步骤104或者步骤105的比对结果。
第三可选的方案中,第一数据的第一散列值存储于第一网络节点的第二区块链中;第一数据是存储于第二网络节点的第一区块链中。在这一方案中,中心节点通过第一网络节点的第二区块链来获取第一数据的第一散列值;中心节 点通过第二网络节点的第一区块链来获取所述第一数据,并计算所述第一数据的第二散列值。接着所述中心节点执行步骤103将所述第一散列值与所述第二散列值进行比对,并得到如步骤104或者步骤105的比对结果。
103,所述中心节点将所述第一散列值与所述第二散列值进行比对。
104,若所述第一散列值与所述第二散列值相同,则所述中心节点确定所述第一数据是可信数据;或者,确定所述第一数据未被篡改;或者,确定所述第一数据的第一散列值是可信散列值。
106,若确定所述第一数据是可信数据,则所述中心节点确定第三区块链的第i个交易信息满足生成条件,生成第三区块链的第i个交易信息。
具体的,所述中心节点可以设定所述第一数据是否为可行数据,设定为所述中心节点判断是否生成第三区块链的第i个交易信息的生成条件,这样在确定第一数据为可信数据之后,确定第三区块链的第i个交易信息满足生成条件,并生成第i个交易信息。
105,若所述第一散列值与所述第二散列值不相同,则所述中心节点确定所述第一数据是不可信数据;或者,确定所述第一数据已被篡改;或者,确定所述第一数据的第一散列值是不可信散列值。
107,若确定所述第一数据是不可信数据,则所述中心节点确定所述第三区块链的第i个交易信息不满足所述生成条件,不生成所述第三区块链的第i个交易信息。
具体的,结合步骤106中所述中心节点对是否生成第三区块链的第i个交易信息的生成条件的设定,在确定所述第一数据是不可信数据之后,确定所述第三区块链的第i个交易信息不满足所述生成条件,不生成所述第三区块链的第i个交易信息。
进一步可选的,若确定所述第一数据是不可信数据,则所述中心节点确定所述第三区块链的第j个交易信息满足生成条件,生成所述第三区块链的第j个交易信息。
针对步骤106和步骤107的方案,举例说明:
步骤106,例如生成第三区块链第i个交易的条件是确定所述第一数据是可信数据,当第一数据是可信数据时,利用所述第一数据来处理某些事情,例 如调取第一数据做大数据分析,做各种数据分析和提取,在此不做限制。
例如第一数据是PM2.5的测量值,提取一段时间内(例如1个星期)的第一数据,根据第一数据来计算多个第一数据来计算这段时间内的PM2.5浓度,从而获得这周的空气质量。
例如第一数据是工业设备的仪表测量数据值,,提取一段时间内(例如1个星期)的第一数据,根据第一数据来获得超过门限1的测量数据值,通过数据的个数和对应时间,来判断仪表故障率。
例如第一数据是医院的病患病历,政府机构或者第三方机构(报销单位)或者外方医院,在第一数据是可信数据的情况下,调用第一数据。
例如第i个交易信息为:调用第一数据,交易信息具体包括以下至少一项:调用第一数据的用户标识,调用第一数据的时间,调用第一数据的权限,第一数据的索引值,第一数据的来源(发送方地址)等等。
生成第i个交易的条件为:当第一数据的可信数据时,调用第一数据。调用第一数据可以用于进行大数据分析,可以查看第一数据等。
同理,针对步骤107第j个交易信息,也是类似。例如第j交易可以为:调用第一数据。第j交易信息可以是中心节点发送数据错误消息给设备1。因此生成第j个交易信息的条件为:当第一数据的为可信数据时,调用第一数据;或者生成第j个交易信息的条件为:当第一数据为不可信数据时,中心节点发送数据错误消息给设备1;
当然形成区块链的交易信息,可以是各种各样的,本申请不限制第三区块链交易的内容和形式,第三区块链的交易信息,并不限定于是调用第一数据。以比特币为例,交易就是发送方A给接收方B一笔钱(例如10元)。但是在物联网里面,设备执行的动作就是一种交易信息,例如设备A给设备B发送了一个信息。或者调用设备A的数据就是一种交易信息。
步骤106和步骤107是可选步骤。
又一需要说明的是,本申请实施例中对中心节点、第一网络节点、第二网络节点在是否为不同的具备通信或者存储功能的设备不做限定。接下来对中心节点、第一网络节点和第二网络节点的可实现方式进行跟描述。
可选的方案A中,中心节点、第一网络节点和第二网络节点为物理上分 离的具备通信或者存储功能的设备,例如,第一网络节点为基站、第二网络节点为存储设备、中心节点为第三方设备。其中,第一数据可以是由设备节点发送至第二网络节点存储的数据;第一数据的第一散列值可以是由设备节点发送至第一网络节点的数据的散列值,或者,第一数据的第一散列值是第一网络节点根据设备节点发送的第一数据所生成的。
基于可选的方案A,进一步可选的,如图1所示的系统中包括多个设备节点、多个第一网络节点、多个第二网络节点的情况下。其中,第二区块链是所述多个第一网络节点,基于算法(例如共识算法)生成的,在所述中心节点从第一网络节点的第二区块链中获取第一数据的第一散列值之前,可以从多个第一网络节点中选择一个第一网络节点确定为目标第一网络节点。一种可选的方案中,所述中心节点可以随意选择一个第一网络节点确定为目标第一网络节点。或者,另一种可选的方案中,所述中心节点从至少一个第一网络节点中选择一个满足第一合法条件的第一网络节点为目标第一网络节点。其中,所述第一合法条件为:与所述目标第一网络节点的第二区块链的第一数据的第一散列值相同的节点数量超过第一阈值。例如,假设第一网络节点的数量为10个,第一阈值为5,中心节点在存储有所述第一数据的区块中获取所述第一数据的第一散列值,若多个第一网络节点中存在3种数值的第一数据的第一散列值,则分别统计各个数值的第一数据的第一散列值的数量,若存在同一数值的第一散列值的数量超过5,则从该数值的第一散列值所在的第一网络节点中选择一个确定为目标第一网络节点。
在图1所示的系统中,进一步可选的,第一区块链是所述多个第二网络节点,基于算法生成的,在所述中心节点从第二网络节点的第一区块链中获取第一数据之前,可以从多个第二网络节点中选择一个第二网络节点确定为目标第二网络节点。一种可选的方案中,所述中心节点可以随意选择一个第二网络节点确定为目标第二网络节点。或者,另一种可选的方案中,所述中心节点从至少一个第二网络节点中选择一个满足第二合法条件的第二网络节点为目标第二网络节点。其中,所述第二合法条件为:与所述目标第二网络节点的第一区块链的第一数据相同的节点数量超过第二阈值。例如,假设第二网络节点的数量为10个,第二阈值为5,中心节点在存储有所述第一数据的区块中获取所 述第一数据,若多个第二网络节点中存在3种数值的第一数据,则分别统计各个数值的第一数据的数量,若存在同一数值的第一数据的数量超过5,则从该数值的第一数据所在的第二网络节点中选择一个确定为目标第二网络节点。
可选的方案B中,第一网络节点和第二网络节点为物理上分离的具备通信或存储功能的设备,中心节点为第一网络节点或者第二网络节点中的任一个。其中,第一数据可以是由设备节点发送至第二网络节点存储的数据;第一数据的第一散列值可以是由设备节点发送至第一网络节点的数据的散列值,或者,第一数据的第一散列值是第一网络节点根据设备节点发送的第一数据所生成的。
可选的,参考图1所示的系统架构以第一网络节点为基站、第二网络节点为存储设备、中心节点为第一网络节点进行说明。由于中心节点为第一网络节点,因此,第一网络节点可以从多个第二网络节点中选择一个确定为目标第二网络节点,具体的选择方法可以参见可选的方案A中的具体介绍,在此不再赘述。由于第一网络节点和第二网络节点的区别在存储有不同数据的区块链,如,第二网络节点存储有第一数据的第一区块链,第一网络节点存储有第一数据的散列值的第二区块链,因此,中心节点为第二网络节点的方案可以参考可选的方案B中心节点为第一网络节点的描述,在此不再赘述。
可选的方案C中,第一网络节点和第二网络节点为同一个具备通信或存储功能的设备,中心节点为第三方设备。参见图2,在图2所示的系统架构中,第一数据和第一数据的第一散列值均存储在第一网络节点中,第一网络节点可以通过接收设备节点发送的第一数据进行存储或生成第一区块链的区块,以及在存储阶段所述第一网络节点根据接收到的第一数据,计算第一数据的第一散列值并进行存储或生成第二区块链的区块。
基于可选的方案C,进一步可选的,第一区块链是接收到所述第一数据的第一网络节点生成的,第二区块链是多个第一网络节点基于算法(例如共识算法)并根据第一数据的第一散列值生成的。或者,第一区块链是多个第一网络节点基于算法(例如共识算法)并根据第一数据生成的;第二区块链是接收到所述第一数据的第一网络节点先计算获得第一散列值进而生成的。
一种可选的方案中,在第一区块链是接收到所述第一数据的第一网络节点 生成的,且第二区块链是多个第一网络节点基于算法(例如共识算法)并根据第一数据的第一散列值生成的情况下,所述中心节点执行步骤101时,可以先从多个第一网络节点中确定一个目标第一网络节点,再从目标第一网络节点中获取第二区块链中的第一数据的第一散列值;所述中心节点执行步骤102可以直接从第一数据所在的第一网络节点中获取。
另一种可选的方案中,在第一区块链是多个第一网络节点基于算法(例如共识算法)并根据第一数据生成的;第二区块链是接收到所述第一数据的第一网络节点先计算获得第一散列值进而生成的,中心节点执行步骤101时,可以从接收到所述第一数据并计算获得第一散列值的第一网络节点所生成的第二区块链中获取,对于中心节点执行步骤102时,可以先从多个第一网络节点中确定一个目标第一网络节点,再从目标第一网络节点中获取第一区块链中的第一数据。
其中,对于从多个第一网络节点中确定目标第一网络节点的方案可以参考可选的方案A中的具体介绍,在此不再赘述。
可选的方案D中,中心节点、第一网络节点和第二网络节点为同一个具备通信或存储功能的设备。具体的中心节点在执行步骤101和步骤102的具体实现方式可以参照可选的方案C中具体介绍,在此不再赘述。
在本申请实施例中,中心节点获取第一网络节点的第一数据的第一散列值,并获取第二网络节点的第一数据,并计算第一数据的第二散列值,将第一散列值和散列值进行比对,进而确定第一数据是否为可信数据。这种方案能够实现了对所存储数据的有效验证,进而提高了数据存储的有效性。另外在分别生成关于第一数据的区块链和关于第一数据的第一散列值的区块链的场景中,即使根据数据所生成的第一区块链的数据都被篡改的情况下,能够通过第二区块链的散列值对第一区块链中的数据进行验证,因此这样提高了数据的防篡改能力。
请参见图4,为本申请实施例提供了一种数据处理方法的流程示意图,如图4所示,本申请实施例中涉及第一网络节点、其他第一网络节点、第二网络节点、其他第二网络节点和设备节点。其中,第一网络节点和第二网络节点为 不同的通信设备,可以参考图1所示的网络架构,所述数据处理方法是由以上节点共同完成的,其中,所述设备节点在执行步骤201至步骤210的过程中,所述设备节点为与所述第二网络节点建立通信连接的多个设备节点中的任意一个,进一步的,所述设备节点可以向建立通信连接的第一网络节点执行步骤211至步骤216。具体的执行过程请参见以下详细介绍。
201,设备节点向第二网络节点发送一个或者多个数据信息。
其中,在本申请实施例的步骤201中,所述数据信息包括第一数据,还可以包括以下至少一项:所述第一数据的索引值、所述第一数据的时间信息、发送所述数据信息的设备节点的标识、所述设备节点的地址和所述网络节点的地址。可选的,所述第一数据的时间信息可以是所述第一数据的发送时间或所述第一数据的产生时间,本申请实施例对此不做限定。
需要说明的是,步骤201设备节点将第一数据发送给了第二网络节点;步骤211,设备节点将第一数据的散列值发送给了第一网络节点。步骤201和步骤211执行次序不分先后。
举例来说,可以参见表1,表1为一种可能的数据信息。
表1
Figure PCTCN2017000082-appb-000001
相应的,第二网络节点接收所述设备节点发送的一个或者多个数据信息。
202,所述第二网络节点根据所述一个或者多个数据信息生成至少一个第一交易信息。
其中,若所述数据信息为一个,则所述第二网络节点可以生成一个第一交易信息。若所述数据信息为多个,则所述第二网络节点可以生成一个第一交易 信息,或者生成不大于所述数据信息数量的多个第一交易信息。可选的,所述第一交易信息包括以下至少一项对应的信息:交易标识、数据项、数据的散列值、生成所述第一交易信息的节点标识项、数据的索引值项、时间信息项、数据的发送方项和数据的接收方项。其中时间信息项可以是指数据的发送时间或者交易的生成时间,本申请实施例对此不做限定。
适用于本申请所有实施例,无论是所述第一交易信息还是其他交易信息:假设在第一交易信息是表示第一数据的交易信息的情况下,其中,数据项对应的信息为第一数据,数据的散列值项对应的信息为第一数据的散列值、数据的索引值项对应的信息为数据的索引值,数据发送项对应的信息为数据的发送方地址,数据的接收方项对应的信息为数据的接收方地址,设备节点的标识项对应的信息为设备节点的标识,生成所述第一交易信息的节点标识项对应的信息为网络节点标识。
进一步的,举例来说,对于所述第二网络节点根据多个数据信息生成一个第一交易信息的情况,所述第二网络节点是通过将多个数据信息进行打包生成一个数据包,进而对一个数据包生成一个第一交易信息。可选的,本申请实施例对由多个数据信息生成少于数据信息的数量的第一交易信息的数量不做限定。由于本申请实施例会涉及到其他交易信息,这里由第二网络节点生成的不论是一个还是多个第一交易信息都用A1表示,以加以区分。
以表1为例,所述第二网络节点可以生成三个交易信息,如表2所示。
表2
Figure PCTCN2017000082-appb-000002
进一步需要说明的是,对于交易信息中包含散列值项的情况请参见表2A。
表2A
Figure PCTCN2017000082-appb-000003
进一步需要说明的是,对于表2还可以以表2B的形式标识,。
表2B
Figure PCTCN2017000082-appb-000004
由于在所述第一交易信息中,数据项指第一数据,数据的索引值项指第一数据的索引值,数据发送项指数据的发送方地址,数据的接收方项指数据的接收方地址,设备节点的标识项指设备节点的标识,或者网络节点标识项指网络节点标识。以此类推,使用本申请所有实施例。表3,表4表5表6或者表7都可以类似地有对应的表3B,表4B表5B表6B或者表7B,不一一赘述。总之本申请中涉及的第一交易信息,第二交易信息等交易信息,上述等同关系都可以适用。
或者,所述第二网络节点可以生成两个交易信息,如表3所示。
表3
Figure PCTCN2017000082-appb-000005
表3中举例,交易1的数据项中的数据1就是第一数据,数据索引值项中100为数据1的索引值项。以此类推,不一一赘述。
或者,所述第二网络节点可以生成两个交易信息,如表4所示。
表4
Figure PCTCN2017000082-appb-000006
203、所述第二网络节点将生成的所述至少一个第一交易信息发送至其他第二网络节点。
其中,本申请实施例所涉及的第二网络节点为多个第二网络节点中的任意一个,而其他第二网络节点是多个第二网络节点中除了这一个第二网络节点之外的其他第二网络节点。
相应的,其他第二网络节点中的任一第二网络节点接收所述至少一个第一交易信息A1。
可选的,所述第二网络节点可以执行步骤204,根据接收到的所述至少一个第一交易信息生成第一区块链中的区块。该步骤中的第一区块链用L1表示。 举例来说,如表5所示,给出了一种可选的由所述至少一个第一交易信息生成的区块,而表5所示的第一交易信息是由一个数据信息生成。若第一交易信息是由多个第一交易信息生成的情况,可以参见表6所示。
表5
Figure PCTCN2017000082-appb-000007
表6
Figure PCTCN2017000082-appb-000008
205,所述其他第二网络节点向所述第二网络节点发送的至少一个第二交易信息。
其中,本申请实施例中,其他第二网络节点发送的第二交易信息用A2表示,需要说明的是,这里的第二交易信息A2和第一交易信息A1均包含有数据项,进而能够实现生成由数据项生成的交易信息生成第一区块链中的区块。 举例说明,具体地,第二网络节点例如是网络节点A,基于它收到的设备节点A发送的数据信息,数据信息中包含一个第一数据,所述第一数据例如是数据A。网络节点A基于数据A,根据步骤303中生成第一交易的方式,生成了第一交易信息A1。其他第二网络节点例如是网络节点B基于它收到的设备节点B发送的数据信息,数据信息中包含一个第一数据,所述第一数据例如是数据B。网络节点B基于数据B,根据上述步骤303中生成第一交易的方式,生成了第二交易信息A2。
可选的,第二交易信息的生成方式与本申请实施例中第一交易信息的生成方式相同,具体可以参考步骤201至步骤202中的详细描述,在此不再赘述。
相应的,所述第二网络节点接收其他第二网络节点发送的至少一个第二交易信息。
206、所述第二网络节点根据第一交易信息和/或所述第二交易信息生成第一区块链中的区块。
可选地,第二网络节点将生成的第一区块链区块广播给其他网络节点。
在本实施例中,是以第二网络节点来生成第一区块链区块为例。实际上,可以是其他网络节点(例如网络节点B)根据第一交易信息B1和第二交易信息B2生成第一区块链的区块。同理,其他第二网络节点(例如网络节点B)将生成的第一区块链区块广播给其他第二网络节点(除了网络节点B以外的其他网络节点,第二网络节点)。例如一种情况下是第二网络节点生成区块,一种情况下是其他网络节点生成区块。第二网络节点和其他网络节点可根据某个算法来确定谁生成第i个区块(i为大于等于1的自然数)。总之,根据上述步骤,第而网络节点与其他网络节点形成了第一区块链。
其中,步骤206的所述第一区块链和步骤204中的第一区块链都是由包含数据项的交易信息所生成的区块组成的,但两个步骤的第一区块链所根据的交易信息不同,因此通过第一区块链L1和第一区块链L2加以区分。
进一步的,在生成第一区块链L2的区块的过程中,所述第二网络节点和其他第二网络节点,需要基于预设的机制或者算法(例如共识算法),来确定由哪个网络节点生成第一区块链L2中的区块。以共识算法举例,其中,预设的共识算法是为了计算出多个第二网络节点中哪一个第二网络节点具有在第一区块链L2中写入区块的算法,若其中一个目标第二网络节点获得在第一区 块链L2中写入区块的权利,则目标第二网络节点将这一区块向多个第二网络节点中除目标第二网络节点之外的节点发送写入的区块,以使在各个第二网络接收到这一区块之后,将该区块保存在各自的第一区块链L2中。共识算法可以是但不仅限于,例如是实用拜占庭容错(PBFT)共识算法,Paxos/Raft算法,工作量证明Proof-of-Work(PoW),股权持有证明Proof-of-Stake(PoS)。关于预设的机制或者算法,上述内容适用于本申请所有实施例。
本申请中算法还可以是机制,算法可以是共识算法或者其他算法,本申请不做限定。本申请多以共识算法举例说明申请内容。另外本发明中,所述预设的机制或者算法可以共识机制或者共识算法,用于决定哪个网络节点有生成区块的权利,所述预设的机制或者算法还可以是用于网络节点如何生成区块的算法。总之作为机制或者算法的具体定义和用途,本发明不做过多限制。上述适用于全文。
在本申请的所有实施例和申请内容中,共识算法可以等同于共识机制,算法可以等同于机制。
针对本申请全文中涉及的第一算法,第二算法,第三算法,第四算法等等,彼此两个算法可以是一样的算法,也可以是不一样的算法。在本申请实施例中不做限制。
针对本申请全文中涉及的第一算法,第二算法,第三算法、第四算法等,所述算法可以是共识算法,也可以不是共识算法。在大部分的实施例中,我们用共识算法来举例说明问题,但本申请不做任何算法上的限定。
207,在生成第一区块链之后,所述第二网络节点向设备节点发送第一通知消息。
其中,所述第一通知消息用于通知设备节点所述第二网络节点已根据所述数据信息生成区块链的区块的消息。可选的,第一通知消息可以在生成第一区块链L1和生成第二区块链L2中的任意一个区块链之后发送。需要说明的是,步骤207为可选步骤。
相应的,所述设备节点接收所述第二网络节点发送的第一通知消息。
210,在生成第一区块链之后,所述设备节点将删除所述数据信息。
可选的,所述设备节点可以将生成时间时长超过第一时间阈值的数据信息进行删除。所述设备节点可以通过记录所述数据信息的生成时长,在生成时长 超过第一时间阈值的情况下,将其删除。
进一步,可选的,所述第二网络节点执行步骤209,向所述设备节点发送第一删除消息。相应的,所述设备节点在接收到第二网络节点发送的第一删除消息之后,执行步骤210。其中,所述第一删除消息为用于指示所述设备节点删除数据信息的指示消息。可选的方案中,所述第二网络节点可以在第一删除消息中指明所要删除的数据信息。又一可选的方案中,所述第二网络节点也可以不指明删除的数据信息,由设备节点自行确定,这样所述第一删除消息的作用为通知设备节点执行删除数据信息即可。
进一步,可选的,所述第二网络节点执行步骤209,也可以是在所述第二网络节点接收到设备节点发送的第二删除消息之后,向所述设备节点发送的第一删除消息。其中,所述第二删除消息为所述至少一个设备节点用于请求删除数据信息。第二删除消息可以为所述设备节点向所述第二网络节点进行申请是否允许删除某一个或者多个数据信息的消息,这样所述第二网络节点可以反馈一个包含允许的第一删除消息或者不允许删除的消息。或者,第二删除消息也可以为所述设备节点向所述第二网络节点请求为所述设备节点确定可以删除的数据信息的消息,这样所述第二网络节点可以确定出一个待删除的数据信息,并添加至第一删除消息中发送至所述设备节点。本申请实施例第二删除消息的所采用的方式不做限定。
接下来对第一网络节点和设备节点的交互过程进行详细介绍。
211,所述设备节点向第一网络设备发送一个或者多个数据信息。
其中,在本申请实施例的步骤211中,所述数据信息包括第一数据的散列值,其中第一数据为步骤201中的数据信息所包括的内容。所述设备节点通过向第二网络节点发送第一数据,向第一网络节点发送第一数据的散列值,这样将第一数据和第一数据的散列值进行分别存储,即时第一数据被篡改了,还可以通过散列值对第一数据进行验证,以提高数据的防篡改能力。所述数据信息还可以包括以下至少一项:所述第一数据的索引值、所述第一数据的时间信息、发送所述数据信息的设备节点的标识、所述设备节点的地址和所述网络节点的地址。可选的,所述第一数据的时间信息可以是所述第一数据的散列值的发送时间或所述第一数据的散列值的产生时间或所述第一数据的产生时间,本申请实施例对此不做限定。
相应的,所述第一网络节点接收所述设备节点发送的一个或者多个数据信息。
212,所述第一网络节点根据所述一个或者多个数据信息生成至少一个第一交易信息。
其中,这里的第一交易信息是在第一网络节点生成的,采用B1表示,以加以区分。第一交易信息B1的生成方式与第一交易信息A1的生成方式相同,进而可以参考步骤202中的详细描述,在此不再赘述。
213、所述第一网络节点将生成的所述至少一个第一交易信息发送至其他第一网络节点。
可选的,所述第一网络节点可以执行步骤204,根据接收到的所述至少一个第一交易信息生成第二区块链中的区块。该步骤中的第二区块链用L3表示。第二区块链L3的区块的生成可以参考步骤203中第一区块链用L1的生成方式,在此不再赘述。
215,所述其他第一网络节点向所述第一网络节点发送的至少一个第二交易信息。
其中,本步骤中第二交易信息用B2表示。
216、所述第一网络节点根据第一交易信息和/或所述第二交易信息生成第二区块链中的区块。
可选地,第一网络节点将生成的第二区块链区块广播给其他网络节点。
在本实施例中,是以第一网络节点来生成第二区块链区块为例。实际上,可以是其他网络节点(例如网络节点B)根据第一交易信息B1和第二交易信息B2生成第二区块链的区块。同理,其他网络节点(例如网络节点B)将生成的第二区块链区块广播给其他网络节点(除了网络节点B以外的其他网络节点,第一网络节点)。例如一种情况下是第一网络节点生成区块,一种情况下是其他网络节点生成区块。第一网络节点和其他网络节点可根据某个算法(例如共识算法)来确定谁生成第i个区块(i为大于等于1的自然数)。总之,根据上述步骤,第一网络节点与其他网络节点形成了第二区块链。
其中,本步骤中的第二区块链用L4表示。第一网络节点根据第一交易信息B1和/或所述第二交易信息B2生成第二区块链L4的方式,与第二网络节点根据第一交易信息A1和/或所述第二交易信息A2生成第一区块链L2的方 式相同,具体可以参考步骤206中的详细描述,在此不再赘述。
进一步,可选的,所述第一网络节点也可以在生成第二区块链之后,向设备节点发送第一通知消息,用于通知设备节点所述第一网络节点已根据所述数据信息生成区块链的区块的消息。
进一步的,所述第一网络节点可以将第一数据的散列值发送给中心节点,所述第二网络节点可以将第一数据发送至中心节点,以使中心节点计算所述第一数据的第二散列值,并将第二散列值和第一散列值进行比对,以检验第一数据是否被篡改,是否为可信数据等,具体的实现过程可以参考图1所示实施例的具体描述,在此不再赘述。
进一步可选的,所述第一网络节点或第二网络节点均可以从目标区块链中确定待删除区块。
其中,对于第一网络节点而言,所述目标区块链为所述第一网络节点中的第二区块链L3或第二区块链L4;对于第二网络节点而言,所述目标区块链为所述第二网络节点中的第一区块链L1或第一区块链L2。
第一网络节点或第二网络节点在确定待删除区块的可选方案可以为:以第二网络节点为例,所述第二网络节点可以按照预设删除规则,从目标区块链中确定待删除区块。其中,所述预设删除规则可以包括但不限定于所述第二网络节点存储所述目标区块链的区块个数大于预设阈值,或者所述待删除区块为生成时间时长超过时间阈值的区块,或者,所述待删除区块为区块序号小于序号阈值的区块。在将待删除区块删除之后,所述第一网络节点或第二网络节点可以记录所述待删除区块的区块头内容。
进一步可选的,所述第一网络节点或第二网络节点可以将所生成的区块链的区块包含的多个交易信息发送至上一级网络节点。可选的,所述第一网络节点或第二网络节点在确定待删除区块之后,可以将待删除区块所包含的至少一个交易信息发送至上一级网络节点。可选的,在上一级网络节点中可以记录所述至少一个交易信息的原存储位置信息。其中,第一网络节点的上一级网络节点与第二网络节点的上一级网络节点可以相同,也可以不同,本申请实施例对此不做限定。
需要说明的是,所述设备节点执行步骤211中向所述第一网络节点发送的一个或者多个数据信息中包含第一数据的第一散列值,具体是设备节点根据第 一数据计算获取第一数据的第一散列值,并将包含第一数据的第一散列值的数据信息发送至所述第一网络节点。或者,所述设备节点可以向所述第一网络数据节点发送的一个或者多个数据信息包含第一数据,在第一网络节点接收到该数据信息之后,根据数据信息中包含的第一数据,计算获取第一数据的第一散列值。或者,所述设备节点可以向所述第一网络数据节点发送的一个或者多个数据信息既包含第一数据又包含第一数据的第一散列值,本申请实施例对此不做限定。
本实施例以第一网络节点与其他第一网节点形成第二区块链,第二网络节点与其他第二网络节点形成第一区块链为例说明本申请内容。其中设备节点可以是多个设备节点执行步骤201和211。另外,实际上图4所示实施例还可以是只有第二网络节点与其他第二网络节点形成第一区块链,而第一网络节点在收到设备节点的数据信息(步骤211)后,可以只是不断的存储收到的数据信息,不形成第二区块链。或者,图4所示实施例还可以是只有第一网络节点与其他第一网络节点形成第二区块链,而第二网络节点在收到设备节点的数据信息(步骤201)后,可以只是不断的存储收到的数据信息,不形成第一区块链。
在本申请实施例中,通过将设备节点中的一个或者多个第一数据发送至其他网络节点进行存储,能够缓解设备节点的存储压力,另外,在第一网络节点中和第二网络节点分别生成了关于第一数据的区块链和关于第一数据的第一散列值的区块链,实现了通过区块链来分别存储数据和散列值,即使根据数据所生成的第一区块链的数据都被篡改的情况下,能够通过第二区块链的散列值对第一区块链中的数据进行验证,因此这样提高了数据的防篡改能力。
请参见图5,为本申请实施例提供了另一种数据处理方法的流程示意图,如图5所示,本申请实施例中涉及第一网络节点、其他第一网络节点和设备节点。可以参考图2所示的网络架构,所述数据处理方法是由以上节点共同完成的,其中,所述设备节点在执行步骤301至步骤312的过程中,所述设备节点为与所述第一网络节点建立通信连接的多个设备节点中的任意一个。需要说明的是,本申请实施例中,第一网络节点和其他第一网络节点所执行的步骤,也可以换为第二网络节点和其他第二网络节点来执行,图5所示实施例是以第一网络节点为例进行的说明。具体的执行过程请参见以下详细介绍。
301,设备节点向第一网络节点发送一个或者多个数据信息。
其中,所述设备节点可以将包含第一数据的数据信息发送至所述第一网络节点。或者,所述设备节点可以将包含第一数据和第一数据的第一散列值的数据信息发送至所述第一网络节点。在以上两种可选的数据信息的基础上,所述数据信息还可以包括以下至少一项:所述第一数据的索引值、所述第一数据的时间信息、发送所述数据信息的设备节点的标识、所述设备节点的地址和接收所述数据信息的第一网络节点的地址。可选的,所述第一数据的时间信息可以是所述第一数据的发送时间或所述第一数据的产生时间,本申请实施例对此不做限定。
可选的,一个或者多个数据信息的表现形式可以参考图4所示实施例中步骤201中数据信息的详细描述,在此不再赘述。
302、所述第一网络节点计算所述第一数据的第一散列值。
其中,对于数据信息中未包含第一数据的第一散列值的情况,所述第一网络节点执行步骤302。对于数据信息中包含第一数据的第一散列值的情况,所述第一网络节点可以计算第一数据的第一散列值,并根据携带的第一散列值进行比较,以确定第一数据在传输过程中是否被篡改,若两者不相同,则确定第一数据已被篡改,可以通知设备节点第一数据已被篡改的通知消息,以及不执行本申请实施例后续步骤,这样增强了第一数据传输的安全性。
总之,所述第一网络节点可以从数据信息中获得或者计算得到每一个第一数据对应的一个第一散列值。可以理解的是,第一网络节点除了可以接收所述设备节点发送的一个或者多个数据信息,还可以接收其他设备节点发送的一个或者多个数据信息。
举例来说,如表7所示,包含了第一网络节点确定的多个第一散列值。表7中,数据索引值可以是第一数据的索引值,也可以是与第一数据的索引值对应的第一散列值的索引值。不论是那种方式,在从分别查找第一数据和第一数据的第一散列值的情况下,可以通过第一数据的索引值,或者第一数据的索引值和第一散列值的索引值之间的对应关系,能够查找到第一数据和所述第一数据对应的第一散列值。
表7
Figure PCTCN2017000082-appb-000009
303、所述第一网络节点根据所述第一散列值生成第一交易信息B1,。
其中,第一交易信息是采用散列值生成的,本申请实施例采用B1对本步骤生成的第一交易信息进行表示,以加以区分。
进一步的,若第一散列值的数量为1个,则所述第一网络节点可以生成一个第一交易信息B1。例如第一数据可以是数据1,数据2,数据3.。。。或者数据n。不同的数据有不同的散列值,那么例如数据1的散列值是散列值1,数据2的散列值是散列值2,如此类推。.若第一散列值的数量为多个,则所述第一网络节点可以生成至少一个第一交易信息B1。可选的,所述第一交易信息包括以下至少一项对应的信息:交易标识、数据项、数据的散列值、生成所述第一交易信息的节点标识项、数据的索引值项、时间信息项、数据的发送方项和数据的接收方项。其中时间信息项例如可以是指数据的发送时间或者交易的生成时间,本申请实施例对此不做限定。
表8
Figure PCTCN2017000082-appb-000010
以表7为中所包含的第一散列值为例,所述第一网络节点可以生成如表8所示的第一交易信息B1。
或者,以表7为中所包含的第一散列值为例,所述第一网络节点可以生成如表9所示的第一交易信息B1。其中,Tx可以为数据包1生成的时间或者交易1生成的时间,本申请实施例对此不做限定。其中,第一网络节点将多个数据的数据散列值作为一个数据包,数据包作为交易的数据项内容。关于地址,具体地,举例说明表9,接收方地址,例如可以是第一网络节点地址,发送方地址,例如所述数据包1的数据散列值所有都来自于设备节点1的情况,即设发送方地址为设备节点1的地址。
表9
Figure PCTCN2017000082-appb-000011
其中,数据包内容可以参见表10所示。
表10
Figure PCTCN2017000082-appb-000012
304,所述第一网络节点向其他第一网络节点发送所述至少一个第一交易信息。
其中,本申请实施例所涉及的第一网络节点为多个第一网络节点中的任意一个,而其他第一网络节点是多个第一网络节点中除了这一个第一网络节点之 外的其他第一网络节点。
相应的,其他第一网络节点中的任一第一网络节点接收所述至少一个第一交易信息B1。
305,所述其他第一网络节点向所述第一网络节点发送的至少一个第二交易信息。
其中,本申请实施例中,其他第一网络节点发送的第二交易信息用B2表示,需要说明的是,这里的第二交易信息B2和第一交易信息B1均包含有数据的散列值项,进而能够实现生成由数据的散列值项生成的交易信息生成第二区块链中的区块。举例说明,具体地,第一网络节点例如是网络节点A,基于它收到的设备节点A发送的数据信息,数据信息中包含一个第一数据,所述第一数据例如是数据A。网络节点A根据数据A,获得所述数据A的散列值A(例如利用数据A计算出散列值A)。基于散列值A,根据上述步骤303中生成第一交易的方式,生成了第一交易信息B1。其他第一网络节点例如是网络节点B基于它收到的设备节点B发送的数据信息,数据信息中包含一个第一数据,所述第一数据例如是数据B。网络节点B根据数据B,获得所述数据B的散列值B(利用数据B计算出散列值B)。基于散列值B,根据上述步骤303中生成第一交易的方式,生成了第二交易信息B2。
可选的,第二交易信息的生成方式与本申请实施例中第一交易信息的生成方式相同,具体可以参考步骤301至步骤203中的详细描述,在此不再赘述。
相应的,所述第一网络节点接收其他第一网络节点发送的至少一个第二交易信息。
306、所述第一网络节点根据第一交易信息和/或所述第二交易信息生成第二区块链中的区块。
其中,所述第一网络节点根据第一交易信息B1和接收到的所述第二交易信息B2生成第二区块链中的区块。可选地,第一网络节点将生成的第二区块链区块广播给其他网络节点。
在本实施例中,是以第一网络节点来生成第二区块链区块为例。实际上,可以是其他网络节点(例如网络节点B)根据第一交易信息B1和第二交易信息B2生成第二区块链的区块。同理,其他网络节点(例如网络节点B)将生成的第二区块链区块广播给其他网络节点(除了网络节点B以外的其他网络 节点,第一网络节点)。本申请实施例中第二区块链L4的生成方法可以参考图4所示实施例中步骤216中第二区块链L4的生成方式,在此不再赘述。
307,所述第一网络节点根据所述第一数据生成第一交易信息A1。
步骤307与步骤302是并列步骤,执行次序不分先后。
308,所述第一网络节点根据所述第一交易信息A1,生成第一区块链L1的区块。
其中,步骤307和步骤308是第一网络节点根据接收到设备节点的数据信息所包含的第一数据,生成第一交易信息。具体实现方式可以是,例如根据设备节点1发送的第一数据1生成第一交易A1(1),根据设备节点2发送的第一数据2生成第一交易A1(2),根据第一数据3生成第一交易A2(3)。或者,第一网络节点根据所述第一数据1,第一数据2,第一数据3组成的数据包,生成了第一交易A1。总之,第一网络节点根据一个或者多个数据信息包含的第一数据,生成至少一个第一交易信息,并根据生成的至少一个交易信息,生成第一区块链的区块的过程。具体的实现方式可以参考图4所示实施例中步骤212至步骤214的详细描述,在此不再赘述。
具体地,所述第一网络节点独自生成第一区块链的所有区块,独立形成一个第一区块链。具体地所述网络节点可以将区块发送给自己,和/或将自己不断生成的区块保存。
具体地,所述第一网络节点所述第一网络节点根据至少一个第一交易信息A1,基于第一算法,生成第一区块链的区块。所述第一算法可以等同于第一机制。所述第一算法可以用于确定哪个网络节点生成第一区块链的区块,因此所述第一算法,举例可以是:所述第一网络节点为生成第一区块链区块的唯一节点。或者,所述第一算法还可以用于所述第一网络节点如何生成所述区块的算法。
同理,针对权利要求中提到的第一算法,第三算法,第五算法,第七算法,所述算法等同于机制,所述算法可以是具体的算法,也可以是非常简单的机制,例如规定某个节点为生成该区块链的区块的唯一节点,或者所述网络节点根据交易直接生成区块等等。总之作为机制或者算法的具体定义和用途,本发明不做过多限制。
309,在所述第一网络节点生成区块链之后,向所述设备节点发送第一通知消息。
其中,所述第一通知消息用于通知设备节点所述第一网络节点已根据所述数据信息生成区块链的区块的消息。可选的,第一通知消息可以在生成第一区块链L1和生成第二区块链L4中的任意一个区块链之后发送。需要说明的是,步骤309为可选步骤。
相应的,所述设备节点接收所述第一网络节点发送的第一通知消息。
310,所述设备节点向所述第一网络设备发送所述第二删除消息。
其中,所述第二删除消息为所述至少一个设备节点用于请求删除数据信息。
311,所述第一网络节点向所述设备节点发送第一删除消息。
其中,所述第一删除消息为用于指示所述设备节点删除数据信息的指示消息。
312,所述设备节点删除所述数据信息。
其中,可选地,所述设备节点删除所述数据信息,可以是根据删除条件去删除数据信息。例如将时间超过门限1的数据信息删除。例如设备节点删除存储时间超过门限1的数据信息。
需要说明的是,步骤310、步骤311、步骤312均为可选步骤,具体的实现方式可以参考图4所示实施例中步骤208、步骤209和步骤210的详细描述,在此不再赘述。
进一步可选的,所述第一网络节点可以从目标区块链中确定待删除区块。其中,所述目标区块链为所述第一网络节点中的第一区块链L1或第二区块链L4。
第一网络节点在确定待删除区块的可选方案可以为:以第一网络节点为例,所述第一网络节点可以按照预设删除规则,从目标区块链中确定待删除区块。其中,所述预设删除规则可以包括但不限定于所述第一网络节点存储所述目标区块链的区块个数大于预设阈值,或者所述待删除区块为生成时间时长超过时间阈值的区块,或者,所述待删除区块为区块序号小于序号阈值的区块。在将待删除区块删除之后,所述第一网络节点可以记录所述待删除区块的区块头内容。
进一步可选的,所述第一网络节点可以将所生成的区块链的区块包含的多个交易信息发送至上一级网络节点。可选的,所述第一网络节点或第一网络节点在确定待删除区块之后,可以将待删除区块所包含的至少一个交易信息发送至上一级网络节点。可选的,在上一级网络节点中可以记录所述至少一个交易信息的原存储位置信息。
进一步的,所述第一网络节点可以将第一数据的散列值和第一数据发送给中心节点,以使中心节点计算所述第一数据的第二散列值,并将第二散列值和第一散列值进行比对,以检验第一数据是否被篡改,是否为可信数据等,具体的实现过程可以参考图2所示系统的实施例的具体描述,在此不再赘述。
本实施例以第一网络节点与其他第一网节点形成第二区块链,第一网络节点根据接收的数据信息生成第一交易从而形成第一区块链。其中设备节点可以是至少一个设备节点执行步骤301.另外,实际上本实施例二还可以只有第一网络节点与其他第一网络节点形成第二区块链,而第一网络节点在收到设备节点的数据信息(步骤301)后,不执行步骤307和308,可以只是不断的存储收到的数据信息,不形成第一区块链。
在本申请实施例中,通过将设备节点中的一个或者多个第一数据发送至第一网络节点进行存储,能够缓解设备节点的存储压力,另外,在第一网络节点中分别生成了关于第一数据的区块链和关于第一数据的第一散列值的区块链,实现了通过区块链来分别存储数据和散列值,即使根据数据所生成的第一区块链的数据都被篡改的情况下,能够通过第二区块链的散列值对第一区块链中的数据进行验证,因此这样提高了数据的防篡改能力。
请参见图6,为本申请实施例提供了另一种数据处理方法的流程示意图。如图6所示,本申请实施例中涉及第一网络节点、其他第一网络节点、设备节点和其他设备节点。可以参考图2所示的网络架构,所述数据处理方法是由以上节点共同完成的,其中,所述设备节点在执行步骤401至步骤413的过程中,所述设备节点为与所述第一网络节点建立通信连接的多个设备节点中的任意一个。具体的执行过程请参见以下详细介绍。
401,设备节点根据一个或者多个数据信息,生成至少一个第二交易信息。
其中,所述第二交易信息包括数据项对应的信息,例如第一数据。可选的 所述第二交易信息还可以包括至少一项对应的信息:数据的索引值项、数据的散列值项、时间信息项、数据的发送方项和数据的接收方项。其中,若包含数据的散列值项,则该项对应的信息为所述设备节点对第一数据计算的第一散列值。其中,时间信息项可以是指第一数据的生成时间或者该第二交易信息的生成时间,本申请实施例对此不做限定。在本申请实施例中设备节点生成的第二交易信息用C1表示,以加以区分。
402,所述设备节点将所述至少一个第二交易信息发送至第一网络节点。
相应的,所述第一网络节点接收所述至少一个第二交易信息。
402a、其他设备节点向所述第一网络节点发送第二交易信息。
其中,网络中有多个设备节点,步骤402中所述第一网络节点接收所述设备节点发送的第二交易信息(用C1表示)外,所述第一网络节点还可以接收与所述第一网络节点建立通信连接的其他设备节点发送的第二交易信息,其他设备发送的第二交易信息用C2表示,以加以区分。所述第二交易信息所包含的内容可以参考步骤401中第二交易信息所包含内容的详细介绍,在此不再赘述。
403,所述第一网络节点根据至少一个第二交易信息,生成第一区块链的区块。
其中,所述第一控制节点根据与其连接的多个设备节点发送第二交易信息,生成区块链。基于第二交易信息包含数据项的情况下,所述第一网络节点可以生成第一区块链L1的区块。
具体地,所述第一网络节点独自生成第一区块链的所有区块,独立形成一个第一区块链。具体地所述网络节点可以将区块发送给自己,和/或将自己不断生成的区块保存下来。
具体地,所述第一网络节点所述第一网络节点根据至少一个第二交易信息,基于第一算法,生成第一区块链的区块。所述第一算法可以等同于第一机制。所述第一算法用于确定哪个网络节点生成第一区块链的区块,因此所述第一算法,举例可以是:所述第一网络节点为生成第一区块链区块的唯一节点。
404,所述第一网络节点根据至少一个第二交易信息确定包含的至少一个第一数据。具体地,所述第一网络节点根据第一个第二交易信息(C1),从第二交易信息C1所包含的第一数据C1,确定第一个第一数据C1;所述第一网 络节点根据第二个第二交易信息(C2)确定第二个第一数据C2;所述第一网络节点根据第三个第二交易信息(C3)确定第三个第一数据C3,以此类推。综上所述,所述第一网络节点根据至少一个第二交易信息确定包含的至少一个第一数据。
其中,所述第一网络节点可以根据由设备节点发送来的交易信息中,确定出多个数据信息,所述数据信息包括第一数据,还可以包括以下至少一项:所述第一数据的索引值、所述第一数据的时间信息、发送所述数据信息的设备节点的标识、所述设备节点的地址和所述网络节点的地址。
405,所述第一网络节点计算第一数据的第一散列值。
可选的,若设备节点发送的每个交易信息中包含数据的散列值项,则所述第一网络节点可以不执行步骤405。
406,所述第一网络节点根据所述第一散列值生成第一交易信息B1。
步骤405与步骤403可以是并行步骤,不限制先后顺序。同理,步骤406与步骤403可以是并行步骤,不限制先后顺序。
其中,所述第一网络节点从设备节点发送来的交易信息中,确定出多个数据信息。在所述第一网络节点通过步骤405计算出所述数据信息中第一数据的第一散列值之后,可以根据该第一数据对应的数据信息中的其他信息确定出时间信息项、数据的索引值项、数据的发送方项和数据的接收方项。
407,所述第一网络节点向其他第一网络节点发送生成的至少一个第一交易信息B1。
408,所述第一网络节点还可以接收其他第一网络节点发送的至少一个第二交易信息B2。
409,所述第一网络节点根据至少一个第一交易信息B1和/或至少一个第二交易信息B2,生成第二区块链L4的区块。或者,所述第一网络节点和其他第一网络节点,基于算法,根据至少一个第一交易信息B1和/或至少一个第二交易信息B2,生成第二区块链L4。
关于“所述第一网络节点根据至少一个第一交易信息B1和/或至少一个第二交易信息B2,生成第二区块链L4的区块。”的说明:在本实施例中,是以第一网络节点来生成第一区块链区块为例。实际上,可以是其他网络节点(例如网络节点B)根据第一交易信息B1和第二交易信息B2生成第一区块链的 区块。同理,其他第一网络节点(例如网络节点B)将生成的第一区块链区块广播给其他第一网络节点(除了网络节点B以外的其他网络节点,第一网络节点)。例如一种情况下是第一网络节点生成区块,一种情况下是其他网络节点生成区块。第一网络节点和其他网络节点可根据某个算法来确定谁生成第i个区块(i为大于等于1的自然数)。总之,根据上述步骤,第而网络节点与其他网络节点形成了第一区块链L4。因此,所述第一网络节点和其他第一网络节点,基于算法,根据至少一个第一交易信息B1和/或至少一个第二交易信息B2,生成第二区块链L4。
后续可选步骤:完成“生成第二区块链L4的区块”之后,第一网络节点将生成的第一区块链区块广播给其他网络节点。
其中,步骤407至步骤409是生成关于散列值项的第二区块链,且是由多个第一网络节点基于算法生成的,这里用L4表示第二区块链,具体的生成第二区块链L4的执行过程可以参考图4所示实施例中步骤216的详细描述,在此不再赘述。
410,在所述第一网络节点生成区块链之后,向所述设备节点发送第一通知消息。
其中,所述第一通知消息用于通知设备节点所述第一网络节点已根据所述数据信息生成区块链的区块的消息。可选的,第一通知消息可以在生成第一区块链L1和生成第二区块链L4中的任意一个区块链之后发送。需要说明的是,步骤410为可选步骤。
相应的,所述设备节点接收所述第一网络节点发送的第一通知消息。
411,所述设备节点向所述第一网络设备发送所述第二删除消息。
其中,所述第二删除消息为所述至少一个设备节点用于请求删除数据信息。
412,所述第一网络节点向所述设备节点发送第一删除消息。
其中,所述第一删除消息为用于指示所述设备节点删除数据信息的指示消息。
413,所述设备节点将删除所述数据信息。
需要说明的是,步骤411、步骤412、步骤413均为可选步骤,具体的实现方式可以参考图4所示实施例中步骤208、步骤209和步骤210的详细描述, 在此不再赘述。
进一步可选的,所述第一网络节点可以从目标区块链中确定待删除区块。其中,所述目标区块链为所述第一网络节点中的第一区块链L1或第二区块链L4。
第一网络节点在确定待删除区块的可选方案可以为:所述第一网络节点可以按照预设删除规则,从目标区块链中确定待删除区块。其中,所述预设删除规则可以包括但不限定于所述第一网络节点存储所述目标区块链的区块个数大于预设阈值,或者所述待删除区块为生成时间时长超过时间阈值的区块,或者,所述待删除区块为区块序号小于序号阈值的区块。在将待删除区块删除之后,所述第一网络节点可以记录所述待删除区块的区块头内容。
进一步可选的,所述第一网络节点可以将所生成的区块链的区块包含的多个交易信息发送至上一级网络节点。可选的,所述第一网络节点或第一网络节点在确定待删除区块之后,可以将待删除区块所包含的至少一个交易信息发送至上一级网络节点。可选的,在上一级网络节点中可以记录所述至少一个交易信息的原存储位置信息。
进一步的,所述第一网络节点可以将第一数据的散列值和第一数据发送给中心节点,以使中心节点计算所述第一数据的第二散列值,并将第二散列值和第一散列值进行比对,以检验第一数据是否被篡改,是否为可信数据等,具体的实现过程可以参考图2所示系统的实施例的具体描述,在此不再赘述。
进一步可选的,所述第一网络节点从所述第二区块链获取所述第一数据的第一散列值;所述第一网络节点从所述第一区块链获取所述第一数据,并计算所述第一数据的第二散列值;所述第一网络节点将所述第一散列值与所述第二散列值进行比对;若所述第一散列值与所述第二散列值相同,则所述第一网络节点确定所述第一数据是可信数据;或者,确定所述第一数据未被篡改;或者,确定所述第一数据的第一散列值是可信散列值;或,若所述第一散列值与所述第二散列值不相同,则所述第一网络节点确定所述第一数据是不可信数据;或者,确定所述第一数据已被篡改;或者,确定所述第一数据的第一散列值是不可信散列值。
在本申请实施例中,设备节点可以将一个或者多个关于数据信息的交易信息发送至第一网络节点进行存储,并且在第一网络节点分别生成了关于第一数 据的区块链和关于第一数据的第一散列值的区块链,实现了通过区块链来分别存储数据和散列值,即使由数据所生成的第一区块链的全部数据都被篡改的情况下,能够通过第二区块链的散列值对第一区块链中的数据进行验证,因此这样提高了数据的防篡改能力。
请参见图7,为本申请实施例提供了另一种数据处理方法的流程示意图。如图7所示,本申请实施例中涉及第一网络节点、其他第一网络节点、设备节点和其他设备节点。可以参考图2所示的网络架构,所述数据处理方法是由以上节点共同完成的,其中,所述设备节点在执行步骤501至步骤514的过程中,所述设备节点为与所述第一网络节点建立通信连接的多个设备节点中的任意一个。具体的执行过程请参见以下详细介绍。
501,设备节点根据一个或者多个数据信息,生成至少一个第二交易信息。
其中,所述第二交易信息包括数据项对应的信息,例如第一数据。可选的所述第二交易信息还可以包括至少一项对应的信息:数据的索引值项、数据的散列值项、时间信息项、数据的发送方项和数据的接收方项。其中,若包含数据的散列值项,则该项对应的信息为所述设备节点对第一数据计算的第一散列值。其中时间信息项可以是指第一数据的生成时间或者该第二交易信息的生成时间,本申请实施例对此不做限定。在本申请实施例中设备节点生成的第二交易信息用C1表示,以加以区分。
502,所述设备节点将所述至少一个第二交易信息发送至第一网络节点和其他设备节点。
相应的,所述第一网络节点接收所述至少一个第二交易信息C1。其他设备节点接收所述至少一个第二交易信息C1。其中,所述其他设备节点以及所述设备节点均与所述第一网络节点建立了通信连接,且各个设备节点之间也可以相互通信。
503,所述其他设备节点向所述设备节点和所述第一网络节点发送至少一个第二交易信息C2。
相应的,所述设备节点接收其他设备节点发送的至少一个第二交易信息C2。
所述第一网络节点接收其他设备节点发送的至少一个第二交易信息C2。
其中,具体地该步骤503,可以是其他设备节点广播第二交易信息C2,由此所述设备节点收到所述第二交易信息C2,第一网络节点收到所述第二交易信息C2。由此,针对所述设备节点侧,所述设备节点接收其他设备节点发送的至少一个第二交易信息C2。
其中,设备节点可以接收其他设备节点发送的第二交易信息,其他设备发送的第二交易信息用C2表示。所述第二交易信息所包含的内容可以参考步骤501中第二交易信息所包含内容的详细介绍,在此不再赘述。
504,所述设备节点根据至少一个一个第二交易信息,生成第二区块链L2的区块。或者,所述设备节点、其他设备节点和第一网络节点,基于算法,根据第二交易信息,生成第一区块链L2。
关于“所述设备节点根据至少一个第二交易信息,生成第二区块链L2的区块。”的说明:在本实施例中,是以所述设备节点来生成第二区块链区块为例。实际上,可以是其他设备节点(例如设备节点B)或者第一网络节点根据第二交易信息生成第二区块链的区块。同理,其他所述设备节点(例如网络节点B)或者第一网络节点将生成的第二区块链区块广播给其他所述设备节点(除了网络节点B以外的其他网络节点,所述设备节点)。因此例如一种情况下,所述设备节点生成区块,另外一种情况下是其他设备节点生成区块或者第一网络节点生成区块。所述设备节点,其他设备节点和第一网络节点可根据某个算法来确定谁生成第i个区块(i为大于等于1的自然数)。总之,根据上述步骤,所述设备节点、其他设备节点和第一网络节点形成了第二区块链L2。因此,所述设备节点、其他设备节点和第一网络节点,基于算法,根据至少一个第二交易信息C1和/或至少一个第一交易信息C2,生成第一区块链L2。
后续可选步骤:完成“生成第二区块链L2的区块”之后,所述设备节点将生成的第一区块链区块广播给其他设备节点和第一网络节点。
其中,具体的生成第二区块链L2的执行过程可以参考图4所示实施例中步骤216的详细描述,在此不再赘述。
505,所述第一网络节点根据至少一个第二交易信息确定包含的至少一个第一数据。
步骤502和/或步骤503之后,第一网络节点就可以执行步骤505。
506,所述第一网络节点计算第一数据的第一散列值。
507,所述第一网络节点根据所述第一散列值生成第一交易信息B1。
508,所述第一网络节点向其他第一网络节点发送生成的至少一个第一交易信息B1。
509,所述第一网络节点还可以接收其他第一网络节点发送的至少一个第二交易信息B2。
510,所述第一网络节点和其他第一网络节点,基于算法,根据至少一个第一交易信息B1和/或至少一个第二交易信息B2,生成第二区块链L4的区块。
在本实施例中,是以第一网络节点来生成第一区块链区块为例。实际上,可以是其他网络节点(例如网络节点B)根据第一交易信息B1和第二交易信息B2生成第一区块链的区块。同理,其他第一网络节点(例如网络节点B)将生成的第一区块链区块广播给其他第一网络节点(除了网络节点B以外的其他网络节点,第一网络节点)。例如,一种情况下是第一网络节点生成区块,另一种情况下是其他网络节点生成区块。第一网络节点和其他网络节点可根据某个算法来确定谁生成第i个区块(i为大于等于1的自然数)。总之,根据上述步骤,第而网络节点与其他网络节点形成了第一区块链L4。
“生成区块”之后的可选步骤:可选地,第一网络节点将生成的第一区块链区块广播给其他网络节点。
其中,步骤505至步骤510与图6所示实施例中步骤404至步骤409的内容相同,具体可以参考图6所示实施例的具体介绍,在此不再赘述。
511,在所述第一网络节点生成区块链之后,向所述设备节点发送第一通知消息。
相应的,所述设备节点接收所述第一网络节点发送的第一通知消息。
512,所述设备节点向所述第一网络设备发送所述第二删除消息。
其中,所述第二删除消息为所述至少一个设备节点用于请求删除区块。
513,所述第一网络节点删除待删除区块。
其中,所述第一网络节点在生成第一区块连L2或第二区块链L4之后,可确定出待删除区块,并将待删除区块删除。其中,所述第一网络节点可以按照预设删除规则,从目标区块链中确定待删除区块。对于第一网络节点而言,所述目标区块链为第一区块链L2或第二区块链L4。所述预设删除规则可以包括但不限定于所述第一网络节点存储所述目标区块链的区块个数大于预设阈 值,或者所述待删除区块为生成时间时长超过时间阈值的区块,或者,所述待删除区块为区块序号小于序号阈值的区块。在将待删除区块删除之后,所述第一网络节点或第一网络节点可以记录所述待删除区块的区块头内容。
进一步可选的,所述第一网络节点可以将所生成的区块链的区块包含的多个交易信息发送至上一级网络节点。可选的,所述第一网络节点或第二网络节点在确定待删除区块之后,可以将待删除区块所包含的至少一个交易信息发送至上一级网络节点。可选的,在上一级网络节点中可以记录所述至少一个交易信息的原存储位置信息。
可选的,所述第一网络节点还可以在接收到所述第二删除消息之后,执行步骤513。
514,所述第一网络节点向所述设备节点发送第一删除消息。
其中,所述第一删除消息为用于指示所述设备节点删除区块的指示消息。可选的方案中,所述第一网络节点可以在第一删除消息中指明所要删除的区块,可选的所要删除的区块可以为步骤513中所述第一网络节点删除的待删除区块。又一可选的方案中,所述第一网络节点也可以不指明删除的区块,由设备节点自行确定所要删除的区块,这样所述第一删除消息的作用为通知设备节点执行删除数据消息即可。
515,所述设备节点将删除区块。
可选的,所述设备节点可以在未执行步骤512和接收步骤514中的第一删除消息的情况下,执行步骤删除第一区块链L2中的区块。具体可以按照预设删除规则,从第一区块链L2中确定待删除区块。其中,所述预设删除规则可以包括但不限定于所述第一网络节点存储所述目标区块链的区块个数大于预设阈值,或者所述待删除区块为生成时间时长超过时间阈值的区块,或者,所述待删除区块为区块序号小于序号阈值的区块。
可选的,所述设备节点可以在接收到步骤514中的第一删除消息之后执行步骤515。若所述第一删除消息携带了待删除的区块,则所述设备节点将所携带的区块进行删除即可;若所述第一删除消息中未携带待删除的区块,则所述设备节点可以按照第一种可选的方案,确定所要删除的区块。
进一步可选的,在删除区块链中的区块之后,所述设备节点可以记录所述待删除区块的区块头内容。所述设备节点可以将待删除区块所包含的至少一个 交易信息发送至上一级节点。可选的,在上一级节点中可以记录所述至少一个交易信息的原存储位置信息。在本申请实施例中,上一级节点可以为第一网络节点,还可以为其他节点,本申请实施例对此不作限定。
通过执行步骤515删除区块链中的区块,能够减小设备节点的存储压力。
进一步的,所述第一网络节点或所述设备节点可以将第一数据发送给中心节点,所述第一网络节点可以将第一数据的散列值发送给中心节点,以使中心节点计算所述第一数据的第二散列值,并将第二散列值和第一散列值进行比对,以检验第一数据是否被篡改,是否为可信数据等,具体的实现过程可以参考图2所示系统的实施例的具体描述,在此不再赘述。
进一步可选的,所述设备节点从所述第二区块链获取所述第一数据的第一散列值;所述设备节点从所述第一区块链获取所述第一数据,并计算所述第一数据的第二散列值;所述设备节点将所述第一散列值与所述第二散列值进行比对;若所述第一散列值与所述第二散列值相同,则所述设备节点确定所述第一数据是可信数据;或者,确定所述第一数据未被篡改;或者,确定所述第一数据的第一散列值是可信散列值;或,若所述第一散列值与所述第二散列值不相同,则所述设备节点确定所述第一数据是不可信数据;或者,确定所述第一数据已被篡改;或者,确定所述第一数据的第一散列值是不可信散列值。
进一步可选的,所述第一网络节点从所述第二区块链获取所述第一数据的第一散列值;所述第一网络节点从所述第一区块链获取所述第一数据,并计算所述第一数据的第二散列值;所述第一网络节点将所述第一散列值与所述第二散列值进行比对;若所述第一散列值与所述第二散列值相同,则所述第一网络节点确定所述第一数据是可信数据;或者,确定所述第一数据未被篡改;或者,确定所述第一数据的第一散列值是可信散列值;或,若所述第一散列值与所述第二散列值不相同,则所述第一网络节点确定所述第一数据是不可信数据;或者,确定所述第一数据已被篡改;或者,确定所述第一数据的第一散列值是不可信散列值。
在本申请实施例中,设备节点可以将一个或者多个关于数据信息的交易信息发送至第一网络节点进行存储,并能够与第一网络节点共同生成关于第一数据的区块链,另外,在第一网络节点生成了关于第一数据的第一散列值的区块链,实现了通过区块链来分别存储数据和散列值,即使由数据所生成的第一区 块链的全部数据都被篡改的情况下,能够通过第二区块链的散列值对第一区块链中的数据进行验证,因此这样提高了数据的防篡改能力。
图8为本申请实施例提供了一种中心节点的模块化示意图。本申请实施例中的中心节点可以是图3所示任一方法实施例描述的中心节点。因此,图3所示方法实施例中重复内容,本实施例可能不再赘述。
如图8所示,本申请实施例的中心节点1可以包括:获取模块11、计算模块12、比对模块13和确定模块14。可选的,所述中心节点1还包括生成模块15。
获取模块11,用于从第一网络节点获取第一数据的第一散列值;
计算模块12,用于从第二网络节点获取所述第一数据,并计算所述第一数据的第二散列值;
比对模块13,用于将所述获取模块11获取的所述第一散列值与所述计算模块12计算的所述第二散列值进行比对;
确定模块14,用于若所述比对模块13确定所述第一散列值与所述第二散列值相同,则确定所述第一数据是可信数据;或者,确定所述第一数据未被篡改;或者,确定所述第一数据的第一散列值是可信散列值。
可选的,所述确定模块14,还用于若所述比对模块13确定所述第一散列值与所述第二散列值不相同,则确定所述第一数据是不可信数据;或者,确定所述第一数据已被篡改;或者,确定所述第一数据的第一散列值是不可信散列值。
可选的,所述获取模块11具体用于:从第一网络节点的第二区块链中获取第一数据对应的第一散列值;其中,所述第二区块链为由包含数据的散列值项的交易信息生成的区块组成的。
可选的,所述计算模块12具体用于:从第二网络节点的第一区块链中的所述第一数据,其中,所述第一区块链为由包含数据项的交易信息生成的区块组成的。
可选的,所述获取模块11,还用于从第一网络节点获取所述第一数据的以下至少一项关联信息:所述第一数据的索引值、所述第一数据的时间信息、发送所述第一数据的设备节点标识、发送所述第一数据的地址和接收所述第一 数据的地址。
可选的,所述获取模块11,还用于从第二网络节点获取所述第一数据的第一散列值的以下至少一项关联信息:所述第一数据的索引值、所述第一数据的时间信息、发送所述第一数据的设备节点标识、发送所述第一数据的地址和接收所述第一数据的地址。
可选的,所述确定模块14,还用于选择一个第一网络节点确定为目标第一网络节点;
所述获取模块11具体用于从目标第一网络节点的第二区块链中获取第一数据的第一散列值。
可选的,在选择一个第一网络节点确定为目标第一网络节点方面,所述确定模块14具体用于从至少一个第一网络节点中选择一个满足第一合法条件的第一网络节点为目标第一网络节点;
所述第一合法条件为:与所述目标第一网络节点的第二区块链的第一数据的第一散列值相同的节点数量超过第一阈值。
可选的,所述确定模块14,还用于选择一个第二网络节点确定为目标第二网络节点。
所述获取模块11具体用于从所述目标第二网络节点的第一区块链中获取第一数据。
可选的,在选择一个第二网络节点确定为目标第二网络节点方面,所述确定模块具体用于从至少一个第二网络节点中选择一个满足第二合法条件的网络节点为第二目标网络节点;
所述第二合法条件为:与所述目标第二网络节点的第一区块链的第一数据相同的网络节点的数量超过第二阈值。
可选的,还包括:生成模块15,用于若确定所述第一数据是可信数据,则确定第三区块链的第i个交易信息满足生成条件,生成第三区块链的第i个交易信息;或者
所述生成模块15,还用于若确定所述第一数据是不可信数据,则确定所述第三区块链的第i个交易信息不满足所述生成条件,不生成所述第三区块链的第i个交易信息;或者
所述生成模块15,还用于若确定所述第一数据是不可信数据,则确定所 述第三区块链的第j个交易信息满足生成条件,生成所述第三区块链的第j个交易信息。
图8所示实施例中的中心节点可以以图9所示的中心节点实现。如图9所示,为本申请实施例提供了一种中心节点的结构示意图,图9所示的中心节点1000包括:处理器1001和收发器1004。其中,处理器1001和收发器1004相连,如通过总线1002相连。可选的,所述中心节点1000还可以包括存储器1003。需要说明的是,实际应用中收发器1004为至少一个,该中心节点1000的结构并不构成对本申请实施例的限定。
其中,处理器1001应用于本申请实施例中,用于实现图8所示的计算模块12、比对模块13、确定模块14、生成模块15的功能。收发器1004包括接收机和发射机,可选的方案中,收发器1004应用于本申请实施例中,用于实现图8所示的获取模块11的功能。
处理器1001可以是中央处理器(Central Processing Unit,CPU),通用处理器,数字信号处理(Digital Signal Processing,DSP),集成电路(Application Specific Integrated Circuit,ASIC),现场可编程逻辑门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。处理器1001也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,DSP和微处理器的组合等等。
总线1002可包括一通路,在上述组件之间传送信息。总线1002可以是外设部件互连标准(Peripheral Component Interconnect,PCI)总线或扩展工业标准结构(Extended Industry Standard Architecture,EISA)总线等。总线1002可以分为地址总线、数据总线、控制总线等。为便于表示,图9中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
存储器1003可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、只读光盘(Compact Disc Read-Only Memory,CD-ROM) 或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。
可选的,存储器1003用于存储执行本申请方案的应用程序代码,并由处理器1001来控制执行。处理器1001用于执行存储器1003中存储的应用程序代码,以实现图3所示任一实施例提供的中心节点的动作。
在本申请实施例中还提供了一种计算机存储介质,用于储存为上述中心节点所用的计算机软件指令,其包含用于执行上述方面为中心节点所设计的程序。
图10为本申请实施例提供了一种网络节点的模块化示意图。本申请实施例中的网络节点可以是图3-图7所示任一方法实施例描述的网络节点。因此,图3-图7所示任一方法实施例中重复内容,本实施例可能不再赘述。
如图10所示,本申请实施例的网络节点2可以包括:区块生成单元2001。可选的,所述网络节点2还可以包括第一信息接收模块2002、信息生成模块2003、第一信息发送模块2004、区块发送模块2005、第二信息接收模块2006、通知消息接收模块2007、删除消息接收模块2008、删除区块确定模块2009、删除消息发送模块2010、删除模块2011和记录模块2012中至少一个模块。
区块生成模块2001,用于根据至少一个第一交易信息,生成区块链的区块。所述第一交易信息包括以下至少一项对应的信息:数据项、数据的索引值项、数据的散列值项、时间信息项、数据的发送方项和数据的接收方项。
可选的,还包括:
第一信息接收模块2002,用于接收至少一个设备节点发送的数据信息;
信息生成模块2003,用于根据所述第一信息接收模块2002接收到的所述数据信息生成至少一个第一交易信息。
可选的,所述数据信息包括以下至少一项:第一数据、所述第一数据的第一散列值、所述第一数据的索引值、所述第一数据的时间信息、发送所述数据信息的设备节点的标识、所述设备节点的地址和所述网络节点的地址。
可选的,还包括:计算模块,用于若所述数据信息包括所述第一数据且未 包括所述第一散列值,则计算所述第一数据的第一散列值;所述信息生成模块2003具体用于根据所述数据信息和所述第一散列值生成至少一个第一交易信息。
可选的,还包括:
第一信息发送模块2004,用于向其他网络节点或至少一个设备节点发送所述信息生成模块2003生成的至少一个第一交易信息。
可选的,还包括:第二信息接收模块2006,用于接收其他网络节点或者至少一个设备节点发送的至少一个第二交易信息;其中,所述第二交易信息包括以下至少一项对应的信息:数据项、数据的索引值项、数据的散列值项、时间信息项、所述数据的发送方项和所述数据的接收方项。
可选的,所述区块生成模块2001,还用于若所述信息生成模块2003生成的至少一个第一交易信息包含数据项,则根据所述至少一个第一交易信息,基于第一算法,生成第一区块链的区块。
可选的,所述区块生成模块2001,还用于若所述信息生成模块2003生成的至少一个第一交易信息包含数据项,且所述第二信息接收模块2006接收到的所述至少一个第二交易信息包含数据项,则根据所述至少一个第一交易信息和/或所述至少一个第二交易信息,基于第二算法,生成第一区块链的区块。
可选的,还包括:
所述区块生成模块,还用于若所述信息生成模块2003生成的至少一个第一交易信息包含数据的散列值项,则根据所述至少一个第一交易信息,基于第三算法,生成第二区块链的区块。
可选的,还包括:
所述区块生成模块,还用于若所述信息生成模块2003生成的至少一个第一交易信息包含数据的散列值项,且所述第二信息接收模块2006接收到的至少一个第二交易信息包含数据的散列值项,则根据所述至少一个第一交易信息和/或所述至少一个第二交易信息,基于第四算法,生成第二区块链的区块。
可选的,所述区块生成模块,还用于若所述信息生成模块2003生成的至少一个第一交易信息包含数据项,则根据所述至少一个第一交易信息,基于第五算法,生成第一区块链的区块;和,若所述信息生成模块2003生成的至少一个第一交易信息包含数据的散列值项,且所述第二信息接收模块2006接收 到的至少一个第二交易信息包含数据的散列值项,则根据所述至少一个第一交易信息和/或所述至少一个第二交易信息,基于第六算法,生成第二区块链的区块;
或者,
所述区块生成模块,还用于若所述信息生成模块2003生成的至少一个第一交易信息包含数据项,且所述第二信息接收模块2006接收到的至少一个第二交易信息包含数据项,则根据所述至少一个第一交易信息和/或所述至少一个第二交易信息,基于第七算法,生成第一区块链的区块;和,所述信息生成模块2003生成的至少一个第一交易信息包含数据的散列值项,则根据所述至少一个第一交易信息,基于第八算法,生成第二区块链的区块。
若生成第一区块链且未生成第二区块链的,则所述网络节点2还包括:
第一获取模块,用于获取第一数据的第一散列值;
所述第一获取模块,还用于从所述第一区块链获取所述第一数据,并计算所述第一数据的第二散列值;
第一比对模块,用于将所述第一散列值与所述第二散列值进行比对;
第一确定模块,用于若所述第一散列值与所述第二散列值相同,则确定所述第一数据是可信数据;或者,确定所述第一数据未被篡改;或者,确定所述第一数据的第一散列值是可信散列值;或,
所述第一确定模块,还用于若所述第一散列值与所述第二散列值不相同,则确定所述第一数据是不可信数据;或者,确定所述第一数据已被篡改;或者,确定所述第一数据的第一散列值是不可信散列值。
若未生成第一区块链且生成第二区块链的,则所述网络节点2还包括:
第二获取模块,用于从所述第二区块链获取所述第一数据的第一散列值;
所述第二获取模块,还用于获取存储的所述第一数据,并计算所述第一数据的第二散列值;
第二比对模块,用于将所述第一散列值与所述第二散列值进行比对;
第二确定模块,用于若所述第一散列值与所述第二散列值相同,则确定所述第一数据是可信数据;或者,确定所述第一数据未被篡改;或者,确定所述第一数据的第一散列值是可信散列值;或,
所述第二确定模块,还用于若所述第一散列值与所述第二散列值不相同, 则确定所述第一数据是不可信数据;或者,确定所述第一数据已被篡改;或者,确定所述第一数据的第一散列值是不可信散列值。
若既生成第一区块链且又生成第二区块链的,则所述网络节点2还包括:
第三获取模块,用于从所述第二区块链获取所述第一数据的第一散列值;
所述第三获取模块,还用于从所述第一区块链获取所述第一数据,并计算所述第一数据的第二散列值;
第三比对模块,用于将所述第一散列值与所述第二散列值进行比对;
第三确定模块,用于若所述第一散列值与所述第二散列值相同,则确定所述第一数据是可信数据;或者,确定所述第一数据未被篡改;或者,确定所述第一数据的第一散列值是可信散列值;或,
所述第三确定模块,还用于若所述第一散列值与所述第二散列值不相同,则确定所述第一数据是不可信数据;或者,确定所述第一数据已被篡改;或者,确定所述第一数据的第一散列值是不可信散列值。
可选的,还包括:区块发送模块2005,用于向中心节点发送所述数据信息或者区块链的区块。
可选的,还包括:通知消息发送模块2007,用于向所述至少一个设备节点发送第一通知消息,所述第一通知消息用于通知设备节点已生成区块链的区块的消息。
可选的,还包括:删除消息发送模块2010,用于向设备节点发送第一删除消息,所述第一删除消息为用于指示所述设备节点删除所述数据信息或者删除区块的指示消息。
可选的,还包括:删除消息接收模块2008,还用于接收所述至少一个设备节点发送的第二删除消息,所述第二删除消息为所述至少一个设备节点用于请求删除所述数据信息或者删除区块。
可选的,删除区块确定模块2009,用于从目标区块链中确定待删除区块,所述目标区块链为所述网络节点所存储的任意一个区块链。
可选的,第二信息发送模块2013,还用于将所述区块链的区块包含的多个交易信息发送至上一级网络节点。
可选的,还包括:删除模块2011,用于将所述目标区块链中的所述待删除区块进行删除。
可选的,所述删除模块2011,具体用于按照预设删除规则,从目标区块链中确定待删除区块;其中,所述预设删除规则为:所述网络节点存储所述目标区块链的区块个数大于预设阈值,或者所述待删除区块为生成时间时长超过时间阈值的区块,或者,所述待删除区块为区块序号小于序号阈值的区块。
可选的,记录模块2012,用于记录所述待删除区块的区块头内容。
图10所示实施例中的网络节点可以以图11所示的网络节点实现。如图11所示,为本申请实施例提供了一种网络节点的结构示意图,图11所示的网络节点4000包括:处理器4001和收发器4004。
其中,处理器4001和收发器4004相连,如通过总线4002相连。可选的,所述网络节点4000还可以包括存储器4003。
需要说明的是,实际应用中收发器4004为至少一个,该网络节点4000的结构并不构成对本申请实施例的限定。
其中,处理器4001应用于本申请实施例中,用于实现图10所示的区块生成单元2001、信息生成模块2003、删除区块确定模块2009、删除模块2011和记录模块2012的功能。收发器4004包括接收机和发射机,收发器4004用于本申请实施例中,用于实现图10所示的第一信息接收模块2002、第一信息发送模块2004、区块发送模块2005、第二信息接收模块2006、通知消息接收模块2007、删除消息接收模块2008、删除消息发送模块2010的功能。
处理器4001可以是CPU,通用处理器,DSP,ASIC,FPGA或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。处理器4001也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,DSP和微处理器的组合等等。
总线4002可包括一通路,在上述组件之间传送信息。总线4002可以是PCI总线或EISA总线等。总线4002可以分为地址总线、数据总线、控制总线等。为便于表示,图11中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
存储器4003可以是ROM或可存储静态信息和指令的其他类型的静态存储设备,RAM或者可存储信息和指令的其他类型的动态存储设备,也可以是 电EEPROM、CD-ROM或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。
可选的,存储器4003用于存储执行本申请方案的应用程序代码,并由处理器4001来控制执行。处理器4001用于执行存储器4003中存储的应用程序代码,以实现图3至图7所示任一实施例中网络节点的动作。
在本申请实施例中还提供了一种计算机存储介质,用于储存为上述网络节点所用的计算机软件指令,其包含用于执行上述方面为网络节点所设计的程序。
图12为本申请实施例提供了一种设备节点的模块化示意图。本申请实施例中的设备节点可以是图3-图7所示任一方法实施例描述的设备节点。因此,图3-图7所示任一方法实施例中重复内容,本实施例可能不再赘述。
如图12所示,本申请实施例的设备节点3可以包括:发送模块30。可选的,所述设备节点3还可以包括第一接收模块31、第二接收模块32、第三接收模块33和删除模块34。
发送模块30,用于向网络节点发送一个或者多个数据信息,所述数据信息包括以下至少一项:第一数据、所述第一数据的第一散列值、所述第一数据的索引值、所述第一数据的时间信息、发送所述数据信息的设备节点的标识、所述设备节点的地址和所述网络节点的地址;所述数据信息用于所述网络节点生成第一交易信息;
可选的,还包括:第一接收模块31,用于接收网络节点发送的区块链第一通知消息,所述第一通知消息用于通知所述网络节点已经根据所述数据信息生成区块链的区块的消息。
可选的,还包括:第二接收模块32,用于接收网络节点发送的区块。
可选的,还包括:第三接收模块33,用于接收到所述网络节点发送第一删除消息,所述第一删除消息为用于指示所述设备节点删除所述数据信息或者删除区块的指示消息。
可选的,所述发送模块30,还用于向所述网络节点发送的第二删除消息, 所述第二删除消息用于请求删除所述数据信息或者删除区块。
可选的,还包括:删除模块34,用于删除所述数据信息。
可选的,所述删除模块34具体用于将生成时长超过第一时间阈值的数据信息进行删除。
图13为本申请实施例提供了另一种设备节点的模块化示意图。本申请实施例中的设备节点可以是图3-图7所示任一方法实施例描述的设备节点。因此,图3-图7所示任一方法实施例中重复内容,本实施例可能不再赘述。
如图13所示,本申请实施例的设备节点3可以包括:生成模块35。可选的,所述设备节点3还可以包括发送模块36、第二接收模块37、第三接收模块38和删除模块39。
生成模块35,用于根据一个或者多个数据信息,生成至少一个第二交易信息,并将所述至少一个第二交易信息发送至网络节点;所述第二交易信息包括以下至少一项对应的信息:数据项、数据的索引值项、数据的散列值项、时间信息项、数据的发送方项和数据的接收方项。
可选的,还包括:第二接收模块37,用于接收网络节点发送的区块。
可选的,还包括:第三接收模块38,用于接收到所述网络节点发送第一删除消息,所述第一删除消息为用于指示所述设备节点删除所述数据信息或者删除区块的指示消息。
可选的,还包括:发送模块36,还用于向所述网络节点发送的第二删除消息,所述第二删除消息用于请求删除所述数据信息或者删除区块。
可选的,还包括:删除模块39,用于删除所述数据信息。
可选的,所述删除模块39具体用于将生成时长超过第一时间阈值的数据信息进行删除。
图12或图13所示实施例中的设备节点可以以图14所示的设备节点实现。如图14所示,为本申请实施例提供了一种设备节点的结构示意图,图14所示的设备节点3000包括:处理器3001和收发器3004。
其中,处理器3001和收发器3004相连,如通过总线3002相连。可选的,所述设备节点3000还可以包括存储器3003。
需要说明的是,实际应用中收发器3004为至少一个,该设备节点3000的结构并不构成对本申请实施例的限定。收发器1004包括接收机和发射机。
一种方案中,处理器1001应用于本申请实施例中,用于实现图12所示的删除模块34的功能。收发器1004应用于本申请实施例中,用于实现图12所示的发送模块30、第一接收模块31、第二接收模块32、第三接收模块33的功能。
另一种方案中,处理器1001应用于本申请实施例中,用于实现图13所示的生成模块35、删除模块39的功能。收发器1004应用于本申请实施例中,用于实现图13所示的发送模块36、第二接收模块37、第三接收模块38的功能。
处理器3001可以是CPU,通用处理器,DSP,ASIC,FPGA或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。处理器3001也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,DSP和微处理器的组合等等。
总线3002可包括一通路,在上述组件之间传送信息。总线3002可以是PCI总线或EISA总线等。总线3002可以分为地址总线、数据总线、控制总线等。为便于表示,图14中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
存储器3003可以是ROM或可存储静态信息和指令的其他类型的静态存储设备,RAM或者可存储信息和指令的其他类型的动态存储设备,也可以是电EEPROM、CD-ROM或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。
可选的,存储器3003用于存储执行本申请方案的应用程序代码,并由处理器3001来控制执行。处理器3001用于执行存储器3003中存储的应用程序代码,以实现图3至图7所示任一实施例中设备节点的动作。
在本申请实施例中还提供了一种计算机存储介质,用于储存为上述设备节点所用的计算机软件指令,其包含用于执行上述方面为设备节点所设计的程 序。
尽管在此结合各实施例对本申请进行了描述,然而,在实施所要求保护的本申请过程中,本领域技术人员通过查看所述附图、公开内容、以及所附权利要求书,可理解并实现所述公开实施例的其他变化。在权利要求中,“包括”(comprising)一词不排除其他组成部分或步骤,“一”或“一个”不排除多个的情况。单个处理器或其他单元可以实现权利要求中列举的若干项功能。相互不同的从属权利要求中记载了某些措施,但这并不表示这些措施不能组合起来产生良好的效果。
本领域技术人员应明白,本申请的实施例可提供为方法、装置(设备)、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。计算机程序存储/分布在合适的介质中,与其它硬件一起提供或作为硬件的一部分,也可以采用其他分布形式,如通过Internet或其它有线或无线电信系统。
本申请是参照本申请实施例的方法、装置(设备)和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管结合具体特征及其实施例对本申请进行了描述,显而易见的,在不脱离本申请的精神和范围的情况下,可对其进行各种修改和组合。相应地,本说明书和附图仅仅是所附权利要求所界定的本申请的示例性说明,且视为已覆盖本申请范围内的任意和所有修改、变化、组合或等同物。显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。

Claims (82)

  1. 一种数据处理方法,其特征在于,包括:
    中心节点从第一网络节点获取第一数据的第一散列值;
    所述中心节点从第二网络节点获取所述第一数据,并计算所述第一数据的第二散列值;
    所述中心节点将所述第一散列值与所述第二散列值进行比对;
    若所述第一散列值与所述第二散列值相同,则所述中心节点确定所述第一数据是可信数据;或者,确定所述第一数据未被篡改;或者,确定所述第一数据的第一散列值是可信散列值。
  2. 根据权利要求1所述的方法,其特征在于,还包括:
    若所述第一散列值与所述第二散列值不相同,则所述中心节点确定所述第一数据是不可信数据;或者,确定所述第一数据已被篡改;或者,确定所述第一数据的第一散列值是不可信散列值。
  3. 根据权利要求1或2所述的方法,其特征在于,所述中心节点从第一网络节点获取第一数据的第一散列值,包括:
    所述中心节点从第一网络节点的第二区块链中获取第一数据对应的第一散列值;其中,所述第二区块链为由包含数据的散列值项的交易信息生成的区块组成的。
  4. 根据权利要求1或2所述的方法,其特征在于,所述中心节点从第二网络节点获取所述第一数据,包括:
    所述中心节点从第二网络节点的第一区块链中获取所述第一数据,其中,所述第一区块链为由包含数据项的交易信息生成的区块组成的。
  5. 根据权利要求1、2或3所述的方法,其特征在于,还包括:
    所述中心节点从第一网络节点获取所述第一数据的第一散列值关联信息, 所述关联信息包括以下至少一项:所述第一数据的索引值、所述第一数据的时间信息、发送所述第一数据的设备节点标识、发送所述第一数据的地址和接收所述第一数据的地址。
  6. 根据权利要求1、2或4所述的方法,其特征在于,还包括:
    所述中心节点从第二网络节点获取所述第一数据的关联信息,所述关联信息包括以下至少一项:所述第一数据的索引值、所述第一数据的时间信息、发送所述第一数据的设备节点标识、发送所述第一数据的地址和接收所述第一数据的地址。
  7. 根据权利要求1、2、3或5所述的方法,其特征在于,所述中心节点从第一网络节点获取第一数据的第一散列值之前,还包括:
    所述中心节点选择一个第一网络节点确定为目标第一网络节点;
    所述中心节点从第一网络节点获取第一数据的第一散列值,包括:
    所述中心节点从目标第一网络节点的第二区块链中获取第一数据的第一散列值。
  8. 根据权利要求7所述的方法,其特征在于,所述中心节点选择一个第一网络节点确定为目标第一网络节点,包括:
    所述中心节点从至少一个第一网络节点中选择一个满足第一合法条件的第一网络节点为目标第一网络节点;
    所述第一合法条件为:与所述目标第一网络节点的第二区块链的第一数据的第一散列值相同的节点数量超过第一阈值。
  9. 根据权利要求1、2、4或6所述的方法,其特征在于,所述中心节点从第二网络节点获取所述第一数据之前,还包括:
    所述中心节点选择一个第二网络节点确定为目标第二网络节点;
    所述中心节点从第二网络节点获取所述第一数据,包括:
    所述中心节点从所述目标第二网络节点的第一区块链中获取第一数据。
  10. 根据权利要求9所述的方法,其特征在于,所述中心节点选择一个第二网络节点确定为目标第二网络节点,包括:
    所述中心节点从至少一个第二网络节点中选择一个满足第二合法条件的网络节点为第二目标网络节点;
    所述第二合法条件为:与所述目标第二网络节点的第一区块链的第一数据相同的网络节点的数量超过第二阈值。
  11. 根据权利要求1-10任一项所述的方法,其特征在于,还包括:
    若确定所述第一数据是可信数据,则所述中心节点确定第三区块链的第i个交易信息满足生成条件,生成第三区块链的第i个交易信息;或者
    若确定所述第一数据是不可信数据,则所述中心节点确定所述第三区块链的第i个交易信息不满足所述生成条件,不生成所述第三区块链的第i个交易信息;或者
    若确定所述第一数据是不可信数据,则所述中心节点确定所述第三区块链的第j个交易信息满足生成条件,生成所述第三区块链的第j个交易信息。
  12. 一种数据处理方法,其特征在于,包括:
    网络节点根据至少一个第一交易信息,生成区块链的区块;
    所述第一交易信息包括以下至少一项对应的信息:交易标识项、生成所述第一交易信息的节点标识项、数据项、数据的索引值项、数据的散列值项、时间信息项、数据的发送方项和数据的接收方项。
  13. 根据权利要求12所述的方法,其特征在于,所述网络节点根据至少一个第一交易信息,生成区块链的区块之前,还包括:
    所述网络节点接收至少一个设备节点发送的数据信息;
    所述网络节点根据所述数据信息生成至少一个第一交易信息。
  14. 根据权利要求13所述的方法,其特征在于,所述数据信息包括以下至少一项:第一数据、所述第一数据的第一散列值、所述第一数据的索引值、所述第一数据的时间信息、发送所述数据信息的设备节点的标识、所述设备节 点的地址和所述网络节点的地址。
  15. 根据权利要求14所述的方法,其特征在于,还包括:
    若所述数据信息包括所述第一数据且未包括所述第一散列值,则所述网络节点计算所述第一数据的第一散列值;
    所述网络节点根据所述数据信息生成至少一个第一交易信息,包括:
    所述网络节点根据所述数据信息和所述第一散列值生成至少一个第一交易信息。
  16. 根据权利要求13-15任一项所述的方法,其特征在于,还包括:
    所述网络节点向其他网络节点或至少一个设备节点发送所述至少一个第一交易信息。
  17. 根据权利要求12-16任一项所述的方法,其特征在于,还包括:
    所述网络节点接收其他网络节点或者至少一个设备节点发送的至少一个第二交易信息;
    其中,所述第二交易信息包括以下至少一项对应的信息:交易标识项、生成所述第二交易信息的节点标识项、数据项、数据的索引值项、数据的散列值项、时间信息项、所述数据的发送方项和所述数据的接收方项。
  18. 根据权利要求12-17任一项所述的方法,其特征在于,还包括:
    若所述至少一个第一交易信息包含数据项,则所述网络节点根据所述至少一个第一交易信息,基于第一算法,生成第一区块链的区块。
  19. 根据权利要求17所述的方法,其特征在于,还包括:
    若所述至少一个第一交易信息包含数据项,且所述至少一个第二交易信息包含数据项,则所述网络节点根据所述至少一个第一交易信息和/或所述至少一个第二交易信息,基于第二算法,生成第一区块链的区块。
  20. 根据权利要求12-17任一项所述的方法,其特征在于,还包括:
    若所述至少一个第一交易信息包含数据的散列值项,则所述网络节点根据所述至少一个第一交易信息,基于第三算法,生成第二区块链的区块。
  21. 根据权利要求17所述的方法,其特征在于,还包括:
    若所述至少一个第一交易信息包含数据的散列值项,且所述至少一个第二交易信息包含数据的散列值项,则所述网络节点根据所述至少一个第一交易信息和/或所述至少一个第二交易信息,基于第四算法,生成第二区块链的区块。
  22. 根据权利要求17所述的方法,其特征在于,
    若所述至少一个第一交易信息包含数据项,则所述网络节点根据所述至少一个第一交易信息,基于第五算法,生成第一区块链的区块;和,若所述至少一个第一交易信息包含数据的散列值项,且所述至少一个第二交易信息包含数据的散列值项,则所述网络节点根据所述至少一个第一交易信息和/或所述至少一个第二交易信息,基于第六算法,生成第二区块链的区块;
    或者,
    若所述至少一个第一交易信息包含数据项,且所述至少一个第二交易信息包含数据项,则所述网络节点根据所述至少一个第一交易信息和/或所述至少一个第二交易信息,基于第七算法,生成第一区块链的区块;和,所述至少一个第一交易信息包含数据的散列值项,则所述网络节点根据所述至少一个第一交易信息,基于第八算法,生成第二区块链的区块。
  23. 根据权利要求18、19或22所述的方法,其特征在于,还包括:
    所述网络节点获取第一数据的第一散列值;
    所述网络节点从所述第一区块链获取所述第一数据,并计算所述第一数据的第二散列值;
    所述网络节点将所述第一散列值与所述第二散列值进行比对;
    若所述第一散列值与所述第二散列值相同,则所述网络节点确定所述第一数据是可信数据;或者,确定所述第一数据未被篡改;或者,确定所述第一数据的第一散列值是可信散列值;或,
    若所述第一散列值与所述第二散列值不相同,则所述网络节点确定所述第 一数据是不可信数据;或者,确定所述第一数据已被篡改;或者,确定所述第一数据的第一散列值是不可信散列值。
  24. 根据权利要求20、21或22所述的方法,其特征在于,还包括:
    所述网络节点从所述第二区块链获取所述第一数据的第一散列值;
    所述网络节点获取存储的所述第一数据,并计算所述第一数据的第二散列值;
    所述网络节点将所述第一散列值与所述第二散列值进行比对;
    若所述第一散列值与所述第二散列值相同,则所述网络节点确定所述第一数据是可信数据;或者,确定所述第一数据未被篡改;或者,确定所述第一数据的第一散列值是可信散列值;或,
    若所述第一散列值与所述第二散列值不相同,则所述网络节点确定所述第一数据是不可信数据;或者,确定所述第一数据已被篡改;或者,确定所述第一数据的第一散列值是不可信散列值。
  25. 根据权利要求22所述的方法,其特征在于,还包括:
    所述网络节点从所述第二区块链获取所述第一数据的第一散列值;
    所述网络节点从所述第一区块链获取所述第一数据,并计算所述第一数据的第二散列值;
    所述网络节点将所述第一散列值与所述第二散列值进行比对;
    若所述第一散列值与所述第二散列值相同,则所述网络节点确定所述第一数据是可信数据;或者,确定所述第一数据未被篡改;或者,确定所述第一数据的第一散列值是可信散列值;或,
    若所述第一散列值与所述第二散列值不相同,则所述网络节点确定所述第一数据是不可信数据;或者,确定所述第一数据已被篡改;或者,确定所述第一数据的第一散列值是不可信散列值。
  26. 根据权利要求13-25任一项所述的方法,其特征在于,还包括:
    所述网络节点向中心节点发送所述数据信息或者区块链的区块。
  27. 根据权利要求12-26任一项所述的方法,其特征在于,所述网络节点根据至少一个第一交易信息,生成区块链的区块之后,还包括:
    所述网络节点向所述至少一个设备节点发送第一通知消息,所述第一通知消息用于通知设备节点已生成区块链的区块的消息。
  28. 根据权利要求13-26任一项所述的方法,其特征在于,还包括:
    所述网络节点向设备节点发送第一删除消息,所述第一删除消息为用于指示所述设备节点删除所述数据信息或者删除区块的指示消息。
  29. 根据权利要求13-28任一项所述的方法,其特征在于,还包括:
    所述网络节点接收所述至少一个设备节点发送的第二删除消息,所述第二删除消息为所述至少一个设备节点用于请求删除所述数据信息或者删除区块。
  30. 根据权利要求12-29所述的方法,其特征在于,还包括:
    所述网络节点从目标区块链中确定待删除区块,所述目标区块链为所述网络节点所存储的任意一个区块链。
  31. 根据权利要求27-30任一项所述的方法,其特征在于,还包括:
    所述网络节点将所述区块链的区块包含的多个交易信息发送至上一级网络节点。
  32. 根据权利要求27-31任一项所述的方法,其特征在于,还包括:
    所述网络节点将所述目标区块链中的所述待删除区块进行删除。
  33. 根据权利要求30-32所述的方法,其特征在于,还包括:
    所述网络节点记录所述待删除区块的区块头内容。
  34. 根据权利要求30所述的方法,其特征在于,所述网络节点从目标区块链中确定待删除区块,包括:
    按照预设删除规则,从目标区块链中确定待删除区块;
    其中,所述预设删除规则为:所述网络节点存储所述目标区块链的区块个数大于预设阈值,或者所述待删除区块为生成时间时长超过时间阈值的区块,或者,所述待删除区块为区块序号小于序号阈值的区块。
  35. 一种数据处理方法,其特征在于,包括:
    设备节点向网络节点发送一个或者多个数据信息,所述数据信息包括以下至少一项:第一数据、所述第一数据的第一散列值、所述第一数据的索引值、所述第一数据的时间信息、发送所述数据信息的设备节点的标识、所述设备节点的地址和所述网络节点的地址;
    所述数据信息用于所述网络节点生成第一交易信息;
    或者,
    设备节点根据一个或者多个数据信息,生成至少一个第二交易信息,并将所述至少一个第二交易信息发送至网络节点;
    所述第二交易信息包括以下至少一项对应的信息:数据项、数据的索引值项、数据的散列值项、时间信息项、数据的发送方项和数据的接收方项。
  36. 根据权利要求35所述的方法,其特征在于,还包括:
    所述设备节点接收网络节点发送的区块链第一通知消息,所述第一通知消息用于通知所述网络节点已经根据所述数据信息生成区块链的区块的消息。
  37. 根据权利要求35或36所述的方法,其特征在于,还包括:
    所述设备节点接收网络节点发送的区块。
  38. 根据权利要求35-37任一项所述的方法,其特征在于,还包括:
    所述设备节点接收到所述网络节点发送第一删除消息,所述第一删除消息为用于指示所述设备节点删除所述数据信息或者删除区块的指示消息。
  39. 根据权利要求35-38任一项所述的方法,其特征在于,还包括:
    所述设备节点向所述网络节点发送的第二删除消息,所述第二删除消息用于请求删除所述数据信息或者删除区块。
  40. 根据权利要求35-39任意项所述的方法,其特征在于,还包括:
    所述设备节点删除所述数据信息。
  41. 根据权利要求40所述的方法,其特征在于,所述设备节点删除数据信息,包括:
    所述设备节点将生成时长超过第一时间阈值的数据信息进行删除。
  42. 一种中心节点,其特征在于,包括:
    获取模块,用于从第一网络节点获取第一数据的第一散列值;
    计算模块,用于从第二网络节点获取所述第一数据,并计算所述第一数据的第二散列值;
    比对模块,用于将所述第一散列值与所述第二散列值进行比对;
    确定模块,用于若所述第一散列值与所述第二散列值相同,则确定所述第一数据是可信数据;或者,确定所述第一数据未被篡改;或者,确定所述第一数据的第一散列值是可信散列值。
  43. 根据权利要求42所述的中心节点,其特征在于,
    所述确定模块,还用于若所述第一散列值与所述第二散列值不相同,则确定所述第一数据是不可信数据;或者,确定所述第一数据已被篡改;或者,确定所述第一数据的第一散列值是不可信散列值。
  44. 根据权利要求42或43所述的中心节点,其特征在于,所述获取模块具体用于:
    从第一网络节点的第二区块链中获取第一数据对应的第一散列值;其中,所述第二区块链为由包含数据的散列值项的交易信息生成的区块组成的。
  45. 根据权利要求43或43所述的中心节点,其特征在于,所述计算模块具体用于:
    从第二网络节点的第一区块链中的所述第一数据,其中,所述第一区块链 为由包含数据项的交易信息生成的区块组成的。
  46. 根据权利要求42、43或44所述的中心节点,其特征在于,
    所述获取模块,还用于从第一网络节点获取所述第一数据的第一散列值关联信息,所述关联信息包括以下至少一项:所述第一数据的索引值、所述第一数据的时间信息、发送所述第一数据的设备节点标识、发送所述第一数据的地址和接收所述第一数据的地址。
  47. 根据权利要求42、43或45所述的中心节点,其特征在于,
    所述获取模块,还用于从第二网络节点获取所述第一数据的关联信息,所述关联信息包括以下至少一项:所述第一数据的索引值、所述第一数据的时间信息、发送所述第一数据的设备节点标识、发送所述第一数据的地址和接收所述第一数据的地址。
  48. 根据权利要求42、43、44或46所述的中心节点,其特征在于,
    所述确定模块,还用于选择一个第一网络节点确定为目标第一网络节点;
    所述获取模块具体用于从目标第一网络节点的第二区块链中获取第一数据的第一散列值。
  49. 根据权利要求48所述的中心节点,其特征在于,在选择一个第一网络节点确定为目标第一网络节点方面,所述确定模块具体用于从至少一个第一网络节点中选择一个满足第一合法条件的第一网络节点为目标第一网络节点;
    所述第一合法条件为:与所述目标第一网络节点的第二区块链的第一数据的第一散列值相同的节点数量超过第一阈值。
  50. 根据权利要求42、43、45或47所述的中心节点,其特征在于,
    所述确定模块,还用于选择一个第二网络节点确定为目标第二网络节点;
    所述获取模块具体用于从所述目标第二网络节点的第一区块链中获取第一数据。
  51. 根据权利要求50所述的中心节点,其特征在于,在选择一个第二网络节点确定为目标第二网络节点方面,所述确定模块具体用于从至少一个第二网络节点中选择一个满足第二合法条件的网络节点为第二目标网络节点;
    所述第二合法条件为:与所述目标第二网络节点的第一区块链的第一数据相同的网络节点的数量超过第二阈值。
  52. 根据权利要求42-51任一项所述的中心节点,其特征在于,还包括:
    生成模块,用于若确定所述第一数据是可信数据,则确定第三区块链的第i个交易信息满足生成条件,生成第三区块链的第i个交易信息;或者
    所述生成模块,还用于若确定所述第一数据是不可信数据,则确定所述第三区块链的第i个交易信息不满足所述生成条件,不生成所述第三区块链的第i个交易信息;或者
    所述生成模块,还用于若确定所述第一数据是不可信数据,则确定所述第三区块链的第j个交易信息满足生成条件,生成所述第三区块链的第j个交易信息。
  53. 一种网络节点,其特征在于,包括:
    区块生成模块,用于根据至少一个第一交易信息,生成区块链的区块;
    所述第一交易信息包括以下至少一项对应的信息:交易标识项、生成所述第一交易信息的节点标识项、数据项、数据的索引值项、数据的散列值项、时间信息项、数据的发送方项和数据的接收方项。
  54. 根据权利要求53所述的网络节点,其特征在于,还包括:
    第一信息接收模块,用于接收至少一个设备节点发送的数据信息;
    信息生成模块,用于根据所述数据信息生成至少一个第一交易信息。
  55. 根据权利要求54所述的网络节点,其特征在于,所述数据信息包括以下至少一项:第一数据、所述第一数据的第一散列值、所述第一数据的索引值、所述第一数据的时间信息、发送所述数据信息的设备节点的标识、所述设备节点的地址和所述网络节点的地址。
  56. 根据权利要求55所述的网络节点,其特征在于,还包括:
    计算模块,用于若所述数据信息包括所述第一数据且未包括所述第一散列值,则计算所述第一数据的第一散列值;
    所述信息生成模块具体用于根据所述数据信息和所述第一散列值生成至少一个第一交易信息。
  57. 根据权利要求54-56任一项所述的网络节点,其特征在于,还包括:
    第一信息发送模块,用于向其他网络节点或至少一个设备节点发送所述至少一个第一交易信息。
  58. 根据权利要求53-57任一项所述的网络节点,其特征在于,还包括:
    第二信息接收模块,用于接收其他网络节点或者至少一个设备节点发送的至少一个第二交易信息;
    其中,所述第二交易信息包括以下至少一项对应的信息:交易标识项、生成所述第二交易信息的节点标识项、数据项、数据的索引值项、数据的散列值项、时间信息项、所述数据的发送方项和所述数据的接收方项。
  59. 根据权利要求53-58任一项所述的网络节点,其特征在于,
    所述区块生成模块,还用于若所述至少一个第一交易信息包含数据项,则根据所述至少一个第一交易信息,基于第一算法,生成第一区块链的区块。
  60. 根据权利要求58所述的网络节点,其特征在于,
    所述区块生成模块,还用于若所述至少一个第一交易信息包含数据项,且所述至少一个第二交易信息包含数据项,则根据所述至少一个第一交易信息和/或所述至少一个第二交易信息,基于第二算法,生成第一区块链的区块。
  61. 根据权利要求53-58任一项所述的网络节点,其特征在于
    所述区块生成模块,还用于若所述至少一个第一交易信息包含数据的散列值项,则根据所述至少一个第一交易信息,基于第三算法,生成第二区块链的 区块。
  62. 根据权利要求58所述的网络节点,其特征在于,
    所述区块生成模块,还用于若所述至少一个第一交易信息包含数据的散列值项,且所述至少一个第二交易信息包含数据的散列值项,则根据所述至少一个第一交易信息和/或所述至少一个第二交易信息,基于第四算法,生成第二区块链的区块。
  63. 根据权利要求58所述的网络节点,其特征在于,
    所述区块生成模块,还用于若所述至少一个第一交易信息包含数据项,则根据所述至少一个第一交易信息,基于第五算法,生成第一区块链的区块;和,若所述至少一个第一交易信息包含数据的散列值项,且所述至少一个第二交易信息包含数据的散列值项,则根据所述至少一个第一交易信息和/或所述至少一个第二交易信息,基于第六算法,生成第二区块链的区块;
    或者,
    所述区块生成模块,还用于若所述至少一个第一交易信息包含数据项,且所述至少一个第二交易信息包含数据项,则根据所述至少一个第一交易信息和/或所述至少一个第二交易信息,基于第七算法,生成第一区块链的区块;和,所述至少一个第一交易信息包含数据的散列值项,则根据所述至少一个第一交易信息,基于第八算法,生成第二区块链的区块。
  64. 根据权利要求59、60或63所述的网络节点,其特征在于,还包括:
    第一获取模块,用于获取第一数据的第一散列值;
    所述第一获取模块,还用于从所述第一区块链获取所述第一数据,并计算所述第一数据的第二散列值;
    第一比对模块,用于将所述第一散列值与所述第二散列值进行比对;
    第一确定模块,用于若所述第一散列值与所述第二散列值相同,则确定所述第一数据是可信数据;或者,确定所述第一数据未被篡改;或者,确定所述第一数据的第一散列值是可信散列值;或,
    所述第一确定模块,还用于若所述第一散列值与所述第二散列值不相同, 则确定所述第一数据是不可信数据;或者,确定所述第一数据已被篡改;或者,确定所述第一数据的第一散列值是不可信散列值。
  65. 根据权利要求61、62或63所述的网络节点,其特征在于,还包括:
    第二获取模块,用于从所述第二区块链获取所述第一数据的第一散列值;
    所述第二获取模块,还用于获取存储的所述第一数据,并计算所述第一数据的第二散列值;
    第二比对模块,用于将所述第一散列值与所述第二散列值进行比对;
    第二确定模块,用于若所述第一散列值与所述第二散列值相同,则确定所述第一数据是可信数据;或者,确定所述第一数据未被篡改;或者,确定所述第一数据的第一散列值是可信散列值;或,
    所述第二确定模块,还用于若所述第一散列值与所述第二散列值不相同,则确定所述第一数据是不可信数据;或者,确定所述第一数据已被篡改;或者,确定所述第一数据的第一散列值是不可信散列值。
  66. 根据权利要求63所述的网络节点,其特征在于,还包括:
    第三获取模块,用于从所述第二区块链获取所述第一数据的第一散列值;
    所述第三获取模块,还用于从所述第一区块链获取所述第一数据,并计算所述第一数据的第二散列值;
    第三比对模块,用于将所述第一散列值与所述第二散列值进行比对;
    第三确定模块,用于若所述第一散列值与所述第二散列值相同,则确定所述第一数据是可信数据;或者,确定所述第一数据未被篡改;或者,确定所述第一数据的第一散列值是可信散列值;或,
    所述第三确定模块,还用于若所述第一散列值与所述第二散列值不相同,则确定所述第一数据是不可信数据;或者,确定所述第一数据已被篡改;或者,确定所述第一数据的第一散列值是不可信散列值。
  67. 根据权利要求54-66任一项所述的网络节点,其特征在于,还包括:
    区块发送模块,用于向中心节点发送所述数据信息或者区块链的区块。
  68. 根据权利要求53-67任一项所述的网络节点,其特征在于,还包括:
    通知消息发送模块,用于向所述至少一个设备节点发送第一通知消息,所述第一通知消息用于通知设备节点已生成区块链的区块的消息。
  69. 根据权利要求54-67任一项所述的网络节点,其特征在于,还包括:
    删除消息发送模块,用于向设备节点发送第一删除消息,所述第一删除消息为用于指示所述设备节点删除所述数据信息或者删除区块的指示消息。
  70. 根据权利要求54-69任一项所述的网络节点,其特征在于,还包括:
    删除消息接收模块,还用于接收所述至少一个设备节点发送的第二删除消息,所述第二删除消息为所述至少一个设备节点用于请求删除所述数据信息或者删除区块。
  71. 根据权利要求53-70所述的网络节点,其特征在于,还包括:
    删除区块确定模块,用于从目标区块链中确定待删除区块,所述目标区块链为所述网络节点所存储的任意一个区块链。
  72. 根据权利要求53-71任一项所述的网络节点,其特征在于,
    第二信息发送模块,还用于将所述区块链的区块包含的多个交易信息发送至上一级网络节点。
  73. 根据权利要求68-72任一项所述的网络节点,其特征在于,还包括
    删除模块,用于将所述目标区块链中的所述待删除区块进行删除。
  74. 根据权利要求71-73所述的网络节点,其特征在于,还包括:
    记录模块,用于记录所述待删除区块的区块头内容。
  75. 根据权利要求71所述的网络节点,其特征在于,所述删除模块,具体用于按照预设删除规则,从目标区块链中确定待删除区块;
    其中,所述预设删除规则为:所述网络节点存储所述目标区块链的区块个 数大于预设阈值,或者所述待删除区块为生成时间时长超过时间阈值的区块,或者,所述待删除区块为区块序号小于序号阈值的区块。
  76. 一种设备节点,其特征在于,包括:
    发送模块,用于向网络节点发送一个或者多个数据信息,所述数据信息包括以下至少一项:第一数据、所述第一数据的第一散列值、所述第一数据的索引值、所述第一数据的时间信息、发送所述数据信息的设备节点的标识、所述设备节点的地址和所述网络节点的地址;
    所述数据信息用于所述网络节点生成第一交易信息;
    或者,
    生成模块,用于根据一个或者多个数据信息,生成至少一个第二交易信息,并将所述至少一个第二交易信息发送至网络节点;
    所述第二交易信息包括以下至少一项对应的信息:数据项、数据的索引值项、数据的散列值项、时间信息项、数据的发送方项和数据的接收方项。
  77. 根据权利要求76所述的设备节点,其特征在于,还包括:
    第一接收模块,用于接收网络节点发送的区块链第一通知消息,所述第一通知消息用于通知所述网络节点已经根据所述数据信息生成区块链的区块的消息。
  78. 根据权利要求76或77所述的设备节点,其特征在于,还包括:
    第二接收模块,用于接收网络节点发送的区块。
  79. 根据权利要求76-78任一项所述的设备节点,其特征在于,还包括:
    第三接收模块,用于接收到所述网络节点发送第一删除消息,所述第一删除消息为用于指示所述设备节点删除所述数据信息或者删除区块的指示消息。
  80. 根据权利要求76-79任一项所述的设备节点,其特征在于,
    所述发送模块,还用于向所述网络节点发送的第二删除消息,所述第二删除消息用于请求删除所述数据信息或者删除区块。
  81. 根据权利要求76-80任意项所述的设备节点,其特征在于,还包括:
    删除模块,用于删除所述数据信息。
  82. 根据权利要求81所述的设备节点,其特征在于,所述删除模块具体用于将生成时长超过第一时间阈值的数据信息进行删除。
PCT/CN2017/000082 2017-01-03 2017-01-03 一种数据处理方法及相关设备 WO2018126344A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2017/000082 WO2018126344A1 (zh) 2017-01-03 2017-01-03 一种数据处理方法及相关设备
CN201780074039.XA CN110023944B (zh) 2017-01-03 2017-01-03 通信方法及终端设备、核心网设备

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/000082 WO2018126344A1 (zh) 2017-01-03 2017-01-03 一种数据处理方法及相关设备

Publications (1)

Publication Number Publication Date
WO2018126344A1 true WO2018126344A1 (zh) 2018-07-12

Family

ID=62788947

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/000082 WO2018126344A1 (zh) 2017-01-03 2017-01-03 一种数据处理方法及相关设备

Country Status (2)

Country Link
CN (1) CN110023944B (zh)
WO (1) WO2018126344A1 (zh)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020036682A1 (en) * 2018-08-14 2020-02-20 Microsoft Technology Licensing, Llc Blockchain digital twin
GB2577751A (en) * 2018-10-05 2020-04-08 Dragon Infosec Ltd A consensus method and framework for a blockchain system
CN111212126A (zh) * 2019-12-27 2020-05-29 百度在线网络技术(北京)有限公司 一种区块链网络的数据传输方法、装置、设备和介质
WO2020134698A1 (zh) * 2018-12-25 2020-07-02 阿里巴巴集团控股有限公司 一种操作请求分配方法、装置及设备
GB2587541A (en) * 2018-10-05 2021-03-31 Dragon Infosec Ltd A consensus method and framework for a blockchain system
CN113225191A (zh) * 2021-03-24 2021-08-06 湖南宸瀚信息科技有限责任公司 共识节点的生成方法、装置、存储介质及处理器
WO2022261649A3 (en) * 2021-06-08 2023-01-19 Artema Labs, Inc Composite cryptographic systems with variable configuration parameters and memory bound functions
US11868509B2 (en) * 2017-11-17 2024-01-09 Telefonaktiebolaget Lm Ericsson (Publ) Method and arrangement for detecting digital content tampering

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104468548A (zh) * 2014-11-28 2015-03-25 华为技术有限公司 一种数据验证的方法、灾备存储器和生产存储器
CN105610578A (zh) * 2016-01-25 2016-05-25 杭州复杂美科技有限公司 区块链信息存证及隐私保护方法
CN105761143A (zh) * 2016-02-01 2016-07-13 上海凭安网络科技有限公司 一种基于区块链的多方共建信用记录的方法
CN105912618A (zh) * 2016-04-07 2016-08-31 浙江万马新能源有限公司 基于区块链的充电桩充电交易通讯方法及装置
CN106230851A (zh) * 2016-08-29 2016-12-14 中金云金融(北京)大数据科技股份有限公司 基于区块链的数据保全方法及系统
CN106650494A (zh) * 2016-12-16 2017-05-10 杭州嘉楠耘智信息科技有限公司 一种数据处理方法及装置

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4176533B2 (ja) * 2003-03-31 2008-11-05 株式会社エヌ・ティ・ティ・ドコモ 端末装置及びプログラム
US7796990B2 (en) * 2006-09-14 2010-09-14 Nokia Corporation Method for the routing of multimedia communication related signaling in a communication system
CN101599994B (zh) * 2009-06-01 2012-07-18 中兴通讯股份有限公司 分布式文件系统、接入节点及节点间传输文件数据的方法
CN101853190B (zh) * 2010-06-04 2012-07-04 华中科技大学 一种适用于嵌入式处理器的数据完整性验证方法
CN102355663B (zh) * 2011-06-30 2014-08-20 北京交通大学 基于分离机制网络的可信域间快速认证方法
GB201112360D0 (en) * 2011-07-18 2011-08-31 Skype Ltd Distributing information
CN102955808A (zh) * 2011-08-26 2013-03-06 腾讯科技(深圳)有限公司 一种数据获取方法和分布式文件系统
CN103902617B (zh) * 2012-12-28 2017-06-09 华为技术有限公司 分布式数据库同步方法和系统
CN104168563B (zh) * 2014-08-15 2017-06-27 西安电子科技大学 一种基于本地信誉存储的k‑匿名激励方法
KR101600717B1 (ko) * 2014-12-04 2016-03-07 한양대학교 산학협력단 P2p 방식의 가상머신 운영체제 이미지 다운로드 방법 및 장치
CN105812391A (zh) * 2016-05-16 2016-07-27 广州鼎鼎信息科技有限公司 一种安全的云存储系统
CN106060036B (zh) * 2016-05-26 2019-07-16 布比(北京)网络技术有限公司 去中心化共识方法及装置
CN106201338B (zh) * 2016-06-28 2019-10-22 华为技术有限公司 数据存储方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104468548A (zh) * 2014-11-28 2015-03-25 华为技术有限公司 一种数据验证的方法、灾备存储器和生产存储器
CN105610578A (zh) * 2016-01-25 2016-05-25 杭州复杂美科技有限公司 区块链信息存证及隐私保护方法
CN105761143A (zh) * 2016-02-01 2016-07-13 上海凭安网络科技有限公司 一种基于区块链的多方共建信用记录的方法
CN105912618A (zh) * 2016-04-07 2016-08-31 浙江万马新能源有限公司 基于区块链的充电桩充电交易通讯方法及装置
CN106230851A (zh) * 2016-08-29 2016-12-14 中金云金融(北京)大数据科技股份有限公司 基于区块链的数据保全方法及系统
CN106650494A (zh) * 2016-12-16 2017-05-10 杭州嘉楠耘智信息科技有限公司 一种数据处理方法及装置

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11868509B2 (en) * 2017-11-17 2024-01-09 Telefonaktiebolaget Lm Ericsson (Publ) Method and arrangement for detecting digital content tampering
WO2020036682A1 (en) * 2018-08-14 2020-02-20 Microsoft Technology Licensing, Llc Blockchain digital twin
US11038950B2 (en) 2018-08-14 2021-06-15 Microsoft Technology Licensing, Llc Blockchain digital twin for transactions on behalf of limited capability devices
GB2577751A (en) * 2018-10-05 2020-04-08 Dragon Infosec Ltd A consensus method and framework for a blockchain system
GB2587541A (en) * 2018-10-05 2021-03-31 Dragon Infosec Ltd A consensus method and framework for a blockchain system
WO2020134698A1 (zh) * 2018-12-25 2020-07-02 阿里巴巴集团控股有限公司 一种操作请求分配方法、装置及设备
US11212371B2 (en) 2018-12-25 2021-12-28 Advanced New Technologies Co., Ltd. Operation request allocation methods, apparatuses, and devices
CN111212126A (zh) * 2019-12-27 2020-05-29 百度在线网络技术(北京)有限公司 一种区块链网络的数据传输方法、装置、设备和介质
CN111212126B (zh) * 2019-12-27 2023-05-26 百度在线网络技术(北京)有限公司 一种区块链网络的数据传输方法、装置、设备和介质
CN113225191A (zh) * 2021-03-24 2021-08-06 湖南宸瀚信息科技有限责任公司 共识节点的生成方法、装置、存储介质及处理器
CN113225191B (zh) * 2021-03-24 2024-02-13 湖南宸瀚信息科技有限责任公司 共识节点的生成方法、装置、存储介质及处理器
WO2022261649A3 (en) * 2021-06-08 2023-01-19 Artema Labs, Inc Composite cryptographic systems with variable configuration parameters and memory bound functions

Also Published As

Publication number Publication date
CN110023944A (zh) 2019-07-16
CN110023944B (zh) 2021-12-28

Similar Documents

Publication Publication Date Title
WO2018126344A1 (zh) 一种数据处理方法及相关设备
US10853812B2 (en) Blockchain transaction safety
AU2017336924B2 (en) Immutable cryptographically secured ledger-backed databases
TWI727292B (zh) 區塊鏈交易方法及裝置、電子設備
US9754259B2 (en) Systems and methods for identifying illegitimate activities based on historical data
WO2020119294A1 (zh) 数据共享方法、装置及系统、电子设备
WO2020001105A1 (zh) 基于区块链的数据验证方法及装置、电子设备
CN109359971B (zh) 区块链交易方法及装置、电子设备
WO2020134624A1 (zh) 一种联盟链的可信度验证方法、系统、装置及设备
US20160342977A1 (en) Device, method and system for virtual asset transactions
US10091230B1 (en) Aggregating identity data from multiple sources for user controlled distribution to trusted risk engines
US7788729B2 (en) Method and system for integrating multiple identities, identity mechanisms and identity providers in a single user paradigm
US11048690B2 (en) Contribution of multiparty data aggregation using distributed ledger technology
WO2016029794A1 (zh) 识别特征账号的方法及装置
TWI719422B (zh) 基於區塊鏈存證的識別雙方證據真實性的方法及裝置
US20210158353A1 (en) Methods, systems, apparatuses, and devices for processing request in consortium blockchain
US11809896B2 (en) Anomalous transaction commitment prevention for database
WO2020134627A1 (zh) 联盟链的可信度验证方法、系统、装置及设备
TWI706362B (zh) 基於區塊鏈的資料處理方法、裝置和伺服器
EP3779816A1 (en) Method and device for recognizing validity of evidence based on blockchain evidence deposition
US11579919B2 (en) Anomalous transaction detection for database
CN114091045A (zh) 保护隐私的信息查询方法、装置、系统、设备及存储介质
US20210126787A1 (en) Optimal endorser node determination based on state
CN111539033A (zh) 一种在区块链中实现数据计算可信的方法及系统
Pattanayak et al. Accounting for impacts due to climate change in GHG mitigation burden sharing

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: 17889783

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: 17889783

Country of ref document: EP

Kind code of ref document: A1