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

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

Info

Publication number
WO2018126837A1
WO2018126837A1 PCT/CN2017/115001 CN2017115001W WO2018126837A1 WO 2018126837 A1 WO2018126837 A1 WO 2018126837A1 CN 2017115001 W CN2017115001 W CN 2017115001W WO 2018126837 A1 WO2018126837 A1 WO 2018126837A1
Authority
WO
WIPO (PCT)
Prior art keywords
block
blocks
blockchain network
storage duration
time
Prior art date
Application number
PCT/CN2017/115001
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 华为技术有限公司
Publication of WO2018126837A1 publication Critical patent/WO2018126837A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content
    • H04L67/5651Reducing the amount or size of exchanged application data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • H04L67/5682Policies or rules for updating, deleting or replacing the stored data

Definitions

  • the present application relates to the field of communications, and in particular, to a blockchain-based data processing method, apparatus, and system.
  • the blockchain network is a network that implements information storage and transmission based on blockchain technology. With the further expansion of the blockchain application industry, the data generated by the devices will explode. Since the current blockchain network maintains the information of the entire book, the explosive growth of data will cause the blockchain network to have a large load, and the blockchain transmission in the blockchain network will consume huge bandwidth.
  • the present application provides a blockchain-based data processing method, device and system, which can reduce the bandwidth required for the transmission of the blockchain network and the transmission of the blockchain.
  • a data processing method based on a blockchain including: determining, by a first device, a to-be-deleted block in a blockchain network, where the first device is a device in the blockchain network; The first device performs a delete related operation to delete the to-be-deleted block.
  • the deletion-related operation is performed to implement deletion of the to-be-deleted block. Therefore, it is possible to reduce the bandwidth required for the load in the blockchain network and the transmission of the blockchain.
  • the first device may determine the to-be-deleted block in the blockchain network before generating the block. Or the first device may determine the to-be-deleted block in the blockchain network before broadcasting the newly generated blockchain.
  • the determining, by the first device, the to-be-deleted block in the blockchain network includes: determining, by the first device, a region in the blockchain network The storage duration or elapsed time of the block; the first device determines the to-be-deleted block according to the storage duration or the elapsed time.
  • the determining, by the first device, the to-be-deleted block according to the storage duration, the first device determining the current a time interval between a time instant and a generation time of the i-th first block in the consecutive K first blocks is greater than or equal to a storage duration of the i-th first block, where the i-th block
  • the storage duration is used to indicate that the data included in the i-th first block or the i-th first block needs to be stored in the blockchain network, and K is greater than or equal to 1.
  • An integer, i 1, . . . K; the first device determines the K first blocks as blocks to be deleted.
  • each block in the blockchain network carries a storage duration of the block.
  • the determining, by the first device, the to-be-deleted block according to the elapsed time The time is the elapsed time of the i-th first block in the consecutive K first blocks, or the elapsed time of the i-th first block in the K first blocks later than the current time, the first The elapsed time of the i first blocks is used to indicate that the data included in the first block or the first block needs to be deleted in the blockchain network, and K is greater than or equal to 1.
  • a positive integer, i 1, . . . K; the first device determines the K first blocks as blocks to be deleted.
  • each block in the blockchain network carries the deletion time of the block.
  • the device in the blockchain network can delete the to-be-deleted block at a specific time indicated by the deletion time, or delete the to-be-deleted block after the specific time.
  • the performing, by the first device, the deleting the related operation includes: deleting, by the first device, the K first blocks; or The first device sets an initial value of the number of deletion authentication times of the K first blocks, and sends the first block information and the deletion of the K first blocks to devices in the blockchain network.
  • the number of times of authentication, the first block information is used to indicate the K first blocks, so that the device in the blockchain network determines that the number of deletion authentications of the K first blocks is the first When the preset value is used, the K first blocks are deleted.
  • the first device determines, at the current time, a generation time of the i th first block in the consecutive K first blocks Before the time interval is greater than or equal to the storage duration of the ith first block, the method further includes: determining, by the first device, that the generated time and the current time exist in the K first blocks The first block whose time interval is smaller than the storage duration of the block; the first device deletes the data included in the first block where the time interval between the generation time and the current time is less than the storage duration of the block.
  • the determining, by the first device, the to-be-deleted block in the blockchain network includes: the first device determining the blockchain Carrying the first block information and deleting the number of authentication times, the first block information is used to indicate consecutive K first blocks, and the number of deletion authentications is used to indicate that the K first blocks are in the area
  • the number of deletion authentications in the blockchain network K is a positive integer greater than or equal to 1; the first device determines the K first blocks as blocks to be deleted.
  • the value of the deletion authentication number is a first preset value
  • the performing, by the first device, the deletion related operation includes: deleting, by the first device, the K first blocks.
  • the value of the deletion authentication number is smaller than a first preset value
  • the first device performs the deletion related operation, and the first device sends the first block to the device in the blockchain network after adding the value of the deletion authentication number to one. And deleting the number of authentications, so that the device in the blockchain network determines that the number of deletion authentications of the K first blocks is the first When the preset value is used, the K first blocks are deleted.
  • the first device deletes the L second blocks; or
  • the first device sets an initial value of the number of deletion authentication times of the L second blocks, and sends the second block information and the deletion of the L second blocks to the devices in the blockchain network. a number of times of authentication, the second block information is used to indicate the L second blocks, so that the device in the blockchain network confirms that the number of deletion authentications of the L second blocks is the When the first preset value is used, the L second blocks are deleted.
  • K and L are fixed values that are configured in advance, or K and L are dynamically configured values.
  • the method further includes: the first device generates a third block, and the third block carries the third The storage duration of the block, the storage duration of the third block is used to indicate the length of time that the data included in the third block or the third block needs to be stored in the blockchain network.
  • the device in the blockchain network can quickly determine whether the third block is the to-be-deleted block according to the storage duration in the third block. Thereby, the implementation of the devices in the blockchain network can be realized.
  • the block header of the third block includes a storage duration of the third block.
  • the third block includes data sent by the second device
  • the method further includes: the first device receiving data sent by the second device and a first storage duration of the data, where the second device is a device in the blockchain network, where the first storage duration is used to indicate a length of time that the data determined by the second device needs to be stored in the blockchain network;
  • the first storage duration determines the storage duration of the third block.
  • the first storage duration is determined by the second device by negotiating with a third device, where the third device is The device in the blockchain network.
  • the first storage duration may be determined by the second device according to the pre-registration mode.
  • the first storage duration is determined by the second device according to a second storage duration
  • the second storage duration is The data determined by the four devices is required to be stored in the blockchain network
  • the fourth device is a device outside the blockchain network.
  • the fourth device is a device outside the blockchain network, and the second device sends the data of the fourth device to the blockchain network as a proxy device of the fourth device.
  • the fourth device does not need to participate in the blockchain network, reducing the performance requirements for the fourth device.
  • the second storage duration is determined by the fourth device by negotiating with a fifth device, where the fifth device is Outside the blockchain network device of.
  • the method further includes: determining, by the first device, a blockchain to which the third block belongs; The third block is added to the blockchain.
  • the blockchain network of the embodiment of the present application there are multiple different types of blockchains, and devices in the blockchain network maintain a plurality of different types of blockchains. It can further reduce the storage requirements of the blockchain network.
  • the determining, by the first device, the blockchain to which the third block belongs, The storage duration of the three blocks and the preset correspondence relationship determine the blockchain to which the third block belongs, and the preset correspondence relationship is the correspondence between the storage duration of the block and the blockchain.
  • the blockchain in another implementation manner of the first aspect, carries an identifier of the blockchain.
  • the method further includes: the first device generates a fourth block; the block header of the fourth block includes a The third block information and the deletion time information, wherein the third block information is used to indicate the deleted block, the deletion time information is used to indicate the deletion time of the deleted block, or the deletion time information is used. Indicates the deletion time of the data included in the deleted block.
  • the block generated by the device in the blockchain network includes the block information and the deletion time information, which can ensure that the device in the blockchain network can easily learn the deleted block and has been deleted. The time at which blocks or the data in these blocks are deleted.
  • the method further includes: the first device to a storage device in the blockchain network or the blockchain network
  • the storage device other than the one transmits the deleted block or the data included in the deleted block.
  • the device in the blockchain network sends the deleted block or the data included in the deleted block to the storage device, so that the data in the block or the blocks can be in the storage device. Save for a while. Thereby, it is possible to facilitate data search and recovery by devices in the blockchain network.
  • the method further includes: the first device to a storage device in the blockchain network or the blockchain network
  • the storage device other than the third storage duration is the storage device in the blockchain network in which the deleted data or the included data in the deleted block needs to be stored. Or the length of time stored in a storage device outside the blockchain network.
  • a second aspect provides a blockchain-based data processing method, including: acquiring, by a second device, the second device is a device in a blockchain network; and the second device determining the data a storage duration, the first storage duration of the data is used to indicate a length of time that the data determined by the second device needs to be stored in the blockchain network; and the second device is to the blockchain
  • the device in the network sends the data and the first storage duration, the first storage duration is used to determine a storage duration of a third block that includes the data, and a storage duration of the third block is used to indicate The length of time in which the data included in the third block or the third block is stored in the blockchain network.
  • the third block is generated by the device that obtains the authentication right in the blockchain network, and the device that obtains the authentication right here may be the second device.
  • the second device in the blockchain network determines the acquisition After the storage time of the obtained data is long, the acquired data and the storage duration of the determined data are sent to the devices in the blockchain network, so that the devices in the blockchain network can determine the inclusion time according to the storage duration determined by the second device.
  • the storage duration of the block of data Therefore, the device in the blockchain network can perform the delete related operation when the block is to be deleted according to the storage duration of the block containing the data, and delete the block to be deleted. Thereby, it is possible to reduce the bandwidth required for the load in the blockchain network and the transmission of the blockchain.
  • the determining, by the second device, the first storage duration of the data includes: the second device negotiates with the third device, and determines the first For the storage duration, the third device is a device in the blockchain network.
  • the acquiring, by the second device, the data includes: the second device receiving the data sent by the fourth device, and the second storage duration
  • the second storage duration is a duration that the data determined by the fourth device needs to be stored in the blockchain network, and the fourth device is a device outside the blockchain network;
  • the determining, by the second device, the first storage duration of the data includes: determining, by the second device, the first storage duration according to the second storage duration.
  • the second storage duration is determined by the fourth device by negotiating with a fifth device, where the fifth device is A device outside the blockchain network.
  • an apparatus for performing the method of any of the above first aspect or any of the possible implementations of the first aspect.
  • the device comprises a functional module for performing the method of the first aspect or any of the possible implementations of the first aspect described above
  • 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 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.
  • a system comprising the apparatus of the third aspect and the apparatus of the fourth aspect, or the apparatus of the fifth aspect and the apparatus of the sixth aspect.
  • a computer readable medium providing a computer readable medium for storing a computer program, the computer program comprising any of the possible implementations of the first aspect or the first aspect described above The instruction in .
  • a ninth aspect a computer readable medium providing a computer readable medium for storing a computer program, the computer program comprising any possible implementation for performing the second aspect or the second aspect described above The instruction in .
  • FIG. 1 is a schematic flowchart of a blockchain-based data processing method according to an embodiment of the present application
  • FIG. 2 is a schematic diagram of a blockchain in accordance with an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a blockchain according to another 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 block diagram of an apparatus according to an embodiment of the present application.
  • FIG. 7 is a schematic block diagram of an apparatus according to another embodiment of the present application.
  • FIG. 8 is a schematic block diagram of an apparatus according to still another embodiment of the present application.
  • FIG. 9 is a schematic block diagram of an apparatus in accordance with still another embodiment of the present application.
  • the device in the blockchain network may be a private device, an operator network device (for example, a base station device), or a station deployed by a certain industry organization, a group, and an individual.
  • an operator network device for example, a base station device
  • 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.
  • 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 is used as a transaction.
  • the data is described as an example, but this does not limit the scope of the embodiments of the present application.
  • the block The chain network has the characteristics of decentralization.
  • the data exchange between each device 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 the time range, the device can not and can not deceive other devices, therefore, the blockchain network has the feature of trust.
  • the total data block of the blockchain network is maintained by all maintenance-capable devices in the entire system, and any of these devices with maintenance functions can participate. Therefore, the blockchain network has the characteristics of collective maintenance.
  • the blockchain network allows each participating device to obtain a copy of the complete database in the form of a sub-database. Unless you can control more than 51% of the devices in the entire network at the same time, the modification of the database on a single device is invalid, and it cannot affect the data content on other devices. Therefore, the blockchain network has a reliable database.
  • 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; and a transaction counter field, generally 1-9 bytes. Record the number of transactions; the transaction field, usually variable length, records 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 (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. Encrypting each block header (for example, Secure Hash Algorithm (SHA)) generates 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 block device calculates a string of 64-bit random numbers and letters according to the obtained input data, but only the device that obtains the hash value satisfying the hash value can be accepted as the workload by the blockchain network.
  • 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.
  • method 100 includes:
  • the first device determines a to-be-deleted block in the blockchain network, where the first device is a device in the blockchain network.
  • the first device performs a delete related operation to delete a to-be-deleted block.
  • the first device may determine the to-be-deleted block in the blockchain network according to the storage duration of the block or the elapsed time of the block.
  • the storage duration of the block is used to indicate the length of time in the block or block that the data needs to be stored in the blockchain network.
  • the elapsed time of the block is used to indicate that the data included in the block or block needs to be in the blockchain.
  • the device in the blockchain network may delete the data in the block or the block at the specific moment indicated by the elapsed time, or may delete the data in the block or the block after the specific time indicated by the elapsed time.
  • the first device determines the to-be-deleted block according to the relationship between the current time and the time interval between the generation time of the block and the storage duration of the block. Or the first device determines the to-be-deleted block according to the relationship between the current time and the elapsed time.
  • the first device determines the block in the blockchain network from the lowest block in the current blockchain or the block with the smallest sequence number (specifically, at initialization, from the first block of the blockchain) The block to be deleted.
  • the first device starts from block X, and when the first device determines that the time interval between the current time and the time recorded by the timestamp of the block X is greater than or equal to the storage duration of the block X, Or when the first device determines that the current time is the elapsed time of the block X, or when the first device determines that the current time is later than the elapsed time of the block X, the first device considers the block X as the to-be-deleted block, the first device The block X can be directly deleted, and then the first device determines whether the block X+1 is the block to be deleted, and so on, until a certain block is not the block to be deleted.
  • the current time (or current time) here may be the time when the first device generates a new block or the time when the current block chain node broadcasts a new block chain, and the time recorded by the time stamp of the block X is included as the block X.
  • the first device determines that the block X is the to-be-deleted block, the first device does not delete the block X, but records the block information of the block X and the number of deletion authentications (initial value 1) in the block.
  • the blockchain is broadcasted to the blockchain network.
  • the device that obtains the authentication right next time increases the value of the number of deleted authentication times by one, until the device that obtains the authentication right for the Nth time, the block X is in the zone.
  • the number of deletion authentications in the blockchain network has reached the preset value N, so the device that obtains the authentication right for the Nth time deletes the block X from the blockchain.
  • the device that obtains the authentication right for the Nth time determines whether the block X+1 is the to-be-deleted block, and if the block X+1 is the to-be-deleted block, the device that obtains the authentication right for the Nth time can block the block.
  • the X+1 block information and the number of deletion authentications (initial value 1) are added to the blockchain, and the blockchain is broadcasted to the blockchain network until block X+1 is in the blockchain network.
  • the device in the blockchain network deletes the block X+1, and the value of N is a preset value.
  • the first device determines whether the consecutive K blocks starting from the block X satisfy the deletion condition, and if the consecutive K blocks satisfy the deletion condition, the first device sets the K areas.
  • the block is determined to be the block to be deleted.
  • the first device may directly delete consecutive K blocks starting from the block X, after which the first device determines whether the consecutive L consecutive blocks starting from the block X+K satisfy the deletion condition, and if so, the first device deletes the A continuous L block starting from block X+K. And so on, until a plurality of consecutive blocks do not completely satisfy the deletion condition position, where the values of K and L may be the same or different. And the values of K and L can be dynamically configured values.
  • the first device determines that the consecutive K blocks starting from the block X satisfy the block to be deleted, the first device does not delete the consecutive K blocks starting from the block X, but the slave block.
  • the block information and the number of deletion authentications (initial value 1) of consecutive K blocks starting from X are recorded in the blockchain, and the blockchain is broadcasted to the blockchain network, and the device that obtains the authentication right next time will The value of deleting the number of authentication times is increased by 1.
  • the device that obtains the authentication right is acquired for the Nth time, the number of deletion authentications of the K blocks starting from block X in the blockchain network has reached the preset value N, so the first The device that acquires the authentication right N times deletes the K blocks starting from block X from the blockchain.
  • the device that obtains the authentication right for the Nth time determines whether the L consecutive blocks starting from the block X+K satisfy the deletion condition, and if the L consecutive blocks starting from the block X+K are the to-be-deleted area.
  • the device that obtains the authentication right for the Nth time may add the block information and the number of deletion authentication times (initial value 1) of the L consecutive blocks starting from the block X+K to the blockchain, and add the zone
  • the blockchain is broadcasted into the blockchain network until the number of deletion authentications of the consecutive L blocks starting from block X+K in the blockchain network is N, and the device in the blockchain network will be from block X. L consecutive blocks starting with +K delete.
  • the first device determines that one or more consecutive K blocks starting from X do not satisfy the deletion condition.
  • the first device can delete the data in the blocks satisfying the deletion condition among the consecutive K blocks at this time, but retain the block headers of the blocks. Wait until the device in the blockchain network determines that consecutive K blocks starting from X satisfy the deletion condition, and delete the consecutive K blocks. Or, recording the block information and the number of deletion authentications of the consecutive K blocks into the blockchain, and broadcasting the blockchain to the blockchain network until a device in the blockchain network determines the continuous When the number of deletion authentications of the K blocks is N, the consecutive K blocks are deleted.
  • deletion condition refers to that the time interval between the current time and the generation time of the block is greater than or equal to the storage duration of the block, or the above deletion condition refers to the current time being the elapsed time of the block. , or the above deletion condition refers to the elapsed time of the current time later than the block.
  • the block information and the number of deletion authentications are recorded in the blockchain of the blockchain.
  • the first device may determine, according to whether the block information is carried in the blockchain, and the number of times of deleting the authentication, determining the to-be-deleted block.
  • the first device determines the block indicated by the block information as the block to be deleted.
  • the first device determines that the value of the number of deletion authentications is less than a preset value, the first device increases the value of the number of deletions by one, and then sends the foregoing block information and the number of authentication deletions to the device in the blockchain network. Until the number of deletion authentications recorded in the blockchain is a preset value, the device in the blockchain network deletes the block indicated by the block information.
  • the first device may directly delete the block indicated by the block information.
  • FIG. 4 shows a blockchain-based data processing method according to another embodiment of the present invention.
  • the blockchain device A-blockchain device D in Figure 4 is a device in a blockchain network.
  • method 200 includes:
  • the blockchain device A generates data that needs to be authenticated in the blockchain network
  • the data generated by the blockchain device A that needs to be authenticated in the blockchain network is transaction data between the blockchain device A and the blockchain device B.
  • the blockchain device A can negotiate with the blockchain device B to agree on the storage duration or elapsed time of the transaction data, and determine the storage duration or elapsed time of the transaction data in the blockchain network.
  • the blockchain device A can independently determine the storage duration or elapsed time of the data in the blockchain network. For example, the blockchain device A determines the storage duration or elapsed time of data in the blockchain network according to the pre-registration mode.
  • the blockchain device A broadcasts the data to the blockchain network
  • the blockchain device D determines a storage duration of the block to be generated.
  • the blockchain device D acquires the block verification right, and the blockchain device D determines the storage duration of the currently generated new block according to the storage duration of all new data when the new block is currently generated.
  • the storage duration of the block refers to the length of time that the block needs to be stored in the blockchain network or the length of time in which the data in the block needs to be stored in the blockchain network.
  • the blockchain device D determines that the storage durations of all the new data described above are the same, the blockchain device D determines the storage duration of all new data as the storage duration of the tile to be generated. If the storage duration of all the above new data is different, the blockchain device D determines the storage duration corresponding to the data having the longest storage duration as the storage duration of the tile to be generated.
  • the blockchain device D determines that it is to be generated.
  • the storage time of the block is 1 hour.
  • the blockchain device D determines 3 hours as the storage duration of the tile to be generated.
  • the blockchain device D acquires the block verification right, and the blockchain device D determines the elapsed time of the currently generated new block based on the elapsed time of all new data when the new block is currently generated. It should be noted here that the elapsed time of the block refers to the time when the block needs to be deleted in the blockchain network or the time in which the data in the block needs to be deleted in the blockchain network.
  • the blockchain device D determines that the elapsed time of all of the above new data is the same, the blockchain device D determines the elapsed time of all new data as the elapsed time of the block to be generated. If the elapsed time of all the above new data is different, the block chain device D determines the elapsed time corresponding to the latest data of the elapsed time as the elapsed time of the block to be generated.
  • the blockchain device D determines that The elapsed time of the generated block is 20:00. However, if the elapsed time of the five data is not completely the same, and the elapsed time of the data 5 is the latest and the elapsed time is 12 o'clock in the morning, the block chain device D determines the 12 o'clock in the morning as the elapsed time of the block to be generated.
  • the blockchain device D connects the generated block to the blockchain, and then broadcasts the blockchain to the blockchain network;
  • the blockchain device C determines the to-be-deleted block in the blockchain network, and performs a deletion-related operation
  • the blockchain device C may determine the to-be-deleted block in the blockchain network by using the method described in the method 100, and perform deletion related. operating.
  • the blockchain device C broadcasts the generated blockchain in the blockchain network.
  • the related method in the method 100 may also be performed to implement the to-be-deleted region. The deletion of the block.
  • the blockchain generated by the blockchain device C may be a block that deletes the to-be-deleted block and increases the block generated by the blockchain device C on the basis of the received blockchain.
  • the chain may also record the block information of the block to be deleted and the number of deletion authentications in the received blockchain, and on the basis of this, add the blockchain obtained by the block generated by the blockchain device C.
  • the block information and the deletion time information may be carried in the block in the block, for example, carrying the block information and deleting in the block header of the block.
  • Time information The block information is used to indicate the deleted block, the deletion time information is used to indicate the deletion time of the deleted block, or the deletion time information is used to indicate the deletion time of the data included in the deleted block.
  • the blockchain device C may send the deleted block or the data included in the deleted block to one or more storage devices, and after a certain time, the storage device deletes the data.
  • the one or more storage devices described above may be storage devices in a blockchain network, or may be storage devices outside the blockchain network.
  • the storage duration of the data in the storage device may be determined by the blockchain device C and the storage duration of the data is transmitted to the storage device while the data is being transmitted to the storage device.
  • a plurality of different types of blockchains exist in the blockchain network, and when the block device generates the block, determine the blockchain corresponding to the block, and connect the generated block to the determined block.
  • the blockchain corresponds to different storage durations, and the blockchain device C determines the blockchain corresponding to the block according to the storage duration of the block when generating the block.
  • the blockchain is stored in three blockchains, namely blockchain 1, blockchain 2, and blockchain 3.
  • the storage duration of the block in the blockchain 1 is less than or equal to 1 hour
  • the storage duration of the block in the blockchain 2 is greater than 1 hour and less than 3 hours
  • the storage duration of the block in the blockchain 3 is greater than or equal to 3 hours.
  • the blockchain device C determines that the generated block has a storage duration of 2 hours
  • the blockchain device C connects the generated block to the blockchain 2.
  • the method for determining the storage duration of the block by the blockchain device C is the same as the method for determining the storage duration of the block by the blockchain D, and details are not described herein again.
  • the blockchain is stored in three blockchains, namely, blockchain 1, blockchain 2, and blockchain 3.
  • the elapsed time of the block in blockchain 1 is before 12 o'clock in the morning
  • the elapsed time of the block in blockchain 2 is after 12 o'clock in the morning and before 8 o'clock in the evening
  • the elapsed time of the block in blockchain 3 is After 8 pm and before 24 pm.
  • the block chain device C determines that the elapsed time of the generated block is 5 pm
  • the block chain device C connects the generated block to the block chain 2.
  • the method for determining the elapsed time of the block by the block chain device C is the same as the method for determining the elapsed time of the block by the block chain D, and details are not described herein again.
  • method 300 includes:
  • the Internet of Things device A generates data that needs to be authenticated in the blockchain network
  • the Internet of Things device A is not a device in the blockchain network, or the IoT device A itself does not directly participate in the blockchain.
  • the data generated by the Internet of Things device A that needs to be authenticated in the blockchain network is transaction data between the Internet of Things device A and the Internet of Things device B.
  • the Internet of Things device A can negotiate with the IoT device B to agree on the storage duration or elapsed time of the transaction data, and determine the storage duration or elapsed time of the transaction data in the blockchain network.
  • the Internet of Things device A may be a smart washing machine, and the smart washing machine may automatically purchase laundry detergent from the smart vending machine, and the data generated during the transaction is transaction data.
  • the smart washing machine can negotiate with the smart vending machine for the storage duration or elapsed time of the transaction data.
  • the data generated by the Internet of Things device A that needs to be authenticated in the blockchain network only relates to the behavior of the IoT device A itself.
  • the Internet of Things device A is an air purifier for detecting PM2.5 at home.
  • the Internet of Things device A can determine the storage duration or elapsed time of the data in the blockchain network.
  • the IoT device A determines the storage duration or elapsed time of data in the blockchain network according to the pre-registration mode.
  • the Internet of Things device A sends the data that needs to be authenticated in the blockchain network to the blockchain device A;
  • the IoT device A transmits the data and the determined storage duration or elapsed duration of the data to the blockchain device A.
  • the IoT device A establishes a communication connection between the IoT device A and the blockchain device A before transmitting the data to the blockchain device A.
  • the IoT device A may send an access message to the blockchain device A after receiving the public key information sent by the blockchain device A, and the blockchain device A receives the access message sent by the IoT device A. , to determine whether it is possible to establish a communication connection with the Internet of Things device A. If possible, the blockchain device A sends feedback information to the IoT device A, and a communication connection is established between the IoT device A and the blockchain device A.
  • the IoT device A determines the self when it sends the data to the blockchain device A. Or the storage duration or elapsed time stored in the storage device by the data negotiated with the Internet of Things device B is also sent to the blockchain device A together, so that the blockchain device A sends the data to the storage device. The storage duration or elapsed time is sent to the storage device together.
  • the device 10 includes:
  • the processing module 11 is configured to determine a to-be-deleted block in the blockchain network, where the device is a device in the blockchain network;
  • the deletion operation execution module 12 is configured to perform a deletion related operation to delete the to-be-deleted block.
  • the deleting related operation is performed after determining the to-be-deleted block in the blockchain network according to the device according to the embodiment of the present application, and deleting the to-be-deleted block is implemented. Thereby, it is possible to reduce the bandwidth required for the load in the blockchain network and the transmission of the blockchain.
  • processing module 11 is specifically configured to:
  • the to-be-deleted block is determined according to the storage duration or the elapsed time shown.
  • the processing module 11 is specifically configured to: determine that a time interval between a current time and a generation time of the i th first block in the consecutive K first blocks is greater than or And a storage duration of the i-th first block, where the storage duration of the i-th block is used to indicate data included in the i-th first block or the i-th first block
  • the processing module 11 is specifically configured to: determine that the current time is the elapsed time of the i th first block in the consecutive K first blocks, or the current time is later than An elapsed time of the i th first block in the K first blocks, where an elapsed time of the i th first block is used to indicate that the first block or the first block is included
  • the deletion operation execution module 12 is specifically configured to: delete the K first blocks; or set an initial value of the deletion authentication times of the K first blocks. Transmitting, to the device in the blockchain network, the first block information and the number of deletion authentications of the K first blocks, where the first block information is used to indicate the K first blocks.
  • the device in the blockchain network is configured to delete the K first blocks when determining that the number of deletion authentications of the K first blocks is a first preset value.
  • the processing module 11 determines that a time interval between a current time and a generation time of the i th first block in the consecutive K first blocks is greater than or equal to the The processing module 11 is further configured to: determine, in the K first blocks, that the time interval between the generated time and the current time is less than the storage time of the block in the first block of the ith first block Piece;
  • the deletion operation execution module 12 is further configured to delete data included in the first block where the time interval between the generation time and the current time is less than the storage duration of the block.
  • determining that the current time is an elapsed time of the i th first block in the consecutive K first blocks, or the current time is later than the K first blocks The processing module 11 is further configured to: determine that the first region of the K first blocks has an elapsed time earlier than the current time, before the elapsed time of the i-th first block.
  • the processing module 11 is specifically configured to: determine that the first block information is carried in the blockchain, and delete the number of authentication times, where the first block information is used to indicate consecutive K
  • the first block the number of deletion authentications is used to indicate the number of deletion authentications of the K first blocks in the blockchain network, and K is a positive integer greater than or equal to 1;
  • a block is determined as the block to be deleted.
  • the value of the deletion authentication number is a first preset value
  • the deleting operation execution module 12 is specifically configured to: delete the K first blocks.
  • the value of the deletion authentication number is smaller than the first preset value
  • the deleting operation execution module 12 is specifically configured to: after the value of the deletion authentication number is increased by 1, send the first block information and the deletion authentication to a device in the blockchain network. The number of times, so that the devices in the blockchain network delete the K first blocks when determining that the number of deletion authentications of the K first blocks is the first preset value.
  • the processing module 11 is further configured to: determine the current time and the consecutive L second blocks.
  • the time interval between the generation moments of the jth second block is greater than or equal to the storage duration of the jth second block, and the L second blocks are generated later than the K first blocks
  • the deletion operation execution module 12 is further configured to delete the L second blocks; or set an initial value of the deletion authentication times of the L second blocks, and to the blockchain network
  • the device sends the second block information and the number of deletion authentications of the L second blocks, where the second block information is used to indicate the L second blocks, so as to be in the blockchain network.
  • the device confirms that the number of deletion authentications of the L second blocks is the first preset value, the device deletes the L second blocks.
  • the processing module 11 is further configured to: generate a third block, where the third block carries a storage duration of the third block, and the third block The storage duration is used to indicate the length of time that the data included in the third block or the third block needs to be stored in the blockchain network.
  • the block header of the third block includes a storage duration of the third block.
  • the third block includes data sent by the second device
  • the processing module 11 is further configured to: receive data sent by the second device and a first storage duration of the data, where the second device is the blockchain network, before the generating the third block
  • the first storage duration is used to indicate a length of time that the data determined by the second device needs to be stored in the blockchain network; and the third is determined according to the first storage duration The storage duration of the block.
  • the first storage duration is determined by the second device by negotiating with a third device, where the third device is a device in the blockchain network.
  • the first storage duration is determined by the second device according to a second storage duration, where the second storage duration is determined by the fourth device.
  • the second storage duration is determined by the fourth device by negotiating with the fifth device, where the fifth device is a device other than the blockchain network. .
  • the processing module 11 is further configured to: determine a blockchain to which the third block belongs; and add the third block to the blockchain.
  • the processing module 11 is specifically configured to: determine, according to the storage duration and the preset correspondence relationship of the third block, a blockchain to which the third block belongs.
  • the preset correspondence relationship is the correspondence between the storage duration of the block and the blockchain.
  • the identifier of the blockchain is carried in the blockchain.
  • the processing module 11 is further configured to: generate a fourth block, where the block header of the fourth block includes third block information and deletion time information, where The third block information is used to indicate the deleted block, the deletion time information is used to indicate the deletion time of the deleted block, or the deletion time information is used to indicate the deletion of the data included in the deleted block. time.
  • the processing module 11 is further configured to: send the deleted block to a storage device in the blockchain network or a storage device outside the blockchain network or The data included in the deleted block.
  • the processing module 11 is further configured to: send a third storage duration to a storage device in the blockchain network or a storage device outside the blockchain network, where The third storage duration is that the deleted block or the included data in the deleted block requires a storage device in the blockchain network or a storage device outside the blockchain network. The length of time that is stored.
  • the device 10 in the embodiment of the present invention is embodied in the form of a functional unit.
  • the device 10 may be used to perform various processes and/or steps in the foregoing method embodiments. To avoid repetition, details are not described herein.
  • FIG. 7 shows a schematic block diagram of a device in accordance with another embodiment of the present application.
  • device 20 includes:
  • the processing module 21 is configured to acquire data, where the device is a device in a blockchain network;
  • the processing module 21 is further configured to determine a first storage duration of the data, where a first storage duration of the data is used to indicate that the data determined by the device needs to be stored in the blockchain network. duration;
  • the transceiver module 23 is configured to send the data and the first storage duration to a device in the blockchain network, where the first storage duration is used to determine a storage duration of a third block that includes the data, The storage duration of the third block is used to indicate a length of time in which the data included in the third block or the third block needs to be stored in the blockchain network.
  • the device according to the embodiment of the present application determines the storage duration of the acquired data
  • the acquired data and the storage duration of the determined data are sent to the device in the blockchain network, so that the device in the blockchain network can
  • the storage duration of the block containing the data is determined according to the storage duration determined by the device. Therefore, the device in the blockchain network can perform the delete related operation when the block is to be deleted according to the storage duration of the block containing the data, and delete the block to be deleted. Thereby, it is possible to reduce the bandwidth required for the load in the blockchain network and the transmission of the blockchain.
  • the processing module 21 is specifically configured to: negotiate with a third device to determine the first storage duration, and the third device is a device in the blockchain network. .
  • the processing module 21 is specifically configured to: receive the data sent by the fourth device, and the second storage duration, where the second storage duration is the data determined by the fourth device.
  • the second storage duration is determined by the fourth device by negotiating with the fifth device, where the fifth device is a device other than the blockchain network. .
  • the device 20 in the embodiment of the present invention is embodied in the form of a functional unit.
  • the device 20 may be used to perform various processes and/or steps in the foregoing method embodiments. To avoid repetition, details are not described herein.
  • FIG. 8 shows an apparatus in accordance with still 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 determine a to-be-deleted block in the blockchain network, where the device is a device in the blockchain network, and the processor 110 is further configured to perform a delete related operation to delete the The block to be deleted.
  • the deleting related operation is performed after determining the to-be-deleted block in the blockchain network according to the device according to the embodiment of the present application, and deleting the to-be-deleted block is implemented. Thereby, it is possible to reduce the bandwidth required for the load in the blockchain network and the transmission of the blockchain.
  • 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. 9 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 is connected to the transceiver 220, 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 acquire data, where the device is a device in a blockchain network, and the transceiver 220 is further configured to determine a first storage duration of the data, where the data is first.
  • the storage duration is used to indicate the length of time that the data determined by the device needs to be stored in the blockchain network; the transceiver 220 is configured to send the data and the device in the blockchain network
  • the first storage duration, the first storage duration is used to determine a storage duration of a third block that includes the data, and a storage duration of the third block is used to indicate the third block or the The data included in the third block needs to be stored in the blockchain network for the length of time.
  • the device according to the embodiment of the present application determines the storage duration of the acquired data
  • the acquired data and the storage duration of the determined data are sent to the device in the blockchain network, so that the device in the blockchain network can
  • the storage duration of the block containing the data is determined according to the storage duration determined by the device. Therefore, the device in the blockchain network can perform the delete related operation when the block is to be deleted according to the storage duration of the block containing the data, and delete the block to be deleted. Thereby, it is possible to reduce the bandwidth required for the load in the blockchain network and the transmission of the blockchain.
  • 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.
  • the processor in the embodiment of the present application may be an integrated circuit chip with signal processing capability.
  • the above processor may be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), or an off-the-shelf programmable gate array (Field).
  • DSP digital signal processor
  • ASIC application specific integrated circuit
  • FPGA Programmable Gate Array
  • 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 SDRAM
  • DDR SDRAM Double Data Rate SDRAM
  • ESDRAM Enhanced Synchronous Dynamic Random Access Memory
  • SLDRAM Synchronous Connection Dynamic Random Access Memory
  • DR RAM direct memory bus random access memory
  • 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.
  • the technical solution of the present application which is essential or contributes to the prior art, or a part of the technical solution, may be embodied in the form of a software product, which is stored in a storage medium, including
  • the instructions are used 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), and a A device that can store program code, such as a random access memory (RAM), a disk, or an optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Computer And Data Communications (AREA)

Abstract

Provided are a blockchain-based data processing method, device and system, the method comprising: a first device determines a block to be deleted in a blockchain network, the first device being a device in the blockchain network; the first device executes a deletion related operation, so as to delete the block to be deleted. The first device in the blockchain network executes the deletion related operation after determining the block to be deleted in the blockchain network, thereby deleting the block to be deleted. The present invention reduces the load in the blockchain network and the bandwidth required for blockchain transmission.

Description

基于区块链的数据处理方法、设备和系统Data processing method, device and system based on blockchain
本申请要求于2017年01月03日提交中国专利局、申请号为201710002175.X、申请名称为“基于区块链的数据处理方法、设备和系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on January 3, 2017, the Chinese Patent Office, the application number is 201710002175.X, and the application name is "block-based data processing method, equipment and system". This is incorporated herein by reference.
技术领域Technical field
本申请涉及通信领域,尤其涉及基于区块链的数据处理方法、设备和系统。The present application relates to the field of communications, and in particular, to a blockchain-based data processing method, apparatus, and system.
背景技术Background technique
区块链网络是基于区块链技术实现信息存储与传输的网络,随着区块链应用行业的进一步扩大,设备产生的数据将会爆发性增长。而由于目前区块链网络维护整个账本的信息,数据的爆发性增长将会导致区块链网络具有很大的负载,并且区块链网络中区块链的传输也将会消耗巨大的带宽。The blockchain network is a network that implements information storage and transmission based on blockchain technology. With the further expansion of the blockchain application industry, the data generated by the devices will explode. Since the current blockchain network maintains the information of the entire book, the explosive growth of data will cause the blockchain network to have a large load, and the blockchain transmission in the blockchain network will consume huge bandwidth.
发明内容Summary of the invention
本申请提供了一种基于区块链的数据处理方法、设备和系统,能够降低区块链网络中的负载和区块链的传输所需的带宽。The present application provides a blockchain-based data processing method, device and system, which can reduce the bandwidth required for the transmission of the blockchain network and the transmission of the blockchain.
第一方面,提供了一种基于区块链的数据处理方法,包括:第一设备确定区块链网络中的待删除区块,所述第一设备为所述区块链网络中的设备;所述第一设备执行删除相关操作,以删除所述待删除区块。In a first aspect, a data processing method based on a blockchain is provided, including: determining, by a first device, a to-be-deleted block in a blockchain network, where the first device is a device in the blockchain network; The first device performs a delete related operation to delete the to-be-deleted block.
根据本申请实施例的基于区块链的数据处理方法,区块链网络中的第一设备确定区块链网络中的待删除区块之后执行删除相关操作,实现待删除区块的删除。由此,能够降低区块链网络中的负载和区块链的传输所需的带宽。According to the blockchain-based data processing method of the embodiment of the present application, after the first device in the blockchain network determines the to-be-deleted block in the blockchain network, the deletion-related operation is performed to implement deletion of the to-be-deleted block. Thereby, it is possible to reduce the bandwidth required for the load in the blockchain network and the transmission of the blockchain.
可选地,第一设备可以在产生区块之前,确定区块链网络中的待删除区块。或者第一设备可以在广播新产生的区块链之前,确定区块链网络中的待删除区块。Optionally, the first device may determine the to-be-deleted block in the blockchain network before generating the block. Or the first device may determine the to-be-deleted block in the blockchain network before broadcasting the newly generated blockchain.
结合第一方面,在第一方面的一种实现方式中,所述第一设备确定区块链网络中的待删除区块,包括:所述第一设备确定所述区块链网络中的区块的存储时长或消逝时间;所述第一设备根据所述存储时长或所述消逝时间,确定所述待删除区块。With reference to the first aspect, in an implementation manner of the first aspect, the determining, by the first device, the to-be-deleted block in the blockchain network includes: determining, by the first device, a region in the blockchain network The storage duration or elapsed time of the block; the first device determines the to-be-deleted block according to the storage duration or the elapsed time.
结合第一方面及其上述实现方式,在第一方面的另一种实现方式中,所述第一设备根据所述存储时长,确定所述待删除区块,包括:所述第一设备确定当前时刻与连续K个第一区块中的第i个第一区块的生成时刻之间的时间间隔大于或等于所述第i个第一区块的存储时长,所述第i个区块的存储时长用于指示所述第i个第一区块或所述第i个第一区块中包括的数据需要在所述区块链网络中被存储的时长,K为大于或等于1的正整数,i=1,…K;所述第一设备将所述K个第一区块确定为待删除区块。With reference to the first aspect and the foregoing implementation manner, in another implementation manner of the first aspect, the determining, by the first device, the to-be-deleted block according to the storage duration, the first device determining the current a time interval between a time instant and a generation time of the i-th first block in the consecutive K first blocks is greater than or equal to a storage duration of the i-th first block, where the i-th block The storage duration is used to indicate that the data included in the i-th first block or the i-th first block needs to be stored in the blockchain network, and K is greater than or equal to 1. An integer, i=1, . . . K; the first device determines the K first blocks as blocks to be deleted.
可选地,区块链网络中的每个区块中携带该区块的存储时长。 Optionally, each block in the blockchain network carries a storage duration of the block.
结合第一方面及其上述实现方式,在第一方面的另一种实现方式中,所述第一设备根据所述消逝时间,确定所述待删除区块,包括:所述第一设备确定当前时间为连续K个第一区块中的第i个第一区块的消逝时间,或当前时间晚于所述K个第一区块中第i个第一区块的消逝时间,所述第i个第一区块的消逝时间用于指示所述第一区块或所述第一区块中包括的数据需要在所述区块链网络中被删除的时间,K为大于或等于1的正整数,i=1,…K;所述第一设备将所述K个第一区块确定为待删除区块。With reference to the first aspect and the foregoing implementation manner, in another implementation manner of the first aspect, the determining, by the first device, the to-be-deleted block according to the elapsed time, The time is the elapsed time of the i-th first block in the consecutive K first blocks, or the elapsed time of the i-th first block in the K first blocks later than the current time, the first The elapsed time of the i first blocks is used to indicate that the data included in the first block or the first block needs to be deleted in the blockchain network, and K is greater than or equal to 1. A positive integer, i=1, . . . K; the first device determines the K first blocks as blocks to be deleted.
可选地,区块链网络中的每个区块中携带该区块的删除时间。Optionally, each block in the blockchain network carries the deletion time of the block.
可以理解的是,区块链网络中的设备可以在删除时间指示的具体时刻删除待删除区块,也可以在这个具体时刻之后删除待删除区块。It can be understood that the device in the blockchain network can delete the to-be-deleted block at a specific time indicated by the deletion time, or delete the to-be-deleted block after the specific time.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,所述第一设备执行删除相关操作,包括:所述第一设备删除所述K个第一区块;或,所述第一设备设置所述K个第一区块的删除认证次数的初始值,并向所述区块链网络中的设备发送第一区块信息和所述K个第一区块的删除认证次数,所述第一区块信息用于指示所述K个第一区块,以便于所述区块链网络中的设备在确定所述K个第一区块的删除认证次数为第一预设值时,删除所述K个第一区块。With reference to the first aspect and the foregoing implementation manner, in another implementation manner of the first aspect, the performing, by the first device, the deleting the related operation, includes: deleting, by the first device, the K first blocks; or The first device sets an initial value of the number of deletion authentication times of the K first blocks, and sends the first block information and the deletion of the K first blocks to devices in the blockchain network. The number of times of authentication, the first block information is used to indicate the K first blocks, so that the device in the blockchain network determines that the number of deletion authentications of the K first blocks is the first When the preset value is used, the K first blocks are deleted.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,在所述第一设备确定当前时刻与连续K个第一区块中的第i个第一区块的生成时刻之间的时间间隔大于或等于所述第i个第一区块的存储时长之前,所述方法还包括:所述第一设备确定所述K个第一区块中存在生成时刻与当前时刻的时间间隔小于区块的存储时长的第一区块;所述第一设备删除所述生成时刻与当前时刻的时间间隔小于区块的存储时长的第一区块中包括的数据。With reference to the first aspect and the foregoing implementation manner, in another implementation manner of the first aspect, the first device determines, at the current time, a generation time of the i th first block in the consecutive K first blocks Before the time interval is greater than or equal to the storage duration of the ith first block, the method further includes: determining, by the first device, that the generated time and the current time exist in the K first blocks The first block whose time interval is smaller than the storage duration of the block; the first device deletes the data included in the first block where the time interval between the generation time and the current time is less than the storage duration of the block.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,在所述第一设备确定当前时间为连续K个第一区块中的第i个第一区块的消逝时间,或当前时间晚于所述K个第一区块中的第i个第一区块的消逝时间之前,所述方法还包括:所述第一设备确定所述K个第一区块中存在消逝时间早于当前时间的第一区块;所述第一设备删除所述消逝时间早于当前时间的第一区块中包括的数据。With reference to the first aspect and the foregoing implementation manner, in another implementation manner of the first aspect, the determining, by the first device, that the current time is an elapsed time of the i th first block in the consecutive K first blocks Or the current time is later than an elapsed time of the i th first block in the K first blocks, the method further comprising: the first device determining that the K first blocks are present The elapsed time is earlier than the first block of the current time; the first device deletes the data included in the first block whose elapsed time is earlier than the current time.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,所述第一设备确定区块链网络中的待删除区块,包括:所述第一设备确定区块链中承载有第一区块信息和删除认证次数,所述第一区块信息用于指示连续K个第一区块,所述删除认证次数用于指示所述K个第一区块在所述区块链网络中的删除认证次数,K为大于或等于1的正整数;所述第一设备将所述K个第一区块确定为待删除区块。With reference to the first aspect and the foregoing implementation manner, in another implementation manner of the first aspect, the determining, by the first device, the to-be-deleted block in the blockchain network includes: the first device determining the blockchain Carrying the first block information and deleting the number of authentication times, the first block information is used to indicate consecutive K first blocks, and the number of deletion authentications is used to indicate that the K first blocks are in the area The number of deletion authentications in the blockchain network, K is a positive integer greater than or equal to 1; the first device determines the K first blocks as blocks to be deleted.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,所述删除认证次数的取值为第一预设值;With reference to the first aspect and the foregoing implementation manner, in another implementation manner of the first aspect, the value of the deletion authentication number is a first preset value;
其中,所述第一设备执行删除相关操作,包括:所述第一设备删除所述K个第一区块。The performing, by the first device, the deletion related operation includes: deleting, by the first device, the K first blocks.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,所述删除认证次数的取值小于第一预设值;In combination with the first aspect and the foregoing implementation manner, in another implementation manner of the first aspect, the value of the deletion authentication number is smaller than a first preset value;
其中,所述第一设备执行删除相关操作,包括:所述第一设备在将所述删除认证次数的取值增加1之后,向所述区块链网络中的设备发送所述第一区块信息和所述删除认证次数,以便于所述区块链网络中的设备在确定所述K个第一区块的删除认证次数为所述第一 预设值时,删除所述K个第一区块。The first device performs the deletion related operation, and the first device sends the first block to the device in the blockchain network after adding the value of the deletion authentication number to one. And deleting the number of authentications, so that the device in the blockchain network determines that the number of deletion authentications of the K first blocks is the first When the preset value is used, the K first blocks are deleted.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,在所述第一设备删除所述K个第一区块之后,所述方法还包括:所述第一设备确定当前时刻与连续L个第二区块中第j个第二区块的生成时刻之间的时间间隔大于或等于第j个第二区块的存储时长,所述L个第二区块为生成时刻晚于所述K个第一区块,且与所述L个第一区块相邻的区块,L为大于或等于1的正整数,j=1,…L;With reference to the first aspect and the foregoing implementation manner, in another implementation manner of the first aspect, after the first device deletes the K first blocks, the method further includes: determining, by the first device The time interval between the current time and the generation time of the jth second block in the consecutive L second blocks is greater than or equal to the storage duration of the jth second block, and the L second blocks are generated a block that is later than the K first blocks and adjacent to the L first blocks, L is a positive integer greater than or equal to 1, j=1, . . . L;
所述第一设备删除所述L个第二区块;或,The first device deletes the L second blocks; or
所述第一设备设置所述L个第二区块的删除认证次数的初始值,并向所述区块链网络中的设备发送第二区块信息和所述L个第二区块的删除认证次数,所述第二区块信息用于指示所述L个第二区块,以便于所述区块链网络中的设备在确认所述L个第二区块的删除认证次数为所述第一预设值时,删除所述L个第二区块。The first device sets an initial value of the number of deletion authentication times of the L second blocks, and sends the second block information and the deletion of the L second blocks to the devices in the blockchain network. a number of times of authentication, the second block information is used to indicate the L second blocks, so that the device in the blockchain network confirms that the number of deletion authentications of the L second blocks is the When the first preset value is used, the L second blocks are deleted.
可选地,K和L为事先配置的固定数值,或者K和L为动态配置的数值。Alternatively, K and L are fixed values that are configured in advance, or K and L are dynamically configured values.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,所述方法还包括:所述第一设备生成第三区块,所述第三区块中携带所述第三区块的存储时长,所述第三区块的存储时长用于指示所述第三区块或所述第三区块中包括的数据需要在所述区块链网络中被存储的时长。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 generates a third block, and the third block carries the third The storage duration of the block, the storage duration of the third block is used to indicate the length of time that the data included in the third block or the third block needs to be stored in the blockchain network.
由于第三区块中携带第三区块的存储时长,使得区块链网络中的设备可以根据第三区块中的存储时长快速的确定第三区块是否为待删除区块。由此,能够实现区块链网络中的设备的实现。Because the storage duration of the third block is carried in the third block, the device in the blockchain network can quickly determine whether the third block is the to-be-deleted block according to the storage duration in the third block. Thereby, the implementation of the devices in the blockchain network can be realized.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,所述第三区块的区块头中包括所述第三区块的存储时长。In conjunction with the first aspect and the foregoing implementation manner, in another implementation manner of the first aspect, the block header of the third block includes a storage duration of the third block.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,所述第三区块中包括第二设备发送的数据;With reference to the first aspect and the foregoing implementation manner, in another implementation manner of the first aspect, the third block includes data sent by the second device;
其中,在所述第一设备生成第三区块之前,所述方法还包括:所述第一设备接收第二设备发送的数据和所述数据的第一存储时长,所述第二设备为所述区块链网络中的设备,所述第一存储时长用于指示所述第二设备确定的所述数据需要在所述区块链网络中被存储的时长;所述第一设备根据所述第一存储时长,确定所述第三区块的存储时长。The method further includes: the first device receiving data sent by the second device and a first storage duration of the data, where the second device is a device in the blockchain network, where the first storage duration is used to indicate a length of time that the data determined by the second device needs to be stored in the blockchain network; The first storage duration determines the storage duration of the third block.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,所述第一存储时长是由所述第二设备通过与第三设备进行协商确定的,所述第三设备为所述区块链网络中的设备。With reference to the first aspect and the foregoing implementation manner, in another implementation manner of the first aspect, the first storage duration is determined by the second device by negotiating with a third device, where the third device is The device in the blockchain network.
在本申请实施例中,第一存储时长可以是由第二设备根据预签约模式确定的。In this embodiment of the present application, the first storage duration may be determined by the second device according to the pre-registration mode.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,所述第一存储时长是所述第二设备根据第二存储时长确定的,所述第二存储时长是由第四设备确定的所述数据需要在所述区块链网络中被存储的时长,所述第四设备为所述区块链网络之外的设备。With reference to the first aspect and the foregoing implementation manner, in another implementation manner of the first aspect, the first storage duration is determined by the second device according to a second storage duration, and the second storage duration is The data determined by the four devices is required to be stored in the blockchain network, and the fourth device is a device outside the blockchain network.
可以理解的是,第四设备为区块链网络之外的设备,第二设备作为第四设备的代理设备将第四设备的数据发送到区块链网络中。由此,第四设备不需要参与区块链网络,降低对第四设备的性能要求。It can be understood that the fourth device is a device outside the blockchain network, and the second device sends the data of the fourth device to the blockchain network as a proxy device of the fourth device. Thus, the fourth device does not need to participate in the blockchain network, reducing the performance requirements for the fourth device.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,所述第二存储时长是由所述第四设备通过与第五设备进行协商确定的,所述第五设备为所述区块链网络之外 的设备。In conjunction with the first aspect and the foregoing implementation manner, in another implementation manner of the first aspect, the second storage duration is determined by the fourth device by negotiating with a fifth device, where the fifth device is Outside the blockchain network device of.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,所述方法还包括:所述第一设备确定所述第三区块所属的区块链;所述第一设备将所述第三区块加入到所述区块链中。In conjunction with the first aspect and the foregoing implementation manner, in another implementation manner of the first aspect, the method further includes: determining, by the first device, a blockchain to which the third block belongs; The third block is added to the blockchain.
本申请实施例的区块链网络中,存在多个不同类型的区块链,区块链网络中的设备对多个不同类型的区块链进行维护。能够进一步降低区块链网络的存储要求。In the blockchain network of the embodiment of the present application, there are multiple different types of blockchains, and devices in the blockchain network maintain a plurality of different types of blockchains. It can further reduce the storage requirements of the blockchain network.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,所述第一设备确定所述第三区块所属的区块链,包括:所述第一设备根据所述第三区块的存储时长和预设对应关系,确定所述第三区块所属的区块链,所述预设对应关系为区块的存储时长和区块链的对应关系。With reference to the first aspect and the foregoing implementation manner, in another implementation manner of the first aspect, the determining, by the first device, the blockchain to which the third block belongs, The storage duration of the three blocks and the preset correspondence relationship determine the blockchain to which the third block belongs, and the preset correspondence relationship is the correspondence between the storage duration of the block and the blockchain.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,所述区块链中携带所述区块链的标识。In conjunction with the first aspect and the foregoing implementation manner, in another implementation manner of the first aspect, the blockchain carries an identifier of the blockchain.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,所述方法还包括:所述第一设备生成第四区块;所述第四区块的区块头中包括第三区块信息和删除时间信息,其中,所述第三区块信息用于指示被删除的区块,所述删除时间信息用于指示被删除区块的删除时刻,或所述删除时间信息用于指示被删除区块中包括的数据的删除时刻。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 generates a fourth block; the block header of the fourth block includes a The third block information and the deletion time information, wherein the third block information is used to indicate the deleted block, the deletion time information is used to indicate the deletion time of the deleted block, or the deletion time information is used. Indicates the deletion time of the data included in the deleted block.
本申请实施例中,区块链网络中的设备生成的区块中包括区块信息和删除时间信息,能够保证区块链网络中的设备方便的获知已被删除的区块以及已被删除的区块或者这些区块中的数据的删除时间。In the embodiment of the present application, the block generated by the device in the blockchain network includes the block information and the deletion time information, which can ensure that the device in the blockchain network can easily learn the deleted block and has been deleted. The time at which blocks or the data in these blocks are deleted.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,所述方法还包括:所述第一设备向所述区块链网络中的存储设备或所述区块链网络之外的存储设备发送被删除的区块或被删除的区块中包括的数据。In another implementation manner of the first aspect, the method further includes: the first device to a storage device in the blockchain network or the blockchain network The storage device other than the one transmits the deleted block or the data included in the deleted block.
本申请实施例中,区块链网络中的设备将被删除的区块或者被删除的区块中包括的数据发送给存储设备,使得这些区块或者这些区块中的数据能够在存储设备中保存一段时间。由此,能够便于区块链网络中的设备进行数据查找和恢复。In the embodiment of the present application, the device in the blockchain network sends the deleted block or the data included in the deleted block to the storage device, so that the data in the block or the blocks can be in the storage device. Save for a while. Thereby, it is possible to facilitate data search and recovery by devices in the blockchain network.
结合第一方面及其上述实现方式,在第一方面的另一实现方式中,所述方法还包括:所述第一设备向所述区块链网络中的存储设备或所述区块链网络之外的存储设备发送第三存储时长,所述第三存储时长为所述被删除的区块或所述被删除的区块中的包括的数据需要在所述区块链网络中的存储设备或所述区块链网络之外的存储设备中被存储的时长。In another implementation manner of the first aspect, the method further includes: the first device to a storage device in the blockchain network or the blockchain network The storage device other than the third storage duration is the storage device in the blockchain network in which the deleted data or the included data in the deleted block needs to be stored. Or the length of time stored in a storage device outside the blockchain network.
第二方面,提供了一种基于区块链的数据处理方法,包括:第二设备获取数据,所述第二设备为区块链网络中的设备;所述第二设备确定所述数据的第一存储时长,所述数据的第一存储时长用于指示所述第二设备确定的所述数据需要在所述区块链网络中被存储的时长;所述第二设备向所述区块链网络中的设备发送所述数据和所述第一存储时长,所述第一存储时长用于确定包含所述数据的第三区块的存储时长,所述第三区块的存储时长用于指示所述第三区块或所述第三区块中包括的所述数据需要在所述区块链网络中被存储的时长。A second aspect provides a blockchain-based data processing method, including: acquiring, by a second device, the second device is a device in a blockchain network; and the second device determining the data a storage duration, the first storage duration of the data is used to indicate a length of time that the data determined by the second device needs to be stored in the blockchain network; and the second device is to the blockchain The device in the network sends the data and the first storage duration, the first storage duration is used to determine a storage duration of a third block that includes the data, and a storage duration of the third block is used to indicate The length of time in which the data included in the third block or the third block is stored in the blockchain network.
可以理解的是,第三区块是由区块链网络中获得认证权的设备生成的,这里获得认证权的设备可以是第二设备。It can be understood that the third block is generated by the device that obtains the authentication right in the blockchain network, and the device that obtains the authentication right here may be the second device.
根据本申请实施例的基于区块链的数据处理方法,区块链网络中的第二设备确定获取 到的数据的存储时长之后,将获取到的数据和确定的数据的存储时长发送给区块链网络中的设备,使得区块链网络中的设备能够根据第二设备确定的存储时长确定包含所述数据的区块的存储时长。由此,区块链网络中的设备可以根据包含所述数据的区块的存储时长确定这个区块是待删除区块时执行删除相关操作,实现待删除区块的删除。由此,能够降低区块链网络中的负载和区块链的传输所需的带宽。According to the blockchain-based data processing method of the embodiment of the present application, the second device in the blockchain network determines the acquisition After the storage time of the obtained data is long, the acquired data and the storage duration of the determined data are sent to the devices in the blockchain network, so that the devices in the blockchain network can determine the inclusion time according to the storage duration determined by the second device. The storage duration of the block of data. Therefore, the device in the blockchain network can perform the delete related operation when the block is to be deleted according to the storage duration of the block containing the data, and delete the block to be deleted. Thereby, it is possible to reduce the bandwidth required for the load in the blockchain network and the transmission of the blockchain.
结合第二方面,在第二方面的一种实现方式中,所述第二设备确定所述数据的第一存储时长,包括:所述第二设备与第三设备进行协商,确定所述第一存储时长,所述第三设备为所述区块链网络中的设备。With reference to the second aspect, in an implementation manner of the second aspect, the determining, by the second device, the first storage duration of the data includes: the second device negotiates with the third device, and determines the first For the storage duration, the third device is a device in the blockchain network.
结合第二方面及其上述实现方式,在第二方面的另一实现方式中,所述第二设备获取数据,包括:所述第二设备接收第四设备发送的所述数据和第二存储时长,所述第二存储时长为第四设备确定的所述数据需要在所述区块链网络中被存储的时长,所述第四设备为所述区块链网络之外的设备;With reference to the second aspect and the foregoing implementation manner, in another implementation manner of the second aspect, the acquiring, by the second device, the data includes: the second device receiving the data sent by the fourth device, and the second storage duration The second storage duration is a duration that the data determined by the fourth device needs to be stored in the blockchain network, and the fourth device is a device outside the blockchain network;
其中,所述第二设备确定所述数据的第一存储时长,包括:所述第二设备根据所述第二存储时长,确定所述第一存储时长。The determining, by the second device, the first storage duration of the data, includes: determining, by the second device, the first storage duration according to the second storage duration.
结合第二方面及其上述实现方式,在第二方面的另一实现方式中,所述第二存储时长是由所述第四设备通过与第五设备进行协商确定的,所述第五设备为所述区块链网络之外的设备。With reference to the second aspect and the foregoing implementation manner, in another implementation manner of the second aspect, the second storage duration is determined by the fourth device by negotiating with a fifth device, where the fifth device is A device outside the blockchain network.
第三方面,提供了一种设备,用于执行上述第一方面或第一方面的任意可能的实现方式中的方法。具体地,所述设备包括用于执行上述第一方面或第一方面的任意可能的实现方式中的方法的功能模块In a third aspect, an apparatus is provided for performing the method of any of the above first aspect or any of the possible implementations of the first aspect. In particular, the device comprises a functional module for performing the method of the first aspect or any of the possible implementations of the first aspect described above
第四方面,提供了一种设备,用于执行上述第二方面或第二方面的任意可能的实现方式中的方法。具体地,所述设备包括用于执行上述第二方面或第二方面的任意可能的实现方式中的方法的功能模块。In a fourth 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 fifth 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 a sixth 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.
第七方面,提供了一种系统,包括第三方面的设备和第四方面的设备,或者包括第五方面的设备和第六方面的设备。According to a seventh aspect, there is provided a system comprising the apparatus of the third aspect and the apparatus of the fourth aspect, or the apparatus of the fifth aspect and the apparatus of the sixth aspect.
第八方面,提供了一种计算机可读介质,提供了一种计算机可读介质,用于存储计算机程序,所述计算机程序包括用于执行上述第一方面或第一方面的任意可能的实现方式中的指令。According to an eighth aspect, a computer readable medium providing a computer readable medium for storing a computer program, the computer program comprising any of the possible implementations of the first aspect or the first aspect described above The instruction in .
第九方面,提供了一种计算机可读介质,提供了一种计算机可读介质,用于存储计算机程序,所述计算机程序包括用于执行上述第二方面或第二方面的任意可能的实现方式中的指令。A ninth aspect, a computer readable medium providing a computer readable medium for storing a computer program, the computer program comprising any possible implementation for performing the second aspect or the second aspect described above The instruction in .
附图说明 DRAWINGS
图1是根据本申请实施例的基于区块链的数据处理方法的示意性流程图;1 is a schematic flowchart of a blockchain-based data processing method according to an embodiment of the present application;
图2是根据本申请实施例的区块链的示意图;2 is a schematic diagram of a blockchain in accordance with an embodiment of the present application;
图3是根据本申请另一实施例的区块链的示意图;3 is a schematic diagram of a blockchain according to another 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 block diagram of an apparatus according to an embodiment of the present application; FIG.
图7是根据本申请另一实施例的设备的示意框图;FIG. 7 is a schematic block diagram of an apparatus according to another embodiment of the present application; FIG.
图8是根据本申请再一实施例的设备的示意性框图;FIG. 8 is a schematic block diagram of an apparatus according to still another embodiment of the present application; FIG.
图9是根据本申请再一实施例的设备的示意性框图。9 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 invention will be clearly and completely described in the following with reference to the accompanying drawings.
在本申请实施例中,区块链网络中的设备可以是私有设备、运营商网络设备(例如,基站设备),也可以是一定的行业组织、团体和个人部署的站点(Station)。In the embodiment of the present application, the device in the blockchain network may be a private device, an operator network device (for example, a base station device), or a station deployed by a certain industry organization, a group, and an individual.
在本申请实施例中,物联网设备可以包括但不限于移动台(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.
为了方便理解本申请,在描述本申请的方法之前,首先在此具体介绍一下区块链网络、区块链网络中的几个要素以及区块链网络中的设备的工作方法。In order to facilitate the understanding of the present application, before describing the method of the present application, firstly, the blockchain network, several elements in the blockchain network, and the working methods of the devices in the blockchain network are first introduced.
需要说明的是,本申请实施例中,设备产生的数据包括与该设备和其对端设备相关的数据和普通的数据。在描述区块链网络中的要素以及区块链网络中个设备的工作方法时,以与设备和其对端设备相关的数据为例,具体以与设备和其对端设备相关的数据为交易数据为例进行描述,但这并不限定本申请实施例的范围。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 devices in the blockchain network, taking the data related to the device and its peer device as an example, the data related to the device and its peer device is used as a transaction. The data is described as an example, but this does not limit the scope of the embodiments of the present application.
区块链网络中没有中心化的硬件或者管理机构,任意设备之间的权利和义务都是均等的,且任何一设备的损坏或者丢失都不影响整个区块链网络的运作,因此,区块链网络具有去中心化的特点。区块链网络中的每个设备之间进行数据交换是无需互相信任的,整个区块链网络的运作规则是公开透明的,所有的数据内容是公开的,因此在区块链网络的规则范围和时间范围内,设备之间是不能也无法欺骗其他设备的,因此,区块链网络具有去信任的特征。区块链网络总的数据块由整个系统中所有具有维护功能的设备共同维护,而这些具有维护功能的设备时任何人都可以参与的,因此,区块链网络具有集体维护的特征。区块链网络通过分数据库的形式,让每个参与设备都能获得一份完整数据库的拷贝。除非能够同时控制整个网络中超过51%的设备,否则单个设备上对数据库的修改时无效的,也无法影响其他设备上的数据内容。因此,区块链网络具有可靠的数据库。There is no centralized hardware or management mechanism in the blockchain network. The rights and obligations between any devices are equal, and the damage or loss of any device does not affect the operation of the entire blockchain network. Therefore, the block The chain network has the characteristics of decentralization. The data exchange between each device 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 the time range, the device can not and can not deceive other devices, therefore, the blockchain network has the feature of trust. The total data block of the blockchain network is maintained by all maintenance-capable devices in the entire system, and any of these devices with maintenance functions can participate. Therefore, the blockchain network has the characteristics of collective maintenance. The blockchain network allows each participating device to obtain a copy of the complete database in the form of a sub-database. Unless you can control more than 51% of the devices in the entire network at the same time, the modification of the database on a single device is invalid, and it cannot affect the data content on other devices. Therefore, the blockchain network has a reliable database.
区块,是一个被包含在区块链中的聚合了数据的容器数据结构,它由一个包含元数据的区块头和紧跟其后的构成区块主体的一长串交易组成。区块具体包括:区块大小字段,通常为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; and a transaction counter field, generally 1-9 bytes. Record the number of transactions; the transaction field, usually variable length, records 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 (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. Encrypting each block header (for example, Secure Hash Algorithm (SHA)) generates 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 devices agree on a 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) essentially adds cost to information transfer, reduces the rate of information transmission, and adds a random element to ensure that only one device can have the right to broadcast information during a time period. This random element is for the device to calculate a random hash value. Specifically, the block device calculates a string of 64-bit random numbers and letters according to the obtained input data, but only the device 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.
下面将在以上描述的基础上,详细描述根据本申请实施例的基于区块链的数据处理方法。如图1所述,方法100包括:The blockchain-based data processing method according to an embodiment of the present application will be described in detail below on the basis of the above description. As illustrated in Figure 1, method 100 includes:
S101,第一设备确定区块链网络中的待删除区块,第一设备为区块链网络中的设备;S101. The first device determines a to-be-deleted block in the blockchain network, where the first device is a device in the blockchain network.
S102,所述第一设备执行删除相关操作,以删除待删除区块。S102. The first device performs a delete related operation to delete a to-be-deleted block.
可选地,在S101中,第一设备可以根据区块的存储时长或区块的消逝时间确定区块链网络中的待删除区块。区块的存储时长用于指示区块或区块中的数据需要在区块链网络中被存储的时长,区块的消逝时间用于指示区块或区块中包括的数据需要在区块链网络中 被删除的时间,区块链网络中的设备可以在消逝时间指示的具体时刻删除区块或区块中的数据,也可以在消逝时间指示的具体时刻之后删除区块或区块中的数据。例如,第一设备根据当前时刻与区块的生成时刻之间的时间间隔与区块的存储时长之间的关系确定待删除区块。或者第一设备根据当前时刻与消逝时间的关系确定待删除区块。Optionally, in S101, the first device may determine the to-be-deleted block in the blockchain network according to the storage duration of the block or the elapsed time of the block. The storage duration of the block is used to indicate the length of time in the block or block that the data needs to be stored in the blockchain network. The elapsed time of the block is used to indicate that the data included in the block or block needs to be in the blockchain. In the network At the time of deletion, the device in the blockchain network may delete the data in the block or the block at the specific moment indicated by the elapsed time, or may delete the data in the block or the block after the specific time indicated by the elapsed time. For example, the first device determines the to-be-deleted block according to the relationship between the current time and the time interval between the generation time of the block and the storage duration of the block. Or the first device determines the to-be-deleted block according to the relationship between the current time and the elapsed time.
举例来说,第一设备从当前区块链中高度最低或者序列号最小的区块(特殊地,在初始化时,从区块链的第一个区块)开始,确定区块链网络中的待删除区块。如图2中所示出的,第一设备从区块X开始,当第一设备确定当前时刻与区块X的时间戳记载的时刻之间的时间间隔大于或等于区块X的存储时长,或者当第一设备确定当前时间为区块X的消逝时间,或者当第一设备确定当前时间晚于区块X的消逝时间时,第一设备认为区块X为待删除区块,第一设备可以直接删除区块X,之后第一设备判断区块X+1是否为待删除区块,依次类推,直到某个区块不是待删除区块为止。这里的当前时刻(或当前时间)可以为第一设备生成新的区块的时刻或者当前区块链节点广播新的区块链的时刻,区块X的时间戳记载的时刻包括为区块X的生成时刻或者区块X的消逝时间。For example, the first device determines the block in the blockchain network from the lowest block in the current blockchain or the block with the smallest sequence number (specifically, at initialization, from the first block of the blockchain) The block to be deleted. As shown in FIG. 2, the first device starts from block X, and when the first device determines that the time interval between the current time and the time recorded by the timestamp of the block X is greater than or equal to the storage duration of the block X, Or when the first device determines that the current time is the elapsed time of the block X, or when the first device determines that the current time is later than the elapsed time of the block X, the first device considers the block X as the to-be-deleted block, the first device The block X can be directly deleted, and then the first device determines whether the block X+1 is the block to be deleted, and so on, until a certain block is not the block to be deleted. The current time (or current time) here may be the time when the first device generates a new block or the time when the current block chain node broadcasts a new block chain, and the time recorded by the time stamp of the block X is included as the block X. The generation time or the elapsed time of block X.
或者,如果第一设备确定区块X为待删除区块,第一设备并不删除区块X,而是将区块X的区块信息和删除认证次数(初始值为1)记录在区块链中,将区块链广播到区块链网络中,下一次取得认证权的设备会将删除认证次数的取值增加1,直到第N次获取到认证权的设备时,区块X在区块链网络中的删除认证次数已经达到预设值N,所以第N次获取到认证权的设备将区块X从区块链中删除。之后,这个第N次获取到认证权的设备确定区块X+1是否为待删除区块,如果区块X+1为待删除区块,第N次获取到认证权的设备可以将区块X+1的区块信息和删除认证次数(初始值为1)加入到区块链中,并将区块链广播到区块链网络中,直到区块X+1在区块链网络中的删除认证次数为N时,区块链网络中的设备将区块X+1删除,N的值为预设值。Alternatively, if the first device determines that the block X is the to-be-deleted block, the first device does not delete the block X, but records the block information of the block X and the number of deletion authentications (initial value 1) in the block. In the chain, the blockchain is broadcasted to the blockchain network. The device that obtains the authentication right next time increases the value of the number of deleted authentication times by one, until the device that obtains the authentication right for the Nth time, the block X is in the zone. The number of deletion authentications in the blockchain network has reached the preset value N, so the device that obtains the authentication right for the Nth time deletes the block X from the blockchain. Then, the device that obtains the authentication right for the Nth time determines whether the block X+1 is the to-be-deleted block, and if the block X+1 is the to-be-deleted block, the device that obtains the authentication right for the Nth time can block the block. The X+1 block information and the number of deletion authentications (initial value 1) are added to the blockchain, and the blockchain is broadcasted to the blockchain network until block X+1 is in the blockchain network. When the number of authentication deletions is N, the device in the blockchain network deletes the block X+1, and the value of N is a preset value.
或者,如图3中所示出的,第一设备确定从区块X开始的连续K个区块是否满足删除条件,如果连续K个区块均满足删除条件,第一设备将这K个区块确定为待删除区块。第一设备可以直接删除从区块X开始的连续K个区块,之后第一设备判断从区块X+K开始的连续L个连续区块是否满足删除条件,如果满足,第一设备删除从区块X+K开始的连续L个区块。依次类推,直到某多个连续区块不完全满足删除条件位置,这里K和L的取值可以相同,也可以不同。并且K和L的值可以是动态配置的数值。Alternatively, as shown in FIG. 3, the first device determines whether the consecutive K blocks starting from the block X satisfy the deletion condition, and if the consecutive K blocks satisfy the deletion condition, the first device sets the K areas. The block is determined to be the block to be deleted. The first device may directly delete consecutive K blocks starting from the block X, after which the first device determines whether the consecutive L consecutive blocks starting from the block X+K satisfy the deletion condition, and if so, the first device deletes the A continuous L block starting from block X+K. And so on, until a plurality of consecutive blocks do not completely satisfy the deletion condition position, where the values of K and L may be the same or different. And the values of K and L can be dynamically configured values.
或者,如果第一设备确定从区块X开始的连续K个区块均满足为待删除区块,第一设备并不删除从区块X开始的连续K个区块,而是将从区块X开始的连续K个区块的区块信息和删除认证次数(初始值为1)记录在区块链中,将区块链广播到区块链网络中,下一次取得认证权的设备会将删除认证次数的取值增加1,直到第N次获取到认证权的设备时,从区块X开始的K个区块在区块链网络中的删除认证次数已经达到预设值N,所以第N次获取到认证权的设备将从区块X开始的K个区块从区块链中删除。之后,这个第N次获取到认证权的设备确定从区块X+K开始的L个连续区块是否均满足删除条件,如果从区块X+K开始的L个连续区块为待删除区块,第N次获取到认证权的设备可以将从区块X+K开始的L个连续区块的区块信息和删除认证次数(初始值为1)加入到区块链中,并将区块链广播到区块链网络中,直到从区块X+K开始的连续L个区块在区块链网络中的删除认证次数为N时,区块链网络中的设备将从区块X+K开始的L个连续区块 删除。Alternatively, if the first device determines that the consecutive K blocks starting from the block X satisfy the block to be deleted, the first device does not delete the consecutive K blocks starting from the block X, but the slave block. The block information and the number of deletion authentications (initial value 1) of consecutive K blocks starting from X are recorded in the blockchain, and the blockchain is broadcasted to the blockchain network, and the device that obtains the authentication right next time will The value of deleting the number of authentication times is increased by 1. When the device that obtains the authentication right is acquired for the Nth time, the number of deletion authentications of the K blocks starting from block X in the blockchain network has reached the preset value N, so the first The device that acquires the authentication right N times deletes the K blocks starting from block X from the blockchain. After that, the device that obtains the authentication right for the Nth time determines whether the L consecutive blocks starting from the block X+K satisfy the deletion condition, and if the L consecutive blocks starting from the block X+K are the to-be-deleted area. Block, the device that obtains the authentication right for the Nth time may add the block information and the number of deletion authentication times (initial value 1) of the L consecutive blocks starting from the block X+K to the blockchain, and add the zone The blockchain is broadcasted into the blockchain network until the number of deletion authentications of the consecutive L blocks starting from block X+K in the blockchain network is N, and the device in the blockchain network will be from block X. L consecutive blocks starting with +K delete.
在上述实施例中,可选地,如果第一设备确定从X开始的连续K个区块存在一个或多个不满足删除条件。第一设备此时可以将连续K个区块中满足删除条件的区块中的数据删除,但保留这些区块的区块头。等到区块链网络中的某个设备确定从X开始的连续K个区块均满足删除条件时,删除这连续K个区块。或者,将这连续K个区块的区块信息和删除认证次数记录到区块链中,并将区块链广播到区块链网络中,直到区块链网络中的某个设备确定这连续K个区块的删除认证次数为N时,将这连续K个区块删除。In the above embodiment, optionally, if the first device determines that one or more consecutive K blocks starting from X do not satisfy the deletion condition. The first device can delete the data in the blocks satisfying the deletion condition among the consecutive K blocks at this time, but retain the block headers of the blocks. Wait until the device in the blockchain network determines that consecutive K blocks starting from X satisfy the deletion condition, and delete the consecutive K blocks. Or, recording the block information and the number of deletion authentications of the consecutive K blocks into the blockchain, and broadcasting the blockchain to the blockchain network until a device in the blockchain network determines the continuous When the number of deletion authentications of the K blocks is N, the consecutive K blocks are deleted.
需要说明的是,上述的删除条件指的是当前时刻与区块的生成时刻之间的时间间隔大于或等于区块的存储时长,或者上述的删除条件指的是当前时间为区块的消逝时间,或者上述的删除条件指的是当前时间晚于区块的消逝时间。It should be noted that the foregoing deletion condition refers to that the time interval between the current time and the generation time of the block is greater than or equal to the storage duration of the block, or the above deletion condition refers to the current time being the elapsed time of the block. , or the above deletion condition refers to the elapsed time of the current time later than the block.
在上述所有实施例中,可选地,区块信息和删除认证次数记录在区块链的区块链头中。In all of the above embodiments, optionally, the block information and the number of deletion authentications are recorded in the blockchain of the blockchain.
可选地,在S101中,第一设备可以根据区块链中是否承载有区块信息和删除认证次数,确定待删除区块。Optionally, in S101, the first device may determine, according to whether the block information is carried in the blockchain, and the number of times of deleting the authentication, determining the to-be-deleted block.
具体来说,在一些实施例中,如果区块链中承载有区块信息和删除认证次数,第一设备将区块信息指示的区块确定为待删除区块。Specifically, in some embodiments, if the block information is carried in the blockchain and the number of authentication attempts is deleted, the first device determines the block indicated by the block information as the block to be deleted.
进一步地,如果第一设备确定删除认证次数的取值小于预设值,第一设备将删除次数的值增加1之后,向区块链网络中的设备发送上述的区块信息和删除认证次数,直到区块链中记录的删除认证次数为预设值时,区块链网络中的设备将区块信息指示的区块删除。Further, if the first device determines that the value of the number of deletion authentications is less than a preset value, the first device increases the value of the number of deletions by one, and then sends the foregoing block information and the number of authentication deletions to the device in the blockchain network. Until the number of deletion authentications recorded in the blockchain is a preset value, the device in the blockchain network deletes the block indicated by the block information.
如果第一设备确定删除认证次数的取值为预设值,第一设备可以直接删除区块信息指示的区块。If the first device determines that the value of the deletion authentication number is a preset value, the first device may directly delete the block indicated by the block information.
图4示出了本发明另一实施例的基于区块链的数据处理方法。图4中的区块链设备A-区块链设备D均为区块链网络中的设备。如图4所示,方法200包括:FIG. 4 shows a blockchain-based data processing method according to another embodiment of the present invention. The blockchain device A-blockchain device D in Figure 4 is a device in a blockchain network. As shown in FIG. 4, method 200 includes:
S201,区块链设备A产生需要在区块链网络中进行认证的数据;S201, the blockchain device A generates data that needs to be authenticated in the blockchain network;
可选地,区块链设备A产生的需要在区块链网中进行认证的数据为区块链设备A和区块链设备B之间的交易数据。Optionally, the data generated by the blockchain device A that needs to be authenticated in the blockchain network is transaction data between the blockchain device A and the blockchain device B.
进而,区块链设备A可以通过与区块链设备B进行协商,对交易数据的存储时长或消逝时间达成一致,确定交易数据需要在区块链网络中的存储时长或消逝时间。或者,区块链设备A可以自己独立确定数据在区块链网络中的存储时长或消逝时间。例如,区块链设备A根据预签约模式确定数据在区块链网络中的存储时长或消逝时间。Furthermore, the blockchain device A can negotiate with the blockchain device B to agree on the storage duration or elapsed time of the transaction data, and determine the storage duration or elapsed time of the transaction data in the blockchain network. Alternatively, the blockchain device A can independently determine the storage duration or elapsed time of the data in the blockchain network. For example, the blockchain device A determines the storage duration or elapsed time of data in the blockchain network according to the pre-registration mode.
S202,区块链设备A将数据广播到区块链网络中;S202, the blockchain device A broadcasts the data to the blockchain network;
S203,区块链设备D确定要产生的区块的存储时长;S203. The blockchain device D determines a storage duration of the block to be generated.
具体地,在一些实施例中,区块链设备D获取到区块验证权,区块链设备D根据当前产生新区块时所有新的数据的存储时长确定当前产生的新区块的存储时长。这里需要说明的是,区块的存储时长指的是区块需要在区块链网络中被存储的时长或者区块中的数据需要在区块链网络中被存储的时长。Specifically, in some embodiments, the blockchain device D acquires the block verification right, and the blockchain device D determines the storage duration of the currently generated new block according to the storage duration of all new data when the new block is currently generated. It should be noted here that the storage duration of the block refers to the length of time that the block needs to be stored in the blockchain network or the length of time in which the data in the block needs to be stored in the blockchain network.
举例来说,如果区块链设备D确定上述所有新的数据的存储时长均相同,区块链设备D将所有新的数据的存储时长确定为要产生的区块的存储时长。如果上述所有新的数据的存储时长不相同,区块链设备D将存储时长最长的数据对应的存储时长确定为要产生的区块的存储时长。 For example, if the blockchain device D determines that the storage durations of all the new data described above are the same, the blockchain device D determines the storage duration of all new data as the storage duration of the tile to be generated. If the storage duration of all the above new data is different, the blockchain device D determines the storage duration corresponding to the data having the longest storage duration as the storage duration of the tile to be generated.
例如,假设有5个新的数据,分别标记为数据1、数据2、数据3、数据4和数据5,如果这5个数据的存储时长均为1小时,则区块链设备D确定要产生的区块的存储时长为1小时。但如果这5个数据的存储时长不完全相同,并且数据5的存储时长最长且存储时长为3小时,则区块链设备D将3小时确定为要产生的区块的存储时长。For example, suppose there are 5 new data, which are respectively labeled as data 1, data 2, data 3, data 4, and data 5. If the storage time of these 5 data is 1 hour, the blockchain device D determines that it is to be generated. The storage time of the block is 1 hour. However, if the storage duration of the five data is not completely the same, and the storage duration of the data 5 is the longest and the storage duration is 3 hours, the blockchain device D determines 3 hours as the storage duration of the tile to be generated.
具体地,在一些实施例中,区块链设备D获取到区块验证权,区块链设备D根据当前产生新区块时所有新的数据的消逝时间确定当前产生的新区块的消逝时间。这里需要说明的是,区块的消逝时间指的是区块需要在区块链网络中被删除的时间或者区块中的数据需要在区块链网络中被删除的时间。Specifically, in some embodiments, the blockchain device D acquires the block verification right, and the blockchain device D determines the elapsed time of the currently generated new block based on the elapsed time of all new data when the new block is currently generated. It should be noted here that the elapsed time of the block refers to the time when the block needs to be deleted in the blockchain network or the time in which the data in the block needs to be deleted in the blockchain network.
举例来说,如果区块链设备D确定上述所有新的数据的消逝时间均相同,区块链设备D将所有新的数据的消逝时间确定为要产生的区块的消逝时间。如果上述所有新的数据的消逝时间不相同,区块链设备D将消逝时间最晚的数据对应的消逝时间确定为要产生的区块的消逝时间。For example, if the blockchain device D determines that the elapsed time of all of the above new data is the same, the blockchain device D determines the elapsed time of all new data as the elapsed time of the block to be generated. If the elapsed time of all the above new data is different, the block chain device D determines the elapsed time corresponding to the latest data of the elapsed time as the elapsed time of the block to be generated.
例如,假设有5个新的数据,分别标记为数据1、数据2、数据3、数据4和数据5,如果这5个数据的消逝时间均为20:00,则区块链设备D确定要产生的区块的消逝时间为20:00。但如果这5个数据的消逝时间不完全相同,并且数据5的消逝时间最晚且消逝时间为上午12点,则区块链设备D将上午12点确定为要产生的区块的消逝时间。For example, suppose there are 5 new data, labeled as Data 1, Data 2, Data 3, Data 4, and Data 5. If the elapsed time of these 5 data is 20:00, the blockchain device D determines that The elapsed time of the generated block is 20:00. However, if the elapsed time of the five data is not completely the same, and the elapsed time of the data 5 is the latest and the elapsed time is 12 o'clock in the morning, the block chain device D determines the 12 o'clock in the morning as the elapsed time of the block to be generated.
S204,区块链设备D将产生的区块连接到区块链上,之后将区块链广播到区块链网络中;S204, the blockchain device D connects the generated block to the blockchain, and then broadcasts the blockchain to the blockchain network;
S205,区块链设备C确定区块链网络中的待删除区块,执行删除相关操作;S205, the blockchain device C determines the to-be-deleted block in the blockchain network, and performs a deletion-related operation;
具体地,在一些实施例中,如果区块链节点C获取到区块认证权,区块链设备C可以采用方法100中描述的方法确定区块链网络中的待删除区块,执行删除相关操作。Specifically, in some embodiments, if the block chain node C acquires the block authentication right, the blockchain device C may determine the to-be-deleted block in the blockchain network by using the method described in the method 100, and perform deletion related. operating.
S206,区块链设备C在区块链网络中广播生成的区块链。S206. The blockchain device C broadcasts the generated blockchain in the blockchain network.
具体地,在一些实施例中,在区块链设备C采用方法100中描述的方法确定区块链网络中的待删除区块时,也可以执行方法100中的相关方法,以实现待删除区块的删除。Specifically, in some embodiments, when the blockchain device C determines the to-be-deleted block in the blockchain network by using the method described in the method 100, the related method in the method 100 may also be performed to implement the to-be-deleted region. The deletion of the block.
可选地,在S206中,区块链设备C生成的区块链可以是在接收到的区块链的基础上删除掉待删除区块并增加区块链设备C生成的区块的区块链,也可以是将待删除区块的区块信息和删除认证次数记录在接收到的区块链中,并在此基础上增加区块链设备C生成的区块得到的区块链。Optionally, in S206, the blockchain generated by the blockchain device C may be a block that deletes the to-be-deleted block and increases the block generated by the blockchain device C on the basis of the received blockchain. The chain may also record the block information of the block to be deleted and the number of deletion authentications in the received blockchain, and on the basis of this, add the blockchain obtained by the block generated by the blockchain device C.
可选地,在S206中,区块链设备C生成区块时,可以在区块中在区块中携带区块信息和删除时间信息,例如在区块的区块头中携带区块信息和删除时间信息。区块信息用于指示被删除的区块,删除时间信息用于指示被删除的区块的删除时刻,或删除时间信息用于指示被删除区块中包括的数据的删除时刻。Optionally, in S206, when the blockchain device C generates the block, the block information and the deletion time information may be carried in the block in the block, for example, carrying the block information and deleting in the block header of the block. Time information. The block information is used to indicate the deleted block, the deletion time information is used to indicate the deletion time of the deleted block, or the deletion time information is used to indicate the deletion time of the data included in the deleted block.
进一步地,区块链设备C可以将被删除的区块或者被删除的区块中包括的数据发送到一个或多个存储设备,在一定时间后,存储设备将这些数据删除。上述的一个或多个存储设备可以是区块链网络中的存储设备,也可以是区块链网络之外的存储设备。数据在存储设备中的存储时长可以由区块链设备C确定并且在向存储设备发送数据的同时将数据的存储时长发送给存储设备。Further, the blockchain device C may send the deleted block or the data included in the deleted block to one or more storage devices, and after a certain time, the storage device deletes the data. The one or more storage devices described above may be storage devices in a blockchain network, or may be storage devices outside the blockchain network. The storage duration of the data in the storage device may be determined by the blockchain device C and the storage duration of the data is transmitted to the storage device while the data is being transmitted to the storage device.
可选地,作为另一个例子,区块链网络中存在多个不同类型的区块链,区块设备在生成区块时,确定区块对应的区块链,将生成的区块连接到确定的区块链上。例如,不同的 区块链对应不同的存储时长,区块链设备C在生成区块时根据区块的存储时长确定区块对应的区块链。Optionally, as another example, a plurality of different types of blockchains exist in the blockchain network, and when the block device generates the block, determine the blockchain corresponding to the block, and connect the generated block to the determined block. On the blockchain. For example, different The blockchain corresponds to different storage durations, and the blockchain device C determines the blockchain corresponding to the block according to the storage duration of the block when generating the block.
举例来说,区块链中存储在3条区块链,分别为区块链1、区块链2和区块链3。区块链1中区块的存储时长小于或等于1小时,区块链2中区块的存储时长大于1小时且小于3小时,区块链3中的区块的存储时长大于或等于3小时。如果区块链设备C确定产生的区块的存储时长为2小时,则区块链设备C将产生的区块连接到区块链2上。并且区块链设备C确定区块的存储时长的方法和上述区块链D确定区块的存储时长的方法相同,在此不再赘述。For example, the blockchain is stored in three blockchains, namely blockchain 1, blockchain 2, and blockchain 3. The storage duration of the block in the blockchain 1 is less than or equal to 1 hour, the storage duration of the block in the blockchain 2 is greater than 1 hour and less than 3 hours, and the storage duration of the block in the blockchain 3 is greater than or equal to 3 hours. . If the blockchain device C determines that the generated block has a storage duration of 2 hours, the blockchain device C connects the generated block to the blockchain 2. The method for determining the storage duration of the block by the blockchain device C is the same as the method for determining the storage duration of the block by the blockchain D, and details are not described herein again.
或者,区块链中存储在3条区块链,分别为区块链1、区块链2和区块链3。区块链1中区块的消逝时间在上午12点之前,区块链2中区块的消逝时间在上午12点之后且在晚上8点之前,区块链3中的区块的消逝时间在晚上8点之后且在24点之前。如果区块链设备C确定产生的区块的消逝时间为下午5点,则区块链设备C将产生的区块连接到区块链2上。并且区块链设备C确定区块的消逝时间的方法和上述区块链D确定区块的消逝时间的方法相同,在此不再赘述。Alternatively, the blockchain is stored in three blockchains, namely, blockchain 1, blockchain 2, and blockchain 3. The elapsed time of the block in blockchain 1 is before 12 o'clock in the morning, and the elapsed time of the block in blockchain 2 is after 12 o'clock in the morning and before 8 o'clock in the evening, the elapsed time of the block in blockchain 3 is After 8 pm and before 24 pm. If the block chain device C determines that the elapsed time of the generated block is 5 pm, the block chain device C connects the generated block to the block chain 2. And the method for determining the elapsed time of the block by the block chain device C is the same as the method for determining the elapsed time of the block by the block chain D, and details are not described herein again.
在本申请实施例中,可选地,区块链设备A产生的需要在区块链网络中进行认证的数据可以是其他设备发送给区块链设备A的。如图5所示出的,方法300包括:In the embodiment of the present application, optionally, the data generated by the blockchain device A that needs to be authenticated in the blockchain network may be sent by other devices to the blockchain device A. As shown in FIG. 5, method 300 includes:
S301,物联网设备A产生需要在区块链网络中进行认证的数据;S301, the Internet of Things device A generates data that needs to be authenticated in the blockchain network;
需要说明的是,物联网设备A不是区块链网络中的设备,或者说物联网设备A本身不直接参与区块链。It should be noted that the Internet of Things device A is not a device in the blockchain network, or the IoT device A itself does not directly participate in the blockchain.
可选地,物联网设备A产生的需要在区块链网络中进行认证的数据是物联网设备A和物联网设备B之间的交易数据。物联网设备A可以和物联网设备B进行协商,对交易数据的存储时长或消逝时间达成一致,确定交易数据在区块链网络中的存储时长或消逝时间。例如,物联网设备A可以是智能洗衣机,智能洗衣机可以从智能售货机处自动购买洗衣液,在此交易过程中产生的数据为交易数据。智能洗衣机可以和智能售货机协商交易数据的存储时长或消逝时间。Optionally, the data generated by the Internet of Things device A that needs to be authenticated in the blockchain network is transaction data between the Internet of Things device A and the Internet of Things device B. The Internet of Things device A can negotiate with the IoT device B to agree on the storage duration or elapsed time of the transaction data, and determine the storage duration or elapsed time of the transaction data in the blockchain network. For example, the Internet of Things device A may be a smart washing machine, and the smart washing machine may automatically purchase laundry detergent from the smart vending machine, and the data generated during the transaction is transaction data. The smart washing machine can negotiate with the smart vending machine for the storage duration or elapsed time of the transaction data.
或者,物联网设备A产生的需要在区块链网络中进行认证的数据只涉及物联网设备A自身的行为,例如,物联网设备A为家里的用于检测PM2.5的空气净化器。则物联网设备A可以自己确定数据在区块链网络中的存储时长或消逝时长。例如,物联网设备A根据预签约模式确定数据在区块链网络中的存储时长或消逝时长。Alternatively, the data generated by the Internet of Things device A that needs to be authenticated in the blockchain network only relates to the behavior of the IoT device A itself. For example, the Internet of Things device A is an air purifier for detecting PM2.5 at home. Then, the Internet of Things device A can determine the storage duration or elapsed time of the data in the blockchain network. For example, the IoT device A determines the storage duration or elapsed time of data in the blockchain network according to the pre-registration mode.
S302,物联网设备A将需要在区块链网络中进行认证的数据发送给区块链设备A;S302, the Internet of Things device A sends the data that needs to be authenticated in the blockchain network to the blockchain device A;
具体地,在一些实施例中,物联网设备A将数据和确定的该数据的存储时长或消逝时长发送给区块链设备A。Specifically, in some embodiments, the IoT device A transmits the data and the determined storage duration or elapsed duration of the data to the blockchain device A.
可选地,作为一个例子,物联网设备A在将数据发送给区块链设备A之前,物联网设备A与区块链设备A之间建立通信连接。例如,物联网设备A可以在接收到区块链设备A发送的公钥信息之后,向区块链设备A发送接入消息,区块链设备A接收到物联网设备A发送的接入消息之后,判断是否能够与物联网设备A建立通信连接。如果可以,区块链设备A向物联网设备A发送反馈信息,至此物联网设备A和区块链设备A之间建立通信连接。Alternatively, as an example, the IoT device A establishes a communication connection between the IoT device A and the blockchain device A before transmitting the data to the blockchain device A. For example, the IoT device A may send an access message to the blockchain device A after receiving the public key information sent by the blockchain device A, and the blockchain device A receives the access message sent by the IoT device A. , to determine whether it is possible to establish a communication connection with the Internet of Things device A. If possible, the blockchain device A sends feedback information to the IoT device A, and a communication connection is established between the IoT device A and the blockchain device A.
可选地,在S302中,物联网设备A在将数据发送给区块链设备A时,将自己确定的 或者通过与物联网设备B协商确定的数据需要在存储设备中存储的存储时长或消逝时间也一起发送给区块链设备A,使得区块链设备A在将数据发给存储设备时,将这个存储时长或消逝时间一起发送给存储设备。Optionally, in S302, the IoT device A determines the self when it sends the data to the blockchain device A. Or the storage duration or elapsed time stored in the storage device by the data negotiated with the Internet of Things device B is also sent to the blockchain device A together, so that the blockchain device A sends the data to the storage device. The storage duration or elapsed time is sent to the storage device together.
S303,执行方法200中S202及其后续步骤。S303. Perform S200 in the method 200 and subsequent steps.
以上结合图1至图5详细描述了本申请实施例的基于区块链的数据处理方法,下面将结合图6详细描述根据本申请的设备,如图6所示,设备10包括:The blockchain-based data processing method of the embodiment of the present application is described in detail above with reference to FIG. 1 to FIG. 5. The device according to the present application will be described in detail below with reference to FIG. 6. As shown in FIG. 6, the device 10 includes:
处理模块11,用于确定区块链网络中的待删除区块,所述设备为所述区块链网络中的设备;The processing module 11 is configured to determine a to-be-deleted block in the blockchain network, where the device is a device in the blockchain network;
删除操作执行模块12,用于执行删除相关操作,以删除所述待删除区块。The deletion operation execution module 12 is configured to perform a deletion related operation to delete the to-be-deleted block.
因此,根据根据本申请实施例的设备确定区块链网络中的待删除区块之后执行删除相关操作,实现待删除区块的删除。由此,能够降低区块链网络中的负载和区块链的传输所需的带宽。Therefore, the deleting related operation is performed after determining the to-be-deleted block in the blockchain network according to the device according to the embodiment of the present application, and deleting the to-be-deleted block is implemented. Thereby, it is possible to reduce the bandwidth required for the load in the blockchain network and the transmission of the blockchain.
在本申请实施例中,可选地,所述处理模块11具体用于:In the embodiment of the present application, optionally, the processing module 11 is specifically configured to:
确定所述区块链网络中的区块的存储时长或消逝时间;Determining a storage duration or elapsed time of a block in the blockchain network;
根据所述存储时长或所示消逝时间,确定所述待删除区块。The to-be-deleted block is determined according to the storage duration or the elapsed time shown.
在本申请实施例中,可选地,所述处理模块11具体用于:确定当前时刻与连续K个第一区块中的第i个第一区块的生成时刻之间的时间间隔大于或等于所述第i个第一区块的存储时长,所述第i个区块的存储时长用于指示所述第i个第一区块或所述第i个第一区块中包括的数据需要在所述区块链网络中被存储的时长,K为大于或等于1的正整数,i=1,…K;将所述K个第一区块确定为待删除区块。In the embodiment of the present application, the processing module 11 is specifically configured to: determine that a time interval between a current time and a generation time of the i th first block in the consecutive K first blocks is greater than or And a storage duration of the i-th first block, where the storage duration of the i-th block is used to indicate data included in the i-th first block or the i-th first block The length of time that needs to be stored in the blockchain network, K is a positive integer greater than or equal to 1, i=1, . . . K; the K first blocks are determined as blocks to be deleted.
在本申请实施例中,可选地,所述处理模块11具体用于:确定当前时间为连续K个第一区块中的第i个第一区块的消逝时间,或者当前时间晚于所述K个第一区块中的第i个第一区块的消逝时间,所述第i个第一区块的消逝时间用于指示所述第一区块或所述第一区块中包括的数据需要在所述区块链网络中被删除的时间,K为大于或等于1的正整数,i=1,…K;将所述K个第一区块确定为待删除区块。In the embodiment of the present application, the processing module 11 is specifically configured to: determine that the current time is the elapsed time of the i th first block in the consecutive K first blocks, or the current time is later than An elapsed time of the i th first block in the K first blocks, where an elapsed time of the i th first block is used to indicate that the first block or the first block is included The data needs to be deleted in the blockchain network, K is a positive integer greater than or equal to 1, i = 1, ... K; the K first blocks are determined as blocks to be deleted.
在本申请实施例中,可选地,所述删除操作执行模块12具体用于:删除所述K个第一区块;或,设置所述K个第一区块的删除认证次数的初始值,并向所述区块链网络中的设备发送第一区块信息和所述K个第一区块的删除认证次数,所述第一区块信息用于指示所述K个第一区块,以便于所述区块链网络中的设备在确定所述K个第一区块的删除认证次数为第一预设值时,删除所述K个第一区块。In the embodiment of the present application, the deletion operation execution module 12 is specifically configured to: delete the K first blocks; or set an initial value of the deletion authentication times of the K first blocks. Transmitting, to the device in the blockchain network, the first block information and the number of deletion authentications of the K first blocks, where the first block information is used to indicate the K first blocks The device in the blockchain network is configured to delete the K first blocks when determining that the number of deletion authentications of the K first blocks is a first preset value.
在本申请实施例中,可选地,在所述处理模块11确定当前时刻与连续K个第一区块中的第i个第一区块的生成时刻之间的时间间隔大于或等于所述第i个第一区块的存储时长之前,所述处理模块11还用于:确定所述K个第一区块中存在生成时刻与当前时刻的时间间隔小于区块的存储时长的第一区块;In the embodiment of the present application, optionally, the processing module 11 determines that a time interval between a current time and a generation time of the i th first block in the consecutive K first blocks is greater than or equal to the The processing module 11 is further configured to: determine, in the K first blocks, that the time interval between the generated time and the current time is less than the storage time of the block in the first block of the ith first block Piece;
所述删除操作执行模块12,还用于删除所述生成时刻与当前时刻的时间间隔小于区块的存储时长的第一区块中包括的数据。The deletion operation execution module 12 is further configured to delete data included in the first block where the time interval between the generation time and the current time is less than the storage duration of the block.
在本申请实施例中,可选地,在确定当前时间为连续K个第一区块中的第i个第一区块的消逝时间,或者当前时间晚于所述K个第一区块中的第i个第一区块的消逝时间之前,所述处理模块11还用于:确定所述K个第一区块中存在消逝时间早于当前时间的第一区 块,K为大于或等于1的正整数,i=1,…K;所述删除操作执行模块12,还用于删除所述消逝时间早于当前时间的第一区块中包括的数据。In the embodiment of the present application, optionally, determining that the current time is an elapsed time of the i th first block in the consecutive K first blocks, or the current time is later than the K first blocks The processing module 11 is further configured to: determine that the first region of the K first blocks has an elapsed time earlier than the current time, before the elapsed time of the i-th first block The block, K is a positive integer greater than or equal to 1, i=1, . . . K; the deletion operation execution module 12 is further configured to delete data included in the first block whose elapsed time is earlier than the current time.
在本申请实施例中,可选地,所述处理模块11具体用于:确定区块链中承载有第一区块信息和删除认证次数,所述第一区块信息用于指示连续K个第一区块,所述删除认证次数用于指示所述K个第一区块在所述区块链网络中的删除认证次数,K为大于或等于1的正整数;将所述K个第一区块确定为待删除区块。In the embodiment of the present application, the processing module 11 is specifically configured to: determine that the first block information is carried in the blockchain, and delete the number of authentication times, where the first block information is used to indicate consecutive K The first block, the number of deletion authentications is used to indicate the number of deletion authentications of the K first blocks in the blockchain network, and K is a positive integer greater than or equal to 1; A block is determined as the block to be deleted.
在本申请实施例中,可选地,所述删除认证次数的取值为第一预设值;In the embodiment of the present application, optionally, the value of the deletion authentication number is a first preset value;
其中,所述删除操作执行模块12具体用于:删除所述K个第一区块。The deleting operation execution module 12 is specifically configured to: delete the K first blocks.
在本申请实施例中,可选地,所述删除认证次数的取值小于第一预设值;In the embodiment of the present application, optionally, the value of the deletion authentication number is smaller than the first preset value;
其中,所述删除操作执行模块12具体用于:在将所述删除认证次数的取值增加1之后,向所述区块链网络中的设备发送所述第一区块信息和所述删除认证次数,以便于所述区块链网络中的设备在确定所述K个第一区块的删除认证次数为所述第一预设值时,删除所述K个第一区块。The deleting operation execution module 12 is specifically configured to: after the value of the deletion authentication number is increased by 1, send the first block information and the deletion authentication to a device in the blockchain network. The number of times, so that the devices in the blockchain network delete the K first blocks when determining that the number of deletion authentications of the K first blocks is the first preset value.
在本申请实施例中,可选地,在所述删除操作执行模块删除所述K个第一区块之后,所述处理模块11还用于:确定当前时刻与连续L个第二区块中第j个第二区块的生成时刻之间的时间间隔大于或等于第j个第二区块的存储时长,所述L个第二区块为生成时刻晚于所述K个第一区块,且与所述L个第一区块相邻的区块,L为大于或等于1的正整数,j=1,…L;In the embodiment of the present application, optionally, after the deleting operation execution module deletes the K first blocks, the processing module 11 is further configured to: determine the current time and the consecutive L second blocks. The time interval between the generation moments of the jth second block is greater than or equal to the storage duration of the jth second block, and the L second blocks are generated later than the K first blocks And a block adjacent to the L first blocks, L is a positive integer greater than or equal to 1, j=1, . . . L;
所述删除操作执行模块12,还用于删除所述L个第二区块;或,设置所述L个第二区块的删除认证次数的初始值,并向所述区块链网络中的设备发送第二区块信息和所述L个第二区块的删除认证次数,所述第二区块信息用于指示所述L个第二区块,以便于所述区块链网络中的设备在确认所述L个第二区块的删除认证次数为所述第一预设值时,删除所述L个第二区块。The deletion operation execution module 12 is further configured to delete the L second blocks; or set an initial value of the deletion authentication times of the L second blocks, and to the blockchain network The device sends the second block information and the number of deletion authentications of the L second blocks, where the second block information is used to indicate the L second blocks, so as to be in the blockchain network. When the device confirms that the number of deletion authentications of the L second blocks is the first preset value, the device deletes the L second blocks.
在本申请实施例中,可选地,所述处理模块11还用于:生成第三区块,所述第三区块中携带所述第三区块的存储时长,所述第三区块的存储时长用于指示所述第三区块或所述第三区块中包括的数据需要在所述区块链网络中被存储的时长。In the embodiment of the present application, the processing module 11 is further configured to: generate a third block, where the third block carries a storage duration of the third block, and the third block The storage duration is used to indicate the length of time that the data included in the third block or the third block needs to be stored in the blockchain network.
在本申请实施例中,可选地,所述第三区块的区块头中包括所述第三区块的存储时长。In the embodiment of the present application, optionally, the block header of the third block includes a storage duration of the third block.
在本申请实施例中,可选地,所述第三区块中包括第二设备发送的数据;In the embodiment of the present application, optionally, the third block includes data sent by the second device;
其中,在所述生成第三区块之前,所述处理模块11还用于:接收第二设备发送的数据和所述数据的第一存储时长,所述第二设备为所述区块链网络中的设备,所述第一存储时长用于指示所述第二设备确定的所述数据需要在所述区块链网络中被存储的时长;根据所述第一存储时长,确定所述第三区块的存储时长。The processing module 11 is further configured to: receive data sent by the second device and a first storage duration of the data, where the second device is the blockchain network, before the generating the third block The first storage duration is used to indicate a length of time that the data determined by the second device needs to be stored in the blockchain network; and the third is determined according to the first storage duration The storage duration of the block.
在本申请实施例中,可选地,所述第一存储时长是由所述第二设备通过与第三设备进行协商确定的,所述第三设备为所述区块链网络中的设备。In the embodiment of the present application, optionally, the first storage duration is determined by the second device by negotiating with a third device, where the third device is a device in the blockchain network.
在本申请实施例中,可选地,所述第一存储时长是所述第二设备根据第二存储时长确定的,所述第二存储时长是由第四设备确定的所述数据需要在所述区块链网络中被存储的时长,所述第四设备为所述区块链网络之外的设备。In the embodiment of the present application, optionally, the first storage duration is determined by the second device according to a second storage duration, where the second storage duration is determined by the fourth device. The duration of time stored in the blockchain network, the fourth device being a device outside the blockchain network.
在本申请实施例中,可选地,所述第二存储时长是由所述第四设备通过与第五设备进行协商确定的,所述第五设备为所述区块链网络之外的设备。 In the embodiment of the present application, optionally, the second storage duration is determined by the fourth device by negotiating with the fifth device, where the fifth device is a device other than the blockchain network. .
在本申请实施例中,可选地,所述处理模块11还用于:确定所述第三区块所属的区块链;将所述第三区块加入到所述区块链中。In the embodiment of the present application, the processing module 11 is further configured to: determine a blockchain to which the third block belongs; and add the third block to the blockchain.
在本申请实施例中,可选地,所述处理模块11具体用于:根据所述第三区块的存储时长和预设对应关系,确定所述第三区块所属的区块链,所述预设对应关系为区块的存储时长和区块链的对应关系。In the embodiment of the present application, the processing module 11 is specifically configured to: determine, according to the storage duration and the preset correspondence relationship of the third block, a blockchain to which the third block belongs. The preset correspondence relationship is the correspondence between the storage duration of the block and the blockchain.
在本申请实施例中,可选地,所述区块链中携带所述区块链的标识。In the embodiment of the present application, optionally, the identifier of the blockchain is carried in the blockchain.
在本申请实施例中,可选地,所述处理模块11还用于:生成第四区块,所述第四区块的区块头中包括第三区块信息和删除时间信息,其中,所述第三区块信息用于指示被删除的区块,所述删除时间信息用于指示被删除区块的删除时刻,或所述删除时间信息用于指示被删除区块中包括的数据的删除时刻。In the embodiment of the present application, the processing module 11 is further configured to: generate a fourth block, where the block header of the fourth block includes third block information and deletion time information, where The third block information is used to indicate the deleted block, the deletion time information is used to indicate the deletion time of the deleted block, or the deletion time information is used to indicate the deletion of the data included in the deleted block. time.
在本申请实施例中,可选地,所述处理模块11还用于:向所述区块链网络中的存储设备或所述区块链网络之外的存储设备发送被删除的区块或被删除的区块中包括的数据。In the embodiment of the present application, the processing module 11 is further configured to: send the deleted block to a storage device in the blockchain network or a storage device outside the blockchain network or The data included in the deleted block.
在本申请实施例中,可选地,所述处理模块11还用于:向所述区块链网络中的存储设备或所述区块链网络之外的存储设备发送第三存储时长,所述第三存储时长为所述被删除的区块或所述被删除的区块中的包括的数据需要在所述区块链网络中的存储设备或所述区块链网络之外的存储设备中被存储的时长。In the embodiment of the present application, the processing module 11 is further configured to: send a third storage duration to a storage device in the blockchain network or a storage device outside the blockchain network, where The third storage duration is that the deleted block or the included data in the deleted block requires a storage device in the blockchain network or a storage device outside the blockchain network. The length of time that is stored.
应理解,本发明实施例中的设备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 be used to perform various processes and/or steps in the foregoing method embodiments. To avoid repetition, details are not described herein.
图7示出了根据本申请另一实施例的设备的示意性框图。如图7所示,设备20包括:FIG. 7 shows a schematic block diagram of a device in accordance with another embodiment of the present application. As shown in Figure 7, device 20 includes:
处理模块21,用于获取数据,所述设备为区块链网络中的设备;The processing module 21 is configured to acquire data, where the device is a device in a blockchain network;
所述处理模块21,还用于确定所述数据的第一存储时长,所述数据的第一存储时长用于指示所述设备确定的所述数据需要在所述区块链网络中被存储的时长;The processing module 21 is further configured to determine a first storage duration of the data, where a first storage duration of the data is used to indicate that the data determined by the device needs to be stored in the blockchain network. duration;
收发模块23,用于向所述区块链网络中的设备发送所述数据和所述第一存储时长,所述第一存储时长用于确定包含所述数据的第三区块的存储时长,所述第三区块的存储时长用于指示所述第三区块或所述第三区块中包括的所述数据需要在所述区块链网络中被存储的时长。The transceiver module 23 is configured to send the data and the first storage duration to a device in the blockchain network, where the first storage duration is used to determine a storage duration of a third block that includes the data, The storage duration of the third block is used to indicate a length of time in which the data included in the third block or the third block needs to be stored in the blockchain network.
因此,根据本申请实施例的设备确定获取到的数据的存储时长之后,将获取到的数据和确定的数据的存储时长发送给区块链网络中的设备,使得区块链网络中的设备能够根据该设备确定的存储时长确定包含所述数据的区块的存储时长。由此,区块链网络中的设备可以根据包含所述数据的区块的存储时长确定这个区块是待删除区块时执行删除相关操作,实现待删除区块的删除。由此,能够降低区块链网络中的负载和区块链的传输所需的带宽。Therefore, after the device according to the embodiment of the present application determines the storage duration of the acquired data, the acquired data and the storage duration of the determined data are sent to the device in the blockchain network, so that the device in the blockchain network can The storage duration of the block containing the data is determined according to the storage duration determined by the device. Therefore, the device in the blockchain network can perform the delete related operation when the block is to be deleted according to the storage duration of the block containing the data, and delete the block to be deleted. Thereby, it is possible to reduce the bandwidth required for the load in the blockchain network and the transmission of the blockchain.
在本申请实施例中,可选地,所述处理模块21具体用于:与第三设备进行协商,确定所述第一存储时长,所述第三设备为所述区块链网络中的设备。In the embodiment of the present application, the processing module 21 is specifically configured to: negotiate with a third device to determine the first storage duration, and the third device is a device in the blockchain network. .
在本申请实施例中,可选地,所述处理模块21具体用于:接收第四设备发送的所述数据和第二存储时长,所述第二存储时长为第四设备确定的所述数据需要在所述区块链网络中被存储的时长,所述第四设备为所述区块链网络之外的设备;根据所述第二存储时长,确定所述第一存储时长。 In the embodiment of the present application, the processing module 21 is specifically configured to: receive the data sent by the fourth device, and the second storage duration, where the second storage duration is the data determined by the fourth device. The length of time required to be stored in the blockchain network, the fourth device being a device outside the blockchain network; determining the first storage duration according to the second storage duration.
在本申请实施例中,可选地,所述第二存储时长是由所述第四设备通过与第五设备进行协商确定的,所述第五设备为所述区块链网络之外的设备。In the embodiment of the present application, optionally, the second storage duration is determined by the fourth device by negotiating with the fifth device, where the fifth device is a device other than the blockchain network. .
应理解,本发明实施例中的设备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 be used to perform various processes and/or steps in the foregoing method embodiments. To avoid repetition, details are not described herein.
图8示出了根据本申请再一实施例的设备。如图8所示,设备100包括处理器110和收发器120,处理器110和收发器120相连,可选地,该设备100还包括存储器130,存储器130与处理器110相连。其中,处理器110、存储器130和收发器120可以通过内部连接通路互相通信。其中,处理器110,用于确定区块链网络中的待删除区块,所述设备为所述区块链网络中的设备;处理器110,还用于执行删除相关操作,以删除所述待删除区块。FIG. 8 shows an apparatus in accordance with still another embodiment of the present application. As shown in FIG. 8, 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 determine a to-be-deleted block in the blockchain network, where the device is a device in the blockchain network, and the processor 110 is further configured to perform a delete related operation to delete the The block to be deleted.
因此,根据根据本申请实施例的设备确定区块链网络中的待删除区块之后执行删除相关操作,实现待删除区块的删除。由此,能够降低区块链网络中的负载和区块链的传输所需的带宽。Therefore, the deleting related operation is performed after determining the to-be-deleted block in the blockchain network according to the device according to the embodiment of the present application, and deleting the to-be-deleted block is implemented. Thereby, it is possible to reduce the bandwidth required for the load in the blockchain network and the transmission of the blockchain.
根据本申请实施例的设备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.
图9示出了根据本申请再一实施例的设备的示意性框图,如图9所示,设备200包括:处理器210和收发器220,处理器210和收发器220相连,可选地,所述设备200还包括存储器230,存储器230与处理器210相连。其中,处理器210、存储器230和收发器220可以通过内部连接通路互相通信。其中,所述处理器210,用于获取数据,所述设备为区块链网络中的设备;所述收发器220,还用于确定所述数据的第一存储时长,所述数据的第一存储时长用于指示所述设备确定的所述数据需要在所述区块链网络中被存储的时长;所述收发器220,用于向所述区块链网络中的设备发送所述数据和所述第一存储时长,所述第一存储时长用于确定包含所述数据的第三区块的存储时长,所述第三区块的存储时长用于指示所述第三区块或所述第三区块中包括的所述数据需要在所述区块链网络中被存储的时长。FIG. 9 is a schematic block diagram of a device according to still another embodiment of the present application. As shown in FIG. 9, the device 200 includes a processor 210 and a transceiver 220. The processor 210 is connected to the transceiver 220, 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 acquire data, where the device is a device in a blockchain network, and the transceiver 220 is further configured to determine a first storage duration of the data, where the data is first. The storage duration is used to indicate the length of time that the data determined by the device needs to be stored in the blockchain network; the transceiver 220 is configured to send the data and the device in the blockchain network The first storage duration, the first storage duration is used to determine a storage duration of a third block that includes the data, and a storage duration of the third block is used to indicate the third block or the The data included in the third block needs to be stored in the blockchain network for the length of time.
因此,根据本申请实施例的设备确定获取到的数据的存储时长之后,将获取到的数据和确定的数据的存储时长发送给区块链网络中的设备,使得区块链网络中的设备能够根据该设备确定的存储时长确定包含所述数据的区块的存储时长。由此,区块链网络中的设备可以根据包含所述数据的区块的存储时长确定这个区块是待删除区块时执行删除相关操作,实现待删除区块的删除。由此,能够降低区块链网络中的负载和区块链的传输所需的带宽。Therefore, after the device according to the embodiment of the present application determines the storage duration of the acquired data, the acquired data and the storage duration of the determined data are sent to the device in the blockchain network, so that the device in the blockchain network can The storage duration of the block containing the data is determined according to the storage duration determined by the device. Therefore, the device in the blockchain network can perform the delete related operation when the block is to be deleted according to the storage duration of the block containing the data, and delete the block to be deleted. Thereby, it is possible to reduce the bandwidth required for the load in the blockchain network and the transmission of the blockchain.
根据本申请实施例的设备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.
可以理解,本申请实施例中的处理器可以是一种集成电路芯片,具有信号的处理能力。上述的处理器可以是通用处理器、数字信号处理器(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 above processor may be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), or an off-the-shelf programmable gate array (Field). Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component. 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 SDRAM (DDR SDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Synchronous Connection Dynamic Random Access Memory (Synchlink DRAM, SLDRAM) ) and direct memory bus random access memory (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盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随 机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。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, which is essential or contributes to the prior art, or a part of the technical solution, may be embodied in the form of a software product, which is stored in a storage medium, including The instructions are used 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), and a A device that can store program code, such as a random access memory (RAM), a disk, or an optical disk.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应所述以权利要求的保护范围为准。 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 (55)

  1. 一种基于区块链的数据处理方法,其特征在于,包括:A blockchain-based data processing method, comprising:
    第一设备确定区块链网络中的待删除区块,所述第一设备为所述区块链网络中的设备;Determining, by the first device, a to-be-deleted block in the blockchain network, where the first device is a device in the blockchain network;
    所述第一设备执行删除相关操作,以删除所述待删除区块。The first device performs a delete related operation to delete the to-be-deleted block.
  2. 根据权利要求1所述的方法,其特征在于,所述第一设备确定区块链网络中的待删除区块,包括:The method according to claim 1, wherein the determining, by the first device, the to-be-deleted block in the blockchain network comprises:
    所述第一设备确定所述区块链网络中的区块的存储时长或消逝时间;Determining, by the first device, a storage duration or an elapsed time of a block in the blockchain network;
    所述第一设备根据所述存储时长或所述消逝时间,确定所述待删除区块。The first device determines the to-be-deleted block according to the storage duration or the elapsed time.
  3. 根据权利要求2所述的方法,其特征在于,所述第一设备根据所述存储时长,确定所述待删除区块,包括:The method according to claim 2, wherein the determining, by the first device, the to-be-deleted block according to the storage duration comprises:
    所述第一设备确定当前时刻与连续K个第一区块中的第i个第一区块的生成时刻之间的时间间隔大于或等于所述第i个第一区块的存储时长,所述第i个区块的存储时长用于指示所述第i个第一区块或所述第i个第一区块中包括的数据需要在所述区块链网络中被存储的时长,K为大于或等于1的正整数,i=1,…K;Determining, by the first device, a time interval between a current time and a generation time of the i th first block in the consecutive K first blocks is greater than or equal to a storage duration of the i th first block, The storage duration of the i-th block is used to indicate the length of time that the data included in the i-th first block or the i-th first block needs to be stored in the blockchain network, K Is a positive integer greater than or equal to 1, i = 1, ... K;
    所述第一设备将所述K个第一区块确定为待删除区块。The first device determines the K first blocks as blocks to be deleted.
  4. 根据权利要求2所述的方法,其特征在于,所述第一设备根据所述消逝时间,确定所述待删除区块,包括:The method according to claim 2, wherein the determining, by the first device, the to-be-deleted block according to the elapsed time comprises:
    所述第一设备确定当前时间为连续K个第一区块中的第i个第一区块的消逝时间,或者当前时间晚于所述K个第一区块中的第i个第一区块的消逝时间,所述第i个第一区块的消逝时间用于指示所述第一区块或所述第一区块中包括的数据需要在所述区块链网络中被删除的时间,K为大于或等于1的正整数,i=1,…K;Determining, by the first device, that the current time is an elapsed time of the i th first block in the consecutive K first blocks, or the current time is later than the i th first area in the K first blocks The elapsed time of the block, the elapsed time of the i-th first block is used to indicate when the data included in the first block or the first block needs to be deleted in the blockchain network , K is a positive integer greater than or equal to 1, i = 1, ... K;
    所述第一设备将所述K个第一区块确定为待删除区块。The first device determines the K first blocks as blocks to be deleted.
  5. 根据权利要求3或4所述的方法,其特征在于,所述第一设备执行删除相关操作,包括:The method according to claim 3 or 4, wherein the first device performs a deletion related operation, including:
    所述第一设备删除所述K个第一区块;或,The first device deletes the K first blocks; or
    所述第一设备设置所述K个第一区块的删除认证次数的初始值,并向所述区块链网络中的设备发送第一区块信息和所述K个第一区块的删除认证次数,所述第一区块信息用于指示所述K个第一区块,以便于所述区块链网络中的设备在确定所述K个第一区块的删除认证次数为第一预设值时,删除所述K个第一区块。The first device sets an initial value of the number of deletion authentication times of the K first blocks, and sends the first block information and the deletion of the K first blocks to devices in the blockchain network. The number of times of authentication, the first block information is used to indicate the K first blocks, so that the device in the blockchain network determines that the number of deletion authentications of the K first blocks is the first When the preset value is used, the K first blocks are deleted.
  6. 根据权利要求3或5所述的方法,其特征在于,在所述第一设备确定当前时刻与连续K个第一区块中的第i个第一区块的生成时刻之间的时间间隔大于或等于所述第i个第一区块的存储时长之前,所述方法还包括:The method according to claim 3 or 5, wherein the time interval between the current time and the generation time of the i-th first block in the consecutive K first blocks is greater than And before or equal to the storage duration of the ith first block, the method further includes:
    所述第一设备确定所述K个第一区块中存在生成时刻与当前时刻的时间间隔小于区块的存储时长的第一区块;Determining, by the first device, that the time interval between the generation time and the current time in the K first blocks is smaller than the storage time of the block;
    所述第一设备删除所述生成时刻与当前时刻的时间间隔小于区块的存储时长的第一区块中包括的数据。 The first device deletes data included in the first block where the time interval between the generation time and the current time is less than the storage duration of the block.
  7. 根据权利要求4或5所述的方法,其特征在于,在所述第一设备确定当前时间为连续K个第一区块中的第i个第一区块的消逝时间,或者当前时间晚于所述K个第一区块中的第i个第一区块的消逝时间之前,所述方法还包括:The method according to claim 4 or 5, wherein the first device determines that the current time is the elapsed time of the i-th first block in the consecutive K first blocks, or the current time is later than The method further includes: before the elapsed time of the ith first block of the K first blocks, the method further includes:
    所述第一设备确定所述K个第一区块中存在消逝时间早于当前时间的第一区块;Determining, by the first device, that the first block in the K first blocks has an elapsed time earlier than a current time;
    所述第一设备删除所述消逝时间早于当前时间的第一区块中包括的数据。The first device deletes data included in the first block whose elapsed time is earlier than the current time.
  8. 根据权利要求1所述的方法,其特征在于,所述第一设备确定区块链网络中的待删除区块,包括:The method according to claim 1, wherein the determining, by the first device, the to-be-deleted block in the blockchain network comprises:
    所述第一设备确定区块链中承载有第一区块信息和删除认证次数,所述第一区块信息用于指示连续K个第一区块,所述删除认证次数用于指示所述K个第一区块在所述区块链网络中的删除认证次数,K为大于或等于1的正整数;Determining, by the first device, that the first block information is carried in the blockchain and deleting the number of authentication times, where the first block information is used to indicate consecutive K first blocks, and the number of deletion authentications is used to indicate the The number of deletion authentications of the K first blocks in the blockchain network, and K is a positive integer greater than or equal to 1;
    所述第一设备将所述K个第一区块确定为待删除区块。The first device determines the K first blocks as blocks to be deleted.
  9. 根据权利要求8所述的方法,其特征在于,所述删除认证次数的取值为第一预设值;The method according to claim 8, wherein the value of the number of deletion authentications is a first preset value;
    其中,所述第一设备执行删除相关操作,包括:The first device performs a delete related operation, including:
    所述第一设备删除所述K个第一区块。The first device deletes the K first blocks.
  10. 根据权利要求9所述的方法,其特征在于,所述删除认证次数的取值小于第一预设值;The method according to claim 9, wherein the value of the number of deletion authentications is less than a first preset value;
    其中,所述第一设备执行删除相关操作,包括:The first device performs a delete related operation, including:
    所述第一设备在将所述删除认证次数的取值增加1之后,向所述区块链网络中的设备发送所述第一区块信息和所述删除认证次数,以便于所述区块链网络中的设备在确定所述K个第一区块的删除认证次数为所述第一预设值时,删除所述K个第一区块。After the first device increases the value of the deletion authentication number by 1, the first device sends the first block information and the deletion authentication number to the device in the blockchain network, so as to facilitate the block. The device in the chain network deletes the K first blocks when determining that the number of deletion authentications of the K first blocks is the first preset value.
  11. 根据权利要求3至9中任一项所述的方法,其特征在于,在所述第一设备删除所述K个第一区块之后,所述方法还包括:The method according to any one of claims 3 to 9, wherein after the first device deletes the K first blocks, the method further comprises:
    所述第一设备确定当前时刻与连续L个第二区块中第j个第二区块的生成时刻之间的时间间隔大于或等于第j个第二区块的存储时长,所述L个第二区块为生成时刻晚于所述K个第一区块,且与所述L个第一区块相邻的区块,L为大于或等于1的正整数,j=1,…L;Determining, by the first device, a time interval between a current time and a generation time of the jth second block in the consecutive L second blocks is greater than or equal to a storage duration of the jth second block, where the L The second block is a block whose generation time is later than the K first blocks and adjacent to the L first blocks, where L is a positive integer greater than or equal to 1, j=1, . . . L ;
    所述第一设备删除所述L个第二区块;或,The first device deletes the L second blocks; or
    所述第一设备设置所述L个第二区块的删除认证次数的初始值,并向所述区块链网络中的设备发送第二区块信息和所述L个第二区块的删除认证次数,所述第二区块信息用于指示所述L个第二区块,以便于所述区块链网络中的设备在确认所述L个第二区块的删除认证次数为所述第一预设值时,删除所述L个第二区块。The first device sets an initial value of the number of deletion authentication times of the L second blocks, and sends the second block information and the deletion of the L second blocks to the devices in the blockchain network. a number of times of authentication, the second block information is used to indicate the L second blocks, so that the device in the blockchain network confirms that the number of deletion authentications of the L second blocks is the When the first preset value is used, the L second blocks are deleted.
  12. 根据权利要求1至11中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 11, wherein the method further comprises:
    所述第一设备生成第三区块,所述第三区块中携带所述第三区块的存储时长,所述第三区块的存储时长用于指示所述第三区块或所述第三区块中包括的数据需要在所述区块链网络中被存储的时长。The first device generates a third block, where the third block carries a storage duration of the third block, and a storage duration of the third block is used to indicate the third block or the The data included in the third block needs to be stored in the blockchain network for the length of time.
  13. 根据权利要求12所述的方法,其特征在于,所述第三区块的区块头中包括所述第三区块的存储时长。The method according to claim 12, wherein the block header of the third block includes a storage duration of the third block.
  14. 根据权利要求12或13所述的方法,其特征在于,所述第三区块中包括第二设备发送的数据; The method according to claim 12 or 13, wherein the third block includes data sent by the second device;
    其中,在所述第一设备生成第三区块之前,所述方法还包括:The method further includes: before the generating, by the first device, the third block:
    所述第一设备接收第二设备发送的数据和所述数据的第一存储时长,所述第二设备为所述区块链网络中的设备,所述第一存储时长用于指示所述第二设备确定的所述数据需要在所述区块链网络中被存储的时长;The first device receives the data sent by the second device and the first storage duration of the data, the second device is a device in the blockchain network, and the first storage duration is used to indicate the first The length of time that the data determined by the second device needs to be stored in the blockchain network;
    所述第一设备根据所述第一存储时长,确定所述第三区块的存储时长。The first device determines, according to the first storage duration, a storage duration of the third block.
  15. 根据权利要求14所述的方法,其特征在于,所述第一存储时长是由所述第二设备通过与第三设备进行协商确定的,所述第三设备为所述区块链网络中的设备。The method according to claim 14, wherein the first storage duration is determined by the second device by negotiating with a third device, wherein the third device is in the blockchain network. device.
  16. 根据权利要求15所述的方法,其特征在于,所述第一存储时长是所述第二设备根据第二存储时长确定的,所述第二存储时长是由第四设备确定的所述数据需要在所述区块链网络中被存储的时长,所述第四设备为所述区块链网络之外的设备。The method according to claim 15, wherein the first storage duration is determined by the second device according to a second storage duration, and the second storage duration is the data requirement determined by the fourth device. The length of time stored in the blockchain network, the fourth device being a device outside the blockchain network.
  17. 根据权利要求16所述的方法,其特征在于,所述第二存储时长是由所述第四设备通过与第五设备进行协商确定的,所述第五设备为所述区块链网络之外的设备。The method according to claim 16, wherein the second storage duration is determined by the fourth device by negotiating with a fifth device, and the fifth device is outside the blockchain network. device of.
  18. 根据权利要求12至17中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 12 to 17, wherein the method further comprises:
    所述第一设备确定所述第三区块所属的区块链;Determining, by the first device, a blockchain to which the third block belongs;
    所述第一设备将所述第三区块加入到所述区块链中。The first device adds the third block to the blockchain.
  19. 根据权利要求18所述的方法,其特征在于,所述第一设备确定所述第三区块所属的区块链,包括:The method according to claim 18, wherein the determining, by the first device, the blockchain to which the third block belongs comprises:
    所述第一设备根据所述第三区块的存储时长和预设对应关系,确定所述第三区块所属的区块链,所述预设对应关系为区块的存储时长和区块链的对应关系。Determining, by the first device, a blockchain to which the third block belongs according to a storage duration of the third block and a preset correspondence, where the preset correspondence is a storage duration of the block and a blockchain Correspondence.
  20. 根据权利要求18或19所述的方法,其特征在于,所述区块链中携带所述区块链的标识。The method according to claim 18 or 19, wherein the blockchain carries an identifier of the blockchain.
  21. 根据权利要求1至20中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 20, wherein the method further comprises:
    所述第一设备生成第四区块,所述第四区块的区块头中包括第三区块信息和删除时间信息,其中,所述第三区块信息用于指示被删除的区块,所述删除时间信息用于指示被删除区块的删除时刻,或所述删除时间信息用于指示被删除区块中包括的数据的删除时刻。The first device generates a fourth block, where the block header of the fourth block includes third block information and deletion time information, where the third block information is used to indicate the deleted block. The deletion time information is used to indicate a deletion time of the deleted block, or the deletion time information is used to indicate a deletion time of data included in the deleted block.
  22. 根据权利要求1至21中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 21, wherein the method further comprises:
    所述第一设备向所述区块链网络中的存储设备或所述区块链网络之外的存储设备发送被删除的区块或被删除的区块中包括的数据。The first device sends the data included in the deleted block or the deleted block to a storage device in the blockchain network or a storage device outside the blockchain network.
  23. 根据权利要求22所述的方法,其特征在于,所述方法还包括:The method of claim 22, wherein the method further comprises:
    所述第一设备向所述区块链网络中的存储设备或所述区块链网络之外的存储设备发送第三存储时长,所述第三存储时长为所述被删除的区块或所述被删除的区块中的包括的数据需要在所述区块链网络中的存储设备或所述区块链网络之外的存储设备中被存储的时长。Transmitting, by the first device, a third storage duration to a storage device in the blockchain network or a storage device outside the blockchain network, where the third storage duration is the deleted block or location The data included in the deleted block needs to be stored in a storage device in the blockchain network or a storage device outside the blockchain network.
  24. 一种基于区块链的数据处理方法,其特征在于,包括:A blockchain-based data processing method, comprising:
    第二设备获取数据,所述第二设备为区块链网络中的设备;The second device acquires data, and the second device is a device in a blockchain network;
    所述第二设备确定所述数据的第一存储时长,所述数据的第一存储时长用于指示所述第二设备确定的所述数据需要在所述区块链网络中被存储的时长;Determining, by the second device, a first storage duration of the data, where a first storage duration of the data is used to indicate a length of time that the data determined by the second device needs to be stored in the blockchain network;
    所述第二设备向所述区块链网络中的设备发送所述数据和所述第一存储时长,所述第一存储时长用于确定包含所述数据的第三区块的存储时长,所述第三区块的存储时长用于 指示所述第三区块或所述第三区块中包括的所述数据需要在所述区块链网络中被存储的时长。Transmitting, by the second device, the data and the first storage duration to a device in the blockchain network, where the first storage duration is used to determine a storage duration of a third block that includes the data, where The storage time of the third block is used for Indicates a length of time in which the data included in the third block or the third block needs to be stored in the blockchain network.
  25. 根据权利要求24所述的方法,其特征在于,所述第二设备确定所述数据的第一存储时长,包括:The method according to claim 24, wherein the determining, by the second device, the first storage duration of the data comprises:
    所述第二设备与第三设备进行协商,确定所述第一存储时长,所述第三设备为所述区块链网络中的设备。The second device negotiates with the third device to determine the first storage duration, and the third device is a device in the blockchain network.
  26. 根据权利要求24所述的方法,其特征在于,所述第二设备获取数据,包括:The method according to claim 24, wherein the acquiring, by the second device, the data comprises:
    所述第二设备接收第四设备发送的所述数据和第二存储时长,所述第二存储时长为第四设备确定的所述数据需要在所述区块链网络中被存储的时长所述第四设备为所述区块链网络之外的设备;Receiving, by the second device, the data sent by the fourth device and the second storage duration, where the second storage duration is the length of time that the data determined by the fourth device needs to be stored in the blockchain network The fourth device is a device outside the blockchain network;
    其中,所述第二设备确定所述数据的第一存储时长,包括:The second device determines a first storage duration of the data, including:
    所述第二设备根据所述第二存储时长,确定所述第一存储时长。The second device determines the first storage duration according to the second storage duration.
  27. 根据权利要求26所述的方法,其特征在于,所述第二存储时长是由所述第四设备通过与第五设备进行协商确定的,所述第五设备为所述区块链网络之外的设备。The method according to claim 26, wherein the second storage duration is determined by the fourth device by negotiating with a fifth device, the fifth device being outside the blockchain network device of.
  28. 一种设备,其特征在于,包括:An apparatus, comprising:
    处理模块,用于确定区块链网络中的待删除区块,所述设备为所述区块链网络中的设备;a processing module, configured to determine a to-be-deleted block in the blockchain network, where the device is a device in the blockchain network;
    删除操作执行模块,用于执行删除相关操作,以删除所述待删除区块。The deletion operation execution module is configured to perform a deletion related operation to delete the to-be-deleted block.
  29. 根据权利要求28所述的设备,其特征在于,所述处理模块具体用于:The device according to claim 28, wherein the processing module is specifically configured to:
    确定所述区块链网络中的区块的存储时长或消逝时间;Determining a storage duration or elapsed time of a block in the blockchain network;
    根据所述存储时长或所述消逝时间,确定所述待删除区块。The to-be-deleted block is determined according to the storage duration or the elapsed time.
  30. 根据权利要求29所述的设备,其特征在于,所述处理模块具体用于:The device according to claim 29, wherein the processing module is specifically configured to:
    确定当前时刻与连续K个第一区块中的第i个第一区块的生成时刻之间的时间间隔大于或等于所述第i个第一区块的存储时长,所述第i个区块的存储时长用于指示所述第i个第一区块或所述第i个第一区块中包括的数据需要在所述区块链网络中被存储的时长,K为大于或等于1的正整数,i=1,…K;Determining, that the time interval between the current time and the generation time of the i th first block in the consecutive K first blocks is greater than or equal to the storage duration of the i th first block, the i th area The storage duration of the block is used to indicate that the data included in the i-th first block or the i-th first block needs to be stored in the blockchain network, and K is greater than or equal to 1 Positive integer, i=1,...K;
    将所述K个第一区块确定为待删除区块。The K first blocks are determined as blocks to be deleted.
  31. 根据权利要求29所述的设备,其特征在于,所述处理模块具体用于:The device according to claim 29, wherein the processing module is specifically configured to:
    确定当前时间为连续K个第一区块中的第i个第一区块的消逝时间,或者当前时间晚于所述K个第一区块中的第i个第一区块的消逝时间,所述第i个第一区块的消逝时间用于指示所述第一区块或所述第一区块中包括的数据需要在所述区块链网络中被删除的时间,K为大于或等于1的正整数,i=1,…K;Determining that the current time is an elapsed time of the i th first block in the consecutive K first blocks, or the current time is later than an elapsed time of the i th first block in the K first blocks, The elapsed time of the i-th first block is used to indicate that the data included in the first block or the first block needs to be deleted in the blockchain network, and K is greater than or a positive integer equal to 1, i = 1, ... K;
    将所述K个第一区块确定为待删除区块。The K first blocks are determined as blocks to be deleted.
  32. 根据权利要求30或31所述的设备,其特征在于,所述删除操作执行模块具体用于:The device according to claim 30 or 31, wherein the deletion operation execution module is specifically configured to:
    删除所述K个第一区块;或,Deleting the K first blocks; or,
    设置所述K个第一区块的删除认证次数的初始值,并向所述区块链网络中的设备发送第一区块信息和所述K个第一区块的删除认证次数,所述第一区块信息用于指示所述K个第一区块,以便于所述区块链网络中的设备在确定所述K个第一区块的删除认证次数为 第一预设值时,删除所述K个第一区块。Setting an initial value of the number of deletion authentications of the K first blocks, and transmitting the first block information and the number of deletion authentications of the K first blocks to the devices in the blockchain network, The first block information is used to indicate the K first blocks, so that the device in the blockchain network determines that the number of deletion authentications of the K first blocks is When the first preset value is used, the K first blocks are deleted.
  33. 根据权利要求30或32所述的设备,其特征在于,在所述处理模块确定当前时刻与连续K个第一区块中的第i个第一区块的生成时刻之间的时间间隔大于或等于所述第i个第一区块的存储时长之前,所述处理模块还用于:The device according to claim 30 or 32, wherein the processing module determines that the time interval between the current time and the generation time of the i-th first block in the consecutive K first blocks is greater than or The processing module is further configured to: before the storage duration of the ith first block is equal to:
    确定所述K个第一区块中存在生成时刻与当前时刻的时间间隔小于区块的存储时长的第一区块;Determining, in the K first blocks, that the time interval between the generation time and the current time is less than the storage time of the block;
    所述删除操作执行模块,还用于删除所述生成时刻与当前时刻的时间间隔小于区块的存储时长的第一区块中包括的数据。The deletion operation execution module is further configured to delete data included in the first block where the time interval between the generation time and the current time is less than the storage duration of the block.
  34. 根据权利要求31或32所述的设备,其特征在于,在确定当前时间为连续K个第一区块中的第i个第一区块的消逝时间,或者当前时间晚于所述K个第一区块中的第i个第一区块的消逝时间之前,所述处理模块还用于:The apparatus according to claim 31 or 32, wherein the elapsed time of determining the current time is the i-th first block in the consecutive K first blocks, or the current time is later than the K first Before the elapsed time of the ith first block in a block, the processing module is further configured to:
    确定所述K个第一区块中存在消逝时间早于当前时间的第一区块;Determining that there is a first block in the K first blocks that has an elapsed time earlier than a current time;
    所述删除操作执行模块,还用于删除所述消逝时间早于当前时间的第一区块中包括的数据。The deletion operation execution module is further configured to delete data included in the first block whose elapsed time is earlier than the current time.
  35. 根据权利要求28所述的设备,其特征在于,所述处理模块具体用于:The device according to claim 28, wherein the processing module is specifically configured to:
    确定区块链中承载有第一区块信息和删除认证次数,所述第一区块信息用于指示连续K个第一区块,所述删除认证次数用于指示所述K个第一区块在所述区块链网络中的删除认证次数,K为大于或等于1的正整数;Determining that the first block information is carried in the block chain and deleting the number of authentication times, the first block information is used to indicate consecutive K first blocks, and the number of deletion authentications is used to indicate the K first areas The number of deletion authentications of the block in the blockchain network, where K is a positive integer greater than or equal to 1;
    将所述K个第一区块确定为待删除区块。The K first blocks are determined as blocks to be deleted.
  36. 根据权利要求35所述的设备,其特征在于,所述删除认证次数的取值为第一预设值;The device according to claim 35, wherein the value of the number of deletion authentications is a first preset value;
    其中,所述删除操作执行模块具体用于:删除所述K个第一区块。The deleting operation execution module is specifically configured to: delete the K first blocks.
  37. 根据权利要求36所述的设备,其特征在于,所述删除认证次数的取值小于第一预设值;The device according to claim 36, wherein the value of the number of deletion authentications is less than a first preset value;
    其中,所述删除操作执行模块具体用于:在将所述删除认证次数的取值增加1之后,向所述区块链网络中的设备发送所述第一区块信息和所述删除认证次数,以便于所述区块链网络中的设备在确定所述K个第一区块的删除认证次数为所述第一预设值时,删除所述K个第一区块。The deleting operation execution module is specifically configured to: after the value of the deletion authentication number is increased by 1, send the first block information and the deletion authentication number to devices in the blockchain network. The device in the blockchain network is configured to delete the K first blocks when determining that the number of deletion authentications of the K first blocks is the first preset value.
  38. 根据权利要求30至36中任一项所述的设备,其特征在于,在所述删除操作执行模块删除所述K个第一区块之后,所述处理模块还用于:The device according to any one of claims 30 to 36, wherein after the deleting operation execution module deletes the K first blocks, the processing module is further configured to:
    确定当前时刻与连续L个第二区块中第j个第二区块的生成时刻之间的时间间隔大于或等于第j个第二区块的存储时长,所述L个第二区块为生成时刻晚于所述K个第一区块,且与所述L个第一区块相邻的区块,L为大于或等于1的正整数,j=1,…L;Determining, that the time interval between the current time and the generation time of the jth second block in the consecutive L second blocks is greater than or equal to the storage duration of the jth second block, wherein the L second blocks are Generating a block that is later than the K first blocks and adjacent to the L first blocks, L is a positive integer greater than or equal to 1, j=1, . . . L;
    所述删除操作执行模块,还用于删除所述L个第二区块;或,设置所述L个第二区块的删除认证次数的初始值,并向所述区块链网络中的设备发送第二区块信息和所述L个第二区块的删除认证次数,所述第二区块信息用于指示所述L个第二区块,以便于所述区块链网络中的设备在确认所述L个第二区块的删除认证次数为所述第一预设值时,删除所述L个第二区块。The deletion operation execution module is further configured to delete the L second blocks; or set an initial value of the deletion authentication times of the L second blocks, and send the device to the device in the blockchain network Transmitting, by the second block information, the number of deletion authentications of the L second blocks, where the second block information is used to indicate the L second blocks, so as to facilitate devices in the blockchain network When it is confirmed that the number of deletion authentications of the L second blocks is the first preset value, deleting the L second blocks.
  39. 根据权利要求28至38中任一项所述的设备,其特征在于,所述处理模块还用于: The device according to any one of claims 28 to 38, wherein the processing module is further configured to:
    生成第三区块,所述第三区块中携带所述第三区块的存储时长,所述第三区块的存储时长用于指示所述第三区块或所述第三区块中包括的数据需要在所述区块链网络中被存储的时长。Generating a third block, where the third block carries a storage duration of the third block, and a storage duration of the third block is used to indicate the third block or the third block The length of time that the included data needs to be stored in the blockchain network.
  40. 根据权利要求39所述的设备,其特征在于,所述第三区块的区块头中包括所述第三区块的存储时长。The device according to claim 39, wherein the block header of the third block includes a storage duration of the third block.
  41. 根据权利要求39或40所述的设备,其特征在于,所述第三区块中包括第二设备发送的数据;The device according to claim 39 or 40, wherein the third block includes data sent by the second device;
    其中,在所述生成第三区块之前,所述处理模块还用于:The processing module is further configured to: before the generating the third block:
    接收第二设备发送的数据和所述数据的第一存储时长,所述第二设备为所述区块链网络中的设备,所述第一存储时长用于指示所述第二设备确定的所述数据需要在所述区块链网络中被存储的时长;Receiving data sent by the second device and a first storage duration of the data, the second device is a device in the blockchain network, and the first storage duration is used to indicate the location determined by the second device The length of time that the data needs to be stored in the blockchain network;
    根据所述第一存储时长,确定所述第三区块的存储时长。And determining, according to the first storage duration, a storage duration of the third block.
  42. 根据权利要求41所述的设备,其特征在于,所述第一存储时长是由所述第二设备通过与第三设备进行协商确定的,所述第三设备为所述区块链网络中的设备。The device according to claim 41, wherein the first storage duration is determined by the second device by negotiating with a third device, wherein the third device is in the blockchain network. device.
  43. 根据权利要求42所述的设备,其特征在于,所述第一存储时长是所述第二设备根据第二存储时长确定的,所述第二存储时长是由第四设备确定的所述数据需要在所述区块链网络中被存储的时长,所述第四设备为所述区块链网络之外的设备。The device according to claim 42, wherein the first storage duration is determined by the second device according to a second storage duration, and the second storage duration is the data requirement determined by the fourth device. The length of time stored in the blockchain network, the fourth device being a device outside the blockchain network.
  44. 根据权利要求43所述的设备,其特征在于,所述第二存储时长是由所述第四设备通过与第五设备进行协商确定的,所述第五设备为所述区块链网络之外的设备。The device according to claim 43, wherein the second storage duration is determined by the fourth device by negotiating with a fifth device, the fifth device being outside the blockchain network device of.
  45. 根据权利要求39至44中任一项所述的设备,其特征在于,所述处理模块还用于:The device according to any one of claims 39 to 44, wherein the processing module is further configured to:
    确定所述第三区块所属的区块链;Determining a blockchain to which the third block belongs;
    将所述第三区块加入到所述区块链中。The third block is added to the blockchain.
  46. 根据权利要求45所述的设备,其特征在于,所述处理模块具体用于:The device according to claim 45, wherein the processing module is specifically configured to:
    根据所述第三区块的存储时长和预设对应关系,确定所述第三区块所属的区块链,所述预设对应关系为区块的存储时长和区块链的对应关系。And determining, according to the storage duration of the third block and the preset correspondence, the blockchain to which the third block belongs, and the preset correspondence relationship is a correspondence between a storage duration of the block and a blockchain.
  47. 根据权利要求45或46所述的设备,其特征在于,所述区块链中携带所述区块链的标识。The device according to claim 45 or 46, wherein the blockchain carries an identifier of the blockchain.
  48. 根据权利要求28至47中任一项所述的设备,其特征在于,所述处理模块还用于:The device according to any one of claims 28 to 47, wherein the processing module is further configured to:
    生成第四区块,所述第四区块的区块头中包括第三区块信息和删除时间信息,其中,所述第三区块信息用于指示被删除的区块,所述删除时间信息用于指示被删除区块的删除时刻,或所述删除时间信息用于指示被删除区块中包括的数据的删除时刻。Generating a fourth block, where the block header of the fourth block includes third block information and deletion time information, wherein the third block information is used to indicate the deleted block, and the deletion time information The deletion time for indicating the deleted block, or the deletion time information is used to indicate the deletion time of the data included in the deleted block.
  49. 根据权利要求28至48中任一项所述的设备,其特征在于,所述处理模块还用于:The device according to any one of claims 28 to 48, wherein the processing module is further configured to:
    向所述区块链网络中的存储设备或所述区块链网络之外的存储设备发送被删除的区块或被删除的区块中包括的数据。The deleted block or the data included in the deleted block is transmitted to a storage device in the blockchain network or a storage device outside the blockchain network.
  50. 根据权利要求49所述的设备,其特征在于,所述处理模块还用于:The device according to claim 49, wherein the processing module is further configured to:
    向所述区块链网络中的存储设备或所述区块链网络之外的存储设备发送第三存储时长,所述第三存储时长为所述被删除的区块或所述被删除的区块中的包括的数据需要在所述区块链网络中的存储设备或所述区块链网络之外的存储设备中被存储的时长。Transmitting, to a storage device in the blockchain network or a storage device outside the blockchain network, a third storage duration, where the third storage duration is the deleted block or the deleted region The data included in the block requires a length of time to be stored in a storage device in the blockchain network or a storage device outside the blockchain network.
  51. 一种设备,其特征在于,包括: An apparatus, comprising:
    处理模块,用于获取数据,所述设备为区块链网络中的设备;a processing module, configured to acquire data, where the device is a device in a blockchain network;
    所述处理模块,还用于确定所述数据的第一存储时长,所述数据的第一存储时长用于指示所述设备确定的所述数据需要在所述区块链网络中被存储的时长;The processing module is further configured to determine a first storage duration of the data, where a first storage duration of the data is used to indicate a duration that the data determined by the device needs to be stored in the blockchain network. ;
    收发模块,用于向所述区块链网络中的设备发送所述数据和所述第一存储时长,所述第一存储时长用于确定包含所述数据的第三区块的存储时长,所述第三区块的存储时长用于指示所述第三区块或所述第三区块中包括的所述数据需要在所述区块链网络中被存储的时长。a transceiver module, configured to send the data and the first storage duration to a device in the blockchain network, where the first storage duration is used to determine a storage duration of a third block that includes the data, where The storage duration of the third block is used to indicate the length of time that the data included in the third block or the third block needs to be stored in the blockchain network.
  52. 根据权利要求51所述的设备,其特征在于,所述处理模块具体用于:与第三设备进行协商,确定所述第一存储时长,所述第三设备为所述区块链网络中的设备。The device according to claim 51, wherein the processing module is specifically configured to: negotiate with a third device to determine the first storage duration, and the third device is in the blockchain network device.
  53. 根据权利要求51所述的设备,其特征在于,所述处理模块具体用于:The device according to claim 51, wherein the processing module is specifically configured to:
    接收第四设备发送的所述数据和第二存储时长,所述第二存储时长为第四设备确定的所述数据需要在所述区块链网络中被存储的时长,所述第四设备为所述区块链网络之外的设备;Receiving, by the fourth device, the data and the second storage duration, where the second storage duration is a duration that the data determined by the fourth device needs to be stored in the blockchain network, and the fourth device is a device outside the blockchain network;
    根据所述第二存储时长,确定所述第一存储时长。Determining the first storage duration according to the second storage duration.
  54. 根据权利要求53所述的设备,其特征在于,所述第二存储时长是由所述第四设备通过与第五设备进行协商确定的,所述第五设备为所述区块链网络之外的设备。The device according to claim 53, wherein the second storage duration is determined by the fourth device by negotiating with a fifth device, and the fifth device is outside the blockchain network. device of.
  55. 一种通信系统,其特征在于,包括权利要求28至50中任一项所述的设备和权利要求51至54中任一项所述的设备。 A communication system comprising the apparatus of any one of claims 28 to 50 and the apparatus of any one of claims 51 to 54.
PCT/CN2017/115001 2017-01-03 2017-12-07 Blockchain-based data processing method, device and system WO2018126837A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710002175.X 2017-01-03
CN201710002175.XA CN108270836B (en) 2017-01-03 2017-01-03 Data processing method, device and system based on block chain

Publications (1)

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

Family

ID=62770701

Family Applications (1)

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

Country Status (2)

Country Link
CN (1) CN108270836B (en)
WO (1) WO2018126837A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11347855B2 (en) * 2019-06-26 2022-05-31 Capital One Services, Llc Data lineage management
CN115801801A (en) * 2022-11-16 2023-03-14 中国联合网络通信集团有限公司 Network management method, device and storage medium
US11693393B2 (en) 2019-09-25 2023-07-04 Schneider Electric Industries Sas Blockchain method for controlling an industrial process

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108876254A (en) * 2018-08-01 2018-11-23 口碑(上海)信息技术有限公司 The providing method and device of inventory data
CN109150598B (en) * 2018-08-10 2021-09-03 上交所技术有限责任公司 BFT consensus algorithm bandwidth utilization rate improvement method based on block slice
CN109145163B (en) * 2018-08-22 2021-08-24 深圳前海微众银行股份有限公司 Block chain data capacity reduction method and device and storage medium
CN109271446B (en) * 2018-08-30 2020-10-23 杭州复杂美科技有限公司 Parallel chain data synchronization method, equipment and storage medium
CN109325762B (en) * 2018-08-30 2020-07-10 杭州复杂美科技有限公司 Parallel chain cross-chain transaction method, equipment and storage medium
CN110880968A (en) * 2018-09-05 2020-03-13 元一科技控股有限公司 Block transmission and recording method and device and computer storage medium
CN109344630B (en) * 2018-09-18 2021-07-02 百度在线网络技术(北京)有限公司 Block generation method, device, equipment and storage medium
CN109189859B (en) * 2018-09-20 2020-10-16 百度在线网络技术(北京)有限公司 Node initialization method and device in block chain network
CN109474675A (en) * 2018-10-18 2019-03-15 尚维斯 A kind of block height split blade type date storage method based on block chain
CN109493044A (en) * 2018-11-08 2019-03-19 深圳壹账通智能科技有限公司 Block chain block delet method, device and terminal device
CN109714398B (en) * 2018-12-11 2021-09-21 新华三技术有限公司 Data storage method and device
CN110264187B (en) 2019-01-23 2021-06-04 腾讯科技(深圳)有限公司 Data processing method and device, computer equipment and storage medium
CN109885258B (en) * 2019-02-01 2023-02-21 立旃(上海)科技有限公司 Data deleting device and method based on block chain
CN110222052A (en) * 2019-05-20 2019-09-10 重庆金融资产交易所有限责任公司 Block chain data processing method, device, computer equipment and storage medium
CN112153085B (en) * 2019-06-26 2022-05-17 华为技术有限公司 Data processing method, node and block chain system
CN110597825B (en) * 2019-09-24 2021-07-27 腾讯科技(深圳)有限公司 Data processing method and device based on block chain and node equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104935657A (en) * 2015-06-15 2015-09-23 清华大学深圳研究生院 Method for actively pushing information and embedded node operating system
CN105790954A (en) * 2016-03-02 2016-07-20 布比(北京)网络技术有限公司 Method and system for constructing electronic evidence
US20160342977A1 (en) * 2015-05-20 2016-11-24 Vennd.io Pty Ltd Device, method and system for virtual asset transactions
CN106251216A (en) * 2016-07-18 2016-12-21 恒宝股份有限公司 A kind of method and system for alleviating node storage pressure
US20170031676A1 (en) * 2015-07-27 2017-02-02 Deja Vu Security, Llc Blockchain computer data distribution

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7877539B2 (en) * 2005-02-16 2011-01-25 Sandisk Corporation Direct data file storage in flash memories
US11188899B2 (en) * 2015-04-07 2021-11-30 Dmg Blockchain Solutions Inc. Off network identity tracking in anonymous cryptocurrency exchange networks

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160342977A1 (en) * 2015-05-20 2016-11-24 Vennd.io Pty Ltd Device, method and system for virtual asset transactions
CN104935657A (en) * 2015-06-15 2015-09-23 清华大学深圳研究生院 Method for actively pushing information and embedded node operating system
US20170031676A1 (en) * 2015-07-27 2017-02-02 Deja Vu Security, Llc Blockchain computer data distribution
CN105790954A (en) * 2016-03-02 2016-07-20 布比(北京)网络技术有限公司 Method and system for constructing electronic evidence
CN106251216A (en) * 2016-07-18 2016-12-21 恒宝股份有限公司 A kind of method and system for alleviating node storage pressure

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11347855B2 (en) * 2019-06-26 2022-05-31 Capital One Services, Llc Data lineage management
US11693393B2 (en) 2019-09-25 2023-07-04 Schneider Electric Industries Sas Blockchain method for controlling an industrial process
CN115801801A (en) * 2022-11-16 2023-03-14 中国联合网络通信集团有限公司 Network management method, device and storage medium
CN115801801B (en) * 2022-11-16 2024-05-10 中国联合网络通信集团有限公司 Network management method, device and storage medium

Also Published As

Publication number Publication date
CN108270836A (en) 2018-07-10
CN108270836B (en) 2020-04-03

Similar Documents

Publication Publication Date Title
WO2018126837A1 (en) Blockchain-based data processing method, device and system
WO2021179655A1 (en) Cross-blockchain data migration method and apparatus, device, and storage medium
US11403636B2 (en) Blockchain-based transaction processing method and apparatus, and electronic device
WO2018126340A1 (en) Blockchain-based data processing method, device and system
WO2022042301A1 (en) Data processing method and apparatus, smart device and storage medium
Singh et al. Blockchain based intelligent vehicle data sharing framework
CN111108478B (en) Method, system and apparatus for communicating and sharing blockchain data
US20210209373A1 (en) Media authentication using distributed ledger
CN109639714B (en) Internet of things identity registration and verification method based on block chain
CN110430186B (en) Block chain data transaction system and method based on agent re-encryption and intelligent contract
WO2020093565A1 (en) Blockchain block deletion method and apparatus, and terminal device
CN105337941B (en) A kind of device identification providing method and device
WO2020199474A1 (en) Medical information sharing method and device, and readable storage medium and server
WO2020258840A1 (en) Blockchain-based transaction processing method and apparatus, and electronic device
Alam et al. Blockchain, fog and iot integrated framework: review, architecture and evaluation
CN112749969B (en) Data processing method and device, computer equipment and storage medium
CN111713088B (en) Method and device for processing data and equipment for processing data
CN103597456A (en) Method and apparatus for implementing memory segment access control in a distributed memory environment
KR102635038B1 (en) Block chain-based system of iot and method for the same
KR102465467B1 (en) The decentralized user data storage and sharing system based on DID
CN111108526A (en) Centralized account book system based on block chain management
WO2021155482A1 (en) Data transmission method and ble device
CN112866981B (en) Method and device for managing subscription data
CN109284624A (en) A kind of data safety partition method and device based on the storage of block chain
WO2019196237A1 (en) Resident household registration information management method, server and computer readable storage medium

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

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

Country of ref document: EP

Kind code of ref document: A1