WO2018126340A1 - Blockchain-based data processing method, device and system - Google Patents

Blockchain-based data processing method, device and system Download PDF

Info

Publication number
WO2018126340A1
WO2018126340A1 PCT/CN2017/000052 CN2017000052W WO2018126340A1 WO 2018126340 A1 WO2018126340 A1 WO 2018126340A1 CN 2017000052 W CN2017000052 W CN 2017000052W WO 2018126340 A1 WO2018126340 A1 WO 2018126340A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
blockchain network
hash value
information
authenticated
Prior art date
Application number
PCT/CN2017/000052
Other languages
French (fr)
Chinese (zh)
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 CN201780081904.3A priority Critical patent/CN110121860B/en
Priority to PCT/CN2017/000052 priority patent/WO2018126340A1/en
Publication of WO2018126340A1 publication Critical patent/WO2018126340A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials

Definitions

  • the embodiments of the present application relate to the field of communications, and in particular, to a blockchain-based data processing method, device, and system.
  • the Internet of Things realizes information exchange and communication by applying computer technologies such as intelligent sensing, recognition technology and pervasive computing. According to the prediction of relevant institutions, the number of IoT devices in the world will reach 25 billion units in 2020. With the normal number of devices in the Internet of Things, if the IoT devices are managed in the traditional centralized network mode, huge investment in data center infrastructure construction and maintenance will be brought. In addition, there is a security risk in a centralized network model.
  • the present application provides a data processing method, device and system based on a blockchain, which can reduce the construction and maintenance cost of the communication system and improve the security performance of the system.
  • a data processing method based on a blockchain including: establishing, by a first device, a communication connection with a second device, where the second device is a device in a blockchain network; The first data generated by the first device needs to be authenticated in the blockchain network; the first device sends the first data to the second device to implement the first data by the The devices in the blockchain network are authenticated.
  • the first device sends the first data to the second device in the blockchain network when generating the first data that needs to be authenticated in the blockchain network.
  • the second device is caused to send the first data to the device in the blockchain network to implement authentication of the first data.
  • the construction and maintenance costs of the communication system can be reduced, and the security performance of the system can be improved.
  • the second device sends the data of the first device to the device in the blockchain network for authentication, which can reduce the capability requirement for the first device.
  • the authentication refers to blockchain consensus authentication or consistency authentication.
  • the first device may be an Internet of Things device, and the first device is not a device in a blockchain network.
  • the first device does not need to authenticate the data by a formula algorithm.
  • the second device sends the first data to the device in the blockchain network by means of broadcast sending, and all devices (including the second device) in the blockchain network can obtain the authentication right, and perform the first data. Certification.
  • the first device establishes a communication connection with the second device, where the first device sends the first public key to the second device
  • the first message the first message includes first information, the first public key is a public key of the second device, and the first information is used to request the second device to be the first Data generated by the device that needs to be authenticated in the blockchain network is sent to a device in the blockchain network for authentication;
  • the first device receives second information sent by the second device, where the The second information is used to indicate that the second device confirms that the data generated by the first device that needs to be authenticated in the blockchain network is sent to a device in the blockchain network for authentication.
  • the first message further includes a second public key, where the second public key is a public key of the first device.
  • the method before the first device establishes a communication connection with the second device, the method further includes: the first device receiving the The third information sent by the second device, where the third information includes a first hash HASH value requirement; the first device generates a first HASH value that meets the first HASH value requirement.
  • the chain network has better scalability and supports access of devices with different needs.
  • the third information includes at least one HASH value requirement, where the at least one HASH value requirement includes the first HASH value requirement , each HASH value in the at least one HASH value requirement Requirement to correspond to at least one type of business;
  • the method further includes: determining, by the first device, the first device according to the service type corresponding to the first data, before the first device generates the first HASH value that meets the first HASH value requirement. A HASH value.
  • the hash value of the embodiment of the present application is related to the service type, so that different access delay requirements and authentication delay requirements of the device can be met.
  • the third information includes at least one HASH value requirement, where the at least one HASH value requirement includes the first HASH value requirement And each of the at least one HASH value requirement corresponds to at least one device group;
  • the method further includes: determining, by the first device, the first device according to the device group to which the first device belongs A HASH value.
  • the second device groups the devices, grouping according to the computing capability of the device, or grouping according to the service type of the device.
  • the hash value of the embodiment of the present application is related to the device group, so that different access delay requirements and authentication delay requirements of the device can be met.
  • the method further includes: the first device sending, to the third device, a second HASH value related to the first data, The second HASH value is used by the third device to determine the integrity of the second data, and the second data is the data after the first data is authenticated in the blockchain network.
  • the integrity of the data is used to indicate whether the data is lost or tampered with during the authentication process in the blockchain network.
  • the third device is an Internet of Things device, and the third device is not a device in a blockchain network.
  • the first data is data related to the first device and the third device, for example, the first data is transaction data between the first device and the third device.
  • the first data is data related to the first device and other IoT devices, for example, the first data is transaction data between the first device and other IoT devices.
  • the second device can directly calculate the hash value of the second data, and then compare whether the calculated hash value and the received hash value are consistent.
  • the second data is first Decryption is performed, and then the hash value of the decrypted data is calculated, and then the calculated hash value is compared with the received hash value.
  • the first data is encrypted by a public key of the third device.
  • the third device may directly calculate the hash value of the second data, and then compare the calculated hash value with the received hash value. To determine the integrity of the second data.
  • the method further includes:
  • the first device determines the second HASH value according to the first data.
  • the first data is encrypted by a public key of the third device
  • the method further includes: the first device The third device sends the first data, so that the third device determines the integrity of the second data according to the second HASH value after determining the second HASH value according to the first data, and second The data is the authenticated data of the first data in the blockchain network.
  • the third device acquires the second data, the advancedity is decrypted, and then the hash value of the decrypted data is calculated, and then the calculated value is obtained.
  • the hash value of the decrypted data is compared to the second HASH value to determine the integrity of the second data.
  • the third device may directly calculate the hash value of the second data, and then compare the calculated hash value with the second HASH value to Determine the integrity of the second data.
  • the first data is not encrypted by the public key of the third device. If the second data is also not encrypted by the public key of the third device, the third device directly calculates the hash value of the second data. The calculated hash value of the second data is then compared with the second HASH value to determine the integrity of the second data.
  • the first data is not encrypted by the public key of the third device
  • the second data is After the public key of the three devices is encrypted
  • the third device decrypts the second data, and then calculates the hash value of the decrypted data, and then performs the calculated hash value of the encrypted data and the second HASH value. Contrast to determine the integrity of the second data.
  • the method further includes: the first device receiving fourth information sent by the second device, where the fourth information is used by And indicating that the first data has been authenticated N times in the blockchain network, and the value of N is a preset value.
  • the method further includes: the first device receiving a Merkel Merkle tree corresponding to the second data sent by the second device Information and block information, the second data is the authenticated data of the first data in the blockchain network, and the block information is used to indicate a region carrying the second data in the blockchain network. Piece.
  • the first device may learn that the first data has been completely N times authenticated in the blockchain network.
  • the block information is the height of the block or the identity of the block.
  • the method further includes: the first device determining to delete the second data from the blockchain network, where the second data is The first data is authenticated data in the blockchain network; the first device sends fifth information to a device in the blockchain network, and the fifth information is used to indicate the area A device in the blockchain network deletes the second data from the blockchain network.
  • the blockchain-based data processing method of the embodiment of the present application can delete data stored in the blockchain network according to requirements, thereby reducing network load and reducing transmission bandwidth required for transmission of the blockchain.
  • the fifth information includes the identifier information and/or the Merkle tree information corresponding to the second data, where the identifier information is used to identify the first Two data.
  • the method further includes: deleting, by the first device, the first data that is locally stored by the first device.
  • a second aspect provides a data processing method based on a blockchain, including: establishing, by a second device, a communication connection with a first device, where the second device is a device in a blockchain network; Receiving, by the first device, first data generated by the first device that needs to be authenticated in the blockchain network; the second device sending the information to a device in the blockchain network The first data, the authentication of the first data is implemented.
  • the second device receives the first data generated by the first device that needs to be authenticated in the blockchain network, and sends the first data to the blockchain network.
  • the device implements the authentication of the first data.
  • the construction and maintenance costs of the communication system can be reduced, and the security performance of the system can be improved.
  • the second device sends the data of the first device to the device in the blockchain network for authentication, which can reduce the capability requirement for the first device.
  • the second device establishes a communication connection with the first device, where the second device receives the first public a first message that is encrypted by the key, the first message includes first information, the first public key is a public key of the second device, and the first information is used to request the second device to
  • the data generated by the first device that needs to be authenticated in the blockchain network is sent to the device in the blockchain network for authentication; the second device sends the second information to the first device.
  • the second information is used to indicate that the second device confirms that the data generated by the first device that needs to be authenticated in the blockchain network is sent to a device in the blockchain network for authentication.
  • the first message further includes a second public key, where the second public key is a public key of the first device.
  • the second device sends the second information to the first device, including: the second device to the first device Sending the second information encrypted by the second public key.
  • the method further includes: the second device generating a preset The number of digital currencies.
  • the method further includes: the second device sending the related information of the digital currency to a device in the blockchain network And if the second device determines that the digital currency has undergone M authentication in the blockchain network, the second device confirms that the digital currency is valid, and the value of M is a preset value.
  • the second device receives, by the first device, the need generated by the first device in the block
  • the first data that is authenticated in the chain network includes: the second device receives a block that is sent by the first device and that carries the first data;
  • the second device sends the first data to a device in the blockchain network, including: the second device Generating, according to the block format required by the blockchain network, a block that carries the first data; the second device sends the area that carries the first data to a device in the blockchain network Piece.
  • the method before the second device establishes a communication connection with the first device, the method further includes: determining, by the second device a first hash HASH value request; the second device sends third information to the first device, where the third information includes the first HASH value requirement, so that the first device meets the generation After the first HASH value required by the first HASH value, a communication connection is established with the second device.
  • the chain network has better scalability and supports access of devices with different needs.
  • the third information includes at least one HASH value requirement, where the at least one HASH value requirement includes the first HASH value requirement And each of the at least one HASH value requirement corresponds to at least one service type;
  • the determining, by the second device, the first hash HASH value request includes: determining, by the second device, the at least one HASH value requirement.
  • the hash value of the embodiment of the present application is related to the service type, so that different access delay requirements and authentication delay requirements of the device can be met.
  • the third information includes at least one HASH value requirement, where the at least one HASH value requirement includes the first HASH value requirement And each of the at least one HASH value requirement corresponds to at least one device group;
  • the second device determines a first hash HASH value requirement, including: the second device Determining the at least one HASH value requirement.
  • the second device groups the devices, grouping according to the computing capability of the device, or grouping according to the service type of the device.
  • the hash value of the embodiment of the present application is related to the device group, so that different access delay requirements and authentication delay requirements of the device can be met.
  • the method further includes: the second device receiving, by the first device, a second information related to the first data that is sent by the first device a HASH value, the second HASH value is used by the third device to determine the integrity of the second data, and the second data is the authenticated data of the first data in the blockchain network; Sending the second HASH value to the third device.
  • the first data is encrypted by a public key of the third device.
  • the second HASH value is determined by the first device according to the first data.
  • the first data is encrypted by a public key of the third device
  • the method further includes: receiving, by the second device
  • the first data is sent by the second device to the third device, so that the third device, according to the first data, determines the second HASH value, according to the second data.
  • the HASH value determines the integrity of the second data
  • the second data is the authenticated data of the first data in the blockchain network.
  • the method further includes: if the second device determines that the first data has passed the N in the blockchain network The second device sends the second data corresponding to the Merkel tree information and the block information to the third device, where the block information is used to indicate that the second chain is carried in the blockchain network.
  • the block of data, the second data is the authenticated data of the first data in the blockchain network, wherein the value of N is a preset value.
  • the method further includes: if the second device determines that the first data has passed the N in the blockchain network The second device sends the fourth information to the first device, where the fourth information is used to indicate that the first data has been authenticated N times in the blockchain network, where The value is the default value.
  • the method further includes: if the second device determines that the first data has passed the N in the blockchain network The second device sends the Merkle tree information and the block information corresponding to the second data to the first device, where the block information is used to indicate the block that carries the second data in the blockchain network.
  • the second data is the authenticated data of the first data in the blockchain network, where the value of N is a preset value.
  • the method further includes: receiving, by the second device, fifth information sent by the first device, where the fifth information is used by The device in the blockchain network is instructed to delete the second data from the blockchain network, where the second data is the authenticated data of the first data in the blockchain network.
  • the fifth information includes the identifier information and/or the Merkle tree information corresponding to the second data, where the identifier information is used to identify the location The second data is described.
  • a data processing method based on a blockchain including: acquiring, by a third device, Merkel tree information and block information corresponding to the second data, where the block information is used to indicate a blockchain a block in the network that carries the second data, where the second data is the data that the first data has been authenticated in the blockchain network, and the first data is a required area generated by the first device.
  • Data for authentication in the blockchain network the third device acquires second data from the block carrying the second data according to the Merkle tree information; and the third device determines the integrity of the second data.
  • the third device may acquire, according to the received Merkle tree information and the block information, the need generated by the first device stored in the blockchain network in the blockchain network. And performing second data corresponding to the first data of the authentication, and confirming the integrity of the second data. Thereby, the confidentiality and integrity of the data can be ensured, and the data stored in the blockchain network has higher reliability.
  • the method further includes: sending, by the third device, a device in the blockchain network A confirmation message is used to indicate that the second data is complete.
  • the confirmation information sent by the third device may be authenticated in the blockchain network.
  • the third device acquires Merkel tree information and block information corresponding to the second data, including: The third device receives the Merkle tree information and the block information sent by the second device, where the second device is a device in the blockchain network.
  • the third device may receive the Merkle tree information and the block information sent by the multiple devices in the blockchain network, thereby avoiding the potential risk caused by the device in the blockchain network being attacked.
  • the second device is a device that sends the first data to the blockchain network for authentication.
  • the method further includes: determining, by the third device, a second hash HASH value related to the first data;
  • the third device determines the integrity of the second data, including: the third device determines the integrity of the second data according to the consistency of the third HASH value and the second HASH value associated with the second data. Sex.
  • the third device determines, by the third device, a second hash HASH value that is related to the first data, The second HASH value, wherein the second HASH value is determined by the first device according to the first data.
  • the first data is encrypted by a public key of the third device.
  • the first data is encrypted by a public key of the third device, and the method further includes: the third Receiving, by the device, the first data sent by the first device; and determining, by the third device, the second HASH value according to the first data.
  • the method further includes: the third device determines to delete the second data from the blockchain network; The device sends fifth information to the device in the blockchain network, where the fifth information is used to indicate that the device in the blockchain network deletes the second data from the blockchain network.
  • the fifth information includes the identifier information and/or the Merkle tree information corresponding to the second data, where the identifier information is used to identify the first Two data.
  • an apparatus for performing the method of any of the above-described first aspect or any of the possible implementations of the first aspect.
  • the device includes means for performing the first aspect described above or A functional module of a method in any of the possible implementations of the first aspect.
  • an apparatus for performing the method of any of the above-described second aspect or any of the possible implementations of the second aspect.
  • the apparatus comprises functional modules for performing the method of any of the possible implementations of the second aspect or the second aspect described above.
  • an apparatus for performing the method of any of the above-described third aspect or any of the possible implementations of the third aspect.
  • the apparatus comprises functional modules for performing the method of any of the above-described third or third aspects of the third aspect.
  • an apparatus comprising a processor, a memory, and a transceiver.
  • the processor, the memory, and the transceiver communicate with each other through an internal connection path, transmitting control and/or data signals, such that the device performs the first aspect or any of the possible implementations of the first aspect Methods.
  • an apparatus comprising a processor, a memory, and a transceiver.
  • the processor, the memory, and the transceiver communicate with each other through an internal connection path, transmitting control and/or data signals, such that the device performs any of the second or second aspects of the foregoing possible implementations.
  • an apparatus comprising a processor, a memory and a transceiver.
  • the processor, the memory, and the transceiver communicate with each other through an internal connection path, transmitting control and/or data signals, such that the device performs any of the third or third aspects of the foregoing possible implementations.
  • a communication system comprising the apparatus of the fourth aspect, the fifth aspect, and the sixth aspect. Or the apparatus of the seventh aspect, the eighth aspect, and the ninth aspect.
  • a computer readable medium for storing a computer program, the computer program comprising instructions for performing the first aspect or any of the possible implementations of the first aspect.
  • a computer readable medium for storing a computer program, the computer program comprising instructions for performing any of the second aspect or the second aspect of the second aspect.
  • a thirteenth aspect a computer readable medium for storing a computer program, the computer program comprising instructions for performing any of the possible implementations of the third or third aspect above.
  • FIG. 1 is a schematic diagram of an application scenario of an embodiment of the present application
  • FIG. 2 is a schematic flowchart of a blockchain-based data processing method according to an embodiment of the present application
  • FIG. 3 is a schematic flowchart of a method for establishing a communication connection by a device according to an embodiment of the present application
  • FIG. 4 is a schematic flowchart of a blockchain-based data processing method according to another embodiment of the present application.
  • FIG. 5 is a schematic flowchart of a blockchain-based data processing method according to still another embodiment of the present application.
  • FIG. 6 is a schematic flowchart of a blockchain-based data processing method according to still another embodiment of the present application.
  • FIG. 7 is a schematic flowchart of a blockchain-based data processing method according to still another embodiment of the present application.
  • FIG. 8 is a schematic block diagram of an apparatus according to an embodiment of the present application.
  • FIG. 9 is a schematic illustration of an apparatus in accordance with another embodiment of the present application.
  • FIG. 10 is a schematic block diagram of an apparatus according to still another embodiment of the present application.
  • FIG. 11 is a schematic block diagram of an apparatus according to still another embodiment of the present application.
  • FIG. 12 is a schematic block diagram of an apparatus according to still another embodiment of the present application.
  • FIG. 13 is a schematic block diagram of an apparatus in accordance with still another embodiment of the present application.
  • FIG. 1 is a schematic diagram of an application scenario of an embodiment of the present application.
  • nodes in the dotted line form a blockchain network
  • IoT devices are not in the blockchain network
  • block nodes in the blockchain network can act as proxy nodes for IoT devices.
  • the data generated by the IoT device that needs to be propagated and verified in the blockchain network is sent to the nodes in the blockchain network to implement data verification.
  • node and device have the same meaning in the embodiment of the present application.
  • the block node in the blockchain network may be a private node, an operator network node (for example, a base station device), or may be a certain industry organization, group, and individual deployment. Site (Station).
  • the Internet of Things device may include, but is not limited to, a mobile station (Mobile Station, MS), a mobile terminal (Mobile Terminal), a mobile phone (Mobile Telephone), a user equipment (User Equipment, UE), a mobile phone (handset).
  • a portable device, a vehicle, etc. for example, the terminal device may be a mobile phone (or "cellular" phone), a computer having a wireless communication function, etc., and the terminal device may also be portable, pocket-sized , handheld, computer built-in or in-vehicle mobile devices.
  • Blockchain networks are characterized by decentralization. Data exchange between each node in the blockchain network does not need to trust each other. The operation rules of the entire blockchain network are open and transparent, and all data content is public, so the rule scope of the blockchain network And within the time range, nodes can not and can not deceive other nodes, therefore, the blockchain network has the feature of trust. The total block of the blockchain network is maintained by all nodes with maintenance functions in the entire system, and any node with maintenance functions can participate. Therefore, the blockchain network has the characteristics of collective maintenance.
  • the blockchain network allows each participating node to obtain a copy of the complete database in the form of a sub-database. Unless you can control more than 51% of the nodes in the entire network at the same time, the modification of the database on a single node is invalid, and it cannot affect the data content on other nodes. Therefore, the blockchain network has a reliable database.
  • the blockchain network has the above characteristics and the number of devices in the Internet of Things will increase dramatically, the blockchain network and the Internet of Things can be combined to realize the self-governance of the Internet of Things and improve the security performance of the Internet of Things.
  • the data generated by the device includes data related to the device and its peer device and common data.
  • the data related to the device and its peer device takes the data related to the device and its peer device as an example, The data is described by taking the data related to the device and its peer device as transaction data, but this does not limit the scope of the embodiments of the present application. among them:
  • a block is a containerized data structure of data that is contained in a blockchain. It consists of a block header containing metadata and a long list of transactions that immediately follow the body of the block.
  • the block specifically includes: a block size field, usually 4 bytes; a block header field, usually 80 bytes; a transaction counter field, generally 1-9 bytes, recording the number of transactions; a transaction field, usually Variable length, record transaction details.
  • the block header consists of three sets of metadata, first a set of data that references the hash value of the parent block, which is used to connect the block to the previous block in the blockchain.
  • the second set of metadata includes difficulty, timestamp, and number used once (Number used once, simply "Nonce”).
  • the third set of metadata is the Merkle number (a data structure used to effectively summarize all transactions in the block).
  • the block header specifically includes the following fields: the version field, usually 4 bytes; the parent block hash value field, usually 32 bytes, used to reference the hash value of the parent block in the blockchain; the Merkle root field, The hash value of the Merkle root of the transaction in the block; the timestamp field, usually 4 fields, is used to identify the approximate time generated by the block, accurate to the second; the Nonce field is used for the workload proof algorithm. counter.
  • Each block can reference the previous block through the "parent block hash value field" of its block header. That is, each block header contains the hash value of its parent block. And each block has only one parent block, but there can be multiple sub-blocks temporarily. The case where multiple sub-blocks appear in one block is called “block chain fork”.
  • a blockchain fork indicates a temporary state, and eventually only one sub-block becomes part of the blockchain.
  • a blockchain is a data structure in which blocks are sequentially linked from the back to the front, and each block points to the previous block. It can be stored as a file containing non-relative relationship records or stored in a simple database. You can think of a blockchain as a stack, with a height indicating the distance between the block and the first block, and a top or top indicating the most recent block. Encryption of each block header (for example, Secure Hash Algorithm ("SHA”)) can generate a hash value. The corresponding block in the blockchain can be identified by this hash value.
  • SHA Secure Hash Algorithm
  • PoW Proof Of Work
  • the essence is to join the information transfer Cost, reduce the rate of information transmission, and add a random element to ensure that only one node in a time period can have the right to broadcast information.
  • This random element is for the node to calculate a random hash value.
  • the block node calculates a string of 64-bit random numbers and letters according to the obtained input data, but only the node that obtains the hash value satisfying the hash value can be accepted as the workload by the blockchain network. prove.
  • the hash algorithm of the workload proof also realizes the wear of historical information by using the information in each new block as the input value of the next hash algorithm, forming a traceable chain (blockchain). .
  • Proof of interest the purpose is to achieve blockchain protection by those with financial interests, this method is to achieve the proof of equity through the number of coins destroyed in each transaction (Coindays).
  • the existing proof of equity system such as Peercoin, is based on evidence blocks in which the target that the miner must achieve is inversely related to the number of days of destruction. People with Peercoin must choose a miner called a proof of equity and contribute a portion of their currency over a period of time to protect the blockchain network.
  • FIG. 2 illustrates a blockchain-based data processing method in accordance with an embodiment of the present application. As shown in FIG. 2, the method 100 includes:
  • the first device establishes a communication connection with the second device, where the second device is a device in the blockchain network.
  • the first device generates data that needs to be authenticated in the blockchain network.
  • the second device receives data that is sent by the first device and needs to be authenticated in the blockchain network.
  • the second device sends the data to a device in the blockchain network to implement authentication of the data.
  • the authentication in the embodiment of the present application refers to performing blockchain consensus authentication or consistency authentication.
  • the first device is a device in the Internet of Things device, and the computing capability of the first device is limited.
  • the second device sends the data of the first device to the device in the blockchain network, which can be understood as the proxy device of the first device.
  • the first device and the second device can establish a communication connection according to the method illustrated in FIG.
  • the first device is described as an Internet of Things device.
  • the method 200 includes:
  • the IoT device receives the public key information sent by the second device.
  • the Internet of Things device can receive public key information sent by all devices in the blockchain network that have the function of serving the Internet of Things device, and then the IoT device can determine the selected blockchain network according to parameters such as the receiving quality of the information.
  • the device acts as its own proxy device and sends its own data that needs to be authenticated in the blockchain network to the devices in the blockchain network.
  • the second device is a proxy device of the Internet of Things device, and the second device is also a device associated with the Internet of Things device.
  • the access sequence in S202 may be a random access sequence in an existing (Long Term Evolution, hereinafter referred to as “LTE”).
  • LTE Long Term Evolution
  • ZC Zadoff-Chu
  • the IoT device synchronizes with the second device.
  • the second device may not broadcast the public key information in the broadcast message, but carry the public key information through the related message in the synchronization process.
  • the IoT device and the second device do not need to synchronize, for example, when the distance between the IoT device and the second device is less than or equal to a preset value.
  • the second device needs to broadcast its own public key information to the Internet of Things device in S201.
  • the IoT device sends an initial access message encrypted by the public key of the second device to the second device.
  • the first information is included in the initial access message, where the first information is used to request the second device to send data of the Internet of Things device to the device in the blockchain network for authentication.
  • the first information here may be the indication information that is displayed, or may be the information that is implicitly indicated.
  • the first information may specifically be the block information, and when the second device determines that the initial access message includes the block information, the first The second device confirms that the physical network device requests to forward the data of the IoT device to other devices in the blockchain network.
  • the public key information of the Internet of Things device is further included in the initial access message.
  • the second device determines whether the data generated by the IoT device that needs to be authenticated in the blockchain network is forwarded.
  • the second device after receiving the initial access message sent by the IoT device, the second device encrypts the initial access message with its own private key, and then confirms whether to accept the request of the IoT device according to its own admission capability.
  • the second device first determines whether the request of the IoT device can be received, and when determining that the IoT device can be accepted, encrypting the initial access message by using its private key, it can be understood that, in this manner, the foregoing A message needs to be included in the header of the initial access message.
  • the second device sends feedback information to the Internet of Things device.
  • the feedback information is used to notify the IoT device that the second device can send the data generated by the IoT device that needs to be authenticated in the blockchain network to the device in the blockchain network to implement data authentication.
  • the second device encrypts the feedback information to the Internet of Things device by using the public key of the Internet of Things device, and then sends the encrypted information to the Internet of Things device. Feedback.
  • the Internet of Things device establishes a communication connection with the second device according to the feedback information.
  • the IoT device After the IoT device establishes a communication connection with the second device, when the IoT device generates data that needs to be authenticated in the blockchain network, the data is first sent to the second device, and the second device broadcasts the data to the region. Authentication and dissemination in a blockchain network.
  • data generated by IoT devices includes transaction data and general data.
  • the Internet of Things device may be a smart washing machine, and the smart washing machine may automatically purchase the washing liquid, and the data generated during the transaction is transaction data.
  • the Internet of Things device is a smart faucet at home.
  • the faucet can automatically purchase water from the water plant. Different faucets can purchase different water sources, such as purified water, washing water, toilet water, etc. Different faucets can be independently traded and sold.
  • Transaction data may be a smart washing machine, and the smart washing machine may automatically purchase the washing liquid, and the data generated during the transaction is transaction data.
  • the Internet of Things device is a smart faucet at home.
  • the faucet can automatically purchase water from the water plant. Different faucets can purchase different water sources, such as purified water, washing water, toilet water, etc. Different faucets can be independently traded and sold.
  • Transaction data is a smart washing machine, and the smart washing machine may automatically purchase the washing liquid, and the data generated during the transaction is transaction data.
  • the Internet of Things device is a smart
  • the data generated by the IoT device is ordinary data, that is, non-transaction data.
  • the detected PM2.5 data is also ordinary data.
  • the method 200 further includes:
  • the second device generates a preset number of digital currencies.
  • the generation rule of the digital currency may be set in advance, for example, one digital currency may be generated every 10 minutes in advance.
  • the second device broadcasts the phase of the digital currency generated by the second device to the other devices in the blockchain network.
  • the relevant information of the digital currency includes the number of digital currencies.
  • the related information of the Internet of Things device may be broadcast to other devices in the blockchain network, where the related information of the IoT device is used to notify the block.
  • Other devices in the chain network These digital currencies are generated because they are connected to IoT devices.
  • the related information of the Internet of Things device may include public key information of the Internet of Things device, or other specific information of the Internet of Things device, for example, IoT device identifier information, and the like.
  • the second node confirms that the digital currency generated by the second node is M-authenticated in the blockchain network, and the second device confirms that the digital currency generated by the second device is valid.
  • the value of M in S210 may be preset.
  • the value of M is 6.
  • method 300 includes:
  • the Internet of Things device generates data that needs to be authenticated in the blockchain network
  • the IoT device sends the data to the second device.
  • the IoT device may directly send the data to the IoT device, or the IoT device generates a block including the data, and sends the block to the second device.
  • the second device broadcasts the received data to the blockchain network for authentication.
  • the second device generates a block that carries the data according to a block format in the blockchain network, and broadcasts the block into the blockchain.
  • the second device receives the block that carries the data sent by the IoT device in S302, the second device directly broadcasts the received block to the blockchain network.
  • the device in the blockchain network authenticates the data.
  • the method for authenticating the data in the device in the blockchain network may use the workload proof method or the equity proof method described above. To avoid repetition, no further details are provided herein.
  • the second device determines that the data has been authenticated N times.
  • the second device can determine whether the data has been authenticated N times according to the depth of the blockchain broadcasted in the current network.
  • the second device sends an authentication completion message to the Internet of Things device.
  • the authentication completion message is used to notify the IoT device that the data generated by the IoT device has passed N times. certificate;
  • the Internet of Things device deletes the stored data.
  • the IoT device After receiving the authentication completion message sent by the second device, the IoT device confirms that the generated data has been authenticated N times by the device in the blockchain network, and all the IoT devices delete the locally stored data.
  • the data is processed by the methods in the methods 100 to 300, and the requirements of the devices in the blockchain network for the IoT devices can be made because the IoT devices can establish communication connections with devices in the blockchain network.
  • the authenticated data is broadcast to the blockchain network and the data is authenticated by devices in the blockchain network. Therefore, the computing power requirement of the Internet of Things device can be effectively reduced, especially for a low-cost, low-power IoT device.
  • FIG. 5 illustrates a data processing method based on a blockchain according to still another embodiment of the present application.
  • the first device is an Internet of Things device.
  • the method 400 includes:
  • the second device determines a hash value requirement.
  • the second device determines a hash value requirement according to the number of IoT devices that are currently establishing a communication connection with the second device, or the second device determines the hash value requirement according to the predicted access request amount during a certain access peak period. For example, when the second device determines that the number of IoT devices that are currently in communication connection with the device is large, the hash value that is difficult to broadcast is required, and the difficulty here is understood to be the number of bits that require the generated low bit to be zero. Exceeded a certain threshold.
  • the generated hash value requirement may be a low order number of bits of the hash value of zero or a preset amount.
  • the second device broadcasts its determined hash value request.
  • the IoT device generates a hash value that meets a hash value requirement, and then establishes a communication connection with the second device.
  • the method for establishing a communication connection between the IoT device and the second device in S403 is the same as that in the method 200. To avoid repetition, details are not described herein again.
  • the IoT device sends data to the second device that needs to be authenticated in the blockchain network.
  • the second device broadcasts the received data to the blockchain network for authentication.
  • the authentication right may be acquired at the same time.
  • the second device obtains the authentication right, the second device is configured according to the data of all the Internet of Things devices existing in the current blockchain network. A new block is generated and the resulting block is concatenated in the current blockchain, after which the blockchain is broadcast into the blockchain network.
  • the second device updates the hash value requirement.
  • the second device may adjust the hash value according to the access amount of the IoT device, or according to the predicted access request amount during a certain access peak period, or the access collision probability. For example, when the second device determines that the current access request is less, or the access collision probability is less, the second device determines that it is difficult to be a smaller hash value requirement.
  • the second device sends the updated hash value request to the Internet of Things device.
  • the second device may determine different hash value requirements according to different service types.
  • the second device sends multiple hash value requests to the Internet of Things device.
  • the IoT device determines the hash value that the generated hash value needs to satisfy according to the service type of the data, and generates a hash value that satisfies the hash value requirement.
  • a communication connection is established with the second device to implement data authentication.
  • the second device groups the IoT devices (eg, may be grouped according to the capabilities of the IoT device), and generates different hash value requirements according to different packets.
  • the second device sends multiple hash value requests to the Internet of Things device.
  • the IoT device determines the hash value that the generated hash value needs to satisfy according to the group to which it belongs, and generates a hash value that satisfies the hash value requirement.
  • a communication connection is established with the second device to implement data authentication.
  • the second device may carry the grouping information of the Internet of Things device in the broadcast message, and the Internet of Things device determines the group to which it belongs according to the grouping information.
  • the flexibility of the IoT device to establish a communication connection with the device in the blockchain network can be ensured, so that the communication system has good scalability.
  • method 500 includes:
  • the IoT device A when the IoT device A determines that the transaction data needs to be authenticated in the blockchain network, the IoT device A sends a hash value related to the transaction data to the IoT device B;
  • transaction data determined by the Internet of Things device A may be transaction data between the Internet of Things device A and the Internet of Things device B, and may also be transaction data of the Internet of Things device A and other Internet of Things devices.
  • the hash value associated with the transaction data is generated by the Internet of Things device A according to the transaction data, where the transaction data may be encrypted by the public key of the Internet of Things device B, or may not be through the Internet of Things device. B's public key has been encrypted.
  • the method for generating a hash value is not limited in the embodiment of the present application.
  • the IoT device A may send a hash value related to the transaction data to the IoT device B through its proxy node (eg, the second device in FIG. 6) or other communication node.
  • the proxy node eg, the second device in FIG. 6
  • the Internet of Things device A sends transaction data to the second device.
  • the transaction data sent by the Internet of Things device A to the second device may be transaction data that has not been encrypted.
  • the transaction data sent by the Internet of Things device A is transaction data encrypted by using only the public key of the Internet of Things device B.
  • the transaction data sent by the Internet of Things device A is encrypted by using the public key of the Internet of Things device B, and then the encrypted data is encrypted by using the private key of the second device.
  • the second device receives the transaction data.
  • the transaction data is decrypted by the public key of the second device to ensure the legality of the transaction data sent by the Internet of Things device A to the second device, and then the second device broadcasts the transaction data encrypted by the public key of the Internet of Things device B to the transaction data.
  • authentication is performed.
  • the second device broadcasts the transaction data to the blockchain network for authentication.
  • S504 The second device confirms that the transaction data has completed N times of authentication in the blockchain network.
  • the second device sends an authentication completion message to the Internet of Things device A.
  • the authentication completion message includes Merkle tree information and block information of data corresponding to the transaction data in the blockchain network, and the block information is used to indicate a block in the blockchain network that carries data corresponding to the transaction data.
  • the data corresponding to the transaction data in the blockchain network is essentially a transaction. Data after N times of authentication in the blockchain network.
  • the second device directly sends the Merkle tree information and the block information of the data corresponding to the transaction data in the blockchain network to the Internet of Things device A, and the IoT device A can receive the two information when Make sure the transaction data has been certified by N.
  • the second device or other blockchain device sends the Merkle tree information and the block information of the data corresponding to the transaction data stored in the blockchain network to the Internet of Things device B.
  • multiple devices in the blockchain network can simultaneously send Merkle tree information and block information to the IoT device B, and the IoT device B can compare the received multiple information, thereby further improving the communication system. reliability.
  • the Internet of Things device B receives the Merkle tree information and the block information sent by its proxy node. Or the Merkle tree information and the block information received by the Internet of Things device B are sent by different devices.
  • the Internet of Things device B verifies the integrity of the data corresponding to the transaction data in the blockchain network
  • the Internet of Things device B determines, according to the block information, a block that carries data corresponding to the transaction data, and then the IoT device B finds the transaction data from the block according to the Merkle tree information of the data corresponding to the transaction data. Corresponding data.
  • the block information here is the height or identity of the block.
  • the Internet of Things device A is directed to The transaction data sent by the second device is not encrypted by the public key of the Internet of Things device B.
  • the IoT device B obtains the data corresponding to the transaction data from the block, the hash of the acquired data corresponding to the transaction data is calculated. The value, after which the calculated hash value is consistent with the received hash value. If they are consistent, the IoT device B considers that the acquired data is complete. Otherwise, the IoT device B considers that the acquired data is incomplete.
  • the Internet of Things device A goes to the second
  • the transaction data sent by the device is encrypted by the public key of the Internet of Things device B.
  • the IoT device B obtains the data of the corresponding transaction data from the block, the IoT device decrypts the acquired data first, and calculates The hash value of the decrypted data, and then compares whether the calculated hash value is consistent with the received hash value. If consistent, IoT device B considers the acquired data. It is complete, otherwise, IoT device B believes that the acquired data is incomplete.
  • the Internet of Things device A is directed to the second device.
  • the sent transaction data is encrypted by the public key of the Internet of Things device B.
  • the IoT device B obtains the data corresponding to the transaction data from the block, the hash value of the acquired data corresponding to the transaction data is calculated, and then Compares the calculated hash value with the received hash value. If they are consistent, the IoT device B considers that the acquired data is complete. Otherwise, the IoT device B considers that the acquired data is incomplete.
  • the IoT device B verifies that the data corresponding to the transaction data is complete, the confirmation information is sent, and the confirmation information is used to indicate that the data corresponding to the transaction data is complete.
  • the confirmation information sent by the Internet of Things device B may also be authenticated by devices in the blockchain network.
  • the Internet of Things device A does not send a hash value to the Internet of Things device B, but sends transaction data to the Internet of Things device B.
  • the Internet of Things device B determines to receive.
  • the hash value of the transaction data to be obtained, and then the hash value of the calculated transaction data is compared with the hash value of the data corresponding to the transaction data obtained from the block to determine whether the acquired data is complete.
  • the transaction data sent by the Internet of Things device A to the Internet of Things device B is encrypted by the public key of the Internet of Things device B in S501, and the transaction data sent by the Internet of Things device A to the second device is also passed in S502.
  • the public key of the Internet of Things device B is encrypted.
  • the IoT device B directly calculates the hash value of the transaction data sent by the IoT device A received, and the hash value of the acquired data, and then the two hashes. The value is compared.
  • the transaction data sent by the Internet of Things device A to the Internet of Things device B is encrypted by the public key of the Internet of Things device B in S501, and the transaction data sent by the Internet of Things device A to the second device is not in S502.
  • the Internet of Things device B decrypts the received transaction data sent by the Internet of Things A, and then calculates the hash value of the decrypted data, and the IoT device obtains the obtained data. After the hash of the data, compare the two hash values.
  • the transaction data sent by the Internet of Things device A to the Internet of Things device B in S501 is not encrypted by the public key of the Internet of Things device B, and the transaction data sent by the Internet of Things device A to the second device in S502 is also IoT device B without being encrypted by the public key of IoT device B
  • the hash value of the transaction data sent by the received IoT device A and the hash value of the acquired data are directly calculated, and then the two hash values are compared.
  • the transaction data sent by the Internet of Things device A to the Internet of Things device B in S501 is not encrypted by the public key of the Internet of Things device B
  • the transaction data sent by the Internet of Things device A to the second device in S502 is After the public key of the Internet of Things device B is encrypted, the IoT device B first decrypts the acquired data, and then calculates the hash value of the decrypted data, and the IoT device receives the received IoT device B and sends it. After hashing the transaction data, compare the two hash values.
  • the data acquired by the Internet of Things device B is complete, indicating that the data acquired by the Internet of Things device B is the same as the transaction data, that is, the transaction data has been authenticated N times in the blockchain network. After that, it was not maliciously modified.
  • the different data generated by the IoT device may have different storage requirements, so the data may be further processed according to the storage requirements of the data.
  • the peer device of the Internet of Things device as an example of the Internet of Things device as an example
  • a blockchain-based data processing method according to still another embodiment of the present application is described.
  • the interactive IoT devices are respectively marked as the Internet of Things.
  • method 600 includes:
  • the Internet of Things device A and the Internet of Things device B determine that the transaction data of both parties has been recorded in the blockchain network;
  • the Internet of Things device A and the Internet of Things device B determine that the transaction data of both parties has been recorded in the blockchain network, and on the other hand, the Internet of Things device A and the Internet of Things device B can further obtain corresponding to the transaction data. Merkle tree information and block information for the data.
  • the proxy node A sends the indication information that the transaction completes the verification through the blockchain network to the IoT device A, and carries the Merkle tree information and the block information.
  • the proxy node A or the proxy node B transmits the information of the transaction completion verification to the Internet of Things device B, and carries the Merkle tree information and the block information.
  • the Internet of Things device A and/or the Internet of Things device B determines that data corresponding to the transaction data can be deleted from the blockchain network;
  • the IoT device A determines that the data corresponding to the transaction data may be deleted from the blockchain network according to the preset storage duration of the transaction data, or the IoT device B determines the correspondence with the transaction data according to the preset storage duration of the transaction data.
  • the data can be deleted from the blockchain network, or the IoT device A and the IoT device B can determine by negotiation that the data corresponding to the transaction data can be from the blockchain. Deleted in the network.
  • the Internet of Things device A and/or the Internet of Things device B send deletion indication information to devices in the blockchain network.
  • the deletion indication information may include Merkle tree information and block information corresponding to the data corresponding to the transaction data.
  • the IoT device A sends the deletion indication information to the device in the blockchain network by using the second device to implement data deletion. It should be noted that, although the second device sends the deletion indication information to the device in the blockchain network, the second device may obtain the verification right to delete the data, just like other devices in the blockchain network.
  • the device in the blockchain network that receives the deletion indication information sent by the Internet of Things device A or the Internet of Things device B broadcasts the deletion indication information in the blockchain network to implement deletion of data corresponding to the transaction data.
  • the devices in the blockchain network start to compete for the authentication right, and the device that obtains the authentication right confirms that the transaction data can be deleted when generating a new blockchain. corresponding.
  • the specific location of the data corresponding to the transaction data in the block is determined, and the data corresponding to the transaction data is deleted when the blockchain is generated, or The indication information is deleted as special transaction data.
  • the device that obtains the authentication right by the Nth deletes the data corresponding to the transaction data.
  • the storage load of the blockchain network can be reduced, and the transmission bandwidth required for the transmission of the blockchain can be reduced.
  • the device 10 includes:
  • the processing module 11 is configured to establish a communication connection between the device and the second device, where the second device is a device in a blockchain network;
  • the processing module 11 is further configured to generate and determine that the first data needs to be authenticated in the blockchain network;
  • the transceiver module 12 is configured to send the first data to the second device to implement the first
  • the data is authenticated by devices in the blockchain network.
  • the device when the device according to the embodiment of the present application generates the first data that needs to be authenticated in the blockchain network, the first data is sent to the second device in the blockchain network, so that the second device sends the first data.
  • the device in the blockchain network is authenticated by the first data.
  • the construction and maintenance costs of the communication system can be reduced, and the security performance of the system can be improved.
  • the second device sends the data of the device to the device in the blockchain network for authentication, which can reduce the capability requirement for the device.
  • the transceiver module 12 is specifically configured to: send, to the second device, a first message encrypted by using a first public key, where the first message includes first information,
  • the first public key is a public key of the second device, and the first information is used to request the second device to send data generated by the device that needs to be authenticated in the blockchain network to
  • the device in the blockchain network performs authentication; receiving second information sent by the second device, where the second information is used to indicate that the second device confirms that the device needs to be generated in the area
  • the data authenticated in the blockchain network is sent to devices in the blockchain network for authentication.
  • the first message further includes a second public key, where the second public key is a public key of the device.
  • the transceiver module 12 is specifically configured to: receive the second information that is sent by the second device and that is encrypted by using the second public key.
  • the processing module 11 is further configured to: generate a block that carries the first data
  • the transceiver module 12 is specifically configured to send the block to the second device.
  • the transceiver module 12 is further configured to: receive third information sent by the second device, where the third information includes a first hash HASH value requirement;
  • the processing module 11 is further configured to generate a first HASH value that meets the first HASH value requirement.
  • the third information includes at least one HASH value requirement, where the at least one HASH value requirement includes the first HASH value requirement, and the at least one HASH value requirement Each HASH value is required to correspond to at least one type of service;
  • the processing module 11 is further configured to: determine the first HASH value according to the service type corresponding to the first data.
  • the third information includes at least one HASH value.
  • the requesting, the at least one HASH value requirement includes the first HASH value requirement, and each of the at least one HASH value requirement is required to correspond to at least one device group;
  • the processing module 11 is further configured to: determine, according to the device group to which the device belongs, the first HASH value.
  • the transceiver module 12 is further configured to: send, to the third device, a second HASH value related to the first data, where the second HASH value is used in the third The device determines the integrity of the second data, and the second data is the authenticated data of the first data in the blockchain network.
  • the first data is encrypted by a public key of the third device.
  • the processing module is further configured to: determine the second HASH value according to the first data.
  • the first data is encrypted by a public key of the third device
  • the transceiver module 12 is further configured to: send the first data to the third device, After the third device determines the second HASH value according to the first data, determining the integrity of the second data according to the second HASH value, where the second data is the first data in the block.
  • the authenticated data in the chain network is not limited to:
  • the transceiver module 12 is further configured to: receive fourth information sent by the second device, where the fourth information is used to indicate that the first data is already in the area After N times of authentication in the blockchain network, the value of N is a preset value.
  • the transceiver module 12 is further configured to: receive the Merkel tree information and the block information corresponding to the second data sent by the second device, where the second data is The first data is authenticated data in the blockchain network, and the block information is used to indicate a block carrying the second data in the blockchain network.
  • the processing module 11 is further configured to: determine to delete the second data from the blockchain network, where the second data is the first data in the blockchain network The certified data;
  • the transceiver module 12 is further configured to send fifth information to a device in the blockchain network, where the fifth information is used to indicate that a device in the blockchain network is deleted from the blockchain network. Second data.
  • the fifth information includes identification information and/or a second number.
  • the identification information is used to identify the second data according to the corresponding Merkle tree information.
  • the processing module 11 is further configured to: delete the first data stored locally by the device.
  • the device 10 in the embodiment of the present invention is embodied in the form of a functional unit.
  • the device 10 may correspond to the first device in some of the foregoing embodiments, and may be used to perform various processes and/or corresponding to the first device in the foregoing method embodiments. Steps, to avoid repetition, will not be repeated here.
  • the processing module 11 can be implemented by a processor.
  • the transceiver module 12 can be implemented by a transceiver. It should be understood that the transceiver can be a device having both a receiving function and a transmitting function, or a component device having a receiving function and a transmitting device having a transmitting function.
  • FIG. 9 shows a device according to another embodiment of the present application. As shown in FIG. 9, the device 20 includes:
  • the processing module 21 is configured to establish a communication connection between the device and the first device, where the device is a device in a blockchain network;
  • the transceiver module 22 is configured to receive, by the first device, the first data generated by the first device that needs to be authenticated in the blockchain network;
  • the transceiver module 22 is further configured to send the first data to a device in the blockchain network to implement authentication of the first data.
  • the device receives the first data generated by the first device that needs to be authenticated in the blockchain network, and sends the first data to the device in the blockchain network to implement authentication of the first data.
  • the device sends the data of the first device to the device in the blockchain network for authentication, which can reduce the capability requirement for the first device.
  • the transceiver module 22 is specifically configured to: receive the first message that is sent by the first device and that is encrypted by using the first public key, where the first message includes the first information.
  • the first public key is a public key of the device, and the first information is used to request the device to send data generated by the first device that needs to be authenticated in the blockchain network to the device.
  • the device in the blockchain network performs authentication; the second information is sent to the first device, where the second information is used to indicate that the device confirms that the first device needs to be generated in the blockchain
  • the data authenticated in the network is sent to devices in the blockchain network for authentication.
  • the first message further includes a second public key, where the The second public key is the public key of the first device.
  • the transceiver module 22 is specifically configured to: send, to the first device, the second information encrypted by using the second public key.
  • the processing module 21 is further configured to: generate a preset number of digital currencies.
  • the transceiver module 22 is further configured to: send information about the digital currency to a device in the blockchain network;
  • the processing module 21 is further configured to: if it is determined that the digital currency has undergone M authentication in the blockchain network, confirm that the digital currency is valid, and the value of M is a preset value.
  • the transceiver module 22 is specifically configured to: receive a block that is sent by the first device and that carries the first data; and send the device to a device in the blockchain network. A block carrying the first data.
  • the processing module 21 is further configured to: generate a block that carries the first data according to a block format required by the blockchain network;
  • the transceiver module 22 is further configured to send the block that carries the first data to a device in the blockchain network.
  • the processing module 21 is further configured to: determine a first hash HASH value requirement
  • the transceiver module 22 is configured to send the third information to the first device, where the third information includes the first HASH value requirement, so that the first device generates the first HASH value that is satisfied. After the required first HASH value, a communication connection is established with the device.
  • the third information includes at least one HASH value requirement, where the at least one HASH value requirement includes the first HASH value requirement, and the at least one HASH value requirement Each HASH value is required to correspond to at least one type of service;
  • the processing module 21 is specifically configured to: determine the at least one HASH value requirement.
  • the third information includes at least one HASH value requirement, where the at least one HASH value requirement includes the first HASH value requirement, and the at least one HASH value requirement Each HASH value is required to correspond to at least one device group;
  • the processing module 21 is specifically configured to: determine the at least one HASH value requirement.
  • the transceiver module 22 is further configured to: receive a second HASH value that is sent by the first device and is related to the first data, where the second HASH value is used.
  • the third device determines the integrity of the second data, where the second data is the authenticated data of the first data in the blockchain network; and the second HASH value is sent to the third device.
  • the first data is encrypted by a public key of the third device.
  • the second HASH value is determined by the first device according to the first data.
  • the first data is encrypted by a public key of the third device
  • the transceiver module 22 is further configured to: receive the first data; and send the third device to the third device Transmitting the first data, so that the third device determines the integrity of the second data according to the second HASH value after determining the second HASH value according to the first data, where the second data is the A data is authenticated in the blockchain network.
  • the transceiver module 22 is further configured to: if the processing module 21 determines that the first data has been authenticated N times in the blockchain network, to the The third device sends the second data corresponding to the Merkel tree information and the block information, where the block information is used to indicate the block in the blockchain network that carries the second data, and the second data is the A data is authenticated in the blockchain network.
  • the transceiver module 22 is further configured to: if the processing module 21 determines that the first data has been authenticated N times in the blockchain network, to the A device sends a fourth information, where the fourth information is used to indicate that the first data has been authenticated N times in the blockchain network, where the value of N is a preset value.
  • the transceiver module 22 is further configured to: if the processing module 21 determines that the first data has been authenticated N times in the blockchain network, to the a device sends the Merkle tree information and the block information corresponding to the second data, where the block information is used to indicate a block carrying the second data in the blockchain network, and the second data is the first data in the The authenticated data in the blockchain network.
  • the transceiver module 22 is further configured to: receive fifth information sent by the first device, where the fifth information is used to indicate that the device in the blockchain network is The second data is deleted in the blockchain network, and the second data is the authenticated data of the first data in the blockchain network.
  • the fifth information includes the identification information and/or the Merkle tree information corresponding to the second data, where the identifier information is used to identify the second data.
  • the device 20 in the embodiment of the present invention is embodied in the form of a functional unit.
  • the device 20 may correspond to the second device in some of the foregoing embodiments, and may be used to perform various processes and/or corresponding to the second device in the foregoing method embodiments. Steps, to avoid repetition, will not be repeated here.
  • the processing module 21 can be implemented by a processor.
  • the transceiver module 22 can be implemented by a transceiver. It should be understood that the transceiver may be a device having both a receiving function and a transmitting function, or a component device having a receiving function and a transmitting device having a transmitting function.
  • FIG. 10 shows a device according to still another embodiment of the present application. As shown in FIG. 10, the device 30 includes:
  • the transceiver module 31 is configured to acquire Merck's Merkle tree information and block information corresponding to the second data, where the block information is used to indicate a block in the blockchain network that carries the second data, where the second data is
  • the first data is authenticated data in the blockchain network, and the first data is data generated by the first device that needs to be authenticated in the blockchain network;
  • the transceiver module 31 is further configured to acquire second data from a block that carries the second data according to the Merkle tree information;
  • the processing module 32 is configured to determine the integrity of the second data.
  • the device can obtain, according to the received Merkle tree information and the block information, a first stored in the blockchain network corresponding to the first data generated by the first device that needs to be authenticated in the blockchain network. Two data and confirm the integrity of the second data. Thereby, the confidentiality and integrity of the data can be ensured, and the data stored in the blockchain network has higher reliability.
  • the transceiver module 31 is further configured to: send confirmation information to a device in the blockchain network, where the confirmation information is used to indicate The second data is complete.
  • the transceiver module 31 is specifically configured to: receive the Merkle tree information and the block information sent by the second device, where the second device is the block A device in a chain network.
  • the second device is a device that sends the first data to the blockchain network for recognition.
  • the processing module 32 is further configured to: determine a second hash HASH value associated with the first data; and according to a third HASH value associated with the second data The consistency of the second HASH value determines the integrity of the second data.
  • the processing module 32 is specifically configured to: receive the second HASH value, where the second HASH value is determined by the first device according to the first data. of.
  • the first data is encrypted by a public key of the device.
  • the first data is encrypted by the public key of the device, and the transceiver module 31 is further configured to: receive the first data sent by the first device. ;
  • the processing module 32 is specifically configured to: determine the second HASH value according to the first data.
  • the processing module 32 is further configured to: determine to delete the second data from the blockchain network;
  • the transceiver module 31 is further configured to send, to the device in the blockchain network, fifth information, where the fifth information is used to indicate that a device in the blockchain network is deleted from the blockchain network. Second data.
  • the fifth information includes the identification information and/or the Merkle tree information corresponding to the second data, where the identifier information is used to identify the second data.
  • the device 30 in the embodiment of the present invention is embodied in the form of a functional unit.
  • the device 30 may correspond to the Internet of Things device B in some embodiments described above, and may be used to perform various processes corresponding to the Internet of Things device B in the foregoing method embodiments. / or steps, in order to avoid repetition, will not repeat them here.
  • the processing module 32 can be implemented by a processor.
  • the transceiver module 31 can be implemented by a transceiver. It should be understood that the transceiver may be a device having both a receiving function and a transmitting function, or a component device having a receiving function and a transmitting device having a transmitting function.
  • Figure 11 illustrates an apparatus in accordance with yet another embodiment of the present application.
  • the device 100 includes a processor 110 and a transceiver 120.
  • the processor 110 is coupled to the transceiver 120.
  • the device 100 further includes a memory 130 coupled to the processor 110.
  • the processor 110, the memory 130, and the transceiver 120 can communicate with each other through an internal connection path.
  • the processor 110 is configured to establish a communication connection between the device and the second device, where the second device is a device in a blockchain network, and the processor 110 is further configured to generate and determine that the first data needs to be in the In the blockchain network
  • the transceiver 120 is configured to send the first data to the second device, so that the first data is authenticated by a device in the blockchain network.
  • the device when the device according to the embodiment of the present application generates the first data that needs to be authenticated in the blockchain network, the first data is sent to the second device in the blockchain network, so that the second device sends the first data.
  • the device in the blockchain network is authenticated by the first data.
  • the construction and maintenance costs of the communication system can be reduced, and the security performance of the system can be improved.
  • the second device sends the data of the device to the device in the blockchain network for authentication, which can reduce the capability requirement for the device.
  • the device 100 may refer to the device 10 corresponding to the embodiment of the present application, and the respective units/modules in the device and the other operations and/or functions described above are respectively for the corresponding processes in the foregoing methods, for the sake of brevity, This will not be repeated here.
  • FIG. 12 is a schematic block diagram of a device according to still another embodiment of the present application.
  • the device 200 includes a processor 210 and a transceiver 220.
  • the processor 210 and the transceiver 220 are connected, optionally,
  • the device 200 also includes a memory 230 that is coupled to the processor 210.
  • the processor 210, the memory 230, and the transceiver 220 can communicate with each other through an internal connection path.
  • the processor 210 is configured to establish a communication connection between the device and the first device, where the device is a device in a blockchain network, and the transceiver 220 is configured to receive the sending by the first device.
  • the first data generated by the first device that needs to be authenticated in the blockchain network; the transceiver 220 is further configured to send the first data to a device in the blockchain network, to implement Authentication of the first data.
  • the device receives the first data generated by the first device that needs to be authenticated in the blockchain network, and sends the first data to the device in the blockchain network to implement authentication of the first data.
  • the device sends the data of the first device to the device in the blockchain network for authentication, which can reduce the capability requirement for the first device.
  • the device 200 may refer to the device 20 corresponding to the embodiment of the present application, and each unit/module in the device and the other operations and/or functions described above are respectively for the corresponding processes in the foregoing method, for the sake of brevity, This will not be repeated here.
  • FIG. 13 is a schematic block diagram of a device according to still another embodiment of the present application.
  • the device 300 includes a processor 310 and a transceiver 320.
  • the processor 310 is connected to the transceiver 320, optionally,
  • the device 300 also includes a memory 330 that is coupled to the processor 310.
  • the processor 310, the memory 330, and the transceiver 320 can communicate with each other through an internal connection path.
  • the transceiver 320 is configured to acquire Merck's Merkle tree information and block information corresponding to the second data, where the block information is used to indicate a block in the blockchain network that carries the second data.
  • the second data is the authenticated data of the first data in the blockchain network, and the first data is data generated by the first device that needs to be authenticated in the blockchain network;
  • the transceiver 320 is further configured to obtain the second data from the block that carries the second data according to the Merkle tree information, where the processor 310 is configured to determine the integrity of the second data.
  • the device can obtain, according to the received Merkle tree information and the block information, a first stored in the blockchain network corresponding to the first data generated by the first device that needs to be authenticated in the blockchain network. Two data and confirm the integrity of the second data. Thereby, the confidentiality and integrity of the data can be ensured, and the data stored in the blockchain network has higher reliability.
  • the device 300 may refer to the device 30 corresponding to the embodiment of the present application, and each unit/module in the device and the other operations and/or functions described above are respectively for the corresponding processes in the foregoing method, for the sake of brevity, This will not be repeated here.
  • the processor in the embodiment of the present application may be an integrated circuit chip with signal processing capability.
  • the processor may be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a Field Programmable Gate Array (FPGA), or the like. Programming logic devices, discrete gates or transistor logic devices, discrete hardware components.
  • the methods, steps, and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed.
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • the memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory.
  • the non-volatile memory may be a read-only memory (ROM), a programmable read only memory (PROM), an erasable programmable read only memory (Erasable PROM, EPROM), or an electric Erase programmable read only memory (EEPROM) or flash memory.
  • the volatile memory can be a Random Access Memory (RAM) that acts as an external cache.
  • RAM Random Access Memory
  • many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (Synchronous DRAM).
  • SDRAM double data rate synchronous dynamic random access memory
  • DDR SDRAM double data rate synchronous dynamic random access memory
  • ESDRAM Enhanced Synchronous Dynamic Random Access Memory
  • SDRAM Synchronous Connection Dynamic Random Access Memory
  • DR RAM Direct Memory Bus
  • the disclosed systems, devices, and methods may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the functions may be stored in a computer readable storage medium if implemented in the form of a software functional unit and sold or used as a standalone product. Based on such understanding, the technical solution of the present application or the part contributing to the prior art or the part of the technical solution may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present application.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

Provided are a blockchain-based data processing method, device and system, the method comprising: a first device establishes a communication connection with a second device, the second device being a device in a blockchain network; the first device determines that first data generated by the first device requires authentication in the blockchain network; the first device sends the first data to the second device, so that the first data is authenticated by devices in the blockchain network. By using the blockchain network to authenticate the data, the blockchain-based data processing method reduces the construction and maintenance costs of a communication system, and improves the security performance of the system. In addition, the second device sends the data of the first device to the devices in the blockchain network for authentication, thereby reducing the capability requirements for the first device.

Description

基于区块链的数据处理方法、设备和系统Data processing method, device and system based on blockchain 技术领域Technical field
本申请实施例涉及通信领域,具体地,涉及基于区块链的数据处理方法、设备和系统。The embodiments of the present application relate to the field of communications, and in particular, to a blockchain-based data processing method, device, and system.
背景技术Background technique
物联网作为在互联网基础上延伸和扩展的网络,通过应用智能感知、识别技术与普适计算等计算机技术,实现信息交换和通信。根据有关机构预测,2020年全球的物联网设备数量将达到250亿台左右。随着物联网中设备数量的正常,如果以传统的中心化网络模式对物联网设备进行管理,将带来巨大的数据中心基础设施建设投入及维护投入。此外,基于中心化的网络模式会存在安全隐患。As a network extending and expanding on the Internet, the Internet of Things realizes information exchange and communication by applying computer technologies such as intelligent sensing, recognition technology and pervasive computing. According to the prediction of relevant institutions, the number of IoT devices in the world will reach 25 billion units in 2020. With the normal number of devices in the Internet of Things, if the IoT devices are managed in the traditional centralized network mode, huge investment in data center infrastructure construction and maintenance will be brought. In addition, there is a security risk in a centralized network model.
因此,需要提供一种数据处理的方法,降低通信系统的建设及维护成本,提高系统的安全性能。Therefore, it is necessary to provide a data processing method, reduce the construction and maintenance cost of the communication system, and improve the security performance of the system.
申请内容Application content
本申请提供一种基于区块链的数据处理方法、设备和系统,能够降低通信系统的建设及维护成本,提高系统的安全性能。The present application provides a data processing method, device and system based on a blockchain, which can reduce the construction and maintenance cost of the communication system and improve the security performance of the system.
第一方面,提供了一种基于区块链的数据处理方法,包括:第一设备与第二设备建立通信连接,所述第二设备为区块链网络中的设备;所述第一设备确定所述第一设备产生的第一数据需要在所述区块链网络中进行认证;所述第一设备向所述第二设备发送所述第一数据,以实现所述第一数据由所述区块链网络中的设备进行认证。In a first aspect, a data processing method based on a blockchain is provided, including: establishing, by a first device, a communication connection with a second device, where the second device is a device in a blockchain network; The first data generated by the first device needs to be authenticated in the blockchain network; the first device sends the first data to the second device to implement the first data by the The devices in the blockchain network are authenticated.
根据本申请实施例的基于区块链的数据处理方法,第一设备在产生需要在区块链网络中进行认证的第一数据时,向区块链网络中的第二设备发送第一数据,使得第二设备将第一数据发送给区块链网络中的设备,实现第一数据的认证。由于采用区块链网络对数据进行认证,能够降低通信系统的建设及维护成本,提高系统的安全性能。并且由第二设备将第一设备的数据发送给区块链网络中的设备进行认证,能够降低对第一设备的能力要求。According to the blockchain-based data processing method of the embodiment of the present application, the first device sends the first data to the second device in the blockchain network when generating the first data that needs to be authenticated in the blockchain network. The second device is caused to send the first data to the device in the blockchain network to implement authentication of the first data. By using the blockchain network to authenticate data, the construction and maintenance costs of the communication system can be reduced, and the security performance of the system can be improved. And the second device sends the data of the first device to the device in the blockchain network for authentication, which can reduce the capability requirement for the first device.
需要说明的是,本申请实施例中,认证指的是区块链共识认证或者一致性认证。 It should be noted that, in the embodiment of the present application, the authentication refers to blockchain consensus authentication or consistency authentication.
可选地,第一设备可以为物联网设备,第一设备不是区块链网络中的设备。第一设备不需要通过公式算法对数据进行认证。Alternatively, the first device may be an Internet of Things device, and the first device is not a device in a blockchain network. The first device does not need to authenticate the data by a formula algorithm.
可选地,第二设备通过广播发送的方式向区块链网络中的设备发送第一数据,区块链网络中的所有设备(包括第二设备)均可以争取认证权,对第一数据进行认证。Optionally, the second device sends the first data to the device in the blockchain network by means of broadcast sending, and all devices (including the second device) in the blockchain network can obtain the authentication right, and perform the first data. Certification.
结合第一方面,在第一方面的一种实现方式中,所述第一设备与第二设备建立通信连接,包括:所述第一设备向所述第二设备发送采用第一公钥加密过的第一消息,所述第一消息中包括第一信息,所述第一公钥为所述第二设备的公钥,所述第一信息用于请求所述第二设备将所述第一设备产生的需要在所述区块链网络中进行认证的数据发送给所述区块链网络中的设备进行认证;所述第一设备接收所述第二设备发送的第二信息,所述第二信息用于指示所述第二设备确认能够将所述第一设备产生的需要在所述区块链网络中进行认证的数据发送给所述区块链网络中的设备进行认证。With reference to the first aspect, in an implementation manner of the first aspect, the first device establishes a communication connection with the second device, where the first device sends the first public key to the second device The first message, the first message includes first information, the first public key is a public key of the second device, and the first information is used to request the second device to be the first Data generated by the device that needs to be authenticated in the blockchain network is sent to a device in the blockchain network for authentication; the first device receives second information sent by the second device, where the The second information is used to indicate that the second device confirms that the data generated by the first device that needs to be authenticated in the blockchain network is sent to a device in the blockchain network for authentication.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,所述第一消息中还包括第二公钥,所述第二公钥为所述第一设备的公钥。In conjunction with the first aspect and the foregoing implementation manner, in another implementation manner of the first aspect, the first message further includes a second public key, where the second public key is a public key of the first device.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,所述第一设备接收第二设备发送的第二信息,包括:所述第一设备接收所述第二设备发送的采用所述第二公钥加密过的所述第二信息。In combination with the first aspect and the foregoing implementation manner, in another implementation manner of the first aspect, the receiving, by the first device, the second information that is sent by the second device, The second information encrypted by the second public key.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,所述第一设备向所述第二设备发送所述第一数据,包括:所述第一设备生成承载所述第一数据的区块;所述第一设备向所述第二设备发送所述区块。In conjunction with the first aspect and the foregoing implementation manner, in another implementation manner of the first aspect, the sending, by the first device, the first data to the second device, a block of the first data; the first device transmits the block to the second device.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,在所述第一设备与第二设备建立通信连接之前,所述方法还包括:所述第一设备接收所述第二设备发送的第三信息,所述第三信息中包括第一哈希HASH值要求;所述第一设备生成满足所述第一HASH值要求的第一HASH值。In conjunction with the first aspect and the foregoing implementation manner, in another implementation manner of the first aspect, before the first device establishes a communication connection with the second device, the method further includes: the first device receiving the The third information sent by the second device, where the third information includes a first hash HASH value requirement; the first device generates a first HASH value that meets the first HASH value requirement.
由于第一设备只能在生成满足哈希值要求的哈希值之后,才能与第二设备建立通信连接,因此可以降低多个设备与第二设备建立通信连接时的冲突概率,并且使得区块链网络具有较好的伸缩性,支持不同需求的设备的接入。Since the first device can only establish a communication connection with the second device after generating a hash value that satisfies the hash value requirement, the collision probability when the plurality of devices establish a communication connection with the second device can be reduced, and the block is made The chain network has better scalability and supports access of devices with different needs.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,所述第三信息中包括至少一个HASH值要求,所述至少一个HASH值要求中包括所述第一HASH值要求,所述至少一个HASH值要求中的每个HASH值 要求与至少一种业务类型相对应;In conjunction with the first aspect and the foregoing implementation manner, in another implementation manner of the first aspect, the third information includes at least one HASH value requirement, where the at least one HASH value requirement includes the first HASH value requirement , each HASH value in the at least one HASH value requirement Requirement to correspond to at least one type of business;
其中,在所述第一设备生成满足所述第一HASH值要求的第一HASH值之前,所述方法还包括:所述第一设备根据所述第一数据对应的业务类型,确定所述第一HASH值。The method further includes: determining, by the first device, the first device according to the service type corresponding to the first data, before the first device generates the first HASH value that meets the first HASH value requirement. A HASH value.
本申请实施例的哈希值要求与业务类型相关,由此能够满足设备不同的接入时延的要求和认证时延要求。The hash value of the embodiment of the present application is related to the service type, so that different access delay requirements and authentication delay requirements of the device can be met.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,所述第三信息中包括至少一个HASH值要求,所述至少一个HASH值要求中包括所述第一HASH值要求,所述至少一个HASH值要求中的每个HASH值要求与至少一个设备组相对应;In conjunction with the first aspect and the foregoing implementation manner, in another implementation manner of the first aspect, the third information includes at least one HASH value requirement, where the at least one HASH value requirement includes the first HASH value requirement And each of the at least one HASH value requirement corresponds to at least one device group;
其中,在所述第一设备生成满足所述第一HASH值要求的第一HASH值之前,所述方法还包括:所述第一设备根据所述第一设备所属的设备组,确定所述第一HASH值。Before the first device generates the first HASH value that meets the first HASH value requirement, the method further includes: determining, by the first device, the first device according to the device group to which the first device belongs A HASH value.
可选地,第二设备对设备进行分组时,根据设备的计算能力进行分组,或者,根据设备的业务类型进行分组。Optionally, when the second device groups the devices, grouping according to the computing capability of the device, or grouping according to the service type of the device.
本申请实施例的哈希值要求与设备组相关,由此能够满足设备不同的接入时延的要求和认证时延要求。The hash value of the embodiment of the present application is related to the device group, so that different access delay requirements and authentication delay requirements of the device can be met.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,所述方法还包括:所述第一设备向第三设备发送与所述第一数据相关的第二HASH值,所述第二HASH值用于所述第三设备确定第二数据的完整性,第二数据为所述第一数据在所述区块链网络中经过认证后的数据。In conjunction with the first aspect and the foregoing implementation manner, in another implementation manner of the first aspect, the method further includes: the first device sending, to the third device, a second HASH value related to the first data, The second HASH value is used by the third device to determine the integrity of the second data, and the second data is the data after the first data is authenticated in the blockchain network.
在本申请实施例中,数据的完整性用于指示数据是否在区块链网络中被认证的过程中丢失或者被篡改。In the embodiment of the present application, the integrity of the data is used to indicate whether the data is lost or tampered with during the authentication process in the blockchain network.
可选地,第三设备为物联网设备,第三设备不是区块链网络中的设备。Optionally, the third device is an Internet of Things device, and the third device is not a device in a blockchain network.
可选地,第一数据为与第一设备和第三设备相关的数据,例如,第一数据为第一设备和第三设备之间的交易数据。或者第一数据为与第一设备和其他物联网设备相关的数据,例如,第一数据为第一设备和其他物联网设备之间的交易数据。Optionally, the first data is data related to the first device and the third device, for example, the first data is transaction data between the first device and the third device. Or the first data is data related to the first device and other IoT devices, for example, the first data is transaction data between the first device and other IoT devices.
由此,能够保证数据的保密性和完整性,使得区块链网络中存储的数据具有更高的可靠性。Thereby, the confidentiality and integrity of the data can be ensured, and the data stored in the blockchain network has higher reliability.
可选地,如果第一数据是未经过第三设备的公钥加密过的,且第二数据 也是未经过第三设备的公钥加密过的,第二设备可以直接计算第二数据的哈希值,之后比较计算得到的哈希值和接收到的哈希值是否一致。Optionally, if the first data is not encrypted by the public key of the third device, and the second data is The second device can directly calculate the hash value of the second data, and then compare whether the calculated hash value and the received hash value are consistent.
或者,如果第一数据是未经过第三设备的公钥加密过的,但第二数据是经过第三设备的公钥加密过的,第二设备获取到第二数据之后,先对第二数据进行解密,之后计算解密后的数据的哈希值,进而将计算得到的哈希值与接收到的哈希值进行对比。Alternatively, if the first data is not encrypted by the public key of the third device, but the second data is encrypted by the public key of the third device, after the second device obtains the second data, the second data is first Decryption is performed, and then the hash value of the decrypted data is calculated, and then the calculated hash value is compared with the received hash value.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,所述第一数据是经过所述第三设备的公钥加密过的。In conjunction with the first aspect and the foregoing implementation manner, in another implementation manner of the first aspect, the first data is encrypted by a public key of the third device.
可选地,如果第二数据是经过第三设备的公钥加密过的,第三设备可以直接计算第二数据的哈希值,之后将计算的哈希值和接收到的哈希值进行对比,以确定第二数据的完整性。Optionally, if the second data is encrypted by the public key of the third device, the third device may directly calculate the hash value of the second data, and then compare the calculated hash value with the received hash value. To determine the integrity of the second data.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,所述方法还包括:With reference to the first aspect and the foregoing implementation manner, in another implementation manner of the first aspect, the method further includes:
所述第一设备根据所述第一数据确定所述第二HASH值。The first device determines the second HASH value according to the first data.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,所述第一数据是经过第三设备的公钥加密过的,所述方法还包括:所述第一设备向所述第三设备发送所述第一数据,以便于所述第三设备在根据所述第一数据确定第二HASH值后,根据所述第二HASH值确定第二数据的完整性,第二数据为所述第一数据在所述区块链网络中经过认证后的数据。In conjunction with the first aspect and the foregoing implementation manner, in another implementation manner of the first aspect, the first data is encrypted by a public key of the third device, and the method further includes: the first device The third device sends the first data, so that the third device determines the integrity of the second data according to the second HASH value after determining the second HASH value according to the first data, and second The data is the authenticated data of the first data in the blockchain network.
可选地,如果第二数据是经过第三设备的公钥加密过的,第三设备获取到第二数据时,先进性解密,再计算解密后的数据的哈希值,之后将计算得到的解密后的数据的哈希值与第二HASH值进行对比,以确定第二数据的完整性。Optionally, if the second data is encrypted by the public key of the third device, when the third device acquires the second data, the advancedity is decrypted, and then the hash value of the decrypted data is calculated, and then the calculated value is obtained. The hash value of the decrypted data is compared to the second HASH value to determine the integrity of the second data.
或者,如果第二数据是未经过第三设备的公钥加密过的,第三设备可以直接计算第二数据的哈希值,之后将计算得到的哈希值与第二HASH值进行对比,以确定第二数据的完整性。Alternatively, if the second data is not encrypted by the public key of the third device, the third device may directly calculate the hash value of the second data, and then compare the calculated hash value with the second HASH value to Determine the integrity of the second data.
可选地,第一数据是未经过第三设备的公钥加密过的,如果第二数据也是未经过第三设备的公钥加密过的,第三设备直接计算第二数据的哈希值,之后将计算得到的第二数据的哈希值与第二HASH值进行对比,以确定第二数据的完整性。Optionally, the first data is not encrypted by the public key of the third device. If the second data is also not encrypted by the public key of the third device, the third device directly calculates the hash value of the second data. The calculated hash value of the second data is then compared with the second HASH value to determine the integrity of the second data.
或者,第一数据是未经过第三设备的公钥加密过的,第二数据是经过第 三设备的公钥加密过的,第三设备先对第二数据进行解密,再计算解密后的数据的哈希值,之后将计算得到的加密后的数据的哈希值与第二HASH值进行对比,以确定第二数据的完整性。Or, the first data is not encrypted by the public key of the third device, and the second data is After the public key of the three devices is encrypted, the third device decrypts the second data, and then calculates the hash value of the decrypted data, and then performs the calculated hash value of the encrypted data and the second HASH value. Contrast to determine the integrity of the second data.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,所述方法还包括:所述第一设备接收所述第二设备发送的第四信息,所述第四信息用于指示所述第一数据已经在所述区块链网络中经过N次认证,N的取值为预设值。In conjunction with the first aspect and the foregoing implementation manner, in another implementation manner of the first aspect, the method further includes: the first device receiving fourth information sent by the second device, where the fourth information is used by And indicating that the first data has been authenticated N times in the blockchain network, and the value of N is a preset value.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,所述方法还包括:所述第一设备接收所述第二设备发送的第二数据对应的梅克尔Merkle树信息和区块信息,第二数据为所述第一数据在所述区块链网络中经过认证后的数据,所述区块信息用于指示所述区块链网络中承载第二数据的区块。In conjunction with the first aspect and the foregoing implementation manner, in another implementation manner of the first aspect, the method further includes: the first device receiving a Merkel Merkle tree corresponding to the second data sent by the second device Information and block information, the second data is the authenticated data of the first data in the blockchain network, and the block information is used to indicate a region carrying the second data in the blockchain network. Piece.
当第一设备接收到第二数据对应的Merkle树信息和区块信息时,第一设备可以获知第一数据已经在区块链网络中完整N次认证。When the first device receives the Merkle tree information and the block information corresponding to the second data, the first device may learn that the first data has been completely N times authenticated in the blockchain network.
可选地,区块信息为区块的高度或区块的标识。Optionally, the block information is the height of the block or the identity of the block.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,所述方法还包括:所述第一设备确定从所述区块链网络中删除第二数据,第二数据为所述第一数据在所述区块链网络中经过认证后的数据;所述第一设备向所述区块链网络中的设备发送第五信息,所述第五信息用于指示所述区块链网络中的设备从所述区块链网络中删除第二数据。In another implementation manner of the first aspect, the method further includes: the first device determining to delete the second data from the blockchain network, where the second data is The first data is authenticated data in the blockchain network; the first device sends fifth information to a device in the blockchain network, and the fifth information is used to indicate the area A device in the blockchain network deletes the second data from the blockchain network.
本申请实施例的基于区块链的数据处理方法,能够根据需求删除区块链网络中存储的数据,由此能够降低网络负载,降低区块链的传输需要占用的传输带宽。The blockchain-based data processing method of the embodiment of the present application can delete data stored in the blockchain network according to requirements, thereby reducing network load and reducing transmission bandwidth required for transmission of the blockchain.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,所述第五信息中包括标识信息和/或第二数据对应的Merkle树信息,所述标识信息用于标识第二数据。With reference to the first aspect and the foregoing implementation manner, in another implementation manner of the first aspect, the fifth information includes the identifier information and/or the Merkle tree information corresponding to the second data, where the identifier information is used to identify the first Two data.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,所述方法还包括:所述第一设备删除所述第一设备的本地存储的所述第一数据。In conjunction with the first aspect and the foregoing implementation manner, in another implementation manner of the first aspect, the method further includes: deleting, by the first device, the first data that is locally stored by the first device.
由此,能够降低第一设备的存储负担。Thereby, the storage load of the first device can be reduced.
第二方面,提供了一种基于区块链的数据处理方法,包括:第二设备与第一设备建立通信连接,所述第二设备为区块链网络中的设备;所述第二设 备接收所述第一设备发送的由所述第一设备产生的需要在所述区块链网络中认证的第一数据;所述第二设备向所述区块链网络中的设备发送所述第一数据,实现所述第一数据的认证。A second aspect provides a data processing method based on a blockchain, including: establishing, by a second device, a communication connection with a first device, where the second device is a device in a blockchain network; Receiving, by the first device, first data generated by the first device that needs to be authenticated in the blockchain network; the second device sending the information to a device in the blockchain network The first data, the authentication of the first data is implemented.
根据本申请实施例的基于区块链的数据处理方法,第二设备接收第一设备产生的需要在区块链网络中进行认证的第一数据,并将第一数据发送给区块链网络中的设备,实现第一数据的认证。由于采用区块链网络对数据进行认证,能够降低通信系统的建设及维护费用,提高系统的安全性能。并且由第二设备将第一设备的数据发送给区块链网络中的设备进行认证,能够降低对第一设备的能力要求。According to the blockchain-based data processing method of the embodiment of the present application, the second device receives the first data generated by the first device that needs to be authenticated in the blockchain network, and sends the first data to the blockchain network. The device implements the authentication of the first data. By using the blockchain network to authenticate data, the construction and maintenance costs of the communication system can be reduced, and the security performance of the system can be improved. And the second device sends the data of the first device to the device in the blockchain network for authentication, which can reduce the capability requirement for the first device.
结合第二方面,在第二方面的一种实现方式中,所述第二设备与所述第一设备建立通信连接,包括:所述第二设备接收所述第一设备发送的采用第一公钥加密过的第一消息,所述第一消息中包括第一信息,所述第一公钥为所述第二设备的公钥,所述第一信息用于请求所述第二设备将所述第一设备产生的需要在所述区块链网络中进行认证的数据发送给所述区块链网络中的设备进行认证;所述第二设备向所述第一设备发送第二信息,所述第二信息用于指示所述第二设备确认能够将所述第一设备产生的需要在所述区块链网络中进行认证的数据发送给所述区块链网络中的设备进行认证。With the second aspect, in an implementation manner of the second aspect, the second device establishes a communication connection with the first device, where the second device receives the first public a first message that is encrypted by the key, the first message includes first information, the first public key is a public key of the second device, and the first information is used to request the second device to The data generated by the first device that needs to be authenticated in the blockchain network is sent to the device in the blockchain network for authentication; the second device sends the second information to the first device. The second information is used to indicate that the second device confirms that the data generated by the first device that needs to be authenticated in the blockchain network is sent to a device in the blockchain network for authentication.
结合第二方面及其上述实现方式,在第二方面的另一实现方式中,所述第一消息中还包括第二公钥,所述第二公钥为所述第一设备的公钥。In conjunction with the second aspect and the foregoing implementation manner, in another implementation manner of the second aspect, the first message further includes a second public key, where the second public key is a public key of the first device.
结合第二方面及其上述实现方式,在第二方面的另一实现方式中,所述第二设备向所述第一设备发送第二信息,包括:所述第二设备向所述第一设备发送采用所述第二公钥加密过的所述第二信息。With the second aspect and the foregoing implementation manner, in another implementation manner of the second aspect, the second device sends the second information to the first device, including: the second device to the first device Sending the second information encrypted by the second public key.
结合第二方面及其上述实现方式,在第二方面的另一实现方式中,在所述第二设备与第一设备建立通信连接之后,所述方法还包括:所述第二设备产生预设数量的数字货币。With the second aspect and the foregoing implementation manner, in another implementation manner of the second aspect, after the second device establishes a communication connection with the first device, the method further includes: the second device generating a preset The number of digital currencies.
结合第二方面及其上述实现方式,在第二方面的另一实现方式中,所述方法还包括:所述第二设备向所述区块链网络中的设备发送所述数字货币的相关信息;若所述第二设备确定所述数字货币在所述区块链网络中经过M次认证,所述第二设备确认所述数字货币生效,M的取值为预设值。With reference to the second aspect and the foregoing implementation manner, in another implementation manner of the second aspect, the method further includes: the second device sending the related information of the digital currency to a device in the blockchain network And if the second device determines that the digital currency has undergone M authentication in the blockchain network, the second device confirms that the digital currency is valid, and the value of M is a preset value.
结合第二方面及其上述实现方式,在第二方面的另一实现方式中,所述第二设备接收所述第一设备发送的由所述第一设备产生的需要在所述区块 链网络中认证的第一数据,包括:所述第二设备接收所述第一设备发送的承载所述第一数据的区块;In conjunction with the second aspect and the foregoing implementation manner, in another implementation manner of the second aspect, the second device receives, by the first device, the need generated by the first device in the block The first data that is authenticated in the chain network includes: the second device receives a block that is sent by the first device and that carries the first data;
其中,所述第二设备向所述区块链网络中的设备发送所述第一数据,包括:所述第二设备向所述区块链网络中的设备发送所述承载所述第一数据的区块。The sending, by the second device, the first data to the device in the blockchain network, the second device sending the bearer the first data to a device in the blockchain network Block.
结合第二方面及其上述实现方式,在第二方面的另一实现方式中,所述第二设备向所述区块链网络中的设备发送所述第一数据,包括:所述第二设备根据所述区块链网络要求的区块格式,生成承载所述第一数据的区块;所述第二设备向所述区块链网络中的设备发送所述承载所述第一数据的区块。With reference to the second aspect and the foregoing implementation manner, in another implementation manner of the second aspect, the second device sends the first data to a device in the blockchain network, including: the second device Generating, according to the block format required by the blockchain network, a block that carries the first data; the second device sends the area that carries the first data to a device in the blockchain network Piece.
结合第二方面及其上述实现方式,在第二方面的另一实现方式中,在所述第二设备与所述第一设备建立通信连接之前,所述方法还包括:所述第二设备确定第一哈希HASH值要求;所述第二设备向所述第一设备发送第三信息,所述第三信息中包括所述第一HASH值要求,使得所述第一设备在生成满足所述第一HASH值要求的第一HASH值之后,与所述第二设备建立通信连接。With reference to the second aspect and the foregoing implementation manner, in another implementation manner of the second aspect, before the second device establishes a communication connection with the first device, the method further includes: determining, by the second device a first hash HASH value request; the second device sends third information to the first device, where the third information includes the first HASH value requirement, so that the first device meets the generation After the first HASH value required by the first HASH value, a communication connection is established with the second device.
由于第一设备只能在生成满足哈希值要求的哈希值之后,才能与第二设备建立通信连接,因此可以降低多个设备与第二设备建立通信连接时的冲突概率,并且使得区块链网络具有较好的伸缩性,支持不同需求的设备的接入。Since the first device can only establish a communication connection with the second device after generating a hash value that satisfies the hash value requirement, the collision probability when the plurality of devices establish a communication connection with the second device can be reduced, and the block is made The chain network has better scalability and supports access of devices with different needs.
结合第二方面及其上述实现方式,在第二方面的另一实现方式中,所述第三信息中包括至少一个HASH值要求,所述至少一个HASH值要求中包括所述第一HASH值要求,所述至少一个HASH值要求中的每个HASH值要求与至少一种业务类型相对应;In conjunction with the second aspect and the foregoing implementation manner, in another implementation manner of the second aspect, the third information includes at least one HASH value requirement, where the at least one HASH value requirement includes the first HASH value requirement And each of the at least one HASH value requirement corresponds to at least one service type;
其中,所述第二设备确定第一哈希HASH值要求,包括:所述第二设备确定所述至少一个HASH值要求。The determining, by the second device, the first hash HASH value request includes: determining, by the second device, the at least one HASH value requirement.
本申请实施例的哈希值要求与业务类型相关,由此能够满足设备不同的接入时延的要求和认证时延要求。The hash value of the embodiment of the present application is related to the service type, so that different access delay requirements and authentication delay requirements of the device can be met.
结合第二方面及其上述实现方式,在第二方面的另一实现方式中,所述第三信息中包括至少一个HASH值要求,所述至少一个HASH值要求中包括所述第一HASH值要求,所述至少一个HASH值要求中的每个HASH值要求与至少一个设备组相对应;In conjunction with the second aspect and the foregoing implementation manner, in another implementation manner of the second aspect, the third information includes at least one HASH value requirement, where the at least one HASH value requirement includes the first HASH value requirement And each of the at least one HASH value requirement corresponds to at least one device group;
其中,所述第二设备确定第一哈希HASH值要求,包括:所述第二设备 确定所述至少一个HASH值要求。The second device determines a first hash HASH value requirement, including: the second device Determining the at least one HASH value requirement.
可选地,第二设备对设备进行分组时,根据设备的计算能力进行分组,或者,根据设备的业务类型进行分组。Optionally, when the second device groups the devices, grouping according to the computing capability of the device, or grouping according to the service type of the device.
本申请实施例的哈希值要求与设备组相关,由此能够满足设备不同的接入时延的要求和认证时延要求。The hash value of the embodiment of the present application is related to the device group, so that different access delay requirements and authentication delay requirements of the device can be met.
结合第二方面及其上述实现方式,在第二方面的另一实现方式中,所述方法还包括:所述第二设备接收所述第一设备发送的与所述第一数据相关的第二HASH值,所述第二HASH值用于第三设备确定第二数据的完整性,第二数据为所述第一数据在所述区块链网络中经过认证后的数据;所述第二设备向所述第三设备发送所述第二HASH值。With reference to the second aspect and the foregoing implementation manner, in another implementation manner of the second aspect, the method further includes: the second device receiving, by the first device, a second information related to the first data that is sent by the first device a HASH value, the second HASH value is used by the third device to determine the integrity of the second data, and the second data is the authenticated data of the first data in the blockchain network; Sending the second HASH value to the third device.
结合第二方面及其上述实现方式,在第二方面的另一实现方式中,所述第一数据是经过所述第三设备的公钥加密过的。With reference to the second aspect and the foregoing implementation manner, in another implementation manner of the second aspect, the first data is encrypted by a public key of the third device.
结合第二方面及其上述实现方式,在第二方面的另一实现方式中,所述第二HASH值是由所述第一设备根据所述第一数据确定的。With reference to the second aspect and the foregoing implementation manner, in another implementation manner of the second aspect, the second HASH value is determined by the first device according to the first data.
结合第二方面及其上述实现方式,在第二方面的另一实现方式中,所述第一数据是经过第三设备的公钥加密过的,所述方法还包括:所述第二设备接收所述第一数据;所述第二设备向所述第三设备发送所述第一数据,以便于所述第三设备在根据所述第一数据确定第二HASH值后,根据所述第二HASH值确定第二数据的完整性,第二数据为所述第一数据在所述区块链网络中经过认证后的数据。With reference to the second aspect and the foregoing implementation manner, in another implementation manner of the second aspect, the first data is encrypted by a public key of the third device, the method further includes: receiving, by the second device The first data is sent by the second device to the third device, so that the third device, according to the first data, determines the second HASH value, according to the second data. The HASH value determines the integrity of the second data, and the second data is the authenticated data of the first data in the blockchain network.
结合第二方面及其上述实现方式,在第二方面的另一实现方式中,所述方法还包括:若所述第二设备确定所述第一数据已经在所述区块链网络中经过N次认证,所述第二设备向所述第三设备发送第二数据对应梅克尔Merkle树信息和区块信息,所述区块信息用于指示所述区块链网络中承载所述第二数据的区块,第二数据为所述第一数据在所述区块链网络中经过认证后的数据,其中,N的取值为预设值。With reference to the second aspect and the foregoing implementation manner, in another implementation manner of the second aspect, the method further includes: if the second device determines that the first data has passed the N in the blockchain network The second device sends the second data corresponding to the Merkel tree information and the block information to the third device, where the block information is used to indicate that the second chain is carried in the blockchain network. The block of data, the second data is the authenticated data of the first data in the blockchain network, wherein the value of N is a preset value.
结合第二方面及其上述实现方式,在第二方面的另一实现方式中,所述方法还包括:若所述第二设备确定所述第一数据已经在所述区块链网络中经过N次认证,所述第二设备向所述第一设备发送第四信息,所述第四信息用于指示所述第一数据已经在所述区块链网络中经过N次认证,其中,N的取值为预设值。 With reference to the second aspect and the foregoing implementation manner, in another implementation manner of the second aspect, the method further includes: if the second device determines that the first data has passed the N in the blockchain network The second device sends the fourth information to the first device, where the fourth information is used to indicate that the first data has been authenticated N times in the blockchain network, where The value is the default value.
结合第二方面及其上述实现方式,在第二方面的另一实现方式中,所述方法还包括:若所述第二设备确定所述第一数据已经在所述区块链网络中经过N次认证,所述第二设备向所述第一设备发送第二数据对应的Merkle树信息和区块信息,所述区块信息用于指示所述区块链网络中承载第二数据的区块,第二数据为所述第一数据在所述区块链网络中经过认证后的数据,其中,N的取值为预设值。With reference to the second aspect and the foregoing implementation manner, in another implementation manner of the second aspect, the method further includes: if the second device determines that the first data has passed the N in the blockchain network The second device sends the Merkle tree information and the block information corresponding to the second data to the first device, where the block information is used to indicate the block that carries the second data in the blockchain network. The second data is the authenticated data of the first data in the blockchain network, where the value of N is a preset value.
结合第二方面及其上述实现方式,在第二方面的另一实现方式中,所述方法还包括:所述第二设备接收所述第一设备发送的第五信息,所述第五信息用于指示所述区块链网络中的设备从所述区块链网络中删除第二数据,第二数据为所述第一数据在所述区块链网络中经过认证后的数据。With reference to the second aspect and the foregoing implementation manner, in another implementation manner of the second aspect, the method further includes: receiving, by the second device, fifth information sent by the first device, where the fifth information is used by The device in the blockchain network is instructed to delete the second data from the blockchain network, where the second data is the authenticated data of the first data in the blockchain network.
结合第二方面及其上述实现方式,在第二方面的另一实现方式中,所述第五信息中包括标识信息和/或第二数据对应的Merkle树信息,所述标识信息用于标识所述第二数据。With reference to the second aspect and the foregoing implementation manner, in another implementation manner of the second aspect, the fifth information includes the identifier information and/or the Merkle tree information corresponding to the second data, where the identifier information is used to identify the location The second data is described.
第三方面,提供了一种基于区块链的数据处理方法,包括:第三设备获取第二数据对应的梅克尔Merkle树信息和区块信息,所述区块信息用于指示区块链网络中承载所述第二数据的区块,第二数据为所述第一数据在所述区块链网络中进过认证后的数据,所述第一数据为第一设备产生的需要在区块链网络中进行认证的数据;所述第三设备根据所述Merkle树信息从承载第二数据的区块中获取第二数据;所述第三设备确定第二数据的完整性。In a third aspect, a data processing method based on a blockchain is provided, including: acquiring, by a third device, Merkel tree information and block information corresponding to the second data, where the block information is used to indicate a blockchain a block in the network that carries the second data, where the second data is the data that the first data has been authenticated in the blockchain network, and the first data is a required area generated by the first device. Data for authentication in the blockchain network; the third device acquires second data from the block carrying the second data according to the Merkle tree information; and the third device determines the integrity of the second data.
根据本申请的基于区块链的数据处理方法,第三设备可以根据接收到的Merkle树信息和区块信息,获取区块链网络中存储的与第一设备产生的需要在区块链网络中进行认证的第一数据对应的第二数据,并确认第二数据的完整性。由此,能够保证数据的保密性和完整性,使得区块链网络中存储的数据具有更高的可靠性。According to the blockchain-based data processing method of the present application, the third device may acquire, according to the received Merkle tree information and the block information, the need generated by the first device stored in the blockchain network in the blockchain network. And performing second data corresponding to the first data of the authentication, and confirming the integrity of the second data. Thereby, the confidentiality and integrity of the data can be ensured, and the data stored in the blockchain network has higher reliability.
结合第三方面,在第三方面的一种实现方式中,若所述第三设备确认第二数据完整,所述方法还包括:所述第三设备向所述区块链网络中的设备发送确认信息,所述确认信息用于指示第二数据完整。With reference to the third aspect, in an implementation manner of the third aspect, if the third device confirms that the second data is complete, the method further includes: sending, by the third device, a device in the blockchain network A confirmation message is used to indicate that the second data is complete.
在本申请实施例中,第三设备发送的确认信息可以在区块链网络中进行认证。In the embodiment of the present application, the confirmation information sent by the third device may be authenticated in the blockchain network.
结合第三方面及其上述实现方式,在第三方面的另一实现方式中,所述第三设备获取第二数据对应的梅克尔Merkle树信息和区块信息,包括:所 述第三设备接收第二设备发送的所述Merkle树信息和所述区块信息,其中,所述第二设备为所述区块链网络中的设备。With reference to the third aspect and the foregoing implementation manner, in another implementation manner of the third aspect, the third device acquires Merkel tree information and block information corresponding to the second data, including: The third device receives the Merkle tree information and the block information sent by the second device, where the second device is a device in the blockchain network.
可选地,第三设备可以接收区块链网络中的多个设备发送的Merkle树信息和区块信息,由此可以避免区块链网络中的设备被攻击时带来的潜在风险。Optionally, the third device may receive the Merkle tree information and the block information sent by the multiple devices in the blockchain network, thereby avoiding the potential risk caused by the device in the blockchain network being attacked.
结合第三方面及其上述实现方式,在第三方面的另一实现方式中,所述第二设备为将所述第一数据发送给所述区块链网络中进行认的设备。In conjunction with the third aspect and the foregoing implementation manner, in another implementation manner of the third aspect, the second device is a device that sends the first data to the blockchain network for authentication.
结合第三方面及其上述实现方式,在第三方面的另一实现方式中,所述方法还包括:所述第三设备确定与所述第一数据相关的第二哈希HASH值;In conjunction with the third aspect and the foregoing implementation manner, in another implementation manner of the third aspect, the method further includes: determining, by the third device, a second hash HASH value related to the first data;
其中,所述第三设备确定第二数据的完整性,包括:所述第三设备根据与第二数据相关的第三HASH值和所述第二HASH值的一致性,确定第二数据的完整性。The third device determines the integrity of the second data, including: the third device determines the integrity of the second data according to the consistency of the third HASH value and the second HASH value associated with the second data. Sex.
结合第三方面及其上述实现方式,在第三方面的另一实现方式中,所述第三设备确定与所述第一数据相关的第二哈希HASH值,包括:所述第三设备接收所述第二HASH值,其中,所述第二HASH值是由所述第一设备根据所述第一数据确定的。With reference to the third aspect and the foregoing implementation manner, in another implementation manner of the third aspect, the third device determines, by the third device, a second hash HASH value that is related to the first data, The second HASH value, wherein the second HASH value is determined by the first device according to the first data.
结合第三方面及其上述实现方式,在第三方面的另一实现方式中,所述第一数据是经过所述第三设备的公钥加密过的。In conjunction with the third aspect and the foregoing implementation manner, in another implementation manner of the third aspect, the first data is encrypted by a public key of the third device.
结合第三方面及其上述实现方式,在第三方面的另一实现方式中,所述第一数据是经过所述第三设备的公钥加密过的,所述方法还包括:所述第三设备接收所述第一设备发送的所述第一数据;所述第三设备根据所述第一数据,确定所述第二HASH值。In conjunction with the third aspect and the foregoing implementation manner, in another implementation manner of the third aspect, the first data is encrypted by a public key of the third device, and the method further includes: the third Receiving, by the device, the first data sent by the first device; and determining, by the third device, the second HASH value according to the first data.
结合第三方面及其上述实现方式,在第三方面的另一实现方式中,所述方法还包括:所述第三设备确定从所述区块链网络中删除第二数据;所述第三设备向所述区块链网络中的设备发送第五信息,所述第五信息用于指示所述区块链网络中的设备从所述区块链网络中删除第二数据。With reference to the third aspect and the foregoing implementation manner, in another implementation manner of the third aspect, the method further includes: the third device determines to delete the second data from the blockchain network; The device sends fifth information to the device in the blockchain network, where the fifth information is used to indicate that the device in the blockchain network deletes the second data from the blockchain network.
结合第三方面及其上述实现方式,在第三方面的另一实现方式中,所述第五信息中包括标识信息和/或第二数据对应的Merkle树信息,所述标识信息用于标识第二数据。With reference to the third aspect and the foregoing implementation manner, in another implementation manner of the third aspect, the fifth information includes the identifier information and/or the Merkle tree information corresponding to the second data, where the identifier information is used to identify the first Two data.
第四方面,提供了一种设备,用于执行上述第一方面或第一方面的任意可能的实现方式中的方法。具体地,所述设备包括用于执行上述第一方面或 第一方面的任意可能的实现方式中的方法的功能模块。In a fourth aspect, an apparatus is provided for performing the method of any of the above-described first aspect or any of the possible implementations of the first aspect. Specifically, the device includes means for performing the first aspect described above or A functional module of a method in any of the possible implementations of the first aspect.
第五方面,提供了一种设备,用于执行上述第二方面或第二方面的任意可能的实现方式中的方法。具体地,所述设备包括用于执行上述第二方面或第二方面的任意可能的实现方式中的方法的功能模块。In a fifth aspect, an apparatus is provided for performing the method of any of the above-described second aspect or any of the possible implementations of the second aspect. In particular, the apparatus comprises functional modules for performing the method of any of the possible implementations of the second aspect or the second aspect described above.
第六方面,提供了一种设备,用于执行上述第三方面或第三方面的任意可能的实现方式中的方法。具体地,所述设备包括用于执行上述第三方面或第三方面的任意可能的实现方式中的方法的功能模块。In a sixth aspect, an apparatus is provided for performing the method of any of the above-described third aspect or any of the possible implementations of the third aspect. In particular, the apparatus comprises functional modules for performing the method of any of the above-described third or third aspects of the third aspect.
第七方面,提供了一种设备,包括处理器、存储器和收发器。所述处理器、所述存储器和所述收发器之间通过内部连接通路互相通信,传递控制和/或数据信号,使得所述设备执行上述第一方面或第一方面的任意可能的实现方式中的方法。In a seventh aspect, an apparatus is provided comprising a processor, a memory, and a transceiver. The processor, the memory, and the transceiver communicate with each other through an internal connection path, transmitting control and/or data signals, such that the device performs the first aspect or any of the possible implementations of the first aspect Methods.
第八方面,提供了一种设备,包括处理器、存储器和收发器。所述处理器、所述存储器和所述收发器之间通过内部连接通路互相通信,传递控制和/或数据信号,使得所述设备执行上述第二方面或第二方面的任意可能的实现方式中的方法。In an eighth aspect, an apparatus is provided comprising a processor, a memory, and a transceiver. The processor, the memory, and the transceiver communicate with each other through an internal connection path, transmitting control and/or data signals, such that the device performs any of the second or second aspects of the foregoing possible implementations. Methods.
第九方面,提供了一种设备,包括处理器、存储器和收发器。所述处理器、所述存储器和所述收发器之间通过内部连接通路互相通信,传递控制和/或数据信号,使得所述设备执行上述第三方面或第三方面的任意可能的实现方式中的方法。In a ninth aspect, an apparatus is provided comprising a processor, a memory and a transceiver. The processor, the memory, and the transceiver communicate with each other through an internal connection path, transmitting control and/or data signals, such that the device performs any of the third or third aspects of the foregoing possible implementations. Methods.
第十方面,提供了一种通信系统,包括第四方面、第五方面和第六方面中的设备。或者包括第七方面、第八方面和第九方面中的设备。In a tenth aspect, a communication system is provided, comprising the apparatus of the fourth aspect, the fifth aspect, and the sixth aspect. Or the apparatus of the seventh aspect, the eighth aspect, and the ninth aspect.
第十一方面,提供了一种计算机可读介质,用于存储计算机程序,所述计算机程序包括用于执行上述第一方面或第一方面的任意可能的实现方式中的指令。In an eleventh aspect, a computer readable medium is provided for storing a computer program, the computer program comprising instructions for performing the first aspect or any of the possible implementations of the first aspect.
第十二方面,提供了一种计算机可读介质,用于存储计算机程序,所述计算机程序包括用于执行上述第二方面或第二方面的任意可能的实现方式中的指令。According to a twelfth aspect, a computer readable medium for storing a computer program, the computer program comprising instructions for performing any of the second aspect or the second aspect of the second aspect.
第十三方面,提供了一种计算机可读介质,用于存储计算机程序,所述计算机程序包括用于执行上述第三方面或第三方面的任意可能的实现方式中的指令。 A thirteenth aspect, a computer readable medium for storing a computer program, the computer program comprising instructions for performing any of the possible implementations of the third or third aspect above.
附图说明DRAWINGS
图1是本申请实施例的应用场景的示意图;FIG. 1 is a schematic diagram of an application scenario of an embodiment of the present application;
图2是根据本申请实施例的基于区块链的数据处理方法的示意性流程图;2 is a schematic flowchart of a blockchain-based data processing method according to an embodiment of the present application;
图3是根据本申请实施例的设备建立通信连接的方法的示意性流程图;3 is a schematic flowchart of a method for establishing a communication connection by a device according to an embodiment of the present application;
图4是根据本申请另一实施例的基于区块链的数据处理方法的示意性流程图;4 is a schematic flowchart of a blockchain-based data processing method according to another embodiment of the present application;
图5是根据本申请再一实施例的基于区块链的数据处理方法的示意性流程图;FIG. 5 is a schematic flowchart of a blockchain-based data processing method according to still another embodiment of the present application; FIG.
图6是根据本申请再一实施例的基于区块链的数据处理方法的示意性流程图;FIG. 6 is a schematic flowchart of a blockchain-based data processing method according to still another embodiment of the present application; FIG.
图7是根据本申请再一实施例的基于区块链的数据处理方法的示意性流程图;FIG. 7 is a schematic flowchart of a blockchain-based data processing method according to still another embodiment of the present application; FIG.
图8是根据本申请实施例的设备的示意性框图;FIG. 8 is a schematic block diagram of an apparatus according to an embodiment of the present application; FIG.
图9是根据本申请另一实施例的设备的示意性;Figure 9 is a schematic illustration of an apparatus in accordance with another embodiment of the present application;
图10是根据本申请再一实施例的设备的示意性框图;FIG. 10 is a schematic block diagram of an apparatus according to still another embodiment of the present application; FIG.
图11是根据本申请再一实施例的设备的示意性框图;11 is a schematic block diagram of an apparatus according to still another embodiment of the present application;
图12是根据本申请再一实施例的设备的示意性框图;FIG. 12 is a schematic block diagram of an apparatus according to still another embodiment of the present application; FIG.
图13是根据本申请再一实施例的设备的示意性框图。FIG. 13 is a schematic block diagram of an apparatus in accordance with still another embodiment of the present application.
具体实施方式detailed description
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。The technical solutions in the embodiments of the present application will be clearly and completely described in the following with reference to the accompanying drawings in the embodiments.
图1是本申请实施例的应用场景的示意图。如图1所示,虚线范围内的节点之间构成一个区块链网络,物联网设备不在区块链网络中,并且区块链网络中的区块节点可以作为物联网设备的代理节点,将物联网设备产生的需要在区块链网络中传播并验证的数据发送给区块链网络中的节点,实现数据的验证。需要说明的是,本申请实施例中“节点”与“设备”具有相同的意义。FIG. 1 is a schematic diagram of an application scenario of an embodiment of the present application. As shown in Figure 1, nodes in the dotted line form a blockchain network, IoT devices are not in the blockchain network, and block nodes in the blockchain network can act as proxy nodes for IoT devices. The data generated by the IoT device that needs to be propagated and verified in the blockchain network is sent to the nodes in the blockchain network to implement data verification. It should be noted that “node” and “device” have the same meaning in the embodiment of the present application.
在本申请实施例中,区块链网络中的区块节点可以是私有节点、运营商网络节点(例如,基站设备),也可以是一定的行业组织、团体和个人部署 的站点(Station)。In the embodiment of the present application, the block node in the blockchain network may be a private node, an operator network node (for example, a base station device), or may be a certain industry organization, group, and individual deployment. Site (Station).
在本申请实施例中,物联网设备可以包括但不限于移动台(Mobile Station,MS)、移动终端(Mobile Terminal)、移动电话(Mobile Telephone)、用户设备(User Equipment,UE)、手机(handset)及便携设备(portable equipment)、车辆(vehicle)等,例如,终端设备可以是移动电话(或称为“蜂窝”电话)、具有无线通信功能的计算机等,终端设备还可以是便携式、袖珍式、手持式、计算机内置的或者车载的移动装置。In the embodiment of the present application, the Internet of Things device may include, but is not limited to, a mobile station (Mobile Station, MS), a mobile terminal (Mobile Terminal), a mobile phone (Mobile Telephone), a user equipment (User Equipment, UE), a mobile phone (handset). And a portable device, a vehicle, etc., for example, the terminal device may be a mobile phone (or "cellular" phone), a computer having a wireless communication function, etc., and the terminal device may also be portable, pocket-sized , handheld, computer built-in or in-vehicle mobile devices.
并且,区块链网络中没有中心化的硬件或者管理机构,任意节点之间的权利和义务都是均等的,且任何一节点的损坏或者丢失都不影响整个区块链网络的运作,因此,区块链网络具有去中心化的特点。区块链网络中的每个节点之间进行数据交换是无需互相信任的,整个区块链网络的运作规则是公开透明的,所有的数据内容是公开的,因此在区块链网络的规则范围和时间范围内,节点之间是不能也无法欺骗其他节点的,因此,区块链网络具有去信任的特征。区块链网络总的数据块由整个系统中所有具有维护功能的节点共同维护,而这些具有维护功能的节点时任何人都可以参与的,因此,区块链网络具有集体维护的特征。区块链网络通过分数据库的形式,让每个参与节点都能获得一份完整数据库的拷贝。除非能够同时控制整个网络中超过51%的节点,否则单个节点上对数据库的修改时无效的,也无法影响其他节点上的数据内容。因此,区块链网络具有可靠的数据库。Moreover, there is no centralized hardware or management mechanism in the blockchain network, and the rights and obligations between any nodes are equal, and the damage or loss of any node does not affect the operation of the entire blockchain network. Blockchain networks are characterized by decentralization. Data exchange between each node in the blockchain network does not need to trust each other. The operation rules of the entire blockchain network are open and transparent, and all data content is public, so the rule scope of the blockchain network And within the time range, nodes can not and can not deceive other nodes, therefore, the blockchain network has the feature of trust. The total block of the blockchain network is maintained by all nodes with maintenance functions in the entire system, and any node with maintenance functions can participate. Therefore, the blockchain network has the characteristics of collective maintenance. The blockchain network allows each participating node to obtain a copy of the complete database in the form of a sub-database. Unless you can control more than 51% of the nodes in the entire network at the same time, the modification of the database on a single node is invalid, and it cannot affect the data content on other nodes. Therefore, the blockchain network has a reliable database.
由于区块链网络具有以上多个特征和物联网中的设备的数量将会急剧增长,可以将区块链网络与物联网进行结合,实现物联网的自我治理,并提高物联网的安全性能。Since the blockchain network has the above characteristics and the number of devices in the Internet of Things will increase dramatically, the blockchain network and the Internet of Things can be combined to realize the self-governance of the Internet of Things and improve the security performance of the Internet of Things.
但大多数物联网设备的计算能力非常有限,所以无法将物联网设备直接加入到区块链网络中。需要提供一种数据处理的方法,通过将区块链网络与物联网进行结合,降低通信系统的建设及维护费用,提高系统的安全性能。However, the computing power of most IoT devices is very limited, so IoT devices cannot be directly added to the blockchain network. It is necessary to provide a data processing method, which combines the blockchain network and the Internet of Things to reduce the construction and maintenance costs of the communication system and improve the security performance of the system.
为了方便理解本申请,在结合图1描述本申请的方法之前,首先在此具体介绍一下区块链网络中的几个要素以及区块链网络中的区块节点的工作方法。In order to facilitate the understanding of the present application, before describing the method of the present application in conjunction with FIG. 1, firstly, several elements in the blockchain network and the working methods of the block nodes in the blockchain network are specifically described herein.
需要说明的是,本申请实施例中,设备产生的数据包括与该设备和其对端设备相关的数据和普通的数据。在描述区块链网络中的要素以及区块链网络中个区块节点的工作方法时,以与设备和其对端设备相关的数据为例,具 体以与设备和其对端设备相关的数据为交易数据为例进行描述,但这并不限定本申请实施例的范围。其中:It should be noted that, in the embodiment of the present application, the data generated by the device includes data related to the device and its peer device and common data. When describing the elements in the blockchain network and the working methods of the block nodes in the blockchain network, taking the data related to the device and its peer device as an example, The data is described by taking the data related to the device and its peer device as transaction data, but this does not limit the scope of the embodiments of the present application. among them:
区块,是一个被包含在区块链中的聚合了数据的容器数据结构,它由一个包含元数据的区块头和紧跟其后的构成区块主体的一长串交易组成。区块具体包括:区块大小字段,通常为4个字节;区块头字段,通常为80个字节;交易计数器字段,一般为1-9个字节,记录交易数量;交易字段,通常为可变长度,记录交易详情。A block is a containerized data structure of data that is contained in a blockchain. It consists of a block header containing metadata and a long list of transactions that immediately follow the body of the block. The block specifically includes: a block size field, usually 4 bytes; a block header field, usually 80 bytes; a transaction counter field, generally 1-9 bytes, recording the number of transactions; a transaction field, usually Variable length, record transaction details.
区块头由三组元数据组成,首先是一组引用父区块哈希值的数据,这组元数据用于将该区块与区块链中的前一区块相连接。第二组元数据包括难度、时间戳和只是用一次的数字(Number used once,简称为“Nonce”)。第三组元数据是梅克尔(Merkle)数根(一种用来有效总结区块中所有交易的数据结构)。区块头具体包括以下字段:版本字段,通常为4字节;父区块哈希值字段,通常为32字节,用于引用区块链中父区块的哈希值;Merkle根字段,用于记录该区块中交易的Merkle树根的哈希值;时间戳字段,通常为4字段,用于标识区块产生的近似时间,精确到秒;Nonce字段,是用于工作量证明算法的计数器。The block header consists of three sets of metadata, first a set of data that references the hash value of the parent block, which is used to connect the block to the previous block in the blockchain. The second set of metadata includes difficulty, timestamp, and number used once (Number used once, simply "Nonce"). The third set of metadata is the Merkle number (a data structure used to effectively summarize all transactions in the block). The block header specifically includes the following fields: the version field, usually 4 bytes; the parent block hash value field, usually 32 bytes, used to reference the hash value of the parent block in the blockchain; the Merkle root field, The hash value of the Merkle root of the transaction in the block; the timestamp field, usually 4 fields, is used to identify the approximate time generated by the block, accurate to the second; the Nonce field is used for the workload proof algorithm. counter.
每个区块都可以通过其区块头的“父区块哈希值字段”引用前一个区块。也就是说,每个区块头部包含它的父区块的哈希值。并且每个区块只有一个父区块,但是可以临时有多个子区块。一个区块出现多个子区块的情况称为“区块链分叉”。区块链分叉指示一个暂时状态,最终只有一个子区块会成为区块链的一部分。Each block can reference the previous block through the "parent block hash value field" of its block header. That is, each block header contains the hash value of its parent block. And each block has only one parent block, but there can be multiple sub-blocks temporarily. The case where multiple sub-blocks appear in one block is called "block chain fork". A blockchain fork indicates a temporary state, and eventually only one sub-block becomes part of the blockchain.
区块链,是由区块从后向前有序链接起来的数据结构,每个区块都指向前一个区块。它可以被存储为一种包含非相对关系记录的文件,或是存储在一个简单的数据库中。可以将区块链看成一个堆栈,高度就表示区块与首区块之间的距离,以及顶部或顶端表示最新的区块。对每个区块头进行加密哈(例如,安全散列算法(Secure Hash Algorithm,简称为“SHA”)),可生成一个哈希值。通过这个哈希值可以识别区块链中的对应区块。A blockchain is a data structure in which blocks are sequentially linked from the back to the front, and each block points to the previous block. It can be stored as a file containing non-relative relationship records or stored in a simple database. You can think of a blockchain as a stack, with a height indicating the distance between the block and the first block, and a top or top indicating the most recent block. Encryption of each block header (for example, Secure Hash Algorithm ("SHA")) can generate a hash value. The corresponding block in the blockchain can be identified by this hash value.
对于整个区块链网络,需要达到的目标是所有节点共同同意某一个信息并将它更新到总的共享账本中。为此,区块链网络中引入了共识机制,共识机制中两种典型的算法为工作量证明和权益证明。其中:For the entire blockchain network, the goal is to have all nodes agree to a certain piece of information and update it to the total shared ledger. To this end, a consensus mechanism is introduced in the blockchain network. Two typical algorithms in the consensus mechanism are workload proof and equity proof. among them:
工作量证明(Proof Of Work,简称为“PoW”),本质是为信息传递加入 成本,降低信息传输的速率,并加入一个随机元素保证一个时间段内只有一个节点可以有权进行信息广播。这个随机元素就是让节点去计算一个随机哈希值。具体就是区块节点根据获得的输入数据,计算得到一串64位的随机数字和字母的字符串,但只有得到满足哈希值要求的哈希值的节点可以被区块链网络接受为工作量证明。并且工作量证明的哈希算法还通过将每一个新生区块中的信息作为下一次哈希算法的输入值的方式,实现了历史信息的穿了,形成了可追溯的链条(区块链)。Proof Of Work ("PoW"), the essence is to join the information transfer Cost, reduce the rate of information transmission, and add a random element to ensure that only one node in a time period can have the right to broadcast information. This random element is for the node to calculate a random hash value. Specifically, the block node calculates a string of 64-bit random numbers and letters according to the obtained input data, but only the node that obtains the hash value satisfying the hash value can be accepted as the workload by the blockchain network. prove. And the hash algorithm of the workload proof also realizes the wear of historical information by using the information in each new block as the input value of the next hash algorithm, forming a traceable chain (blockchain). .
权益证明,目的是实现区块链由那些具有经济利益的人进行保障,这种方法是通过每笔交易销毁的币天数(Coindays)来实现权益证明。现有的权益证明体系,例如点点币(Peercoin)是基于证据区块的,在证据区块中,矿工必须达成的目标与销毁币天数是负相关的。拥有Peercoin的人必须选择称为权益证明的挖矿人,并在一段时间内贡献他们的一部分币来保护区块链网络。Proof of interest, the purpose is to achieve blockchain protection by those with financial interests, this method is to achieve the proof of equity through the number of coins destroyed in each transaction (Coindays). The existing proof of equity system, such as Peercoin, is based on evidence blocks in which the target that the miner must achieve is inversely related to the number of days of destruction. People with Peercoin must choose a miner called a proof of equity and contribute a portion of their currency over a period of time to protect the blockchain network.
下面将结合以上的描述,详细描述根据本申请实施例的基于区块链的数据处理方法。图2示出了根据本申请实施例的基于区块链的数据处理方法。如图2所示,方法100包括:A blockchain-based data processing method according to an embodiment of the present application will be described in detail below in conjunction with the above description. FIG. 2 illustrates a blockchain-based data processing method in accordance with an embodiment of the present application. As shown in FIG. 2, the method 100 includes:
S101,第一设备与第二设备建立通信连接,第二设备为区块链网络中的设备;S101. The first device establishes a communication connection with the second device, where the second device is a device in the blockchain network.
S102,第一设备产生需要在区块链网络中认证的数据;S102. The first device generates data that needs to be authenticated in the blockchain network.
S103,第二设备接收第一设备发送的需要在区块链网络中认证的数据;S103. The second device receives data that is sent by the first device and needs to be authenticated in the blockchain network.
S104,第二设备向区块链网络中的设备发送所述数据,实现所述数据的认证。S104. The second device sends the data to a device in the blockchain network to implement authentication of the data.
需要说明的是,本申请实施例中的认证指的是进行区块链共识认证或一致性认证。It should be noted that the authentication in the embodiment of the present application refers to performing blockchain consensus authentication or consistency authentication.
可选地,在方法100中第一设备为物联网设备中的设备,第一设备的计算能力有限。第二设备将第一设备的数据发送给区块链网络中的设备,可以理解为第二设备为第一设备的代理设备。Optionally, in the method 100, the first device is a device in the Internet of Things device, and the computing capability of the first device is limited. The second device sends the data of the first device to the device in the blockchain network, which can be understood as the proxy device of the first device.
具体地,在一些实施例中,第一设备与第二设备可以根据图3所示的方法建立通信连接。以第一设备为物联网设备为例进行描述,如图3所示,方法200包括:Specifically, in some embodiments, the first device and the second device can establish a communication connection according to the method illustrated in FIG. The first device is described as an Internet of Things device. As shown in FIG. 3, the method 200 includes:
S201,物联网设备接收第二设备发送的公钥信息; S201. The IoT device receives the public key information sent by the second device.
在S201中,物联网设备可以接收区块链网络中具有服务物联网设备的功能的所有设备发送的公钥信息,之后物联网设备可以根据信息的接收质量等参数,判断选择区块链网络中的那个设备作为自己的代理设备,将自己产生的需要在区块链网络中进行认证的数据发送给区块链网络中的设备。In S201, the Internet of Things device can receive public key information sent by all devices in the blockchain network that have the function of serving the Internet of Things device, and then the IoT device can determine the selected blockchain network according to parameters such as the receiving quality of the information. The device acts as its own proxy device and sends its own data that needs to be authenticated in the blockchain network to the devices in the blockchain network.
S202,物联网设备确定第二设备作为其代理设备后,确定接入第二设备的接入序列;S202. After determining, by the IoT device, the second device, as the proxy device, determining an access sequence for accessing the second device.
需要说明的是,第二设备作为物联网设备的代理设备,也可以理解为,第二设备为与物联网设备相关联的设备。It should be noted that the second device is a proxy device of the Internet of Things device, and the second device is also a device associated with the Internet of Things device.
可选地,S202中的接入序列可以为现有(Long Term Evolution,简称为“LTE”)中的随机接入序列。例如,可以为Zadoff-Chu(ZC)序列。Optionally, the access sequence in S202 may be a random access sequence in an existing (Long Term Evolution, hereinafter referred to as “LTE”). For example, it can be a Zadoff-Chu (ZC) sequence.
S203,物联网设备与第二设备进行同步;S203. The IoT device synchronizes with the second device.
可选地,当物联网设备与第二设备之间的距离大于预设值时,物联网设备与第二设备之间需要进行同步。此时,第二设备可以不再广播消息中广播公钥信息,而是通过同步过程中的相关消息携带公钥信息。Optionally, when the distance between the IoT device and the second device is greater than a preset value, synchronization between the IoT device and the second device is required. At this time, the second device may not broadcast the public key information in the broadcast message, but carry the public key information through the related message in the synchronization process.
但需要说明的是,当物联网设备与第二设备不需要进行同步时,例如,物联网设备与第二设备之间的距离小于或等于预设值时。第二设备需要在S201中向物联网设备广播自己的公钥信息。However, it should be noted that when the IoT device and the second device do not need to synchronize, for example, when the distance between the IoT device and the second device is less than or equal to a preset value. The second device needs to broadcast its own public key information to the Internet of Things device in S201.
S204,物联网设备向第二设备发送采用第二设备的公钥加密过的初始接入消息;S204. The IoT device sends an initial access message encrypted by the public key of the second device to the second device.
其中,在初始接入消息中包括第一信息,第一信息用于请求第二设备将物联网设备的数据发送给区块链网络中的设备进行认证。这里的第一信息可以是显示的指示信息,也可以是隐式指示的信息,例如,第一信息具体可以是区块信息,当第二设备确定初始接入消息中包含区块信息时,第二设备确认物理网设备请求自己将物联网设备的数据转发给区块链网络中的其他设备。The first information is included in the initial access message, where the first information is used to request the second device to send data of the Internet of Things device to the device in the blockchain network for authentication. The first information here may be the indication information that is displayed, or may be the information that is implicitly indicated. For example, the first information may specifically be the block information, and when the second device determines that the initial access message includes the block information, the first The second device confirms that the physical network device requests to forward the data of the IoT device to other devices in the blockchain network.
或者,进一步地,在初始接入消息中还包括物联网设备的公钥信息。Or, further, the public key information of the Internet of Things device is further included in the initial access message.
S205,第二设备确定是否能够为物联网设备转发其产生的需要在区块链网络中进行认证的数据;S205. The second device determines whether the data generated by the IoT device that needs to be authenticated in the blockchain network is forwarded.
可选地,第二设备接收到物联网设备发送的初始接入消息之后,采用自己的私钥加密该初始接入消息,然后根据自身的接纳能力确认是否接纳物联网设备的请求。 Optionally, after receiving the initial access message sent by the IoT device, the second device encrypts the initial access message with its own private key, and then confirms whether to accept the request of the IoT device according to its own admission capability.
或者,第二设备先决定是否可以接收物联网设备的请求,在确定可以接纳该物联网设备时,使用其私钥加密初始接入消息,可以理解的是,在这种方式中,上述的第一信息需要包含在初始接入消息的消息头中,Alternatively, the second device first determines whether the request of the IoT device can be received, and when determining that the IoT device can be accepted, encrypting the initial access message by using its private key, it can be understood that, in this manner, the foregoing A message needs to be included in the header of the initial access message.
S206,第二设备向物联网设备发送反馈信息;S206. The second device sends feedback information to the Internet of Things device.
在S206中,反馈信息用于告知物联网设备第二设备可以将物联网设备产生的需要在区块链网络中进行认证的数据发送给区块链网络中的设备,实现数据的认证。In S206, the feedback information is used to notify the IoT device that the second device can send the data generated by the IoT device that needs to be authenticated in the blockchain network to the device in the blockchain network to implement data authentication.
可选地,当S204中的初始接入消息中包括物联网设备的公钥信息时,第二设备向物联网设备采用物联网设备的公钥加密反馈信息,之后向物联网设备发送加密过的反馈信息。Optionally, when the initial access message in the S204 includes the public key information of the Internet of Things device, the second device encrypts the feedback information to the Internet of Things device by using the public key of the Internet of Things device, and then sends the encrypted information to the Internet of Things device. Feedback.
S207,物联网设备根据反馈信息,与第二设备建立通信连接。S207. The Internet of Things device establishes a communication connection with the second device according to the feedback information.
进而,物联网设备与第二设备建立通信连接之后,物联网设备在产生需要在区块链网络中进行认证的数据时,首先将数据发送给第二设备,由第二设备将数据广播到区块链网络中进行认证和传播。Further, after the IoT device establishes a communication connection with the second device, when the IoT device generates data that needs to be authenticated in the blockchain network, the data is first sent to the second device, and the second device broadcasts the data to the region. Authentication and dissemination in a blockchain network.
如前文中所述的,物联网设备产生的数据包括交易数据和普通的数据。例如,物联网设备可以是智能洗衣机,智能洗衣机可以自动购买洗衣液,在此交易过程中产生的数据为交易数据。或者物联网设备为家里的智能水龙头,水龙头可以自动购买自来水厂的水,不同的水龙头可以购买不同的水源,例如净化用水、洗涤用水、卫生间用水等,各个不同的水龙头可以独立进行买卖交易,产生交易数据。As described in the foregoing, data generated by IoT devices includes transaction data and general data. For example, the Internet of Things device may be a smart washing machine, and the smart washing machine may automatically purchase the washing liquid, and the data generated during the transaction is transaction data. Or the Internet of Things device is a smart faucet at home. The faucet can automatically purchase water from the water plant. Different faucets can purchase different water sources, such as purified water, washing water, toilet water, etc. Different faucets can be independently traded and sold. Transaction data.
或者很多电器的一些关键零部件都可以加上特定的物联网传感器,用户可以通过这个部件的使用时间向厂家付费,在零部件可能存在故障隐患时,厂家就会主动进行维修或更换,这种场景下,物联网设备产生的数据为普通的数据,也即非交易数据。再例如,家里的空气净化器,检测到的PM2.5的数据也为普通的数据。Or some key components of many electrical appliances can be added with specific IoT sensors. Users can pay the manufacturer through the use time of this component. When the components may have hidden troubles, the manufacturer will take the initiative to repair or replace them. In the scenario, the data generated by the IoT device is ordinary data, that is, non-transaction data. For example, in the home air purifier, the detected PM2.5 data is also ordinary data.
在本申请实施例中,当第二设备接纳物联网设备之后,第二设备可以有权利产生一定数量的数字货币。因此,方法200还包括:In the embodiment of the present application, after the second device receives the Internet of Things device, the second device may have the right to generate a certain amount of digital currency. Therefore, the method 200 further includes:
S208,第二设备产生预设数量的数字货币;S208. The second device generates a preset number of digital currencies.
可选地,可以预先设置数字货币的产生规则,例如,可以预先规定每10分钟产生一个数字货币。Alternatively, the generation rule of the digital currency may be set in advance, for example, one digital currency may be generated every 10 minutes in advance.
S209,第二设备向区块链网络中的其他设备广播其产生的数字货币的相 关信息;S209. The second device broadcasts the phase of the digital currency generated by the second device to the other devices in the blockchain network. Information
可选地,数字货币的相关信息包括数字货币的数量。Optionally, the relevant information of the digital currency includes the number of digital currencies.
可选地,在第二设备广播其产生的数字货币的同时,可以向区块链网络中的其他设备广播物联网设备的相关信息,这里的物联网设备的相关信息作用是用于告知区块链网络中的其他设备这些数字货币的产生是由于接纳了物联网设备才产生的。举例来说,物联网设备的相关信息可以包括物联网设备的公钥信息,或者物联网设备的其他的具体信息,例如,物联网设备标识符信息等。Optionally, while the second device broadcasts the digital currency generated by the second device, the related information of the Internet of Things device may be broadcast to other devices in the blockchain network, where the related information of the IoT device is used to notify the block. Other devices in the chain network These digital currencies are generated because they are connected to IoT devices. For example, the related information of the Internet of Things device may include public key information of the Internet of Things device, or other specific information of the Internet of Things device, for example, IoT device identifier information, and the like.
S210,第二节点确认其生产生的数字货币在区块链网络中进行了M次认证时,第二设备确认其产生的数字货币生效。S210. The second node confirms that the digital currency generated by the second node is M-authenticated in the blockchain network, and the second device confirms that the digital currency generated by the second device is valid.
可选地,在S210中M的数值可以是预先设置的。例如,M的值为6。Alternatively, the value of M in S210 may be preset. For example, the value of M is 6.
由此,物联网设备和第二设备根据方法200建立起了通信连接。之后,当物联网设备产生需要在区块链网络中进行认证的数据时,可以根据图4所示的方法与第二设备进行通信。如图4所示,方法300包括:Thus, the IoT device and the second device establish a communication connection in accordance with method 200. Thereafter, when the IoT device generates data that needs to be authenticated in the blockchain network, it can communicate with the second device according to the method shown in FIG. As shown in FIG. 4, method 300 includes:
S301,物联网设备产生了需要在区块链网络中进行认证的数据;S301. The Internet of Things device generates data that needs to be authenticated in the blockchain network;
S302,物联网设备向第二设备发送所述数据;S302. The IoT device sends the data to the second device.
可选地,物联网设备可以直接将所述数据发送给物联网设备,或者物联网设备生成包括所述数据的区块,将区块发送给第二设备。Optionally, the IoT device may directly send the data to the IoT device, or the IoT device generates a block including the data, and sends the block to the second device.
S303,第二设备将接收到的数据广播到区块链网络中进行认证;S303. The second device broadcasts the received data to the blockchain network for authentication.
可选地,第二设备根据区块链网络中的区块格式生成承载所述数据的区块,将区块广播到区块链中。或者,如果在S302中第二设备接收到的是物联网设备发送的承载所述数据的区块,第二设备直接将接收到的区块广播到区块链网络中。Optionally, the second device generates a block that carries the data according to a block format in the blockchain network, and broadcasts the block into the blockchain. Alternatively, if the second device receives the block that carries the data sent by the IoT device in S302, the second device directly broadcasts the received block to the blockchain network.
S304,区块链网络中的设备对所述数据进行认证;S304. The device in the blockchain network authenticates the data.
可选地,区块链网络中的设备对数据进行认证的方法,可以采用上文中所述的工作量证明法或权益证明法,为避免重复,在此不再赘述。Optionally, the method for authenticating the data in the device in the blockchain network may use the workload proof method or the equity proof method described above. To avoid repetition, no further details are provided herein.
S305,第二设备确定数据已经经过N次认证;S305. The second device determines that the data has been authenticated N times.
第二设备根据当前网络中广播的区块链的深度,即可以确定出数据是否已经经过N次认证。The second device can determine whether the data has been authenticated N times according to the depth of the blockchain broadcasted in the current network.
S306,第二设备向物联网设备发送认证完成消息;S306. The second device sends an authentication completion message to the Internet of Things device.
该认证完成消息用于通知物联网设备其产生的数据已经经过了N次认 证;The authentication completion message is used to notify the IoT device that the data generated by the IoT device has passed N times. certificate;
S307,物联网设备删除存储的数据;S307. The Internet of Things device deletes the stored data.
可选地,物联网设备接收到第二设备发送的认证完成消息之后,确认产生的数据已经被区块链网络中的设备进行了N次认证,所有物联网设备将本地存储的数据删除。Optionally, after receiving the authentication completion message sent by the second device, the IoT device confirms that the generated data has been authenticated N times by the device in the blockchain network, and all the IoT devices delete the locally stored data.
可以看出,采用方法100至300中的方法对数据进行处理,由于能够使得物联网设备与区块链网络中的设备建立通信连接,使得区块链网络中的设备将物联网设备产生的需要进行认证的数据广播到区块链网络中,并通过区块链网络中的设备对数据进行认证。由此能够有效降低物联网设备的计算力要求,尤其对于低成本呢、低功耗的物联网设备非常有利。It can be seen that the data is processed by the methods in the methods 100 to 300, and the requirements of the devices in the blockchain network for the IoT devices can be made because the IoT devices can establish communication connections with devices in the blockchain network. The authenticated data is broadcast to the blockchain network and the data is authenticated by devices in the blockchain network. Therefore, the computing power requirement of the Internet of Things device can be effectively reduced, especially for a low-cost, low-power IoT device.
但是,当物联网设备的数量较多时,多个物联网设备可能选择以区块链网络中的同一个设备建立通信连接,这样就会发生接入冲突,并且不同的数据可能有不同的接入延时和认证延时要求,因此在上述方法100至300的基础上,需要降低多个物联网设备接入时的冲突概率,满足不同数据对接入时延和认证时延的要求。However, when the number of IoT devices is large, multiple IoT devices may choose to establish communication connections with the same device in the blockchain network, so that access conflicts may occur, and different data may have different access. Delay and authentication delay requirements, therefore, based on the above methods 100 to 300, it is necessary to reduce the collision probability of multiple IoT devices when accessing, and meet the requirements of different data for access delay and authentication delay.
图5示出了根据本申请再一实施例的基于区块链的数据处理方法,以第一设备为物联网设备为例,如图5所示,方法400包括:FIG. 5 illustrates a data processing method based on a blockchain according to still another embodiment of the present application. The first device is an Internet of Things device. As shown in FIG. 5, the method 400 includes:
S401,第二设备确定哈希值要求;S401. The second device determines a hash value requirement.
可选地,第二设备根据当前与其建立通信连接的物联网设备的数量确定哈希值要求,或者第二设备根据预测的在一定的接入高峰时段的接入请求量确定哈希值要求。例如,在第二设备确定当前与其建立通信连接的物联网设备的数量较多时,广播难度较大的哈希值要求,这里的难度较大可以理解为要求产生的低位为零的比特的个数超过一定的门限值。例如,产生的哈希值要求可以是哈希值的低位预设数量的比特为零或一个预设的量。Optionally, the second device determines a hash value requirement according to the number of IoT devices that are currently establishing a communication connection with the second device, or the second device determines the hash value requirement according to the predicted access request amount during a certain access peak period. For example, when the second device determines that the number of IoT devices that are currently in communication connection with the device is large, the hash value that is difficult to broadcast is required, and the difficulty here is understood to be the number of bits that require the generated low bit to be zero. Exceeded a certain threshold. For example, the generated hash value requirement may be a low order number of bits of the hash value of zero or a preset amount.
S402,第二设备广播其确定的哈希值要求;S402. The second device broadcasts its determined hash value request.
S403,物联网设备产生满足哈希值要求的哈希值,之后与第二设备建立通信连接;S403. The IoT device generates a hash value that meets a hash value requirement, and then establishes a communication connection with the second device.
在S403中物联网设备与第二设备建立通信连接的方法与方法200中相同,为避免重复,在此不再赘述。The method for establishing a communication connection between the IoT device and the second device in S403 is the same as that in the method 200. To avoid repetition, details are not described herein again.
S404,物联网设备向第二设备发送需要在区块链网络中进行认证的数据; S404. The IoT device sends data to the second device that needs to be authenticated in the blockchain network.
S405,第二设备将接收到的数据广播到区块链网络中进行认证;S405. The second device broadcasts the received data to the blockchain network for authentication.
可选地,第二设备将数据广播到区块链网络中时,可以同时争取验证权,当第二设备获得认证权时,第二设备根据当前区块链网络中存在的所有物联网设备的数据产生新的区块,并将产生的区块串接在当前的区块链中,之后将区块链广播到区块链网络中。Optionally, when the second device broadcasts the data to the blockchain network, the authentication right may be acquired at the same time. When the second device obtains the authentication right, the second device is configured according to the data of all the Internet of Things devices existing in the current blockchain network. A new block is generated and the resulting block is concatenated in the current blockchain, after which the blockchain is broadcast into the blockchain network.
S406,第二设备更新哈希值要求;S406. The second device updates the hash value requirement.
可选地,第二设备可以根据物联网设备的接入量,或者根据预测的在一定的接入高峰时段的接入请求量,或者接入冲突概率,调整哈希值要求。例如,当第二设备确定当前的接入请求较少,或者接入冲突概率较少时,第二设备确定难为较小的哈希值要求。Optionally, the second device may adjust the hash value according to the access amount of the IoT device, or according to the predicted access request amount during a certain access peak period, or the access collision probability. For example, when the second device determines that the current access request is less, or the access collision probability is less, the second device determines that it is difficult to be a smaller hash value requirement.
S407,第二设备向物联网设备发送更新后的哈希值要求;S407. The second device sends the updated hash value request to the Internet of Things device.
S408,物联网设备更新记录的第二设备的哈希值要求;S408, a hash value requirement of the second device of the IoT device update record;
S409,当物联网设备再次有需要在区块链网络中进行认证的数据时,向第二设备发送数据,实现数据的认证。S409: When the IoT device again needs data to be authenticated in the blockchain network, send data to the second device to implement data authentication.
可选地,在S401或S406中,第二设备可以根据不同的业务类型确定不同的哈希值要求。相对应的,在S402或S407中,第二设备将多个哈希值要求发送给物联网设备。当物联网设备产生需要在区块链网络中进行认证的数据时,物联网设备根据数据的业务类型,确定产生的哈希值需要满足的哈希值要求,在产生满足哈希值要求的哈希值之后,与第二设备建立通信连接,实现数据的认证。Optionally, in S401 or S406, the second device may determine different hash value requirements according to different service types. Correspondingly, in S402 or S407, the second device sends multiple hash value requests to the Internet of Things device. When the IoT device generates data that needs to be authenticated in the blockchain network, the IoT device determines the hash value that the generated hash value needs to satisfy according to the service type of the data, and generates a hash value that satisfies the hash value requirement. After the hash value, a communication connection is established with the second device to implement data authentication.
或者,在S401或S406中,第二设备将物联网设备进行分组(例如,可以根据物联网设备的能力进行分组),根据不同的分组产生不同的哈希值要求。相对应的,在S402或S407中,第二设备将多个哈希值要求发送给物联网设备。当物联网设备产生需要在区块链网络中进行认证的数据时,物联网设备根据自己所属的分组,确定产生的哈希值需要满足的哈希值要求,在产生满足哈希值要求的哈希值之后,与第二设备建立通信连接,实现数据的认证。其中,第二设备可以在广播消息中携带物联网设备的分组信息,物联网设备根据分组信息,确定自己所属的分组。Alternatively, in S401 or S406, the second device groups the IoT devices (eg, may be grouped according to the capabilities of the IoT device), and generates different hash value requirements according to different packets. Correspondingly, in S402 or S407, the second device sends multiple hash value requests to the Internet of Things device. When the IoT device generates data that needs to be authenticated in the blockchain network, the IoT device determines the hash value that the generated hash value needs to satisfy according to the group to which it belongs, and generates a hash value that satisfies the hash value requirement. After the hash value, a communication connection is established with the second device to implement data authentication. The second device may carry the grouping information of the Internet of Things device in the broadcast message, and the Internet of Things device determines the group to which it belongs according to the grouping information.
由此,根据方法400中的处理数据的方法,能够保证物联网设备与区块链网络中的设备建立通信连接的灵活性,使得通信系统具有很好的伸缩性。Thus, according to the method of processing data in the method 400, the flexibility of the IoT device to establish a communication connection with the device in the blockchain network can be ensured, so that the communication system has good scalability.
在本申请实施例中,当物联网设备产生的数据为交易数据时,需要保证 物联网设备的交易数据的保密性和完整性,因此需要物联网设备的对端设备能够及时验证相关交易数据的真实性。以物联网设备的对端设备同样是物联网设备为例,描述根据本申请再一实施例的基于区块链的数据处理方法,为了描述方便,将进行交互的物联网设备分别标记为物联网设备A和物联网设备B。如图6所示,方法500包括:In the embodiment of the present application, when the data generated by the Internet of Things device is transaction data, it needs to be guaranteed. The confidentiality and integrity of the transaction data of the Internet of Things device requires the peer device of the IoT device to verify the authenticity of the relevant transaction data in time. Taking the peer device of the Internet of Things device as an example of the Internet of Things device as an example, a blockchain-based data processing method according to still another embodiment of the present application is described. For convenience of description, the interactive IoT devices are respectively marked as the Internet of Things. Device A and IoT Device B. As shown in FIG. 6, method 500 includes:
S501,当物联网设备A确定交易数据需要在区块链网络中进行认证时,物联网设备A向物联网设备B发送与交易数据相关的哈希值;S501, when the IoT device A determines that the transaction data needs to be authenticated in the blockchain network, the IoT device A sends a hash value related to the transaction data to the IoT device B;
需要说明的是,物联网设备A确定的这个交易数据可以是物联网设备A和物联网设备B之间的交易数据,也可以是物联网设备A和其他物联网设备的交易数据。It should be noted that the transaction data determined by the Internet of Things device A may be transaction data between the Internet of Things device A and the Internet of Things device B, and may also be transaction data of the Internet of Things device A and other Internet of Things devices.
可选地,与交易数据相关的哈希值是由物联网设备A根据交易数据产生的,这里的交易数据可以是经过物联网设备B的公钥加密过的,也可以是未经过物联网设备B的公钥加密过的。本申请实施例对具体产生哈希值的方法不作限定。Optionally, the hash value associated with the transaction data is generated by the Internet of Things device A according to the transaction data, where the transaction data may be encrypted by the public key of the Internet of Things device B, or may not be through the Internet of Things device. B's public key has been encrypted. The method for generating a hash value is not limited in the embodiment of the present application.
可选地,物联网设备A可以通过其代理节点(例如,图6中的第二设备)或者其他通信节点将与交易数据相关的哈希值发送给物联网设备B。Alternatively, the IoT device A may send a hash value related to the transaction data to the IoT device B through its proxy node (eg, the second device in FIG. 6) or other communication node.
S502,物联网设备A向第二设备发送交易数据;S502. The Internet of Things device A sends transaction data to the second device.
可选地,物联网设备A向第二设备发送的交易数据可以是没有加密过的交易数据。或者物联网设备A发送的交易数据是只采用物联网设备B的公钥进行加密过的交易数据。或者物联网设备A发送的交易数据是先采用物联网设备B的公钥进行加密之后,再采用第二设备的私钥进行加密过的交易数据,此种情况下,第二设备接收到交易数据时,通过第二设备的公钥解密交易数据,以确保物联网设备A向第二设备发送的交易数据的合法性,之后第二设备将采用物联网设备B的公钥加密的交易数据广播到区块链网络中,进行认证。Optionally, the transaction data sent by the Internet of Things device A to the second device may be transaction data that has not been encrypted. Or the transaction data sent by the Internet of Things device A is transaction data encrypted by using only the public key of the Internet of Things device B. Or the transaction data sent by the Internet of Things device A is encrypted by using the public key of the Internet of Things device B, and then the encrypted data is encrypted by using the private key of the second device. In this case, the second device receives the transaction data. At the time, the transaction data is decrypted by the public key of the second device to ensure the legality of the transaction data sent by the Internet of Things device A to the second device, and then the second device broadcasts the transaction data encrypted by the public key of the Internet of Things device B to the transaction data. In the blockchain network, authentication is performed.
S503,第二设备将交易数据广播到区块链网络中进行认证;S503. The second device broadcasts the transaction data to the blockchain network for authentication.
S504,第二设备确认交易数据已经在区块链网络中完成N次认证;S504: The second device confirms that the transaction data has completed N times of authentication in the blockchain network.
S505,第二设备向物联网设备A发送认证完成消息;S505. The second device sends an authentication completion message to the Internet of Things device A.
可选地,认证完成消息中包括区块链网络中与交易数据对应的数据的Merkle树信息和区块信息,区块信息用于指示区块链网络中承载与交易数据对应的数据的区块,这里区块链网络中与交易数据对应的数据本质上是交易 数据在区块链网络中经过N次认证后的数据。Optionally, the authentication completion message includes Merkle tree information and block information of data corresponding to the transaction data in the blockchain network, and the block information is used to indicate a block in the blockchain network that carries data corresponding to the transaction data. Here, the data corresponding to the transaction data in the blockchain network is essentially a transaction. Data after N times of authentication in the blockchain network.
或者,在S505中第二设备直接向物联网设备A发送区块链网络中与交易数据对应的数据的Merkle树信息和区块信息,物联网设备A在接收到这两个信息时,即可以确定交易数据已经经过N此认证。Alternatively, in S505, the second device directly sends the Merkle tree information and the block information of the data corresponding to the transaction data in the blockchain network to the Internet of Things device A, and the IoT device A can receive the two information when Make sure the transaction data has been certified by N.
S506,第二设备或其他区块链设备向物联网设备B发送区块链网络中存储的与交易数据对应的数据的Merkle树信息和区块信息;S506. The second device or other blockchain device sends the Merkle tree information and the block information of the data corresponding to the transaction data stored in the blockchain network to the Internet of Things device B.
可选地,区块链网络中的多个设备可以同时向物联网设备B发送Merkle树信息和区块信息,物联网设备B可以对比接收到的多个信息,由此能够进一步提高通信系统的可靠性。Optionally, multiple devices in the blockchain network can simultaneously send Merkle tree information and block information to the IoT device B, and the IoT device B can compare the received multiple information, thereby further improving the communication system. reliability.
可选地,物联网设备B接收其代理节点发送的Merkle树信息和区块信息。或者物联网设备B接收的Merkle树信息和区块信息是由不同设备发送的。Optionally, the Internet of Things device B receives the Merkle tree information and the block information sent by its proxy node. Or the Merkle tree information and the block information received by the Internet of Things device B are sent by different devices.
S507,物联网设备B验证区块链网络中与所述交易数据对应的数据的完整性;S507, the Internet of Things device B verifies the integrity of the data corresponding to the transaction data in the blockchain network;
可选地,物联网设备B根据区块信息确定承载与交易数据对应的数据的区块,之后物联网设备B根据与交易数据对应的数据的Merkle树信息从这个区块中找到与交易数据的对应的数据。这里的区块信息为区块的高度或者标识。Optionally, the Internet of Things device B determines, according to the block information, a block that carries data corresponding to the transaction data, and then the IoT device B finds the transaction data from the block according to the Merkle tree information of the data corresponding to the transaction data. Corresponding data. The block information here is the height or identity of the block.
可选地,若在S501中与交易数据相关的哈希值是由物联网设备A根据未采用物联网设备B的公钥加密过的交易数据产生的,且在S502中物联网设备A向第二设备发送的交易数据是没有经过物联网设备B的公钥加密过的,物联网设备B从区块中获取与交易数据对应的数据时,计算获取到的与交易数据对应的数据的哈希值,之后比较计算的哈希值与接收到的哈希值是否一致。如果一致,物联网设备B认为获取到的数据是完整的,否则,物联网设备B认为获取到的数据是不完整的。Optionally, if the hash value related to the transaction data in S501 is generated by the Internet of Things device A according to the transaction data encrypted without using the public key of the Internet of Things device B, and in S502, the Internet of Things device A is directed to The transaction data sent by the second device is not encrypted by the public key of the Internet of Things device B. When the IoT device B obtains the data corresponding to the transaction data from the block, the hash of the acquired data corresponding to the transaction data is calculated. The value, after which the calculated hash value is consistent with the received hash value. If they are consistent, the IoT device B considers that the acquired data is complete. Otherwise, the IoT device B considers that the acquired data is incomplete.
或者,若在S501中与交易数据相关的哈希值是由物联网设备A根据未采用物联网设备B的公钥加密过的交易数据产生的,且在S502中,物联网设备A向第二设备发送的交易数据是采用物联网设备B的公钥加密过的,物联网设备B从区块中获取到的对应交易数据的数据时,物联网设备先对获取到的数据进行解密,并计算解密后的数据的哈希值,之后比较计算的哈希值与接收到的哈希值是否一致。如果一致,物联网设备B认为获取到的数据 是完整的,否则,物联网设备B认为获取到的数据是不完整的。Alternatively, if the hash value associated with the transaction data in S501 is generated by the Internet of Things device A based on the transaction data encrypted without using the public key of the Internet of Things device B, and in S502, the Internet of Things device A goes to the second The transaction data sent by the device is encrypted by the public key of the Internet of Things device B. When the IoT device B obtains the data of the corresponding transaction data from the block, the IoT device decrypts the acquired data first, and calculates The hash value of the decrypted data, and then compares whether the calculated hash value is consistent with the received hash value. If consistent, IoT device B considers the acquired data. It is complete, otherwise, IoT device B believes that the acquired data is incomplete.
或者,若在S501中与交易数据相关的哈希值是由物联网设备A根据采用物联网设备B的公钥加密过的交易数据产生的,且在S502中,物联网设备A向第二设备发送的交易数据是采用物联网设备B的公钥加密过的,物联网设备B从区块中获取与交易数据对应的数据时,计算获取到的与交易数据对应的数据的哈希值,之后比较计算的哈希值与接收到的哈希值是否一致。如果一致,物联网设备B认为获取到的数据是完整的,否则,物联网设备B认为获取到的数据是不完整的。Alternatively, if the hash value associated with the transaction data in S501 is generated by the Internet of Things device A based on the transaction data encrypted using the public key of the Internet of Things device B, and in S502, the Internet of Things device A is directed to the second device. The sent transaction data is encrypted by the public key of the Internet of Things device B. When the IoT device B obtains the data corresponding to the transaction data from the block, the hash value of the acquired data corresponding to the transaction data is calculated, and then Compares the calculated hash value with the received hash value. If they are consistent, the IoT device B considers that the acquired data is complete. Otherwise, the IoT device B considers that the acquired data is incomplete.
S508,若物联网设备B验证与交易数据对应的数据完整,发送确认信息,确认信息用于指示与交易数据对应的数据完整。S508. If the IoT device B verifies that the data corresponding to the transaction data is complete, the confirmation information is sent, and the confirmation information is used to indicate that the data corresponding to the transaction data is complete.
可选地,物联网设备B发送的确认信息,也可以经过区块链网络中的设备进行认证。Optionally, the confirmation information sent by the Internet of Things device B may also be authenticated by devices in the blockchain network.
可选地,在S501中,物联网设备A不向物联网设备B发送哈希值,而是向物联网设备B发送交易数据,物联网设备B接收到交易数据时,物联网设备B确定接收到的交易数据的哈希值,之后将计算的交易数据的哈希值与从区块中获取的与交易数据对应的数据的哈希值进行比较,确定获取到的数据是否完整。Optionally, in S501, the Internet of Things device A does not send a hash value to the Internet of Things device B, but sends transaction data to the Internet of Things device B. When the Internet of Things device B receives the transaction data, the Internet of Things device B determines to receive. The hash value of the transaction data to be obtained, and then the hash value of the calculated transaction data is compared with the hash value of the data corresponding to the transaction data obtained from the block to determine whether the acquired data is complete.
例如,若在S501中物联网设备A向物联网设备B发送的交易数据是经过物联网设备B的公钥加密过的,且在S502中物联网设备A向第二设备发送的交易数据也是经过物联网设备B的公钥加密过的,物联网设备B直接算接收到的物联网设备A发送过来的交易数据的哈希值,以及获取到的数据的哈希值,之后将这两个哈希值进行对比。For example, if the transaction data sent by the Internet of Things device A to the Internet of Things device B is encrypted by the public key of the Internet of Things device B in S501, and the transaction data sent by the Internet of Things device A to the second device is also passed in S502. The public key of the Internet of Things device B is encrypted. The IoT device B directly calculates the hash value of the transaction data sent by the IoT device A received, and the hash value of the acquired data, and then the two hashes. The value is compared.
或者,若在S501中物联网设备A向物联网设备B发送的交易数据是经过物联网设备B的公钥加密过的,且在S502中物联网设备A向第二设备发送的交易数据是未经过物联网设备B的公钥加密过的,物联网设备B将接收到的物联网A发送过来的交易数据进行解密,之后计算解密后的数据的哈希值,物联网设备在计算得到获取到的数据的哈希值之后,将这两个哈希值进行对比。Alternatively, if the transaction data sent by the Internet of Things device A to the Internet of Things device B is encrypted by the public key of the Internet of Things device B in S501, and the transaction data sent by the Internet of Things device A to the second device is not in S502. After the public key of the Internet of Things device B is encrypted, the Internet of Things device B decrypts the received transaction data sent by the Internet of Things A, and then calculates the hash value of the decrypted data, and the IoT device obtains the obtained data. After the hash of the data, compare the two hash values.
或者,若在S501中物联网设备A向物联网设备B发送的交易数据是未经过物联网设备B的公钥加密过的,且在S502中物联网设备A向第二设备发送的交易数据也是未经过物联网设备B的公钥加密过的,物联网设备B 直接算接收到的物联网设备A发送过来的交易数据的哈希值,以及获取到的数据的哈希值,之后将这两个哈希值进行对比。Alternatively, if the transaction data sent by the Internet of Things device A to the Internet of Things device B in S501 is not encrypted by the public key of the Internet of Things device B, and the transaction data sent by the Internet of Things device A to the second device in S502 is also IoT device B without being encrypted by the public key of IoT device B The hash value of the transaction data sent by the received IoT device A and the hash value of the acquired data are directly calculated, and then the two hash values are compared.
或者,若在S501中物联网设备A向物联网设备B发送的交易数据是未经过物联网设备B的公钥加密过的,且在S502中物联网设备A向第二设备发送的交易数据是经过物联网设备B的公钥加密过的,物联网设备B先将获取到的数据进行解密,之后计算解密后的数据的哈希值,物联网设备在计算得到接收到物联网设备B发送过来的交易数据的哈希值之后,将这两个哈希值进行对比。Alternatively, if the transaction data sent by the Internet of Things device A to the Internet of Things device B in S501 is not encrypted by the public key of the Internet of Things device B, and the transaction data sent by the Internet of Things device A to the second device in S502 is After the public key of the Internet of Things device B is encrypted, the IoT device B first decrypts the acquired data, and then calculates the hash value of the decrypted data, and the IoT device receives the received IoT device B and sends it. After hashing the transaction data, compare the two hash values.
需要说明的是,物联网设备B获取到的数据是完整的,说明物联网设备B获取到的数据与交易数据是相同的,也就是说,交易数据在区块链网络中进过N次认证之后,没有被恶意修改。It should be noted that the data acquired by the Internet of Things device B is complete, indicating that the data acquired by the Internet of Things device B is the same as the transaction data, that is, the transaction data has been authenticated N times in the blockchain network. After that, it was not maliciously modified.
在上述所有实施例中,物联网设备产生的不同的数据可能会有不同的存储要求,因此可以进一步根据数据的存储要求对数据进行处理。以物联网设备的对端设备同样是物联网设备为例,描述根据本申请再一实施例的基于区块链的数据处理方法,为了描述方便,将进行交互的物联网设备分别标记为物联网设备A和物联网设备B。如图7所示,方法600包括:In all of the above embodiments, the different data generated by the IoT device may have different storage requirements, so the data may be further processed according to the storage requirements of the data. Taking the peer device of the Internet of Things device as an example of the Internet of Things device as an example, a blockchain-based data processing method according to still another embodiment of the present application is described. For convenience of description, the interactive IoT devices are respectively marked as the Internet of Things. Device A and IoT Device B. As shown in FIG. 7, method 600 includes:
S601,物联网设备A和物联网设备B确定双方的交易数据已经记录在区块链网络中;S601, the Internet of Things device A and the Internet of Things device B determine that the transaction data of both parties has been recorded in the blockchain network;
可选地,一方面物联网设备A和物联网设备B确定双方的交易数据已经记录在区块链网络中,另一方面物联网设备A和物联网设备B均可以进一步获取到与交易数据对应的数据的Merkle树信息和区块信息。具体地,代理节点A将交易通过区块链网络完成验证的指示信息发给物联网设备A,并且携带Merkle树信息和区块信息。此外,代理节点A或者代理节点B将交易完成验证的信息发送给物联网设备B,并且携带Merkle树信息和区块信息。Optionally, on the one hand, the Internet of Things device A and the Internet of Things device B determine that the transaction data of both parties has been recorded in the blockchain network, and on the other hand, the Internet of Things device A and the Internet of Things device B can further obtain corresponding to the transaction data. Merkle tree information and block information for the data. Specifically, the proxy node A sends the indication information that the transaction completes the verification through the blockchain network to the IoT device A, and carries the Merkle tree information and the block information. In addition, the proxy node A or the proxy node B transmits the information of the transaction completion verification to the Internet of Things device B, and carries the Merkle tree information and the block information.
S602,物联网设备A和/或物联网设备B确定与交易数据对应的数据可以从区块链网络中删除;S602, the Internet of Things device A and/or the Internet of Things device B determines that data corresponding to the transaction data can be deleted from the blockchain network;
可选地,物联网设备A根据交易数据的预设存储时长确定与交易数据对应的数据可以从区块链网络中删除,或者物联网设备B根据交易数据的预设存储时长确定与交易数据对应的数据可以从区块链网络中删除,或者物联网设备A和物联网设备B通过协商确定与交易数据对应的数据可以从区块链 网络中删除。Optionally, the IoT device A determines that the data corresponding to the transaction data may be deleted from the blockchain network according to the preset storage duration of the transaction data, or the IoT device B determines the correspondence with the transaction data according to the preset storage duration of the transaction data. The data can be deleted from the blockchain network, or the IoT device A and the IoT device B can determine by negotiation that the data corresponding to the transaction data can be from the blockchain. Deleted in the network.
S603,物联网设备A和/或物联网设备B向区块链网络中的设备发送删除指示信息;S603. The Internet of Things device A and/or the Internet of Things device B send deletion indication information to devices in the blockchain network.
可选地,删除指示信息中可以包括与交易数据对应的数据对应的Merkle树信息和区块信息。Optionally, the deletion indication information may include Merkle tree information and block information corresponding to the data corresponding to the transaction data.
可选地,物联网设备A通过第二设备向区块链网络中的设备发送删除指示信息,实现数据的删除。需要说明的是,第二设备虽然将删除指示信息发送给区块链网络中的设备,但是第二设备也可与区块链网络中的其他设备一样,通过获取验证权,实现数据的删除。Optionally, the IoT device A sends the deletion indication information to the device in the blockchain network by using the second device to implement data deletion. It should be noted that, although the second device sends the deletion indication information to the device in the blockchain network, the second device may obtain the verification right to delete the data, just like other devices in the blockchain network.
S604,接收到物联网设备A或物联网设备B发送的删除指示信息的区块链网络中的设备将删除指示信息广播在区块链网络中,实现与交易数据对应的数据的删除;S604. The device in the blockchain network that receives the deletion indication information sent by the Internet of Things device A or the Internet of Things device B broadcasts the deletion indication information in the blockchain network to implement deletion of data corresponding to the transaction data.
可选地,当删除指示信息广播在区块链网络中后,区块链网络中的设备开始争抢认证权,取得认证权的设备在生成新的区块链时,确认可以删除与交易数据对应的。例如根据删除指示信息中的Merkle树信息和区块信息,确定与交易数据对应的数据在区块中的具体位置,在当次生成区块链时删除与交易数据对应的数据,或者,可以将删除指示信息作为特殊的交易数据,在经过区块链网络中的N个设备的认证后,由第N个获取到认证权的设备删除该与交易数据对应的数据。Optionally, after the deletion indication information broadcasts in the blockchain network, the devices in the blockchain network start to compete for the authentication right, and the device that obtains the authentication right confirms that the transaction data can be deleted when generating a new blockchain. corresponding. For example, according to the Merkle tree information and the block information in the deletion indication information, the specific location of the data corresponding to the transaction data in the block is determined, and the data corresponding to the transaction data is deleted when the blockchain is generated, or The indication information is deleted as special transaction data. After the authentication by the N devices in the blockchain network, the device that obtains the authentication right by the Nth deletes the data corresponding to the transaction data.
需要说明的是,方法600中区块链网络中的其他设备可以认为指的是物联网设备B的代理设备。It should be noted that other devices in the blockchain network in the method 600 can be considered as referring to the proxy device of the Internet of Things device B.
由此,能够降低区块链网络的存储负担,降低区块链的传输需要占用的传输带宽。Thereby, the storage load of the blockchain network can be reduced, and the transmission bandwidth required for the transmission of the blockchain can be reduced.
以上结合图2至图7详细描述了根据本申请实施例的基于区块链的数据处理方法,下面将结合图8详细描述根据本申请实施例的设备,如图8所示,设备10包括:The block-based data processing method according to the embodiment of the present application is described in detail with reference to FIG. 2 to FIG. 7. The device according to the embodiment of the present application is described in detail below with reference to FIG. 8. As shown in FIG. 8, the device 10 includes:
处理模块11,用于建立所述设备与第二设备的通信连接,所述第二设备为区块链网络中的设备;The processing module 11 is configured to establish a communication connection between the device and the second device, where the second device is a device in a blockchain network;
所述处理模块11,还用于产生并确定第一数据需要在所述区块链网络中进行认证;The processing module 11 is further configured to generate and determine that the first data needs to be authenticated in the blockchain network;
收发模块12,用于向所述第二设备发送所述第一数据,以实现所述第一 数据由所述区块链网络中的设备进行认证。The transceiver module 12 is configured to send the first data to the second device to implement the first The data is authenticated by devices in the blockchain network.
因此,根据本申请实施例的设备在产生需要在区块链网络中进行认证的第一数据时,向区块链网络中的第二设备发送第一数据,使得第二设备将第一数据发送给区块链网络中的设备,实现第一数据的认证。由于采用区块链网络对数据进行认证,能够降低通信系统的建设及维护成本,提高系统的安全性能。并且由第二设备将设备的数据发送给区块链网络中的设备进行认证,能够降低对设备的能力要求。Therefore, when the device according to the embodiment of the present application generates the first data that needs to be authenticated in the blockchain network, the first data is sent to the second device in the blockchain network, so that the second device sends the first data. The device in the blockchain network is authenticated by the first data. By using the blockchain network to authenticate data, the construction and maintenance costs of the communication system can be reduced, and the security performance of the system can be improved. And the second device sends the data of the device to the device in the blockchain network for authentication, which can reduce the capability requirement for the device.
在本申请实施例中,可选地,所述收发模块12具体用于:向所述第二设备发送采用第一公钥加密过的第一消息,所述第一消息中包括第一信息,所述第一公钥为所述第二设备的公钥,所述第一信息用于请求所述第二设备将所述设备产生的需要在所述区块链网络中进行认证的数据发送给所述区块链网络中的设备进行认证;接收所述第二设备发送的第二信息,所述第二信息用于指示所述第二设备确认能够将所述设备产生的需要在所述区块链网络中进行认证的数据发送给所述区块链网络中的设备进行认证。In the embodiment of the present application, the transceiver module 12 is specifically configured to: send, to the second device, a first message encrypted by using a first public key, where the first message includes first information, The first public key is a public key of the second device, and the first information is used to request the second device to send data generated by the device that needs to be authenticated in the blockchain network to The device in the blockchain network performs authentication; receiving second information sent by the second device, where the second information is used to indicate that the second device confirms that the device needs to be generated in the area The data authenticated in the blockchain network is sent to devices in the blockchain network for authentication.
在本申请实施例中,可选地,所述第一消息中还包括第二公钥,所述第二公钥为所述设备的公钥。In the embodiment of the present application, optionally, the first message further includes a second public key, where the second public key is a public key of the device.
在本申请实施例中,可选地,所述收发模块12具体用于:接收所述第二设备发送的采用所述第二公钥加密过的所述第二信息。In the embodiment of the present application, the transceiver module 12 is specifically configured to: receive the second information that is sent by the second device and that is encrypted by using the second public key.
在本申请实施例中,可选地,所述处理模块11还用于:生成承载所述第一数据的区块;In the embodiment of the present application, the processing module 11 is further configured to: generate a block that carries the first data;
所述收发模块12,具体用于向所述第二设备发送所述区块。The transceiver module 12 is specifically configured to send the block to the second device.
在本申请实施例中,可选地,所述收发模块12还用于:接收所述第二设备发送的第三信息,所述第三信息中包括第一哈希HASH值要求;In the embodiment of the present application, the transceiver module 12 is further configured to: receive third information sent by the second device, where the third information includes a first hash HASH value requirement;
所述处理模块11,还用于生成满足所述第一HASH值要求的第一HASH值。The processing module 11 is further configured to generate a first HASH value that meets the first HASH value requirement.
在本申请实施例中,可选地,所述第三信息中包括至少一个HASH值要求,所述至少一个HASH值要求中包括所述第一HASH值要求,所述至少一个HASH值要求中的每个HASH值要求与至少一种业务类型相对应;In the embodiment of the present application, optionally, the third information includes at least one HASH value requirement, where the at least one HASH value requirement includes the first HASH value requirement, and the at least one HASH value requirement Each HASH value is required to correspond to at least one type of service;
其中,所述处理模块11还用于:根据所述第一数据对应的业务类型,确定所述第一HASH值。The processing module 11 is further configured to: determine the first HASH value according to the service type corresponding to the first data.
在本申请实施例中,可选地,所述第三信息中包括至少一个HASH值要 求,所述至少一个HASH值要求中包括所述第一HASH值要求,所述至少一个HASH值要求中的每个HASH值要求与至少一个设备组相对应;In the embodiment of the present application, optionally, the third information includes at least one HASH value. The requesting, the at least one HASH value requirement includes the first HASH value requirement, and each of the at least one HASH value requirement is required to correspond to at least one device group;
其中,所述处理模块11还用于:根据所述设备所属的设备组,确定所述第一HASH值。The processing module 11 is further configured to: determine, according to the device group to which the device belongs, the first HASH value.
在本申请实施例中,可选地,所述收发模块12还用于:向第三设备发送与所述第一数据相关的第二HASH值,所述第二HASH值用于所述第三设备确定第二数据的完整性,第二数据为所述第一数据在所述区块链网络中经过认证后的数据。In the embodiment of the present application, the transceiver module 12 is further configured to: send, to the third device, a second HASH value related to the first data, where the second HASH value is used in the third The device determines the integrity of the second data, and the second data is the authenticated data of the first data in the blockchain network.
在本申请实施例中,可选地,所述第一数据是经过所述第三设备的公钥加密过的。In the embodiment of the present application, optionally, the first data is encrypted by a public key of the third device.
在本申请实施例中,可选地,所述处理模块还用于:根据所述第一数据确定所述第二HASH值。In the embodiment of the present application, the processing module is further configured to: determine the second HASH value according to the first data.
在本申请实施例中,可选地,所述第一数据是经过第三设备的公钥加密过的,所述收发模块12还用于:向所述第三设备发送所述第一数据,以便于所述第三设备在根据所述第一数据确定第二HASH值后,根据所述第二HASH值确定第二数据的完整性,第二数据为所述第一数据在所述区块链网络中经过认证后的数据。In the embodiment of the present application, optionally, the first data is encrypted by a public key of the third device, and the transceiver module 12 is further configured to: send the first data to the third device, After the third device determines the second HASH value according to the first data, determining the integrity of the second data according to the second HASH value, where the second data is the first data in the block. The authenticated data in the chain network.
在本申请实施例中,可选地,所述收发模块12还用于:接收所述第二设备发送的第四信息,所述第四信息用于指示所述第一数据已经在所述区块链网络中经过N次认证,N的值为预设值。In the embodiment of the present application, the transceiver module 12 is further configured to: receive fourth information sent by the second device, where the fourth information is used to indicate that the first data is already in the area After N times of authentication in the blockchain network, the value of N is a preset value.
在本申请实施例中,可选地,所述收发模块12还用于:接收所述第二设备发送的第二数据对应的梅克尔Merkle树信息和区块信息,第二数据为所述第一数据在所述区块链网络中经过认证后的数据,所述区块信息用于指示所述区块链网络中承载第二数据的区块。In the embodiment of the present application, the transceiver module 12 is further configured to: receive the Merkel tree information and the block information corresponding to the second data sent by the second device, where the second data is The first data is authenticated data in the blockchain network, and the block information is used to indicate a block carrying the second data in the blockchain network.
在本申请实施例中,可选地,所述处理模块11还用于:确定从所述区块链网络中删除第二数据,第二数据为所述第一数据在所述区块链网络中经过认证后的数据;In the embodiment of the present application, optionally, the processing module 11 is further configured to: determine to delete the second data from the blockchain network, where the second data is the first data in the blockchain network The certified data;
所述收发模块12,还用于向所述区块链网络中的设备发送第五信息,所述第五信息用于指示所述区块链网络中的设备从所述区块链网络中删除第二数据。The transceiver module 12 is further configured to send fifth information to a device in the blockchain network, where the fifth information is used to indicate that a device in the blockchain network is deleted from the blockchain network. Second data.
在本申请实施例中,可选地,所述第五信息中包括标识信息和/或第二数 据对应的Merkle树信息,所述标识信息用于标识第二数据。In the embodiment of the present application, optionally, the fifth information includes identification information and/or a second number. The identification information is used to identify the second data according to the corresponding Merkle tree information.
在本申请实施例中,可选地,所述处理模块11还用于:删除所述设备的本地存储的所述第一数据。In the embodiment of the present application, the processing module 11 is further configured to: delete the first data stored locally by the device.
应理解,本发明实施例中的设备10以功能单元的形式体现。在一个可选例子中,本领域技术人员可以理解,设备10可以对应于上述某些实施例中的第一设备,可以用于执行上述方法实施例中与第一设备对应的各个流程和/或步骤,为避免重复,在此不再赘述。It should be understood that the device 10 in the embodiment of the present invention is embodied in the form of a functional unit. In an alternative example, those skilled in the art may understand that the device 10 may correspond to the first device in some of the foregoing embodiments, and may be used to perform various processes and/or corresponding to the first device in the foregoing method embodiments. Steps, to avoid repetition, will not be repeated here.
具体地,在本发明实施例中,处理模块11可以由处理器实现。收发模块12可以由收发器实现,应理解,收发器可以是同时具备接收功能与发送功能的器件,也可以是具备接收功能的接收器件与具备发送功能的发送器件的组件器件。Specifically, in the embodiment of the present invention, the processing module 11 can be implemented by a processor. The transceiver module 12 can be implemented by a transceiver. It should be understood that the transceiver can be a device having both a receiving function and a transmitting function, or a component device having a receiving function and a transmitting device having a transmitting function.
图9示出了根据本申请另一实施例的设备,如图9所示,设备20包括:FIG. 9 shows a device according to another embodiment of the present application. As shown in FIG. 9, the device 20 includes:
处理模块21,用于建立所述设备与第一设备的通信连接,所述设备为区块链网络中的设备;The processing module 21 is configured to establish a communication connection between the device and the first device, where the device is a device in a blockchain network;
收发模块22,用于接收所述第一设备发送的由所述第一设备产生的需要在所述区块链网络中认证的第一数据;The transceiver module 22 is configured to receive, by the first device, the first data generated by the first device that needs to be authenticated in the blockchain network;
所述收发模块22,还用于向所述区块链网络中的设备发送所述第一数据,实现所述第一数据的认证。The transceiver module 22 is further configured to send the first data to a device in the blockchain network to implement authentication of the first data.
因此,根据本申请实施例的设备接收第一设备产生的需要在区块链网络中进行认证的第一数据,并将第一数据发送给区块链网络中的设备,实现第一数据的认证。由于采用区块链网络对数据进行认证,能够降低通信系统的建设及维护成本,提高系统的安全性能。并且由设备将第一设备的数据发送给区块链网络中的设备进行认证,能够降低对第一设备的能力要求。Therefore, the device according to the embodiment of the present application receives the first data generated by the first device that needs to be authenticated in the blockchain network, and sends the first data to the device in the blockchain network to implement authentication of the first data. . By using the blockchain network to authenticate data, the construction and maintenance costs of the communication system can be reduced, and the security performance of the system can be improved. And the device sends the data of the first device to the device in the blockchain network for authentication, which can reduce the capability requirement for the first device.
在本申请实施例中,可选地,所述收发模块22具体用于:接收所述第一设备发送的采用第一公钥加密过的第一消息,所述第一消息中包括第一信息,所述第一公钥为所述设备的公钥,所述第一信息用于请求所述设备将所述第一设备产生的需要在所述区块链网络中进行认证的数据发送给所述区块链网络中的设备进行认证;向所述第一设备发送第二信息,所述第二信息用于指示所述设备确认能够将所述第一设备产生的需要在所述区块链网络中进行认证的数据发送给所述区块链网络中的设备进行认证。In the embodiment of the present application, the transceiver module 22 is specifically configured to: receive the first message that is sent by the first device and that is encrypted by using the first public key, where the first message includes the first information. The first public key is a public key of the device, and the first information is used to request the device to send data generated by the first device that needs to be authenticated in the blockchain network to the device. The device in the blockchain network performs authentication; the second information is sent to the first device, where the second information is used to indicate that the device confirms that the first device needs to be generated in the blockchain The data authenticated in the network is sent to devices in the blockchain network for authentication.
在本申请实施例中,可选地,所述第一消息中还包括第二公钥,所述第 二公钥为所述第一设备的公钥。In the embodiment of the present application, optionally, the first message further includes a second public key, where the The second public key is the public key of the first device.
在本申请实施例中,可选地,所述收发模块22具体用于:向所述第一设备发送采用所述第二公钥加密过的所述第二信息。In the embodiment of the present application, the transceiver module 22 is specifically configured to: send, to the first device, the second information encrypted by using the second public key.
在本申请实施例中,可选地,所述处理模块21还用于:产生预设数量的数字货币。In the embodiment of the present application, the processing module 21 is further configured to: generate a preset number of digital currencies.
在本申请实施例中,可选地,,所述收发模块22还用于:向所述区块链网络中的设备发送所述数字货币的相关信息;In the embodiment of the present application, optionally, the transceiver module 22 is further configured to: send information about the digital currency to a device in the blockchain network;
所述处理模块21,还用于若确定所述数字货币在所述区块链网络中经过M次认证,确认所述数字货币生效,M的取值为预设值。The processing module 21 is further configured to: if it is determined that the digital currency has undergone M authentication in the blockchain network, confirm that the digital currency is valid, and the value of M is a preset value.
在本申请实施例中,可选地,所述收发模块22具体用于:接收所述第一设备发送的承载所述第一数据的区块;向所述区块链网络中的设备发送所述承载所述第一数据的区块。In the embodiment of the present application, the transceiver module 22 is specifically configured to: receive a block that is sent by the first device and that carries the first data; and send the device to a device in the blockchain network. A block carrying the first data.
在本申请实施例中,可选地,所述处理模块21还用于:根据所述区块链网络要求的区块格式,生成承载所述第一数据的区块;In the embodiment of the present application, the processing module 21 is further configured to: generate a block that carries the first data according to a block format required by the blockchain network;
所述收发模块22,还用于向所述区块链网络中的设备发送所述承载所述第一数据的区块。The transceiver module 22 is further configured to send the block that carries the first data to a device in the blockchain network.
在本申请实施例中,可选地,所述处理模块21还用于:确定第一哈希HASH值要求;In the embodiment of the present application, the processing module 21 is further configured to: determine a first hash HASH value requirement;
所述收发模块22,具体用于向所述第一设备发送第三信息,所述第三信息中包括所述第一HASH值要求,使得所述第一设备在生成满足所述第一HASH值要求的第一HASH值之后,与所述设备建立通信连接。The transceiver module 22 is configured to send the third information to the first device, where the third information includes the first HASH value requirement, so that the first device generates the first HASH value that is satisfied. After the required first HASH value, a communication connection is established with the device.
在本申请实施例中,可选地,所述第三信息中包括至少一个HASH值要求,所述至少一个HASH值要求中包括所述第一HASH值要求,所述至少一个HASH值要求中的每个HASH值要求与至少一种业务类型相对应;In the embodiment of the present application, optionally, the third information includes at least one HASH value requirement, where the at least one HASH value requirement includes the first HASH value requirement, and the at least one HASH value requirement Each HASH value is required to correspond to at least one type of service;
其中,所述处理模块21具体用于:确定所述至少一个HASH值要求。The processing module 21 is specifically configured to: determine the at least one HASH value requirement.
在本申请实施例中,可选地,所述第三信息中包括至少一个HASH值要求,所述至少一个HASH值要求中包括所述第一HASH值要求,所述至少一个HASH值要求中的每个HASH值要求与至少一个设备组相对应;In the embodiment of the present application, optionally, the third information includes at least one HASH value requirement, where the at least one HASH value requirement includes the first HASH value requirement, and the at least one HASH value requirement Each HASH value is required to correspond to at least one device group;
其中,所述处理模块21具体用于:确定所述至少一个HASH值要求。The processing module 21 is specifically configured to: determine the at least one HASH value requirement.
在本申请实施例中,可选地,所述收发模块22还用于:接收所述第一设备发送的与所述第一数据相关的第二HASH值,所述第二HASH值用于 第三设备确定第二数据的完整性,第二数据为所述第一数据在所述区块链网络中经过认证后的数据;向所述第三设备发送所述第二HASH值。In the embodiment of the present application, the transceiver module 22 is further configured to: receive a second HASH value that is sent by the first device and is related to the first data, where the second HASH value is used. The third device determines the integrity of the second data, where the second data is the authenticated data of the first data in the blockchain network; and the second HASH value is sent to the third device.
在本申请实施例中,可选地,所述第一数据是经过所述第三设备的公钥加密过的。In the embodiment of the present application, optionally, the first data is encrypted by a public key of the third device.
在本申请实施例中,可选地,所述第二HASH值是由所述第一设备根据所述第一数据确定的。In the embodiment of the present application, optionally, the second HASH value is determined by the first device according to the first data.
在本申请实施例中,可选地,所述第一数据是经过第三设备的公钥加密过的,所述收发模块22还用于:接收所述第一数据;向所述第三设备发送所述第一数据,以便于所述第三设备在根据所述第一数据确定第二HASH值后,根据所述第二HASH值确定第二数据的完整性,第二数据为所述第一数据在所述区块链网络中经过认证后的数据。In the embodiment of the present application, optionally, the first data is encrypted by a public key of the third device, and the transceiver module 22 is further configured to: receive the first data; and send the third device to the third device Transmitting the first data, so that the third device determines the integrity of the second data according to the second HASH value after determining the second HASH value according to the first data, where the second data is the A data is authenticated in the blockchain network.
在本申请实施例中,可选地,所述收发模块22还用于:若所述处理模块21确定所述第一数据已经在所述区块链网络中经过N次认证,向所述第三设备发送第二数据对应梅克尔Merkle树信息和区块信息,所述区块信息用于指示所述区块链网络中承载所述第二数据的区块,第二数据为所述第一数据在所述区块链网络中经过认证后的数据。In the embodiment of the present application, the transceiver module 22 is further configured to: if the processing module 21 determines that the first data has been authenticated N times in the blockchain network, to the The third device sends the second data corresponding to the Merkel tree information and the block information, where the block information is used to indicate the block in the blockchain network that carries the second data, and the second data is the A data is authenticated in the blockchain network.
在本申请实施例中,可选地,所述收发模块22还用于:若所述处理模块21确定所述第一数据已经在所述区块链网络中经过N次认证,向所述第一设备发送第四信息,所述第四信息用于指示所述第一数据已经在所述区块链网络中经过N次认证,其中,N的取值为预设值。In the embodiment of the present application, the transceiver module 22 is further configured to: if the processing module 21 determines that the first data has been authenticated N times in the blockchain network, to the A device sends a fourth information, where the fourth information is used to indicate that the first data has been authenticated N times in the blockchain network, where the value of N is a preset value.
在本申请实施例中,可选地,所述收发模块22还用于:若所述处理模块21确定所述第一数据已经在所述区块链网络中经过N次认证,向所述第一设备发送第二数据对应的Merkle树信息和区块信息,所述区块信息用于指示所述区块链网络中承载第二数据的区块,第二数据为所述第一数据在所述区块链网络中经过认证后的数据。In the embodiment of the present application, the transceiver module 22 is further configured to: if the processing module 21 determines that the first data has been authenticated N times in the blockchain network, to the a device sends the Merkle tree information and the block information corresponding to the second data, where the block information is used to indicate a block carrying the second data in the blockchain network, and the second data is the first data in the The authenticated data in the blockchain network.
在本申请实施例中,可选地,所述收发模块22还用于:接收所述第一设备发送的第五信息,所述第五信息用于指示所述区块链网络中的设备从所述区块链网络中删除第二数据,第二数据为所述第一数据在所述区块链网络中经过认证后的数据。In the embodiment of the present application, the transceiver module 22 is further configured to: receive fifth information sent by the first device, where the fifth information is used to indicate that the device in the blockchain network is The second data is deleted in the blockchain network, and the second data is the authenticated data of the first data in the blockchain network.
在本申请实施例中,可选地,所述第五信息中包括标识信息和/或第二数据对应的Merkle树信息,所述标识信息用于标识所述第二数据。 In the embodiment of the present application, optionally, the fifth information includes the identification information and/or the Merkle tree information corresponding to the second data, where the identifier information is used to identify the second data.
应理解,本发明实施例中的设备20以功能单元的形式体现。在一个可选例子中,本领域技术人员可以理解,设备20可以对应于上述某些实施例中的第二设备,可以用于执行上述方法实施例中与第二设备对应的各个流程和/或步骤,为避免重复,在此不再赘述。It should be understood that the device 20 in the embodiment of the present invention is embodied in the form of a functional unit. In an alternative example, those skilled in the art may understand that the device 20 may correspond to the second device in some of the foregoing embodiments, and may be used to perform various processes and/or corresponding to the second device in the foregoing method embodiments. Steps, to avoid repetition, will not be repeated here.
具体地,在本发明实施例中,处理模块21可以由处理器实现。收发模块22可以由收发器实现,应理解,收发器可以是同时具备接收功能与发送功能的器件,也可以是具备接收功能的接收器件与具备发送功能的发送器件的组件器件。Specifically, in the embodiment of the present invention, the processing module 21 can be implemented by a processor. The transceiver module 22 can be implemented by a transceiver. It should be understood that the transceiver may be a device having both a receiving function and a transmitting function, or a component device having a receiving function and a transmitting device having a transmitting function.
图10示出了根据本申请再一实施例的设备,如图10所示,设备30包括:FIG. 10 shows a device according to still another embodiment of the present application. As shown in FIG. 10, the device 30 includes:
收发模块31,用于获取第二数据对应的梅克尔Merkle树信息和区块信息,所述区块信息用于指示区块链网络中承载所述第二数据的区块,第二数据为所述第一数据在所述区块链网络中经过认证后的数据,所述第一数据为第一设备产生的需要在所述区块链网络中进行认证的数据;The transceiver module 31 is configured to acquire Merck's Merkle tree information and block information corresponding to the second data, where the block information is used to indicate a block in the blockchain network that carries the second data, where the second data is The first data is authenticated data in the blockchain network, and the first data is data generated by the first device that needs to be authenticated in the blockchain network;
所述收发模块31,还用于根据所述Merkle树信息从承载第二数据的区块中获取第二数据;The transceiver module 31 is further configured to acquire second data from a block that carries the second data according to the Merkle tree information;
处理模块32,用于确定第二数据的完整性。The processing module 32 is configured to determine the integrity of the second data.
因此,根据本申请的设备可以根据接收到的Merkle树信息和区块信息,获取区块链网络中存储的与第一设备产生的需要在区块链网络中进行认证的第一数据对应的第二数据,并确认第二数据的完整性。由此,能够保证数据的保密性和完整性,使得区块链网络中存储的数据具有更高的可靠性。Therefore, the device according to the present application can obtain, according to the received Merkle tree information and the block information, a first stored in the blockchain network corresponding to the first data generated by the first device that needs to be authenticated in the blockchain network. Two data and confirm the integrity of the second data. Thereby, the confidentiality and integrity of the data can be ensured, and the data stored in the blockchain network has higher reliability.
在本申请实施例中,可选地,若所述第二数据完整,所述收发模块31还用于:向所述区块链网络中的设备发送确认信息,所述确认信息用于指示第二数据完整。In the embodiment of the present application, optionally, if the second data is complete, the transceiver module 31 is further configured to: send confirmation information to a device in the blockchain network, where the confirmation information is used to indicate The second data is complete.
在本申请实施例中,可选地,所述收发模块31具体用于:接收第二设备发送的所述Merkle树信息和所述区块信息,其中,所述第二设备为所述区块链网络中的设备。In the embodiment of the present application, the transceiver module 31 is specifically configured to: receive the Merkle tree information and the block information sent by the second device, where the second device is the block A device in a chain network.
在本申请实施例中,可选地,所述第二设备为将所述第一数据发送给所述区块链网络中进行认的设备。In the embodiment of the present application, optionally, the second device is a device that sends the first data to the blockchain network for recognition.
在本申请实施例中,可选地,所述处理模块32还用于:确定与所述第一数据相关的第二哈希HASH值;根据与第二数据相关的第三HASH值和 所述第二HASH值的一致性,确定第二数据的完整性。In the embodiment of the present application, the processing module 32 is further configured to: determine a second hash HASH value associated with the first data; and according to a third HASH value associated with the second data The consistency of the second HASH value determines the integrity of the second data.
在本申请实施例中,可选地,所述处理模块32具体用于:接收所述第二HASH值,其中,所述第二HASH值是由所述第一设备根据所述第一数据确定的。In the embodiment of the present application, the processing module 32 is specifically configured to: receive the second HASH value, where the second HASH value is determined by the first device according to the first data. of.
在本申请实施例中,可选地,所述第一数据是经过所述设备的公钥加密过的。In the embodiment of the present application, optionally, the first data is encrypted by a public key of the device.
在本申请实施例中,可选地,所述第一数据是经过所述设备的公钥加密过的,所述收发模块31还用于:接收所述第一设备发送的所述第一数据;In the embodiment of the present application, optionally, the first data is encrypted by the public key of the device, and the transceiver module 31 is further configured to: receive the first data sent by the first device. ;
其中,所述处理模块32具体用于:根据所述第一数据,确定所述第二HASH值。The processing module 32 is specifically configured to: determine the second HASH value according to the first data.
在本申请实施例中,可选地,所述处理模块32还用于:确定从所述区块链网络中删除第二数据;In the embodiment of the present application, the processing module 32 is further configured to: determine to delete the second data from the blockchain network;
所述收发模块31,还用于向所述区块链网络中的设备发送第五信息,所述第五信息用于指示所述区块链网络中的设备从所述区块链网络中删除第二数据。The transceiver module 31 is further configured to send, to the device in the blockchain network, fifth information, where the fifth information is used to indicate that a device in the blockchain network is deleted from the blockchain network. Second data.
在本申请实施例中,可选地,所述第五信息中包括标识信息和/或第二数据对应的Merkle树信息,所述标识信息用于标识第二数据。In the embodiment of the present application, optionally, the fifth information includes the identification information and/or the Merkle tree information corresponding to the second data, where the identifier information is used to identify the second data.
应理解,本发明实施例中的设备30以功能单元的形式体现。在一个可选例子中,本领域技术人员可以理解,设备30可以对应于上述某些实施例中的物联网设备B,可以用于执行上述方法实施例中与物联网设备B对应的各个流程和/或步骤,为避免重复,在此不再赘述。It should be understood that the device 30 in the embodiment of the present invention is embodied in the form of a functional unit. In an alternative example, those skilled in the art may understand that the device 30 may correspond to the Internet of Things device B in some embodiments described above, and may be used to perform various processes corresponding to the Internet of Things device B in the foregoing method embodiments. / or steps, in order to avoid repetition, will not repeat them here.
具体地,在本发明实施例中,处理模块32可以由处理器实现。收发模块31可以由收发器实现,应理解,收发器可以是同时具备接收功能与发送功能的器件,也可以是具备接收功能的接收器件与具备发送功能的发送器件的组件器件。Specifically, in the embodiment of the present invention, the processing module 32 can be implemented by a processor. The transceiver module 31 can be implemented by a transceiver. It should be understood that the transceiver may be a device having both a receiving function and a transmitting function, or a component device having a receiving function and a transmitting device having a transmitting function.
图11示出了根据本申请再一实施例的设备。如图11所示,设备100包括处理器110和收发器120,处理器110和收发器120相连,可选地,该设备100还包括存储器130,存储器130与处理器110相连。其中,处理器110、存储器130和收发器120可以通过内部连接通路互相通信。其中,处理器110,用于建立所述设备与第二设备的通信连接,所述第二设备为区块链网络中的设备;处理器110,还用于产生并确定第一数据需要在所述区块链网络中进 行认证;收发器120,用于向所述第二设备发送所述第一数据,以实现所述第一数据由所述区块链网络中的设备进行认证。Figure 11 illustrates an apparatus in accordance with yet another embodiment of the present application. As shown in FIG. 11, the device 100 includes a processor 110 and a transceiver 120. The processor 110 is coupled to the transceiver 120. Optionally, the device 100 further includes a memory 130 coupled to the processor 110. The processor 110, the memory 130, and the transceiver 120 can communicate with each other through an internal connection path. The processor 110 is configured to establish a communication connection between the device and the second device, where the second device is a device in a blockchain network, and the processor 110 is further configured to generate and determine that the first data needs to be in the In the blockchain network And the transceiver 120 is configured to send the first data to the second device, so that the first data is authenticated by a device in the blockchain network.
因此,根据本申请实施例的设备在产生需要在区块链网络中进行认证的第一数据时,向区块链网络中的第二设备发送第一数据,使得第二设备将第一数据发送给区块链网络中的设备,实现第一数据的认证。由于采用区块链网络对数据进行认证,能够降低通信系统的建设及维护成本,提高系统的安全性能。并且由第二设备将设备的数据发送给区块链网络中的设备进行认证,能够降低对设备的能力要求。Therefore, when the device according to the embodiment of the present application generates the first data that needs to be authenticated in the blockchain network, the first data is sent to the second device in the blockchain network, so that the second device sends the first data. The device in the blockchain network is authenticated by the first data. By using the blockchain network to authenticate data, the construction and maintenance costs of the communication system can be reduced, and the security performance of the system can be improved. And the second device sends the data of the device to the device in the blockchain network for authentication, which can reduce the capability requirement for the device.
根据本申请实施例的设备100可以参照对应本申请实施例的设备10,并且,该设备中的各个单元/模块和上述其他操作和/或功能分别为了上述方法中的相应流程,为了简洁,在此不再赘述。The device 100 according to the embodiment of the present application may refer to the device 10 corresponding to the embodiment of the present application, and the respective units/modules in the device and the other operations and/or functions described above are respectively for the corresponding processes in the foregoing methods, for the sake of brevity, This will not be repeated here.
图12示出了根据本申请再一实施例的设备的示意性框图,如图12所示,设备200包括:处理器210和收发器220,处理器210和收发器220相连,可选地,所述设备200还包括存储器230,存储器230与处理器210相连。其中,处理器210、存储器230和收发器220可以通过内部连接通路互相通信。其中,所述处理器210,用于建立所述设备与第一设备的通信连接,所述设备为区块链网络中的设备;所述收发器220,用于接收所述第一设备发送的由所述第一设备产生的需要在所述区块链网络中认证的第一数据;所述收发器220,还用于向所述区块链网络中的设备发送所述第一数据,实现所述第一数据的认证。FIG. 12 is a schematic block diagram of a device according to still another embodiment of the present application. As shown in FIG. 12, the device 200 includes a processor 210 and a transceiver 220. The processor 210 and the transceiver 220 are connected, optionally, The device 200 also includes a memory 230 that is coupled to the processor 210. The processor 210, the memory 230, and the transceiver 220 can communicate with each other through an internal connection path. The processor 210 is configured to establish a communication connection between the device and the first device, where the device is a device in a blockchain network, and the transceiver 220 is configured to receive the sending by the first device. The first data generated by the first device that needs to be authenticated in the blockchain network; the transceiver 220 is further configured to send the first data to a device in the blockchain network, to implement Authentication of the first data.
因此,根据本申请实施例的设备接收第一设备产生的需要在区块链网络中进行认证的第一数据,并将第一数据发送给区块链网络中的设备,实现第一数据的认证。由于采用区块链网络对数据进行认证,能够降低通信系统的建设及维护费用,提高系统的安全性能。并且由设备将第一设备的数据发送给区块链网络中的设备进行认证,能够降低对第一设备的能力要求。Therefore, the device according to the embodiment of the present application receives the first data generated by the first device that needs to be authenticated in the blockchain network, and sends the first data to the device in the blockchain network to implement authentication of the first data. . By using the blockchain network to authenticate data, the construction and maintenance costs of the communication system can be reduced, and the security performance of the system can be improved. And the device sends the data of the first device to the device in the blockchain network for authentication, which can reduce the capability requirement for the first device.
根据本申请实施例的设备200可以参照对应本申请实施例的设备20,并且,该设备中的各个单元/模块和上述其他操作和/或功能分别为了上述方法中的相应流程,为了简洁,在此不再赘述。The device 200 according to the embodiment of the present application may refer to the device 20 corresponding to the embodiment of the present application, and each unit/module in the device and the other operations and/or functions described above are respectively for the corresponding processes in the foregoing method, for the sake of brevity, This will not be repeated here.
图13示出了根据本申请再一实施例的设备的示意性框图,如图13所示,设备300包括:处理器310和收发器320,处理器310和收发器320相连,可选地,所述设备300还包括存储器330,存储器330与处理器310相连。 其中,处理器310、存储器330和收发器320可以通过内部连接通路互相通信。其中,所述收发器320,用于获取第二数据对应的梅克尔Merkle树信息和区块信息,所述区块信息用于指示区块链网络中承载所述第二数据的区块,第二数据为所述第一数据在所述区块链网络中经过认证后的数据,所述第一数据为第一设备产生的需要在所述区块链网络中进行认证的数据;所述收发器320,还用于根据所述Merkle树信息从承载第二数据的区块中获取第二数据;所述处理器310,用于确定第二数据的完整性。FIG. 13 is a schematic block diagram of a device according to still another embodiment of the present application. As shown in FIG. 13, the device 300 includes a processor 310 and a transceiver 320. The processor 310 is connected to the transceiver 320, optionally, The device 300 also includes a memory 330 that is coupled to the processor 310. The processor 310, the memory 330, and the transceiver 320 can communicate with each other through an internal connection path. The transceiver 320 is configured to acquire Merck's Merkle tree information and block information corresponding to the second data, where the block information is used to indicate a block in the blockchain network that carries the second data. The second data is the authenticated data of the first data in the blockchain network, and the first data is data generated by the first device that needs to be authenticated in the blockchain network; The transceiver 320 is further configured to obtain the second data from the block that carries the second data according to the Merkle tree information, where the processor 310 is configured to determine the integrity of the second data.
因此,根据本申请的设备可以根据接收到的Merkle树信息和区块信息,获取区块链网络中存储的与第一设备产生的需要在区块链网络中进行认证的第一数据对应的第二数据,并确认第二数据的完整性。由此,能够保证数据的保密性和完整性,使得区块链网络中存储的数据具有更高的可靠性。Therefore, the device according to the present application can obtain, according to the received Merkle tree information and the block information, a first stored in the blockchain network corresponding to the first data generated by the first device that needs to be authenticated in the blockchain network. Two data and confirm the integrity of the second data. Thereby, the confidentiality and integrity of the data can be ensured, and the data stored in the blockchain network has higher reliability.
根据本申请实施例的设备300可以参照对应本申请实施例的设备30,并且,该设备中的各个单元/模块和上述其他操作和/或功能分别为了上述方法中的相应流程,为了简洁,在此不再赘述。The device 300 according to the embodiment of the present application may refer to the device 30 corresponding to the embodiment of the present application, and each unit/module in the device and the other operations and/or functions described above are respectively for the corresponding processes in the foregoing method, for the sake of brevity, This will not be repeated here.
可以理解,本申请实施例中的处理器可以是一种集成电路芯片,具有信号的处理能力。上述的处理器可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。It can be understood that the processor in the embodiment of the present application may be an integrated circuit chip with signal processing capability. The processor may be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a Field Programmable Gate Array (FPGA), or the like. Programming logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps, and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
本申请实施例中的存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDR  SDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DR RAM)。应注意,本文描述的系统和方法的存储器旨在包括但不限于这些和任意其它适合类型的存储器。The memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be a read-only memory (ROM), a programmable read only memory (PROM), an erasable programmable read only memory (Erasable PROM, EPROM), or an electric Erase programmable read only memory (EEPROM) or flash memory. The volatile memory can be a Random Access Memory (RAM) that acts as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (Synchronous DRAM). SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDR SDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Synchronous Connection Dynamic Random Access Memory (SDRAM), and Direct Memory Bus (DR RAM). It should be noted that the memories of the systems and methods described herein are intended to comprise, without being limited to, these and any other suitable types of memory.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods to implement the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present application.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。A person skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the system, the device and the unit described above can refer to the corresponding process in the foregoing method embodiment, and details are not described herein again.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质 中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。The functions may be stored in a computer readable storage medium if implemented in the form of a software functional unit and sold or used as a standalone product. Based on such understanding, the technical solution of the present application or the part contributing to the prior art or the part of the technical solution may be embodied in the form of a software product stored in a storage medium. A number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应所述以权利要求的保护范围为准。 The foregoing is only a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application. It should be covered by the scope of protection of this application. Therefore, the scope of protection of the present application should be determined by the scope of the claims.

Claims (95)

  1. 一种基于区块链的数据处理方法,其特征在于,包括:A blockchain-based data processing method, comprising:
    第一设备与第二设备建立通信连接,所述第二设备为区块链网络中的设备;The first device establishes a communication connection with the second device, where the second device is a device in the blockchain network;
    所述第一设备确定所述第一设备产生的第一数据需要在所述区块链网络中进行认证;Determining, by the first device, that the first data generated by the first device needs to be authenticated in the blockchain network;
    所述第一设备向所述第二设备发送所述第一数据,以实现所述第一数据由所述区块链网络中的设备进行认证。The first device sends the first data to the second device, so that the first data is authenticated by a device in the blockchain network.
  2. 根据权利要求1所述的方法,其特征在于,所述第一设备与第二设备建立通信连接,包括:The method according to claim 1, wherein the first device establishes a communication connection with the second device, including:
    所述第一设备向所述第二设备发送采用第一公钥加密过的第一消息,所述第一消息中包括第一信息,所述第一公钥为所述第二设备的公钥,所述第一信息用于请求所述第二设备将所述第一设备产生的需要在所述区块链网络中进行认证的数据发送给所述区块链网络中的设备进行认证;Transmitting, by the first device, the first message that is encrypted by using the first public key to the second device, where the first message includes first information, where the first public key is a public key of the second device The first information is used to request the second device to send data generated by the first device that needs to be authenticated in the blockchain network to a device in the blockchain network for authentication;
    所述第一设备接收所述第二设备发送的第二信息,所述第二信息用于指示所述第二设备确认能够将所述第一设备产生的需要在所述区块链网络中进行认证的数据发送给所述区块链网络中的设备进行认证。The first device receives the second information sent by the second device, where the second information is used to indicate that the second device confirms that the need generated by the first device is performed in the blockchain network. The authenticated data is sent to devices in the blockchain network for authentication.
  3. 根据权利要求2所述的方法,其特征在于,所述第一消息中还包括第二公钥,所述第二公钥为所述第一设备的公钥。The method according to claim 2, wherein the first message further comprises a second public key, and the second public key is a public key of the first device.
  4. 根据权利要求3所述的方法,其特征在于,所述第一设备接收第二设备发送的第二信息,包括:The method according to claim 3, wherein the receiving, by the first device, the second information sent by the second device comprises:
    所述第一设备接收所述第二设备发送的采用所述第二公钥加密过的所述第二信息。The first device receives the second information that is sent by the second device and is encrypted by using the second public key.
  5. 根据权利要求1至4中任一项所述的方法,其特征在于,所述第一设备向所述第二设备发送所述第一数据,包括:The method according to any one of claims 1 to 4, wherein the transmitting, by the first device, the first data to the second device comprises:
    所述第一设备生成承载所述第一数据的区块;The first device generates a block that carries the first data;
    所述第一设备向所述第二设备发送所述区块。The first device sends the block to the second device.
  6. 根据权利要求1至5中任一项所述的方法,其特征在于,在所述第一设备与第二设备建立通信连接之前,所述方法还包括:The method according to any one of claims 1 to 5, wherein before the establishing a communication connection between the first device and the second device, the method further comprises:
    所述第一设备接收所述第二设备发送的第三信息,所述第三信息中包括第一哈希HASH值要求; Receiving, by the first device, third information sent by the second device, where the third information includes a first hash HASH value requirement;
    所述第一设备生成满足所述第一HASH值要求的第一HASH值。The first device generates a first HASH value that satisfies the first HASH value requirement.
  7. 根据权利要求6所述的方法,其特征在于,所述第三信息中包括至少一个HASH值要求,所述至少一个HASH值要求中包括所述第一HASH值要求,所述至少一个HASH值要求中的每个HASH值要求与至少一种业务类型相对应;The method according to claim 6, wherein the third information includes at least one HASH value requirement, the at least one HASH value requirement includes the first HASH value requirement, and the at least one HASH value requirement Each HASH value in the request corresponds to at least one type of service;
    其中,在所述第一设备生成满足所述第一HASH值要求的第一HASH值之前,所述方法还包括:The method further includes: before the first device generates the first HASH value that meets the requirement of the first HASH value, the method further includes:
    所述第一设备根据所述第一数据对应的业务类型,确定所述第一HASH值。The first device determines the first HASH value according to the service type corresponding to the first data.
  8. 根据权利要求6所述的方法,其特征在于,所述第三信息中包括至少一个HASH值要求,所述至少一个HASH值要求中包括所述第一HASH值要求,所述至少一个HASH值要求中的每个HASH值要求与至少一个设备组相对应;The method according to claim 6, wherein the third information includes at least one HASH value requirement, the at least one HASH value requirement includes the first HASH value requirement, and the at least one HASH value requirement Each HASH value in the request corresponds to at least one device group;
    其中,在所述第一设备生成满足所述第一HASH值要求的第一HASH值之前,所述方法还包括:The method further includes: before the first device generates the first HASH value that meets the requirement of the first HASH value, the method further includes:
    所述第一设备根据所述第一设备所属的设备组,确定所述第一HASH值。The first device determines the first HASH value according to the device group to which the first device belongs.
  9. 根据权利要求1至8中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 8, wherein the method further comprises:
    所述第一设备向第三设备发送与所述第一数据相关的第二HASH值,所述第二HASH值用于所述第三设备确定第二数据的完整性,第二数据为所述第一数据在所述区块链网络中经过认证后的数据。Transmitting, by the first device, a second HASH value related to the first data to a third device, where the second HASH value is used by the third device to determine integrity of the second data, where the second data is The first data is authenticated data in the blockchain network.
  10. 根据权利要求9所述的方法,其特征在于,所述第一数据是经过所述第三设备的公钥加密过的。The method of claim 9 wherein said first data is encrypted via a public key of said third device.
  11. 根据权利要求9或10所述的方法,其特征在于,所述方法还包括:The method according to claim 9 or 10, wherein the method further comprises:
    所述第一设备根据所述第一数据确定所述第二HASH值。The first device determines the second HASH value according to the first data.
  12. 根据权利要求1至8中任一项所述的方法,其特征在于,所述第一数据是经过第三设备的公钥加密过的,所述方法还包括:The method according to any one of claims 1 to 8, wherein the first data is encrypted by a public key of a third device, the method further comprising:
    所述第一设备向所述第三设备发送所述第一数据,以便于所述第三设备在根据所述第一数据确定第二HASH值后,根据所述第二HASH值确定第二数据的完整性,第二数据为所述第一数据在所述区块链网络中经过认证后 的数据。The first device sends the first data to the third device, so that the third device determines the second data according to the second HASH value after determining the second HASH value according to the first data. Integrity, the second data is that the first data is authenticated in the blockchain network The data.
  13. 根据权利要求1至12中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 12, further comprising:
    所述第一设备接收所述第二设备发送的第四信息,所述第四信息用于指示所述第一数据已经在所述区块链网络中经过N次认证,N的值为预设值。The first device receives the fourth information sent by the second device, where the fourth information is used to indicate that the first data has been authenticated N times in the blockchain network, and the value of N is preset. value.
  14. 根据权利要求1至12中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 12, further comprising:
    所述第一设备接收所述第二设备发送的第二数据对应的梅克尔Merkle树信息和区块信息,第二数据为所述第一数据在所述区块链网络中经过认证后的数据,所述区块信息用于指示所述区块链网络中承载第二数据的区块。Receiving, by the first device, Merkel tree information and block information corresponding to the second data sent by the second device, where the second data is that the first data is authenticated in the blockchain network Data, the block information is used to indicate a block carrying the second data in the blockchain network.
  15. 根据权利要求1至14中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 14, wherein the method further comprises:
    所述第一设备确定从所述区块链网络中删除第二数据,第二数据为所述第一数据在所述区块链网络中经过认证后的数据;Determining, by the first device, the second data from the blockchain network, where the second data is data that is authenticated by the first data in the blockchain network;
    所述第一设备向所述区块链网络中的设备发送第五信息,所述第五信息用于指示所述区块链网络中的设备从所述区块链网络中删除第二数据。The first device sends fifth information to the device in the blockchain network, where the fifth information is used to indicate that the device in the blockchain network deletes the second data from the blockchain network.
  16. 根据权利要求15所述的方法,其特征在于,所述第五信息中包括标识信息和/或第二数据对应的Merkle树信息,所述标识信息用于标识第二数据。The method according to claim 15, wherein the fifth information includes identification information and/or Merkle tree information corresponding to the second data, and the identification information is used to identify the second data.
  17. 根据权利要求1至16中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 16, wherein the method further comprises:
    所述第一设备删除所述第一设备的本地存储的所述第一数据。The first device deletes the first data stored locally by the first device.
  18. 一种基于区块链的数据处理方法,其特征在于,包括:A blockchain-based data processing method, comprising:
    第二设备与第一设备建立通信连接,所述第二设备为区块链网络中的设备;The second device establishes a communication connection with the first device, where the second device is a device in the blockchain network;
    所述第二设备接收所述第一设备发送的由所述第一设备产生的需要在所述区块链网络中认证的第一数据;Receiving, by the second device, the first data that is generated by the first device and needs to be authenticated in the blockchain network;
    所述第二设备向所述区块链网络中的设备发送所述第一数据,实现所述第一数据的认证。The second device sends the first data to a device in the blockchain network to implement authentication of the first data.
  19. 根据权利要求18所述的方法,其特征在于,所述第二设备与所述第一设备建立通信连接,包括: The method of claim 18, wherein the establishing, by the second device, the communication connection with the first device comprises:
    所述第二设备接收所述第一设备发送的采用第一公钥加密过的第一消息,所述第一消息中包括第一信息,所述第一公钥为所述第二设备的公钥,所述第一信息用于请求所述第二设备将所述第一设备产生的需要在所述区块链网络中进行认证的数据发送给所述区块链网络中的设备进行认证;The second device receives the first message that is sent by the first device and is encrypted by using the first public key, where the first message includes the first information, and the first public key is the public of the second device. Key, the first information is used to request the second device to send data generated by the first device that needs to be authenticated in the blockchain network to a device in the blockchain network for authentication;
    所述第二设备向所述第一设备发送第二信息,所述第二信息用于指示所述第二设备确认能够将所述第一设备产生的需要在所述区块链网络中进行认证的数据发送给所述区块链网络中的设备进行认证。The second device sends the second information to the first device, where the second information is used to indicate that the second device confirms that the first device needs to be authenticated in the blockchain network. The data is sent to devices in the blockchain network for authentication.
  20. 根据权利要求19所述的方法,其特征在于,所述第一消息中还包括第二公钥,所述第二公钥为所述第一设备的公钥。The method according to claim 19, wherein the first message further comprises a second public key, and the second public key is a public key of the first device.
  21. 根据权利要求20所述的方法,其特征在于,所述第二设备向所述第一设备发送第二信息,包括:The method according to claim 20, wherein the sending, by the second device, the second information to the first device comprises:
    所述第二设备向所述第一设备发送采用所述第二公钥加密过的所述第二信息。The second device sends the second information encrypted by the second public key to the first device.
  22. 根据权利要求18至21中任一项所述的方法,其特征在于,在所述第二设备与第一设备建立通信连接之后,所述方法还包括:The method according to any one of claims 18 to 21, wherein after the second device establishes a communication connection with the first device, the method further comprises:
    所述第二设备产生预设数量的数字货币。The second device generates a preset number of digital currencies.
  23. 根据权利要求22所述的方法,其特征在于,所述方法还包括:The method of claim 22, wherein the method further comprises:
    所述第二设备向所述区块链网络中的设备发送所述数字货币的相关信息;Transmitting, by the second device, related information of the digital currency to a device in the blockchain network;
    若所述第二设备确定所述数字货币在所述区块链网络中经过M次认证,所述第二设备确认所述数字货币生效,M的取值为预设值。If the second device determines that the digital currency has undergone M authentication in the blockchain network, the second device confirms that the digital currency is valid, and the value of M is a preset value.
  24. 根据权利要求18至23中任一项所述的方法,其特征在于,所述第二设备接收所述第一设备发送的由所述第一设备产生的需要在所述区块链网络中认证的第一数据,包括:The method according to any one of claims 18 to 23, wherein the second device receives, by the first device, that is generated by the first device and needs to be authenticated in the blockchain network. The first data, including:
    所述第二设备接收所述第一设备发送的承载所述第一数据的区块;Receiving, by the second device, a block that is sent by the first device and that carries the first data;
    其中,所述第二设备向所述区块链网络中的设备发送所述第一数据,包括:The sending, by the second device, the first data to a device in the blockchain network, including:
    所述第二设备向所述区块链网络中的设备发送所述承载所述第一数据的区块。The second device sends the block carrying the first data to a device in the blockchain network.
  25. 根据权利要求18至23中任一项所述的方法,其特征在于,所述第二设备向所述区块链网络中的设备发送所述第一数据,包括: The method according to any one of claims 18 to 23, wherein the transmitting, by the second device, the first data to a device in the blockchain network comprises:
    所述第二设备根据所述区块链网络要求的区块格式,生成承载所述第一数据的区块;The second device generates a block that carries the first data according to a block format required by the blockchain network;
    所述第二设备向所述区块链网络中的设备发送所述承载所述第一数据的区块。The second device sends the block carrying the first data to a device in the blockchain network.
  26. 根据权利要求18至25中任一项所述的方法,其特征在于,在所述第二设备与所述第一设备建立通信连接之前,所述方法还包括:The method according to any one of claims 18 to 25, wherein before the second device establishes a communication connection with the first device, the method further comprises:
    所述第二设备确定第一哈希HASH值要求;The second device determines a first hash HASH value requirement;
    所述第二设备向所述第一设备发送第三信息,所述第三信息中包括所述第一HASH值要求,使得所述第一设备在生成满足所述第一HASH值要求的第一HASH值之后,与所述第二设备建立通信连接。The second device sends the third information to the first device, where the third information includes the first HASH value requirement, so that the first device generates the first one that meets the first HASH value requirement. After the HASH value, a communication connection is established with the second device.
  27. 根据权利要求26所述的方法,其特征在于,所述第三信息中包括至少一个HASH值要求,所述至少一个HASH值要求中包括所述第一HASH值要求,所述至少一个HASH值要求中的每个HASH值要求与至少一种业务类型相对应;The method according to claim 26, wherein the third information includes at least one HASH value requirement, the at least one HASH value requirement includes the first HASH value requirement, and the at least one HASH value requirement Each HASH value in the request corresponds to at least one type of service;
    其中,所述第二设备确定第一哈希HASH值要求,包括:The second device determines a first hash HASH value requirement, including:
    所述第二设备确定所述至少一个HASH值要求。The second device determines the at least one HASH value requirement.
  28. 根据权利要求26所述的方法,其特征在于,所述第三信息中包括至少一个HASH值要求,所述至少一个HASH值要求中包括所述第一HASH值要求,所述至少一个HASH值要求中的每个HASH值要求与至少一个设备组相对应;The method according to claim 26, wherein the third information includes at least one HASH value requirement, the at least one HASH value requirement includes the first HASH value requirement, and the at least one HASH value requirement Each HASH value in the request corresponds to at least one device group;
    其中,所述第二设备确定第一哈希HASH值要求,包括:The second device determines a first hash HASH value requirement, including:
    所述第二设备确定所述至少一个HASH值要求。The second device determines the at least one HASH value requirement.
  29. 根据权利要求18至28中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 18 to 28, wherein the method further comprises:
    所述第二设备接收所述第一设备发送的与所述第一数据相关的第二HASH值,所述第二HASH值用于第三设备确定第二数据的完整性,第二数据为所述第一数据在所述区块链网络中经过认证后的数据;The second device receives a second HASH value that is sent by the first device and is related to the first data, where the second HASH value is used by the third device to determine the integrity of the second data, where the second data is Determining the authenticated data of the first data in the blockchain network;
    所述第二设备向所述第三设备发送所述第二HASH值。The second device sends the second HASH value to the third device.
  30. 根据权利要求29所述的方法,其特征在于,所述第一数据是经过所述第三设备的公钥加密过的。The method of claim 29 wherein said first data is encrypted via a public key of said third device.
  31. 根据权利要求29或30所述的方法,其特征在于,所述第二HASH 值是由所述第一设备根据所述第一数据确定的。The method according to claim 29 or 30, wherein said second HASH The value is determined by the first device based on the first data.
  32. 根据权利要求18至27中任一项所述的方法,其特征在于,所述第一数据是经过第三设备的公钥加密过的,所述方法还包括:The method according to any one of claims 18 to 27, wherein the first data is encrypted by a public key of the third device, the method further comprising:
    所述第二设备接收所述第一数据;The second device receives the first data;
    所述第二设备向所述第三设备发送所述第一数据,以便于所述第三设备在根据所述第一数据确定第二HASH值后,根据所述第二HASH值确定第二数据的完整性,第二数据为所述第一数据在所述区块链网络中经过认证后的数据。The second device sends the first data to the third device, so that the third device determines the second data according to the second HASH value after determining the second HASH value according to the first data. The integrity of the second data is the authenticated data of the first data in the blockchain network.
  33. 根据权利要求18至32中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 18 to 32, wherein the method further comprises:
    若所述第二设备确定所述第一数据已经在所述区块链网络中经过N次认证,所述第二设备向所述第三设备发送第二数据对应梅克尔Merkle树信息和区块信息,所述区块信息用于指示所述区块链网络中承载所述第二数据的区块,第二数据为所述第一数据在所述区块链网络中经过认证后的数据,其中,N的取值为预设值。If the second device determines that the first data has been authenticated N times in the blockchain network, the second device sends the second data corresponding to the Merkel tree information and area to the third device. Block information, the block information is used to indicate a block that carries the second data in the blockchain network, and the second data is data that is authenticated by the first data in the blockchain network. Where N is the default value.
  34. 根据权利要求18至33中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 18 to 33, wherein the method further comprises:
    若所述第二设备确定所述第一数据已经在所述区块链网络中经过N次认证,所述第二设备向所述第一设备发送第四信息,所述第四信息用于指示所述第一数据已经在所述区块链网络中经过N次认证,其中,N的取值为预设值。If the second device determines that the first data has been authenticated N times in the blockchain network, the second device sends fourth information to the first device, where the fourth information is used to indicate The first data has been authenticated N times in the blockchain network, where the value of N is a preset value.
  35. 根据权利要求18至33中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 18 to 33, wherein the method further comprises:
    若所述第二设备确定所述第一数据已经在所述区块链网络中经过N次认证,所述第二设备向所述第一设备发送第二数据对应的Merkle树信息和区块信息,所述区块信息用于指示所述区块链网络中承载第二数据的区块,第二数据为所述第一数据在所述区块链网络中经过认证后的数据,其中,N的取值为预设值。If the second device determines that the first data has been authenticated N times in the blockchain network, the second device sends the Merkle tree information and the block information corresponding to the second data to the first device. The block information is used to indicate a block that carries the second data in the blockchain network, and the second data is the authenticated data of the first data in the blockchain network, where, The value is the default value.
  36. 根据权利要求18至35中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 18 to 35, wherein the method further comprises:
    所述第二设备接收所述第一设备发送的第五信息,所述第五信息用于指 示所述区块链网络中的设备从所述区块链网络中删除第二数据,第二数据为所述第一数据在所述区块链网络中经过认证后的数据。The second device receives the fifth information sent by the first device, where the fifth information is used to refer to The device in the blockchain network deletes the second data from the blockchain network, and the second data is the authenticated data of the first data in the blockchain network.
  37. 根据权利要求36所述的方法,其特征在于,所述第五信息中包括标识信息和/或第二数据对应的Merkle树信息,所述标识信息用于标识所述第二数据。The method according to claim 36, wherein the fifth information includes identification information and/or Merkle tree information corresponding to the second data, and the identification information is used to identify the second data.
  38. 一种基于区块链的数据处理方法,其特征在于,包括:A blockchain-based data processing method, comprising:
    第三设备获取第二数据对应的梅克尔Merkle树信息和区块信息,所述区块信息用于指示区块链网络中承载所述第二数据的区块,第二数据为所述第一数据在所述区块链网络中经过认证后的数据,所述第一数据为第一设备产生的需要在所述区块链网络中进行认证的数据;The third device acquires the Merkel tree information and the block information corresponding to the second data, where the block information is used to indicate the block in the blockchain network that carries the second data, where the second data is the Data that is authenticated in the blockchain network, the first data being data generated by the first device that needs to be authenticated in the blockchain network;
    所述第三设备根据所述Merkle树信息从承载第二数据的区块中获取第二数据;The third device acquires second data from the block that carries the second data according to the Merkle tree information;
    所述第三设备确定第二数据的完整性。The third device determines the integrity of the second data.
  39. 根据权利要求38所述的方法,其特征在于,若所述第三设备确认第二数据完整,所述方法还包括:The method according to claim 38, wherein if the third device confirms that the second data is complete, the method further includes:
    所述第三设备向所述区块链网络中的设备发送确认信息,所述确认信息用于指示第二数据完整。The third device sends an acknowledgement message to the device in the blockchain network, where the acknowledgement information is used to indicate that the second data is complete.
  40. 根据权利要求38或39所述的方法,其特征在于,所述第三设备获取第二数据对应的梅克尔Merkle树信息和区块信息,包括:The method according to claim 38 or 39, wherein the third device acquires the Merkel tree information and the block information corresponding to the second data, including:
    所述第三设备接收第二设备发送的所述Merkle树信息和所述区块信息,其中,所述第二设备为所述区块链网络中的设备。The third device receives the Merkle tree information and the block information sent by the second device, where the second device is a device in the blockchain network.
  41. 根据权利要求40所述的方法,其特征在于,所述第二设备为将所述第一数据发送给所述区块链网络中进行认的设备。The method according to claim 40, wherein said second device is a device for transmitting said first data to said blockchain network for authentication.
  42. 根据权利要求38至41中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 38 to 41, wherein the method further comprises:
    所述第三设备确定与所述第一数据相关的第二哈希HASH值;The third device determines a second hash HASH value associated with the first data;
    其中,所述第三设备确定第二数据的完整性,包括:The third device determines the integrity of the second data, including:
    所述第三设备根据与第二数据相关的第三HASH值和所述第二HASH值的一致性,确定第二数据的完整性。The third device determines the integrity of the second data according to the consistency of the third HASH value and the second HASH value associated with the second data.
  43. 根据权利要求42所述的方法,其特征在于,所述第三设备确定与所述第一数据相关的第二哈希HASH值,包括: The method according to claim 42, wherein the third device determines a second hash HASH value associated with the first data, comprising:
    所述第三设备接收所述第二HASH值,其中,所述第二HASH值是由所述第一设备根据所述第一数据确定的。The third device receives the second HASH value, where the second HASH value is determined by the first device according to the first data.
  44. 根据权利要求43所述的方法,其特征在于,所述第一数据是经过所述第三设备的公钥加密过的。The method of claim 43 wherein said first data is encrypted via a public key of said third device.
  45. 根据权利要求42所述的方法,其特征在于,所述第一数据是经过所述第三设备的公钥加密过的,所述方法还包括:The method according to claim 42, wherein the first data is encrypted by a public key of the third device, the method further comprising:
    所述第三设备接收所述第一设备发送的所述第一数据;Receiving, by the third device, the first data sent by the first device;
    其中,所述第三设备确定与所述第一数据相关的第二哈希HASH值,包括:The third device determines a second hash HASH value associated with the first data, including:
    所述第三设备根据所述第一数据,确定所述第二HASH值。The third device determines the second HASH value according to the first data.
  46. 根据权利要求38至45中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 38 to 45, wherein the method further comprises:
    所述第三设备确定从所述区块链网络中删除第二数据;The third device determines to delete the second data from the blockchain network;
    所述第三设备向所述区块链网络中的设备发送第五信息,所述第五信息用于指示所述区块链网络中的设备从所述区块链网络中删除第二数据。The third device sends fifth information to the device in the blockchain network, where the fifth information is used to indicate that the device in the blockchain network deletes the second data from the blockchain network.
  47. 根据权利要求46所述的方法,其特征在于,所述第五信息中包括标识信息和/或第二数据对应的Merkle树信息,所述标识信息用于标识第二数据。The method according to claim 46, wherein the fifth information includes identification information and/or Merkle tree information corresponding to the second data, and the identification information is used to identify the second data.
  48. 一种设备,其特征在于,包括:An apparatus, comprising:
    处理模块,用于建立所述设备与第二设备的通信连接,所述第二设备为区块链网络中的设备;a processing module, configured to establish a communication connection between the device and the second device, where the second device is a device in a blockchain network;
    所述处理模块,还用于产生并确定第一数据需要在所述区块链网络中进行认证;The processing module is further configured to generate and determine that the first data needs to be authenticated in the blockchain network;
    收发模块,用于向所述第二设备发送所述第一数据,以实现所述第一数据由所述区块链网络中的设备进行认证。And a transceiver module, configured to send the first data to the second device, to implement that the first data is authenticated by a device in the blockchain network.
  49. 根据权利要求48所述的设备,其特征在于,所述收发模块具体用于:The device according to claim 48, wherein the transceiver module is specifically configured to:
    向所述第二设备发送采用第一公钥加密过的第一消息,所述第一消息中包括第一信息,所述第一公钥为所述第二设备的公钥,所述第一信息用于请求所述第二设备将所述设备产生的需要在所述区块链网络中进行认证的数据发送给所述区块链网络中的设备进行认证; Transmitting, by the second device, a first message that is encrypted by using a first public key, where the first message includes first information, where the first public key is a public key of the second device, the first The information is used to request the second device to send data generated by the device that needs to be authenticated in the blockchain network to a device in the blockchain network for authentication;
    接收所述第二设备发送的第二信息,所述第二信息用于指示所述第二设备确认能够将所述设备产生的需要在所述区块链网络中进行认证的数据发送给所述区块链网络中的设备进行认证。Receiving, by the second device, second information, where the second information is used to indicate that the second device confirms that data generated by the device that needs to be authenticated in the blockchain network is sent to the The devices in the blockchain network are authenticated.
  50. 根据权利要求49所述的设备,其特征在于,所述第一消息中还包括第二公钥,所述第二公钥为所述设备的公钥。The device according to claim 49, wherein the first message further comprises a second public key, and the second public key is a public key of the device.
  51. 根据权利要求50所述的设备,其特征在于,所述收发模块具体用于:The device according to claim 50, wherein the transceiver module is specifically configured to:
    接收所述第二设备发送的采用所述第二公钥加密过的所述第二信息。Receiving, by the second device, the second information encrypted by using the second public key.
  52. 根据权利要求48至51中任一项所述的设备,其特征在于,所述处理模块还用于:生成承载所述第一数据的区块;The device according to any one of claims 48 to 51, wherein the processing module is further configured to: generate a block that carries the first data;
    所述收发模块,具体用于向所述第二设备发送所述区块。The transceiver module is specifically configured to send the block to the second device.
  53. 根据权利要求48至52中任一项所述的设备,其特征在于,所述收发模块还用于:The device according to any one of claims 48 to 52, wherein the transceiver module is further configured to:
    接收所述第二设备发送的第三信息,所述第三信息中包括第一哈希HASH值要求;Receiving, by the second device, third information, where the third information includes a first hash HASH value requirement;
    所述处理模块,还用于生成满足所述第一HASH值要求的第一HASH值。The processing module is further configured to generate a first HASH value that meets the first HASH value requirement.
  54. 根据权利要求53所述的设备,其特征在于,所述第三信息中包括至少一个HASH值要求,所述至少一个HASH值要求中包括所述第一HASH值要求,所述至少一个HASH值要求中的每个HASH值要求与至少一种业务类型相对应;The device according to claim 53, wherein the third information includes at least one HASH value requirement, the at least one HASH value requirement includes the first HASH value requirement, and the at least one HASH value requirement Each HASH value in the request corresponds to at least one type of service;
    其中,所述处理模块还用于:The processing module is further configured to:
    根据所述第一数据对应的业务类型,确定所述第一HASH值。Determining the first HASH value according to the service type corresponding to the first data.
  55. 根据权利要求53所述的设备,其特征在于,所述第三信息中包括至少一个HASH值要求,所述至少一个HASH值要求中包括所述第一HASH值要求,所述至少一个HASH值要求中的每个HASH值要求与至少一个设备组相对应;The device according to claim 53, wherein the third information includes at least one HASH value requirement, the at least one HASH value requirement includes the first HASH value requirement, and the at least one HASH value requirement Each HASH value in the request corresponds to at least one device group;
    其中,所述处理模块还用于:The processing module is further configured to:
    根据所述设备所属的设备组,确定所述第一HASH值。Determining the first HASH value according to the device group to which the device belongs.
  56. 根据权利要求49至55中任一项所述的设备,其特征在于,所述收发模块还用于: The device according to any one of claims 49 to 55, wherein the transceiver module is further configured to:
    向第三设备发送与所述第一数据相关的第二HASH值,所述第二HASH值用于所述第三设备确定第二数据的完整性,第二数据为所述第一数据在所述区块链网络中经过认证后的数据。Sending, to the third device, a second HASH value related to the first data, where the second HASH value is used by the third device to determine integrity of the second data, where the second data is The authenticated data in the blockchain network.
  57. 根据权利要求56所述的设备,其特征在于,所述第一数据是经过所述第三设备的公钥加密过的。The device according to claim 56, wherein said first data is encrypted by a public key of said third device.
  58. 根据权利要求56或57所述的设备,其特征在于,所述处理模块还用于:根据所述第一数据确定所述第二HASH值。The device according to claim 56 or 57, wherein the processing module is further configured to: determine the second HASH value according to the first data.
  59. 根据权利要求49至55中任一项所述的设备,其特征在于,所述第一数据是经过第三设备的公钥加密过的,所述收发模块还用于:The device according to any one of claims 49 to 55, wherein the first data is encrypted by a public key of the third device, and the transceiver module is further configured to:
    向所述第三设备发送所述第一数据,以便于所述第三设备在根据所述第一数据确定第二HASH值后,根据所述第二HASH值确定第二数据的完整性,第二数据为所述第一数据在所述区块链网络中经过认证后的数据。Transmitting the first data to the third device, so that the third device determines the integrity of the second data according to the second HASH value after determining the second HASH value according to the first data, The two data is the authenticated data of the first data in the blockchain network.
  60. 根据权利要求48至59中任一项所述的设备,其特征在于,所述收发模块还用于:The device according to any one of claims 48 to 59, wherein the transceiver module is further configured to:
    接收所述第二设备发送的第四信息,所述第四信息用于指示所述第一数据已经在所述区块链网络中经过N次认证,N的值为预设值。Receiving fourth information sent by the second device, where the fourth information is used to indicate that the first data has been authenticated N times in the blockchain network, and the value of N is a preset value.
  61. 根据权利要求48至59中任一项所述的设备,其特征在于,所述收发模块还用于:The device according to any one of claims 48 to 59, wherein the transceiver module is further configured to:
    接收所述第二设备发送的第二数据对应的梅克尔Merkle树信息和区块信息,第二数据为所述第一数据在所述区块链网络中经过认证后的数据,所述区块信息用于指示所述区块链网络中承载第二数据的区块。Receiving Merkel's Merkle tree information and block information corresponding to the second data sent by the second device, where the second data is the authenticated data of the first data in the blockchain network, the area The block information is used to indicate a block carrying the second data in the blockchain network.
  62. 根据权利要求48至61中任一项所述的设备,其特征在于,所述处理模块还用于:确定从所述区块链网络中删除第二数据,第二数据为所述第一数据在所述区块链网络中经过认证后的数据;The device according to any one of claims 48 to 61, wherein the processing module is further configured to: determine to delete second data from the blockchain network, the second data being the first data The authenticated data in the blockchain network;
    所述收发模块,还用于向所述区块链网络中的设备发送第五信息,所述第五信息用于指示所述区块链网络中的设备从所述区块链网络中删除第二数据。The transceiver module is further configured to send fifth information to a device in the blockchain network, where the fifth information is used to indicate that a device in the blockchain network is deleted from the blockchain network. Two data.
  63. 根据权利要求62所述的设备,其特征在于,所述第五信息中包括标识信息和/或第二数据对应的Merkle树信息,所述标识信息用于标识第二数据。The device according to claim 62, wherein the fifth information includes identification information and/or Merkle tree information corresponding to the second data, and the identification information is used to identify the second data.
  64. 根据权利要求48至63中任一项所述的设备,其特征在于,所述处 理模块还用于:删除所述设备的本地存储的所述第一数据。Apparatus according to any one of claims 48 to 63, wherein said The management module is further configured to: delete the first data stored locally by the device.
  65. 一种设备,其特征在于,包括:An apparatus, comprising:
    处理模块,用于建立所述设备与第一设备的通信连接,所述设备为区块链网络中的设备;a processing module, configured to establish a communication connection between the device and the first device, where the device is a device in a blockchain network;
    收发模块,用于接收所述第一设备发送的由所述第一设备产生的需要在所述区块链网络中认证的第一数据;a transceiver module, configured to receive, by the first device, first data generated by the first device and required to be authenticated in the blockchain network;
    所述收发模块,还用于向所述区块链网络中的设备发送所述第一数据,实现所述第一数据的认证。The transceiver module is further configured to send the first data to a device in the blockchain network to implement authentication of the first data.
  66. 根据权利要求65所述的设备,其特征在于,所述收发模块具体用于:The device according to claim 65, wherein the transceiver module is specifically configured to:
    接收所述第一设备发送的采用第一公钥加密过的第一消息,所述第一消息中包括第一信息,所述第一公钥为所述设备的公钥,所述第一信息用于请求所述设备将所述第一设备产生的需要在所述区块链网络中进行认证的数据发送给所述区块链网络中的设备进行认证;Receiving, by the first device, a first message that is encrypted by using a first public key, where the first message includes first information, where the first public key is a public key of the device, and the first information is And configured to request the device to send, by the first device, data that needs to be authenticated in the blockchain network to a device in the blockchain network for authentication;
    向所述第一设备发送第二信息,所述第二信息用于指示所述设备确认能够将所述第一设备产生的需要在所述区块链网络中进行认证的数据发送给所述区块链网络中的设备进行认证。Transmitting, to the first device, second information, where the second information is used to indicate that the device confirms that data generated by the first device that needs to be authenticated in the blockchain network is sent to the area Devices in the blockchain network are authenticated.
  67. 根据权利要求66所述的设备,其特征在于,所述第一消息中还包括第二公钥,所述第二公钥为所述第一设备的公钥。The device according to claim 66, wherein the first message further comprises a second public key, and the second public key is a public key of the first device.
  68. 根据权利要求67所述的设备,其特征在于,所述收发模块具体用于:向所述第一设备发送采用所述第二公钥加密过的所述第二信息。The device according to claim 67, wherein the transceiver module is specifically configured to: send, to the first device, the second information encrypted by using the second public key.
  69. 根据权利要求65至68中任一项所述的设备,其特征在于,所述处理模块还用于:产生预设数量的数字货币。The device according to any one of claims 65 to 68, wherein the processing module is further configured to generate a preset number of digital currencies.
  70. 根据权利要求69所述的设备,其特征在于,所述收发模块还用于:向所述区块链网络中的设备发送所述数字货币的相关信息;The device according to claim 69, wherein the transceiver module is further configured to: send information about the digital currency to a device in the blockchain network;
    所述处理模块,还用于若确定所述数字货币在所述区块链网络中经过M次认证,确认所述数字货币生效,M的取值为预设值。The processing module is further configured to: if it is determined that the digital currency has undergone M authentication in the blockchain network, confirm that the digital currency is valid, and the value of M is a preset value.
  71. 根据权利要求65至70中任一项所述的设备,其特征在于,所述收发模块具体用于:The device according to any one of claims 65 to 70, wherein the transceiver module is specifically configured to:
    接收所述第一设备发送的承载所述第一数据的区块;Receiving, by the first device, a block that carries the first data;
    向所述区块链网络中的设备发送所述承载所述第一数据的区块。 Transmitting the block carrying the first data to a device in the blockchain network.
  72. 根据权利要求65至70中任一项所述的设备,其特征在于,所述处理模块还用于:根据所述区块链网络要求的区块格式,生成承载所述第一数据的区块;The device according to any one of claims 65 to 70, wherein the processing module is further configured to: generate a block that carries the first data according to a block format required by the blockchain network ;
    所述收发模块,还用于向所述区块链网络中的设备发送所述承载所述第一数据的区块。The transceiver module is further configured to send the block that carries the first data to a device in the blockchain network.
  73. 根据权利要求65至72中任一项所述的设备,其特征在于,所述处理模块还用于:确定第一哈希HASH值要求;The device according to any one of claims 65 to 72, wherein the processing module is further configured to: determine a first hash HASH value requirement;
    所述收发模块,具体用于向所述第一设备发送第三信息,所述第三信息中包括所述第一HASH值要求,使得所述第一设备在生成满足所述第一HASH值要求的第一HASH值之后,与所述设备建立通信连接。The transceiver module is configured to send the third information to the first device, where the third information includes the first HASH value requirement, so that the first device meets the requirement that the first HASH value is met. After the first HASH value, a communication connection is established with the device.
  74. 根据权利要求73所述的设备,其特征在于,所述第三信息中包括至少一个HASH值要求,所述至少一个HASH值要求中包括所述第一HASH值要求,所述至少一个HASH值要求中的每个HASH值要求与至少一种业务类型相对应;The device according to claim 73, wherein the third information includes at least one HASH value requirement, the at least one HASH value requirement includes the first HASH value requirement, and the at least one HASH value requirement Each HASH value in the request corresponds to at least one type of service;
    其中,所述处理模块具体用于:确定所述至少一个HASH值要求。The processing module is specifically configured to: determine the at least one HASH value requirement.
  75. 根据权利要求73所述的设备,其特征在于,所述第三信息中包括至少一个HASH值要求,所述至少一个HASH值要求中包括所述第一HASH值要求,所述至少一个HASH值要求中的每个HASH值要求与至少一个设备组相对应;The device according to claim 73, wherein the third information includes at least one HASH value requirement, the at least one HASH value requirement includes the first HASH value requirement, and the at least one HASH value requirement Each HASH value in the request corresponds to at least one device group;
    其中,所述处理模块具体用于:确定所述至少一个HASH值要求。The processing module is specifically configured to: determine the at least one HASH value requirement.
  76. 根据权利要求65至75中任一项所述的设备,其特征在于,所述收发模块还用于:The device according to any one of claims 65 to 75, wherein the transceiver module is further configured to:
    接收所述第一设备发送的与所述第一数据相关的第二HASH值,所述第二HASH值用于第三设备确定第二数据的完整性,第二数据为所述第一数据在所述区块链网络中经过认证后的数据;Receiving, by the first device, a second HASH value related to the first data, where the second HASH value is used by the third device to determine integrity of the second data, where the second data is The authenticated data in the blockchain network;
    向所述第三设备发送所述第二HASH值。Sending the second HASH value to the third device.
  77. 根据权利要求76所述的设备,其特征在于,所述第一数据是经过所述第三设备的公钥加密过的。The device according to claim 76, wherein said first data is encrypted by a public key of said third device.
  78. 根据权利要求76或77所述的设备,其特征在于,所述第二HASH值是由所述第一设备根据所述第一数据确定的。The apparatus according to claim 76 or 77, wherein said second HASH value is determined by said first device based on said first data.
  79. 根据权利要求65至74中任一项所述的设备,其特征在于,所述第 一数据是经过第三设备的公钥加密过的,所述收发模块还用于:Apparatus according to any one of claims 65 to 74, wherein said A data is encrypted by a public key of the third device, and the transceiver module is further configured to:
    接收所述第一数据;Receiving the first data;
    向所述第三设备发送所述第一数据,以便于所述第三设备在根据所述第一数据确定第二HASH值后,根据所述第二HASH值确定第二数据的完整性,第二数据为所述第一数据在所述区块链网络中经过认证后的数据。Transmitting the first data to the third device, so that the third device determines the integrity of the second data according to the second HASH value after determining the second HASH value according to the first data, The two data is the authenticated data of the first data in the blockchain network.
  80. 根据权利要求65至79中任一项所述的设备,其特征在于,所述收发模块还用于:The device according to any one of claims 65 to 79, wherein the transceiver module is further configured to:
    若所述处理模块确定所述第一数据已经在所述区块链网络中经过N次认证,向所述第三设备发送第二数据对应梅克尔Merkle树信息和区块信息,所述区块信息用于指示所述区块链网络中承载所述第二数据的区块,第二数据为所述第一数据在所述区块链网络中经过认证后的数据,其中,N的取值为预设值。And if the processing module determines that the first data has been authenticated N times in the blockchain network, sending, by the third device, second data corresponding to Merkel Merkle tree information and block information, the area The block information is used to indicate the block in the blockchain network that carries the second data, and the second data is the data in which the first data is authenticated in the blockchain network, where The value is the default value.
  81. 根据权利要求65至80中任一项所述的设备,其特征在于,所述收发模块还用于:The device according to any one of claims 65 to 80, wherein the transceiver module is further configured to:
    若所述处理模块确定所述第一数据已经在所述区块链网络中经过N次认证,向所述第一设备发送第四信息,所述第四信息用于指示所述第一数据已经在所述区块链网络中经过N次认证,其中,N的取值为预设值。If the processing module determines that the first data has been authenticated N times in the blockchain network, sending fourth information to the first device, where the fourth information is used to indicate that the first data has been The authentication is performed N times in the blockchain network, where the value of N is a preset value.
  82. 根据权利要求65至80中任一项所述的设备,其特征在于,所述收发模块还用于:The device according to any one of claims 65 to 80, wherein the transceiver module is further configured to:
    若所述处理模块确定所述第一数据已经在所述区块链网络中经过N次认证,向所述第一设备发送第二数据对应的Merkle树信息和区块信息,所述区块信息用于指示所述区块链网络中承载第二数据的区块,第二数据为所述第一数据在所述区块链网络中经过认证后的数据,其中,N的取值为预设值。If the processing module determines that the first data has been authenticated N times in the blockchain network, sending the Merkle tree information and the block information corresponding to the second data to the first device, the block information And the second data is the authenticated data of the first data in the blockchain network, where the value of N is preset. value.
  83. 根据权利要求65至82中任一项所述的设备,其特征在于,所述收发模块还用于:The device according to any one of claims 65 to 82, wherein the transceiver module is further configured to:
    接收所述第一设备发送的第五信息,所述第五信息用于指示所述区块链网络中的设备从所述区块链网络中删除第二数据,第二数据为所述第一数据在所述区块链网络中经过认证后的数据。Receiving, by the first device, the fifth information, where the fifth information is used to indicate that the device in the blockchain network deletes the second data from the blockchain network, where the second data is the first The data is authenticated in the blockchain network.
  84. 根据权利要求83所述的设备,其特征在于,所述第五信息中包括标识信息和/或第二数据对应的Merkle树信息,所述标识信息用于标识所述 第二数据。The device according to claim 83, wherein the fifth information includes identification information and/or Merkle tree information corresponding to the second data, where the identification information is used to identify the Second data.
  85. 一种设备,其特征在于,包括:An apparatus, comprising:
    收发模块,用于获取第二数据对应的梅克尔Merkle树信息和区块信息,所述区块信息用于指示区块链网络中承载所述第二数据的区块,第二数据为所述第一数据在所述区块链网络中经过认证后的数据,所述第一数据为第一设备产生的需要在所述区块链网络中进行认证的数据;a transceiver module, configured to acquire Merck's Merkle tree information and block information corresponding to the second data, where the block information is used to indicate a block in the blockchain network that carries the second data, where the second data is Determining, by the first data, the authenticated data in the blockchain network, where the first data is data generated by the first device and required to be authenticated in the blockchain network;
    所述收发模块,还用于根据所述Merkle树信息从承载第二数据的区块中获取第二数据;The transceiver module is further configured to acquire second data from a block that carries the second data according to the Merkle tree information;
    处理模块,用于确定第二数据的完整性。a processing module for determining integrity of the second data.
  86. 根据权利要求85所述的设备,其特征在于,若所述第二数据完整,所述收发模块还用于:The device according to claim 85, wherein if the second data is complete, the transceiver module is further configured to:
    向所述区块链网络中的设备发送确认信息,所述确认信息用于指示第二数据完整。An acknowledgment message is sent to the device in the blockchain network, the acknowledgment information being used to indicate that the second data is complete.
  87. 根据权利要求85或86所述的设备,其特征在于,所述收发模块具体用于:The device according to claim 85 or 86, wherein the transceiver module is specifically configured to:
    接收第二设备发送的所述Merkle树信息和所述区块信息,其中,所述第二设备为所述区块链网络中的设备。Receiving the Merkle tree information and the block information sent by the second device, where the second device is a device in the blockchain network.
  88. 根据权利要求87所述的设备,其特征在于,所述第二设备为将所述第一数据发送给所述区块链网络中进行认的设备。The device according to claim 87, wherein said second device is a device for transmitting said first data to said blockchain network for authentication.
  89. 根据权利要求85至88中任一项所述的设备,其特征在于,所述处理模块还用于:The device according to any one of claims 85 to 88, wherein the processing module is further configured to:
    确定与所述第一数据相关的第二哈希HASH值;Determining a second hash HASH value associated with the first data;
    根据与第二数据相关的第三HASH值和所述第二HASH值的一致性,确定第二数据的完整性。And determining the integrity of the second data according to the consistency of the third HASH value and the second HASH value associated with the second data.
  90. 根据权利要求89所述的设备,其特征在于,所述处理模块具体用于:The device according to claim 89, wherein the processing module is specifically configured to:
    接收所述第二HASH值,其中,所述第二HASH值是由所述第一设备根据所述第一数据确定的。Receiving the second HASH value, wherein the second HASH value is determined by the first device according to the first data.
  91. 根据权利要求90所述的设备,其特征在于,所述第一数据是经过所述设备的公钥加密过的。The device of claim 90 wherein said first data is encrypted via a public key of said device.
  92. 根据权利要求89所述的设备,其特征在于,所述第一数据是经过 所述设备的公钥加密过的,所述收发模块还用于:The device according to claim 89, wherein said first data is passed The public key of the device is encrypted, and the transceiver module is further configured to:
    接收所述第一设备发送的所述第一数据;Receiving the first data sent by the first device;
    其中,所述处理模块具体用于:根据所述第一数据,确定所述第二HASH值。The processing module is specifically configured to: determine the second HASH value according to the first data.
  93. 根据权利要求85至92中任一项所述的设备,其特征在于,所述处理模块还用于:The device according to any one of claims 85 to 92, wherein the processing module is further configured to:
    确定从所述区块链网络中删除第二数据;Determining to delete the second data from the blockchain network;
    所述收发模块,还用于向所述区块链网络中的设备发送第五信息,所述第五信息用于指示所述区块链网络中的设备从所述区块链网络中删除第二数据。The transceiver module is further configured to send fifth information to a device in the blockchain network, where the fifth information is used to indicate that a device in the blockchain network is deleted from the blockchain network. Two data.
  94. 根据权利要求93所述的设备,其特征在于,所述第五信息中包括标识信息和/或第二数据对应的Merkle树信息,所述标识信息用于标识第二数据。The device according to claim 93, wherein the fifth information includes identification information and/or Merkle tree information corresponding to the second data, and the identification information is used to identify the second data.
  95. 一种通信系统,其特征在于,包括:权利要求48至64中任一项所述的设备、权利要求65至84中任一项所述的设备和权利要求85至94中任一项所述的设备。 A communication system, comprising: the apparatus of any one of claims 48 to 64, the apparatus of any one of claims 65 to 84, and any one of claims 85 to 94 device of.
PCT/CN2017/000052 2017-01-03 2017-01-03 Blockchain-based data processing method, device and system WO2018126340A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201780081904.3A CN110121860B (en) 2017-01-03 2017-01-03 Data processing method, device and system based on block chain
PCT/CN2017/000052 WO2018126340A1 (en) 2017-01-03 2017-01-03 Blockchain-based data processing method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/000052 WO2018126340A1 (en) 2017-01-03 2017-01-03 Blockchain-based data processing method, device and system

Publications (1)

Publication Number Publication Date
WO2018126340A1 true WO2018126340A1 (en) 2018-07-12

Family

ID=62788941

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/000052 WO2018126340A1 (en) 2017-01-03 2017-01-03 Blockchain-based data processing method, device and system

Country Status (2)

Country Link
CN (1) CN110121860B (en)
WO (1) WO2018126340A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200059510A1 (en) * 2018-08-14 2020-02-20 Microsoft Technology Licensing, Llc Blockchain digital twin
CN112116475A (en) * 2020-09-22 2020-12-22 中国科学院沈阳计算技术研究所有限公司 Block chain-based distributed data transaction method and system
DE102022106864A1 (en) 2022-03-23 2023-09-28 Dr. Ing. H.C. F. Porsche Aktiengesellschaft Method for determining whether a portable device belongs to an associated group of portable devices based on a blockchain

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111478948B (en) * 2020-03-20 2023-02-17 深圳市芯链科技有限公司 Block chain access method, internet of things equipment and storage medium
CN111552215B (en) * 2020-05-22 2022-02-11 中国联合网络通信集团有限公司 Internet of things equipment safety protection method and system
CN113065118B (en) * 2021-03-16 2022-06-14 青岛海尔科技有限公司 Method and device for determining authentication code, storage medium and electronic device
CN114153827B (en) * 2021-10-11 2023-01-10 北京天德科技有限公司 Transaction data removing method based on block chain system
CN114172665A (en) * 2021-12-07 2022-03-11 东软集团股份有限公司 Block chain zero trust system and method for block chain zero trust system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105790954A (en) * 2016-03-02 2016-07-20 布比(北京)网络技术有限公司 Method and system for constructing electronic evidence
CN105975868A (en) * 2016-04-29 2016-09-28 杭州云象网络技术有限公司 Block chain-based evidence preservation method and apparatus
CN106100847A (en) * 2016-06-14 2016-11-09 惠众商务顾问(北京)有限公司 Asymmetric encryption block chain identity information verification method and device
CN106126722A (en) * 2016-06-30 2016-11-16 中国科学院计算技术研究所 A kind of prefix compound tree based on checking and method for designing

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10346814B2 (en) * 2014-06-04 2019-07-09 MONI Limited System and method for executing financial transactions
CN104320262B (en) * 2014-11-05 2017-07-21 中国科学院合肥物质科学研究院 The method and system of client public key address binding, retrieval and the verification of account book technology are disclosed based on encryption digital cash
US10484168B2 (en) * 2015-03-02 2019-11-19 Dell Products L.P. Methods and systems for obfuscating data and computations defined in a secure distributed transaction ledger
CN105719185B (en) * 2016-01-22 2019-02-15 杭州复杂美科技有限公司 The data comparison and common recognition method of block chain

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105790954A (en) * 2016-03-02 2016-07-20 布比(北京)网络技术有限公司 Method and system for constructing electronic evidence
CN105975868A (en) * 2016-04-29 2016-09-28 杭州云象网络技术有限公司 Block chain-based evidence preservation method and apparatus
CN106100847A (en) * 2016-06-14 2016-11-09 惠众商务顾问(北京)有限公司 Asymmetric encryption block chain identity information verification method and device
CN106126722A (en) * 2016-06-30 2016-11-16 中国科学院计算技术研究所 A kind of prefix compound tree based on checking and method for designing

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200059510A1 (en) * 2018-08-14 2020-02-20 Microsoft Technology Licensing, Llc Blockchain digital twin
WO2020036682A1 (en) * 2018-08-14 2020-02-20 Microsoft Technology Licensing, Llc Blockchain digital twin
CN112567712A (en) * 2018-08-14 2021-03-26 微软技术许可有限责任公司 Block chain digital twinning
US11038950B2 (en) 2018-08-14 2021-06-15 Microsoft Technology Licensing, Llc Blockchain digital twin for transactions on behalf of limited capability devices
CN112567712B (en) * 2018-08-14 2023-09-01 微软技术许可有限责任公司 Blockchain digital twinning
CN112116475A (en) * 2020-09-22 2020-12-22 中国科学院沈阳计算技术研究所有限公司 Block chain-based distributed data transaction method and system
CN112116475B (en) * 2020-09-22 2023-07-04 中国科学院沈阳计算技术研究所有限公司 Distributed data transaction method and system based on blockchain
DE102022106864A1 (en) 2022-03-23 2023-09-28 Dr. Ing. H.C. F. Porsche Aktiengesellschaft Method for determining whether a portable device belongs to an associated group of portable devices based on a blockchain

Also Published As

Publication number Publication date
CN110121860A (en) 2019-08-13
CN110121860B (en) 2021-08-13

Similar Documents

Publication Publication Date Title
WO2018126340A1 (en) Blockchain-based data processing method, device and system
WO2018126837A1 (en) Blockchain-based data processing method, device and system
CN109559122B (en) Block chain data transmission method and block chain data transmission system
US11038682B2 (en) Communication method, apparatus and system, electronic device, and computer readable storage medium
CN111797415A (en) Block chain based data sharing method, electronic device and storage medium
CN107454079B (en) Lightweight equipment authentication and shared key negotiation method based on Internet of things platform
CN108400872B (en) Block chain information transmission method and system based on satellite-ground cooperation
US20210143986A1 (en) Method for securely sharing data under certain conditions on a distributed ledger
WO2022111102A1 (en) Method, system and apparatus for establishing secure connection, electronic device, and machine-readable storage medium
CN103873487A (en) Method for achieving home credible networking based on safety pendent of smart home device
WO2019110018A1 (en) Message authentication method for communication network system, communication method and communication network system
CN112311543B (en) GBA key generation method, terminal and NAF network element
CN103905384A (en) Embedded inter-terminal session handshake realization method based on security digital certificate
WO2022068356A1 (en) Blockchain-based information encryption method and apparatus, device and medium
WO2023283789A1 (en) Secure communication method and apparatus, terminal device, and network device
WO2024032289A1 (en) Video playback method and system, video security platform, and communication device
WO2023236551A1 (en) Decentralized trusted access method for cellular base station
CN114039753A (en) Access control method and device, storage medium and electronic equipment
CN114143108A (en) Session encryption method, device, equipment and storage medium
CN112866981B (en) Method and device for managing subscription data
CN111709053B (en) Operation method and operation device based on loose coupling transaction network
CN111768189B (en) Charging pile operation method, device and system based on block chain
CN105471657A (en) Method, device and system for managing inter-domain communication log of virtual machine
Gao et al. Bc-aka: Blockchain based asymmetric authentication and key agreement protocol for distributed 5g core network
US9979539B2 (en) Method and system of authenticating a network device in a location based verification framework

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

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

Country of ref document: EP

Kind code of ref document: A1