WO2021164321A1 - 区块处理方法、基于区块链的数据查询方法及装置 - Google Patents

区块处理方法、基于区块链的数据查询方法及装置 Download PDF

Info

Publication number
WO2021164321A1
WO2021164321A1 PCT/CN2020/126458 CN2020126458W WO2021164321A1 WO 2021164321 A1 WO2021164321 A1 WO 2021164321A1 CN 2020126458 W CN2020126458 W CN 2020126458W WO 2021164321 A1 WO2021164321 A1 WO 2021164321A1
Authority
WO
WIPO (PCT)
Prior art keywords
block
target
chain
sub
blockchain
Prior art date
Application number
PCT/CN2020/126458
Other languages
English (en)
French (fr)
Inventor
李欣
Original Assignee
腾讯科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Priority to EP20919567.6A priority Critical patent/EP4009187A4/en
Priority to JP2022527689A priority patent/JP7441311B2/ja
Priority to KR1020227015836A priority patent/KR20220074968A/ko
Publication of WO2021164321A1 publication Critical patent/WO2021164321A1/zh
Priority to US17/675,511 priority patent/US20220171776A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries
    • 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
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3297Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving time stamps, e.g. generation of time stamps
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees
    • 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/30Payment architectures, schemes or protocols characterised by the use of specific devices or networks
    • G06Q20/36Payment architectures, schemes or protocols characterised by the use of specific devices or networks using electronic wallets or electronic money safes

Definitions

  • the present disclosure relates to the field of blockchain technology, and in particular to a block processing method, a blockchain-based data query method, device, computer equipment, and storage medium.
  • Blockchain is essentially a decentralized database consisting of multiple blocks connected in series.
  • the consensus blocks are connected in the order of generation time to form a block chain. New blocks are generated, and after consensus, they can be connected to the end of the block chain.
  • the embodiments of the present disclosure provide a block processing method, a block chain-based data query method, device, computer equipment, and storage medium.
  • the technical scheme is as follows:
  • a block processing method includes:
  • the sub-chain that meets the target condition is determined as the target sub-chain;
  • the block is added to the target sub-chain of the target blockchain.
  • a blockchain-based data query method includes:
  • a block index table of the target block chain is obtained, the query instruction carries the transaction occurrence time of the transaction in the target block, and the data in the block index table
  • the storage unit is used to record the storage location information of the block in the target blockchain, and one data storage unit corresponds to a time stamp;
  • the target block is searched in the target blockchain.
  • a block processing device which includes:
  • the obtaining module is used to obtain the time interval stored in the root block of the target blockchain in response to the generation of any block;
  • the sub-chain determination module is used to determine the sub-chain that meets the target condition from the first target number of sub-chains connected to the root block in response to the transaction occurrence time of the transaction contained in the block being within the time interval Is the target sub-chain;
  • the adding module is used to add the block to the target sub-chain of the target blockchain in response to the consensus of the block.
  • the first target number is determined based on the average consensus duration of the blocks in the blockchain system to which the target blockchain belongs and the block generation period.
  • the sub-chain determination module is used to:
  • the sub-chain containing the least number of blocks is determined as the target sub-chain
  • one sub-chain is randomly determined as the target sub-chain.
  • the add module is used to:
  • the sequence number is used to indicate the sequence of the blocks in the target sub-chain.
  • the number is used to indicate the storage location of the block in the target blockchain;
  • the block carrying the block number is added to the target sub-chain.
  • the add module is used to:
  • the sub-chain number of the target sub-chain and the sequence number of the block are spliced to obtain the block number of the block in the target block chain.
  • the device further includes:
  • Block determination module used to determine the previous block of the block as a candidate block
  • the comparison module is used for re-determining the adding position of the block in response to the sequence number of the candidate block and the sequence number of the block not increasing continuously, and executing the step of adding the block to the target sub-chain.
  • the device further includes:
  • the information storage module is used to store the storage location information of the block in the block index table of the target blockchain, and the block index table is used to record the block information of each block in the target blockchain.
  • the block index table includes a second target number of data storage units, and one data storage unit corresponds to one time identifier.
  • the information storage module is used to:
  • the storage location information of the block is stored in the target data storage unit of the block index table, and the time identifier of the target data storage unit matches the transaction occurrence time of the transaction contained in the block.
  • a block chain-based data query device which includes:
  • the obtaining module is used to obtain the block index table of the target block chain in response to the query instruction on the target block in the target block chain.
  • the query instruction carries the transaction occurrence time of the transaction data in the target block.
  • the data storage unit in the block index table is used to record the storage location information of the block in the target blockchain, and one data storage unit corresponds to a time identifier;
  • the determining module is used to determine a target data storage unit from the block index table, and the time identifier of the target data storage unit matches the time when the transaction occurs;
  • the search module is used to search for the target block in the target blockchain based on the storage location information in the target data storage unit.
  • the determining module is used to:
  • the data storage unit is determined as the target data storage unit.
  • a computer device in one aspect, includes one or more processors and one or more memories, and at least one computer program is stored in the one or more memories. Multiple processors are loaded and executed to implement the operations performed by the block processing method or the blockchain-based data query method.
  • a computer-readable storage medium is provided, and at least one computer program is stored in the computer-readable storage medium.
  • the at least one computer program is loaded and executed by a processor to implement the block processing method or is based on a blockchain. The operation performed by the data query method.
  • FIG. 1 is a schematic diagram of a blockchain system 100 provided by an embodiment of the present disclosure
  • Figure 2 is a functional architecture diagram of a node device provided by an embodiment of the present disclosure
  • FIG. 3 is a flowchart of a block processing method provided by an embodiment of the present disclosure
  • FIG. 4 is a schematic diagram of a target blockchain provided by an embodiment of the present disclosure.
  • FIG. 5 is a schematic diagram of a target blockchain data structure provided by an embodiment of the present disclosure.
  • FIG. 6 is a schematic structural diagram of a target blockchain and a block index table provided by an embodiment of the present disclosure
  • FIG. 7 is a flowchart of a data query method based on blockchain provided by an embodiment of the present disclosure.
  • FIG. 8 is a schematic structural diagram of a block processing device provided by an embodiment of the present disclosure.
  • FIG. 9 is a schematic structural diagram of a block chain-based data query device provided by an embodiment of the present disclosure.
  • FIG. 10 is a schematic structural diagram of a terminal provided by an embodiment of the present disclosure.
  • FIG. 11 is a schematic structural diagram of a server provided by an embodiment of the present disclosure.
  • Blockchain is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • the blockchain is essentially a decentralized database, which is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify the validity of the information. (Anti-counterfeiting) and generate the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
  • the underlying platform of the blockchain can include processing modules such as user management, basic services, smart contracts, and operation monitoring.
  • the user management module is responsible for the identity information management of all blockchain participants, including the maintenance of public and private key generation (account management), key management, and maintenance of the correspondence between the user’s real identity and the blockchain address (authority management), etc.
  • authorization supervise and audit certain real-identity transactions, and provide risk control rule configuration (risk control audit); basic service modules are deployed on all blockchain node devices to verify the validity of business requests, After completing the consensus on the valid request, it is recorded on the storage.
  • the basic service For a new business request, the basic service first performs interface adaptation analysis and authentication processing (interface adaptation), and then encrypts the business information through the consensus algorithm (consensus management), After encryption, it is completely and consistently transmitted to the shared ledger (network communication), and recorded and stored; the smart contract module is responsible for contract registration and issuance, contract triggering and contract execution.
  • interface adaptation interface adaptation
  • consensus algorithm consensus algorithm
  • the smart contract module is responsible for contract registration and issuance, contract triggering and contract execution.
  • the operation monitoring module is mainly responsible for the deployment of the product release process , Configuration modification, contract settings, cloud adaptation, and visual output of real-time status during product operation, such as: alarms, monitoring network conditions, monitoring node equipment health status, etc.
  • the platform product service layer provides basic capabilities and implementation frameworks for typical applications. Based on these basic capabilities, developers can superimpose business characteristics to complete the blockchain implementation of business logic.
  • the application service layer provides application services based on the blockchain solution for business participants to use.
  • the embodiment of the present disclosure provides a blockchain system 100 implemented based on blockchain technology.
  • the system architecture of the blockchain system will be introduced below.
  • FIG. 1 is a schematic diagram of a blockchain system 100 provided by an embodiment of the present disclosure.
  • the blockchain system 100 may include multiple node devices 101.
  • the blockchain system 100 may also include at least one Client.
  • the node device 101 may be any form of computing device in the network, such as a server, a host, a user terminal, and so on.
  • the node device 101 and the node device 101 can share data.
  • the node devices 101 may establish a P2P network based on a peer-to-peer (Peer To Peer, P2P) protocol.
  • P2P protocol is an application layer protocol that runs on top of the Transmission Control Protocol (TCP) protocol.
  • the device type of the node device 101 may include a smart phone, a tablet computer, an e-book reader, an MP3 (Moving Picture Experts Group Audio Layer III, dynamic image expert compression standard audio layer 3) player, and MP4 (Moving Picture Experts) Group Audio Layer IV, the dynamic image expert compresses the standard audio layer 4) At least one of a player, a laptop computer or a desktop computer.
  • each node device 101 can receive input information, and maintain the shared data in the blockchain system based on the received input information.
  • there may be an information connection between each node device in the blockchain system and the node devices may transmit information through the above-mentioned information connection.
  • the node devices may transmit information through the above-mentioned information connection.
  • other node devices in the blockchain system can also obtain the input information, and store the input information as data in the shared data, so that the block The data stored on all node devices in the chain system are consistent.
  • FIG. 2 is a functional architecture diagram of a node device provided by an embodiment of the present disclosure.
  • the node device 101 can be functionally divided into a hardware layer, an intermediate layer, an operating system layer, and an application layer.
  • the specific functions involved can be as follows :
  • Routing the basic function of node devices, used to support communication between node devices.
  • node devices can also have the following functions:
  • the services implemented by the application include:
  • Wallet used to provide the function of electronic currency transactions, including initiating transactions (that is, sending the transaction records of the current transaction to other node devices in the blockchain system, and after other node devices are successfully verified, it will be regarded as an acknowledgement that the transaction is valid
  • the transaction record data is written into the temporary block of the blockchain; of course, the wallet also supports querying the remaining electronic money in the electronic money address.
  • Shared ledger used to provide functions such as storage, query and modification of account data, and send the record data of the operation of the account data to other node devices in the blockchain system. After other node devices are validated, they will be used as A response that acknowledges that the account data is valid, writes the record data into a temporary block, and can also send a confirmation to the node device that initiated the operation.
  • Smart contracts can execute the terms of a certain contract, implemented by the code deployed on the shared ledger for execution when certain conditions are met, and the code is used to complete automated transactions according to actual business requirements. For example, query the logistics status of the goods purchased by the buyer, and transfer the buyer’s electronic currency to the merchant’s address after the buyer signs for the goods; Contract processed.
  • Blockchain includes a series of blocks that are connected to each other in the order of generation. Once a block is added to the block chain, it will not be removed. The block chain system is recorded in the block. Record data submitted by the mid-node device.
  • a node device which is a computer device, including but not limited to a server or a terminal.
  • FIG. 3 is a flowchart of a block processing method provided by an embodiment of the present disclosure.
  • the method is applied to the node device in the above-mentioned blockchain system as an example for description.
  • the method may specifically include the following steps:
  • the node device obtains the time interval stored in the root block of the target blockchain in response to the generation of any new block.
  • the “new block” involved in the embodiments of the present disclosure refers to the block generated at the latest moment in the blockchain system. Any block is called a “new block” when it is just generated.
  • the implementation of the present disclosure The "root block” involved in the example refers to the first block generated in the blockchain system, also known as the "creation block”. Therefore, the above step 301 is that the node device obtains the time interval stored in the root block of the target blockchain in response to the generation of any block.
  • the node device may be any node device in the blockchain system, and the node device may be a terminal, a server, etc., which is not limited in the embodiment of the present disclosure.
  • the target block chain belongs to the block chain system. Of course, the block chain system may also include other block chains, which is not limited in the embodiment of the present disclosure.
  • Figure 4 is a schematic diagram of a target blockchain provided by an embodiment of the present disclosure.
  • the target blockchain 401 has a tree structure, that is, the target blockchain 401 includes a root block 402 and The multiple sub-chains connected to the root block 402, as shown in FIG.
  • the root block 402 may be connected to the sub-chain 403, the sub-chain 404, and the sub-chain 405, and one sub-chain may include at least one block.
  • the blockchain system may include at least one blockchain, and the structure of each blockchain is the same as the structure of the target blockchain.
  • a time interval is stored in the root block of the target blockchain, and the time interval can be used to limit the transaction occurrence time of each block in the target blockchain.
  • the transaction occurrence time is The transaction data in this time interval can be stored in the target blockchain.
  • the blockchain system can generate blocks according to the block generation cycle, and a new block can be generated in each block generation cycle.
  • Each block generation cycle can correspond to a transaction period.
  • the transactions that occur during the transaction period are all recorded in the same block. For example, transactions that occur within the first second are recorded in one block, and transactions that occur within the second second are recorded in another block.
  • the block generation period can be used to indicate the packaging period of transaction data in the blockchain system. For example, if the transaction data generated per second is packaged into one block, the block generation period is to generate one block per second.
  • the block generation period can be set by the developer, which is not limited in the embodiment of the present disclosure.
  • the root block may not store transaction data. Therefore, in the blockchain system, the root block of each blockchain can be generated in a pre-generated manner, that is, in a root zone. Before the time interval corresponding to the block arrives, just generate this root block. For example, when the time interval corresponding to the root block is from 23:00 to 24:00, the blockchain system can generate this root block any time before 23:00. Among them, the any time can be determined randomly or based on the operating status of the blockchain system. For example, the root block can be generated when the data processing pressure is low. The generation time is not limited.
  • the node device traverses the first target number of sub-chains connected to the root block to determine the number of blocks included in each sub-chain.
  • the first target quantity may be determined based on the average consensus duration of the blocks in the blockchain system to which the target blockchain belongs and the block generation period.
  • the first target number can be determined based on the calculation result of dividing the average consensus duration of the block by a block generation period.
  • the average consensus duration of the block can be determined by statistics on the duration of each block in the blockchain system through consensus.
  • the number of blocks included in the sub-chain can be determined based on the block number of each block.
  • Each block in the target blockchain can correspond to a block number, which can be used to indicate the storage location of the block in the target blockchain, and the block number of a block can be determined by the block number.
  • the sub-chain number of the sub-chain to which the block belongs and the sequence number of the block in the sub-chain to which it belongs, and the sequence number is the sequence of the block in the sub-chain to which it belongs.
  • the block number of a block can be 2.3, then the sub-chain number of the sub-chain to which the block belongs is 2, and the block is the third block on the sub-chain to which it belongs.
  • the node device when the node device traverses each sub-chain, it can obtain the block number of the last block in each sub-chain, and determine each sub-chain based on the sequence number in the block number of the last block. The number of included blocks. Wherein, the maximum value of the sub-chain number is equal to the first target quantity.
  • a blockchain may include multiple sub-chains, and blocks can be added to each sub-chain, which can improve the efficiency of adding blocks and improve the concurrent processing capability of the system.
  • the node device determines the target sub-chain based on the number of blocks contained in each sub-chain.
  • the sub-chain containing the least number of blocks is determined as the target sub-chain; if the number of blocks contained in each sub-chain is If they are the same, in each of the sub-chains, one of the sub-chains is randomly determined as the target sub-chain.
  • the sub-chain containing the least number of blocks that is, the sub-chain with the shortest length, is taken as the target sub-chain, and the subsequent block addition steps are performed on the target sub-chain to balance each of the target blockchains.
  • the length of the sub-chain from a longer time period, can achieve the effect of basically the same length of each sub-chain.
  • the node device determines the sub-chain containing the smallest number of blocks as the target sub-chain; or, in response to the node device having the same number of blocks contained in each sub-chain, One of the sub-chains is randomly selected as the target sub-chain.
  • the above steps 302 and 303 if the transaction time of the transaction contained in the new block is within the time interval, the first target number of sub-chains connected to the root block will be traversed, and the target condition will be met.
  • This sub-chain is used as the step of the target sub-chain. Since the new block refers to any block generated in the blockchain system at the latest moment, in other words, the above steps 302-303 are the node device's response to the transaction contained in any block.
  • the transaction occurrence time is within the time interval, and from the first number of target sub-chains connected to the root block, the sub-chain that meets the target condition is taken as a possible implementation of the target sub-chain.
  • the target condition can be set by the developer, which is not limited in the embodiment of the present disclosure.
  • the target condition can be set to the minimum number of blocks included in the sub-chain.
  • the sub-chain is screened based on the target conditions, and a target sub-chain is determined to add a new block. Through this method of determining the target sub-chain, the structure of the blockchain can be made more reasonable. For example, when the When the target condition is that the number of blocks included in the sub-chain is the smallest, the length of each sub-chain in the blockchain can be in a more balanced state.
  • the node device In response to the consensus of the new block, the node device adds the new block to the target sub-chain of the target blockchain.
  • the above step 304 is that the node device, in response to the consensus of any block, adds any block to the target blockchain Of the target sub-chain.
  • the node device in the blockchain system can determine the block number of the new block based on the sub-chain number of the target sub-chain and the sequence number of the block in the target sub-chain, and it will carry the area.
  • the new block with the block number is added to the target sub-chain.
  • the node device may be the leader node device in the consensus node device.
  • the node device determines any block based on the sub-chain number of the target sub-chain and the sequence number of the block in the target sub-chain The block number of, any block carrying the block number will be added to the target sub-chain.
  • the node device may add a block number to the new block.
  • the node device may add one to the sequence number of the block with the highest block height in the target sub-chain as the sequence number of the new block; the sub-chain number of the target sub-chain and the sequence number of the new block Perform splicing to obtain the block number of the new block in the target blockchain.
  • the node device adds one to the sequence number of the block with the highest block height in the target sub-chain to obtain the sequence of any block Number; splicing the sub-chain number of the target sub-chain and the sequence number of any block to obtain the block number of any block in the target block chain.
  • the block number of the new block may be 2.4.
  • the sequence number is used to indicate the sequence of the blocks in the target sub-chain
  • the block number is used to indicate the storage location of the new block in the target blockchain.
  • the consensus node device in the blockchain system can verify the block number of each block based on the generation rule of the block number. It should be noted that the foregoing description of the block number construction method is only an exemplary description, and the embodiment of the present disclosure does not limit which block number construction method is specifically adopted.
  • Figure 5 is a schematic diagram of a target blockchain data structure provided by an embodiment of the present disclosure.
  • the target blockchain shown in Figure 5 is taken as an example to illustrate the generation process of the block number.
  • a time interval is stored in the root block 500.
  • the block generation period in the blockchain system is set to 1 second and the average consensus duration of the block is 3 seconds
  • the first target number corresponding to the target blockchain is 3 , That is, the number of sub-chains is 3.
  • the first block 501 When the first block 501 is generated in this time interval, except for the root block, there is no other block in the target block chain on the chain, then the first block 501 can be shared with the root zone
  • the blocks are connected to form a sub-chain, the sub-chain number is 1, and the block number of the first block 501 is 1.1; when the consensus of the second block 502 is completed, the first block 501 has been on the chain , And the number of sub-chains in the target blockchain does not reach the first target number, then the second block 502 can be connected with the root block to form a sub-chain whose sub-chain number is 2, and the second block 502
  • the block number of each block 502 is 2.1; the chaining process of the third block 503 is the same as the chaining process of the second block 502, and will not be repeated here.
  • the target block chain already includes the target number of sub-chains, and the number of blocks in each sub-chain is the same, then the fourth block 504 can randomly select a sub-chain to complete the chain Steps, for example, the fourth block 504 can select a sub-chain with a sub-chain number of 1, and a block number of 1.2; the on-chain process of the fifth block 505 is the same as the on-chain process of the fourth block 504 I won’t go into details here.
  • the shortest length is the sub-chain number 3
  • the sixth block 506 needs to be added to the sub-chain number 3 after the consensus is completed Because the consensus process of the sixth block 506 takes a long time on the sub-chain of
  • the shortest length is still the sub-chain with sub-chain number 3
  • the seventh block 507 is first completed on the chain and connected to the sub-chain with sub-chain number 3
  • the block number of the seventh block 507 is 3.2
  • the sixth block 506 completes the consensus, and is also connected to the sub-chain with the sub-chain number 3
  • the block number of the sixth block 506 is 3.3 .
  • the new block is added to the end of the target sub-chain, that is, after the new block is connected with the block with the highest block height in the target sub-chain, the new block can also be Add a location for verification.
  • the node device can determine the previous block of the new block as a candidate block; compare the sequence number of the candidate block with the sequence number of the new block; The sequence number and the sequence number of the new block are not continuously increasing, that is, the new block is not connected to the end of the target sub-chain, then the adding position of the new block is re-determined, and the new block is added to the Steps on the target sub-chain.
  • This verification mechanism can ensure that the sequence number of each block in the sub-chain is sequentially increasing, avoiding bifurcation of the sub-chain and avoiding block disorder.
  • the verification mechanism of the node device refers to: determining the previous block of any block as a candidate block; responding to the candidate block
  • the sequence number of the block and the sequence number of any block are not continuously increasing, and the adding position of the any block is re-determined, and the step of adding the any block to the target sub-chain is performed.
  • the technical solution provided by the embodiment of the present disclosure obtains the time interval stored in the root block of the target blockchain by responding to the generation of any new block; if the transaction occurrence time of the transaction contained in the new block is within the time interval , Then traverse the first target number of sub-chains connected to the root block, and use the sub-chain that meets the target conditions as the target sub-chain; in response to the consensus of the new block, add the new block to the target block chain. On the target sub-chain.
  • the block is connected to the blockchain according to the time when the block passes the consensus. There is no need to wait for the previously generated block to complete the consensus, and the blockchain is constructed as a tree structure consisting of multiple sub-chains. Each sub-chain can add blocks at the same time, which improves the efficiency of adding blocks, enables blocks to be chained in time, and ensures the normal operation of the blockchain system.
  • each block chain is constructed as a tree structure containing a root block and multiple sub-chains. Through the time interval stored in the root block of each block chain, each block chain can be flexibly controlled. The number of blocks in the blockchain prevents too many blocks stored in a blockchain, which increases the difficulty of data query, and ensures the good operation of the system.
  • each root block can also be indexed, that is, a root block index table can be maintained in the blockchain system for recording the storage location, time interval and other information of each root block.
  • the embodiment of the present disclosure does not limit the specific construction method of the root block index table.
  • the foregoing embodiment mainly introduces a method for constructing a block chain.
  • the blockchain system can maintain a block index table that is linked to the target blockchain, and the block index table can record each block in the target blockchain
  • the storage location information is convenient for data query on the target blockchain.
  • the node device in response to the consensus of the new block, can store the storage location information of the new block in the block index table of the target blockchain, and the block index table is used to record the target.
  • Block information of each block in the blockchain may be a block number.
  • the node device Since the new block refers to any block generated in the blockchain system at the latest time, in other words, the node device stores the storage location information of any block in the block index table of the target blockchain.
  • the block index table includes a second target number of data storage units, one data storage unit corresponds to a time stamp, and one data storage unit can store fixed-length data, and the fixed-length data Block information such as storage location information of the block can be recorded in the block.
  • Block information such as storage location information of the block can be recorded in the block.
  • the specific value of the second target quantity can be set by the developer, and the fixed length can be set by the developer, which is not limited in the embodiment of the present disclosure.
  • the second target number can be set to 60.
  • a block index table includes 60 data storage units, that is, the blocks generated every minute are stored in the same A block index table.
  • the node device determines that any data storage unit is the target Data storage unit; storing the storage location information of the new block in the target data storage unit of the block index table.
  • the node device Since a new block refers to any block generated in the blockchain system at the latest moment, in other words, the node device stores the storage location information of any block in the target data storage unit of the block index table, where the The time identifier of the target data storage unit matches the transaction occurrence time of the transaction contained in any block.
  • the time identifier may be a time offset relative to the start time of the time interval. For example, when the time interval is from 23:00 to 24:00, the time identifier is 00:01, that is, relative When the time offset at 23:00 is 00:01, the transaction time 23:01 can match the time identifier, and the storage location information of the block storing the transaction data generated at 23:01 can be recorded in The time identifier is in the data storage unit corresponding to 00:01. Referring to FIG. 6, FIG. 6 is a schematic structural diagram of a target blockchain and a block index table provided by an embodiment of the present disclosure.
  • the data storage unit of the block index table 601 When the time interval is from 23:00 to 24:00, the data storage unit of the block index table 601 The storage location information of the block 603 generated at 23:01 can be stored in 602. It should be noted that the foregoing description of the method for storing block information in the block index table is only an exemplary description, and the embodiment of the present disclosure does not limit the specific storage method used. It should be noted that the time mark may also be set to a certain moment in the time interval, for example, it may be set to 23:01, etc. The specific form of the time mark is not limited in the embodiment of the present disclosure.
  • the data storage unit can also store other data information of the block, for example, the hash value of the block, which is not limited in the embodiment of the present disclosure.
  • the block information of each block can be recorded in the order of the transaction occurrence time of the transactions contained in the block, for example, the storage location of the block, so that the block chain system can easily check each block. Block query and verification.
  • FIG. 7 is a flowchart of a blockchain-based data query method provided by an embodiment of the present disclosure. Referring to FIG. 7, in a possible implementation manner, the method may specifically include the following steps:
  • the node device obtains a block index table of the target block chain in response to a query instruction for the target block in the target block chain.
  • the query instruction can carry the transaction time of the transaction contained in the target block, and each data storage unit in the block index table is used to record the storage of each block in the target blockchain For location information, one data storage unit corresponds to a time stamp.
  • each data storage unit in the block index table is used to record the storage of each block in the target blockchain For location information, one data storage unit corresponds to a time stamp.
  • the node device matches the time identifier of each data storage unit with the transaction occurrence time, and determines the data storage unit corresponding to the time identifier that successfully matches the transaction occurrence time as the target data storage unit.
  • step 702 is also a possible implementation manner in which the node device determines the target data storage unit from the block index table, wherein the time identifier of the target data storage unit matches the time when the transaction occurs.
  • the time identifier may be set as a time offset relative to the start time of the time interval.
  • the node device can obtain the time interval stored in the root block of the target blockchain; determine the time when the transaction occurrence time is relative to the start time of the time interval Offset; when any time indicator is the same as the time offset, it is determined that any time indicator matches the generation time successfully; the data storage unit corresponding to any time indicator is determined as the target data storage unit.
  • the node device obtains the time interval stored in the root block of the target blockchain; determines the time offset of the transaction occurrence time relative to the start time of the time interval; responds to any data storage
  • the time identifier of the unit is the same as the time offset, and any data storage unit is determined as the target data storage unit.
  • a data storage unit may store data of a fixed length, wherein the specific value of the fixed length can be set by the developer.
  • the block information of each block is stored in the order of the transaction occurrence time of the transaction contained in the block.
  • the node device can determine that the transaction occurrence time is relative to The time offset of the start time of the time interval is multiplied by the fixed length to determine the storage location of the block information of the target block in the block index table, that is, to determine the storage The target data storage unit with the block information.
  • a data storage unit stores the block information of a block, and the data storage unit is located by the transaction occurrence time of the transaction contained in the block, which can ensure the accuracy of the obtained block information. That is, it can ensure that the storage location of the block is accurately obtained, and the accuracy of the data query result can be improved.
  • the node device searches for the target block in the target blockchain based on the storage location information in the target data storage unit.
  • the storage location information can be expressed as a block number, that is, after the node device obtains the block number, it can determine the sub-chain to which the target block belongs based on the sub-chain number in the block number , Determining the sequence of the target block in the sub-chain based on the sequence number in the block number, thereby locating the target block in the sub-chain, and obtaining data information in the target block.
  • the data storage unit may also store the hash value of the target block, etc., and the node device may verify the target block based on the hash value and the data information in the target block.
  • the storage location of the block is recorded by the block index table associated with the block chain, which can effectively avoid the problem of data difficulty caused by the disorder of the block in the block chain, and improve the data query Efficiency and accuracy.
  • FIG. 8 is a schematic structural diagram of a block processing device provided by an embodiment of the present disclosure. Referring to FIG. 8, the device includes:
  • the obtaining module 801 is configured to obtain the time interval stored in the root block of the target blockchain in response to the generation of any new block;
  • the obtaining module 801 is used to obtain the time interval stored in the root block of the target blockchain in response to the generation of any block;
  • the sub-chain determination module 802 is configured to, if the transaction occurrence time of the transaction contained in the new block is within the time interval, traverse the first target number of sub-chains connected to the root block, and determine the sub-chain that meets the target condition Is the target sub-chain;
  • the sub-chain determination module 802 is used to respond to the transaction occurrence time of the transaction contained in the block within the time interval, and from the first target number of sub-chains connected to the root block, the The sub-chain of the target condition is determined as the target sub-chain;
  • the adding module 803 is configured to add the new block to the target sub-chain of the target blockchain in response to the consensus of the new block;
  • the adding module 803 is configured to add the block to the target sub-chain of the target blockchain in response to the consensus of the block.
  • the first target number is determined based on the average consensus duration of the blocks in the blockchain system to which the target blockchain belongs and the block generation period.
  • sub-chain determination module 802 is used to:
  • the sub-chain containing the least number of blocks is determined as the target sub-chain
  • each sub-chain If the number of blocks included in each sub-chain is the same, in each sub-chain, one of the sub-chains is randomly determined as the target sub-chain.
  • sub-chain determination module 802 is used to:
  • the sub-chain containing the least number of blocks is determined as the target sub-chain
  • one sub-chain is randomly determined as the target sub-chain.
  • the adding module 803 is used to:
  • the sequence number is used to indicate the sequence of the blocks in the target sub-chain.
  • the number is used to indicate the storage location of the new block in the target blockchain;
  • the new block carrying the block number is added to the target sub-chain.
  • the adding module 803 is used to:
  • the sequence number is used to indicate the sequence of the blocks in the target sub-chain.
  • the number is used to indicate the storage location of the block in the target blockchain;
  • the block carrying the block number is added to the target sub-chain.
  • the adding module 803 is used to:
  • the sub-chain number of the target sub-chain and the sequence number of the new block are spliced together to obtain the block number of the new block in the target block chain.
  • the adding module 803 is used to:
  • the sub-chain number of the target sub-chain and the sequence number of the block are spliced to obtain the block number of the block in the target block chain.
  • the device further includes:
  • Block determination module used to determine the previous block of the new block as a candidate block
  • the block determination module is used to determine the previous block of the block as a candidate block
  • the comparison module is used to compare the sequence number of the candidate block with the sequence number of the new block; if the sequence number of the candidate block and the sequence number of the new block are not continuously increasing, re-determine the sequence number of the new block Add location, perform the steps of adding the new block to the target sub-chain;
  • the comparison module is used to re-determine the adding position of the block in response to the sequence number of the candidate block and the sequence number of the block not increasing continuously, and execute adding the block to the target Steps on the child chain.
  • the device further includes:
  • the information storage module is used to store the storage location information of the new block in the block index table of the target blockchain, and the block index table is used to record the block information of each block in the target blockchain.
  • the information storage module is used to store the storage location information of the block in the block index table of the target blockchain, and the block index table is used to record each area in the target blockchain.
  • the block information of the block is used to record each area in the target blockchain.
  • the block index table includes a second target number of data storage units, and one data storage unit corresponds to one time identifier.
  • the information storage module is used to:
  • any data storage unit in the block index table matches the transaction occurrence time of the transaction contained in the new block, then any data storage unit is determined as the target data storage unit;
  • the storage location information of the new block is stored in the target data storage unit of the block index table.
  • the information storage module is used for:
  • the storage location information of the block is stored in the target data storage unit of the block index table, and the time identifier of the target data storage unit matches the transaction occurrence time of the transaction contained in the block.
  • the device provided by the embodiment of the present disclosure obtains the time interval stored in the root block of the target blockchain by responding to the generation of any new block; if the transaction occurrence time of the transaction contained in the new block is within the time interval, Then traverse the first target number of sub-chains connected to the root block, and use the sub-chain that meets the target conditions as the target sub-chain; in response to the consensus of the new block, add the new block to the target of the target blockchain Sub-chain.
  • the block is connected to the blockchain according to the time when the block passes the consensus, without waiting for the previously generated block to complete the consensus, and the blockchain is composed of multiple sub-chains, and multiple sub-chains can add blocks at the same time , Improve the efficiency of adding blocks, make the blocks can be chained in time, and ensure the normal operation of the block chain system.
  • the block processing device provided in the above embodiment only uses the division of the above functional modules for example during block processing.
  • the above functions can be allocated by different functional modules according to needs.
  • the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
  • the block processing device and the block processing method embodiment provided in the foregoing embodiment belong to the same concept. For the specific implementation process, please refer to the block processing method embodiment, which will not be repeated here.
  • FIG. 9 is a schematic structural diagram of a block chain-based data query device provided by an embodiment of the present disclosure. Referring to FIG. 9, the device includes:
  • the obtaining module 901 is configured to obtain a block index table of the target block chain in response to a query instruction for a target block in the target block chain.
  • the query instruction carries the transaction occurrence time of the transaction data in the target block.
  • Each data storage unit in the block index table is used to record the storage location information of each block in the target blockchain, and one data storage unit corresponds to a time stamp; that is, the data storage unit in the block index table
  • the data storage unit is used to record the storage location information of the blocks in the target blockchain;
  • the matching module 902 is configured to match the time identifier of each data storage unit with the time when the transaction occurred;
  • the determining module 903 is configured to determine the data storage unit corresponding to the time identifier that successfully matches the transaction time as the target data storage unit;
  • the determining module 903 is configured to determine a target data storage unit from the block index table, and the time identifier of the target data storage unit matches the time when the transaction occurs;
  • the searching module 904 is configured to search for the target block in the target blockchain based on the storage location information in the target data storage unit.
  • the matching module 902 is used to:
  • any time identifier is the same as the time offset, it is determined that the any time identifier matches the generation time successfully.
  • the determining module 803 is used for:
  • the data storage unit is determined as the target data storage unit.
  • the data query device based on the blockchain provided in the above embodiment performs data query based on the blockchain
  • only the division of the above-mentioned functional modules is used as an example.
  • the above-mentioned Function allocation is completed by different functional modules, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
  • the block chain-based data query device provided in the above embodiment belongs to the same concept as the block chain-based data query method embodiment. For the specific implementation process, please refer to the block chain-based data query method embodiment. Go into details.
  • FIG. 10 is a schematic structural diagram of a terminal provided by an embodiment of the present disclosure.
  • the terminal 1000 can be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, moving picture experts compressing standard audio layer 3), MP4 (Moving Picture Experts Group Audio Layer IV, moving picture experts compressing standard audio Level 4) Player, laptop or desktop computer.
  • the terminal 1000 may also be called user equipment, portable terminal, laptop terminal, desktop terminal and other names.
  • the terminal 1000 includes: one or more processors 1001 and one or more memories 1002.
  • the processor 1001 may include one or more processing cores, such as a 4-core processor, a 10-core processor, and so on.
  • the processor 1001 may adopt at least one hardware form among DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array, Programmable Logic Array). accomplish.
  • the processor 1001 may also include a main processor and a coprocessor.
  • the main processor is a processor used to process data in the wake-up state, also called a CPU (Central Processing Unit, central processing unit); the coprocessor is A low-power processor used to process data in the standby state.
  • the processor 1001 may be integrated with a GPU (Graphics Processing Unit, image processor), and the GPU is used to render and draw content that needs to be displayed on the display screen.
  • the processor 1001 may further include an AI (Artificial Intelligence) processor, and the AI processor is used to process computing operations related to machine learning.
  • AI Artificial Intelligence
  • the memory 1002 may include one or more computer-readable storage media, which may be non-transitory.
  • the memory 1002 may also include high-speed random access memory and non-volatile memory, such as one or more magnetic disk storage devices and flash memory storage devices.
  • the non-transitory computer-readable storage medium in the memory 1002 is used to store at least one computer program, and the at least one computer program is used to be executed by the processor 1001 to implement the methods provided in the method embodiments of the present disclosure.
  • the terminal 1000 optionally further includes: a peripheral device interface 1003 and at least one peripheral device.
  • the processor 1001, the memory 1002, and the peripheral device interface 1003 may be connected through a bus or a signal line.
  • Each peripheral device can be connected to the peripheral device interface 1003 through a bus, a signal line, or a circuit board.
  • the peripheral device includes: at least one of a radio frequency circuit 1004, a display screen 1005, a camera component 1006, an audio circuit 1007, a positioning component 1008, and a power supply 1009.
  • the peripheral device interface 1003 may be used to connect at least one peripheral device related to I/O (Input/Output) to the processor 1001 and the memory 1002.
  • the processor 1001, the memory 1002, and the peripheral device interface 1003 are integrated on the same chip or circuit board; in some other embodiments, any one of the processor 1001, the memory 1002, and the peripheral device interface 1003 or The two can be implemented on a separate chip or circuit board, which is not limited in this embodiment.
  • the radio frequency circuit 1004 is used for receiving and transmitting RF (Radio Frequency, radio frequency) signals, also called electromagnetic signals.
  • the radio frequency circuit 1004 communicates with a communication network and other communication devices through electromagnetic signals.
  • the radio frequency circuit 1004 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals.
  • the radio frequency circuit 1004 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and so on.
  • the radio frequency circuit 1004 can communicate with other terminals through at least one wireless communication protocol.
  • the wireless communication protocol includes, but is not limited to: metropolitan area networks, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (Wireless Fidelity, wireless fidelity) networks.
  • the radio frequency circuit 1004 may also include a circuit related to NFC (Near Field Communication), which is not limited in the present disclosure.
  • the display screen 1005 is used to display a UI (User Interface, user interface).
  • the UI can include graphics, text, icons, videos, and any combination thereof.
  • the display screen 1005 also has the ability to collect touch signals on or above the surface of the display screen 1005.
  • the touch signal can be input to the processor 1001 as a control signal for processing.
  • the display screen 1005 may also be used to provide virtual buttons and/or virtual keyboards, also called soft buttons and/or soft keyboards.
  • the display screen 1005 there may be one display screen 1005, which is provided with the front panel of the terminal 1000; in other embodiments, there may be at least two display screens 1005, which are respectively arranged on different surfaces of the terminal 1000 or in a folded design; In some embodiments, the display screen 1005 may be a flexible display screen, which is arranged on a curved surface or a folding surface of the terminal 1000. Furthermore, the display screen 1005 can also be set as a non-rectangular irregular pattern, that is, a special-shaped screen.
  • the display screen 1005 may be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode, organic light-emitting diode), etc.
  • the camera assembly 1006 is used to capture images or videos.
  • the camera assembly 1006 includes a front camera and a rear camera.
  • the front camera is set on the front panel of the terminal, and the rear camera is set on the back of the terminal.
  • the camera assembly 1006 may also include a flash.
  • the flash can be a single-color flash or a dual-color flash. Dual color temperature flash refers to a combination of warm light flash and cold light flash, which can be used for light compensation under different color temperatures.
  • the audio circuit 1007 may include a microphone and a speaker.
  • the microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input to the processor 1001 for processing, or input to the radio frequency circuit 1004 to implement voice communication. For the purpose of stereo collection or noise reduction, there may be multiple microphones, which are respectively set in different parts of the terminal 1000.
  • the microphone can also be an array microphone or an omnidirectional collection microphone.
  • the speaker is used to convert the electrical signal from the processor 1001 or the radio frequency circuit 1004 into sound waves.
  • the speaker can be a traditional thin-film speaker or a piezoelectric ceramic speaker.
  • the speaker When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into human audible sound waves, but also convert the electrical signal into human inaudible sound waves for distance measurement and other purposes.
  • the audio circuit 1007 may also include a headphone jack.
  • the positioning component 1008 is used to locate the current geographic location of the terminal 1000 to implement navigation or LBS (Location Based Service, location-based service).
  • the positioning component 1008 may be a positioning component based on the GPS (Global Positioning System, Global Positioning System) of the United States, the Beidou system of China, the Granus system of Russia, or the Galileo system of the European Union.
  • the power supply 1009 is used to supply power to various components in the terminal 1000.
  • the power source 1009 may be alternating current, direct current, disposable batteries, or rechargeable batteries.
  • the rechargeable battery may support wired charging or wireless charging.
  • the rechargeable battery can also be used to support fast charging technology.
  • the terminal 1000 further includes one or more sensors 1010.
  • the one or more sensors 1010 include, but are not limited to: an acceleration sensor 1011, a gyroscope sensor 1012, a pressure sensor 1013, a fingerprint sensor 1014, an optical sensor 1015, and a proximity sensor 1016.
  • the acceleration sensor 1011 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal 1000.
  • the acceleration sensor 1011 can be used to detect the components of gravitational acceleration on three coordinate axes.
  • the processor 1001 may control the display screen 1005 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 1011.
  • the acceleration sensor 1011 may also be used for the collection of game or user motion data.
  • the gyroscope sensor 1012 can detect the body direction and rotation angle of the terminal 1000, and the gyroscope sensor 1012 can cooperate with the acceleration sensor 1011 to collect the user's 3D actions on the terminal 1000. Based on the data collected by the gyroscope sensor 1012, the processor 1001 can implement the following functions: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
  • the pressure sensor 1013 may be disposed on the side frame of the terminal 1000 and/or the lower layer of the display screen 1005.
  • the processor 1001 performs left and right hand recognition or quick operation according to the holding signal collected by the pressure sensor 1013.
  • the processor 1001 controls the operability controls on the UI interface according to the user's pressure operation on the display screen 1005.
  • the operability control includes at least one of a button control, a scroll bar control, an icon control, and a menu control.
  • the fingerprint sensor 1014 is used to collect the user's fingerprint.
  • the processor 1001 identifies the user's identity according to the fingerprint collected by the fingerprint sensor 1014, or the fingerprint sensor 1014 identifies the user's identity according to the collected fingerprint.
  • the processor 1001 authorizes the user to perform related sensitive operations, including unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings.
  • the fingerprint sensor 1014 may be provided on the front, back or side of the terminal 1000. When a physical button or a manufacturer logo is provided on the terminal 1000, the fingerprint sensor 1014 can be integrated with the physical button or the manufacturer logo.
  • the optical sensor 1015 is used to collect the ambient light intensity.
  • the processor 1001 may control the display brightness of the display screen 1005 according to the intensity of the ambient light collected by the optical sensor 1015. Optionally, when the ambient light intensity is high, the display brightness of the display screen 1005 is increased; when the ambient light intensity is low, the display brightness of the display screen 1005 is decreased. In another embodiment, the processor 1001 may also dynamically adjust the shooting parameters of the camera assembly 1006 according to the ambient light intensity collected by the optical sensor 1015.
  • the proximity sensor 1016 also called a distance sensor, is usually arranged on the front panel of the terminal 1000.
  • the proximity sensor 1016 is used to collect the distance between the user and the front of the terminal 1000.
  • the processor 1001 controls the display screen 1005 to switch from the on-screen state to the off-screen state; when the proximity sensor 1016 detects When the distance between the user and the front of the terminal 1000 gradually increases, the processor 1001 controls the display screen 1005 to switch from the rest screen state to the bright screen state.
  • FIG. 10 does not constitute a limitation on the terminal 1000, and may include more or fewer components than shown in the figure, or combine certain components, or adopt different component arrangements.
  • FIG. 11 is a schematic structural diagram of a server provided by an embodiment of the present disclosure.
  • the server 1100 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 1101 and one Or multiple memories 1102, wherein at least one computer program is stored in the one or more memories 1102, and the at least one computer program is loaded and executed by the one or more processors 1101 to implement the methods provided in the foregoing various method embodiments method.
  • the server 1100 may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output.
  • the server 1100 may also include other components for implementing device functions, which are not described here.
  • the aforementioned node device refers to a computer device that includes one or more processors and one or more memories, and at least one computer program is stored in the one or more memories.
  • the computer program is loaded and executed by the one or more processors to realize the following operations:
  • the block is added to the target sub-chain of the target blockchain.
  • the first target number is determined based on the average consensus duration of blocks in the blockchain system to which the target blockchain belongs and the block generation period.
  • the at least one computer program is loaded and executed by the one or more processors to implement the following operations:
  • the sub-chain containing the least number of blocks is determined as the target sub-chain
  • one sub-chain is randomly determined as the target sub-chain.
  • the at least one computer program is loaded and executed by the one or more processors to implement the following operations:
  • the sequence number is used to indicate the sequence of the blocks in the target sub-chain.
  • the number is used to indicate the storage location of the block in the target blockchain;
  • the block carrying the block number is added to the target sub-chain.
  • the at least one computer program is loaded and executed by the one or more processors to implement the following operations:
  • the sub-chain number of the target sub-chain and the sequence number of the block are spliced to obtain the block number of the block in the target block chain.
  • the at least one computer program is loaded and executed by the one or more processors to implement the following operations:
  • the adding position of the block is re-determined, and the step of adding the block to the target sub-chain is performed.
  • the at least one computer program is loaded and executed by the one or more processors to implement the following operations:
  • the storage location information of the block is stored in a block index table of the target blockchain, and the block index table is used to record the block information of each block in the target blockchain.
  • the block index table includes a second target number of data storage units, and one data storage unit corresponds to one time identifier.
  • the at least one computer program is loaded and executed by the one or more processors to implement the following operations:
  • the storage location information of the block is stored in the target data storage unit of the block index table, and the time identifier of the target data storage unit matches the transaction occurrence time of the transaction contained in the block.
  • the aforementioned node device refers to a computer device that includes one or more processors and one or more memories, and at least one computer program is stored in the one or more memories.
  • a computer program is loaded and executed by the one or more processors to achieve the following operations:
  • a block index table of the target block chain is obtained, the query instruction carries the transaction occurrence time of the transaction in the target block, and the data in the block index table
  • the storage unit is used to record the storage location information of the block in the target blockchain, and one data storage unit corresponds to a time stamp;
  • the target block is searched in the target blockchain.
  • the at least one computer program is loaded and executed by the one or more processors to implement the following operations:
  • the data storage unit is determined as the target data storage unit.
  • a computer-readable storage medium such as a memory including at least one computer program. Block chain data query method.
  • the computer-readable storage medium may be Read-Only Memory (ROM), Random Access Memory (RAM), Compact Disc Read-Only Memory (CD-ROM), Magnetic tapes, floppy disks and optical data storage devices, etc.
  • the at least one computer program is loaded and executed by the processor to implement the following operations:
  • the block is added to the target sub-chain of the target blockchain.
  • the first target number is determined based on the average consensus duration of blocks in the blockchain system to which the target blockchain belongs and the block generation period.
  • the at least one computer program is loaded and executed by the processor to implement the following operations:
  • the sub-chain containing the least number of blocks is determined as the target sub-chain
  • one sub-chain is randomly determined as the target sub-chain.
  • the at least one computer program is loaded and executed by the processor to implement the following operations:
  • the sequence number is used to indicate the sequence of the blocks in the target sub-chain.
  • the number is used to indicate the storage location of the block in the target blockchain;
  • the block carrying the block number is added to the target sub-chain.
  • the at least one computer program is loaded and executed by the processor to implement the following operations:
  • the sub-chain number of the target sub-chain and the sequence number of the block are spliced to obtain the block number of the block in the target block chain.
  • the at least one computer program is loaded and executed by the processor to implement the following operations:
  • the adding position of the block is re-determined, and the step of adding the block to the target sub-chain is performed.
  • the at least one computer program is loaded and executed by the processor to implement the following operations:
  • the storage location information of the block is stored in a block index table of the target blockchain, and the block index table is used to record the block information of each block in the target blockchain.
  • the block index table includes a second target number of data storage units, and one data storage unit corresponds to one time identifier.
  • the at least one computer program is loaded and executed by the processor to implement the following operations:
  • the storage location information of the block is stored in the target data storage unit of the block index table, and the time identifier of the target data storage unit matches the transaction occurrence time of the transaction contained in the block.
  • the at least one computer program is loaded and executed by the processor to implement the following operations:
  • a block index table of the target block chain is obtained, the query instruction carries the transaction occurrence time of the transaction in the target block, and the data in the block index table
  • the storage unit is used to record the storage location information of the block in the target blockchain, and one data storage unit corresponds to a time stamp;
  • the target block is searched in the target blockchain.
  • the at least one computer program is loaded and executed by the processor to implement the following operations:
  • the data storage unit is determined as the target data storage unit.
  • a computer program or computer program product including at least one piece of program code is also provided, which when it runs on a computer device, causes the computer device to execute the block processing method provided by the foregoing various embodiments or based on the region. Any possible implementation of the block chain data query method will not be repeated here.
  • the computer program can be stored in a computer-readable storage medium.
  • the storage medium mentioned can be a read-only memory, a magnetic disk or an optical disk, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Mining & Analysis (AREA)
  • Business, Economics & Management (AREA)
  • Software Systems (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Fuzzy Systems (AREA)
  • Computational Linguistics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Mathematical Physics (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Computing Systems (AREA)
  • Computer Hardware Design (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Health & Medical Sciences (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

一种区块处理方法、基于区块链的数据查询方法、装置、计算机设备及存储介质,属于区块链技术领域,所述方法包括:响应于任一个新区块的生成,获取目标区块链的根区块所存储的时间区间;若该新区块所包含交易的交易发生时间位于该时间区间内,则遍历该根区块所连接的第一目标数量个子链,将符合目标条件的该子链确定为目标子链;响应于该新区块通过共识,将该新区块添加至该目标区块链的目标子链上。应用上述方法、装置、计算机设备及存储介质,按照区块通过共识的时间,将区块存储至区块链上,无需等待之前生成的区块完成共识,且区块链由多个子链构成,多个子链可以同时添加区块,提高了区块的添加效率,使区块可以及时上链,确保区块链系统正常运行。

Description

区块处理方法、基于区块链的数据查询方法及装置
本公开要求于2020年02月18日提交的申请号为202010099538.8、发明名称为“区块处理方法、基于区块链的数据查询方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本公开中。
技术领域
本公开涉及区块链技术领域,特别涉及一种区块处理方法、基于区块链的数据查询方法、装置、计算机设备及存储介质。
背景技术
区块链(Blockchain)本质上是一个去中心化的数据库,由多个串联的区块构成。在目前的区块链构建方法中,通过共识的区块按照生成时间顺序连接,构成一条区块链,有新区块生成,且通过共识后,可以连接在这条区块链的尾部。
发明内容
本公开实施例提供了一种区块处理方法、基于区块链的数据查询方法、装置、计算机设备及存储介质。该技术方案如下:
一方面,提供了一种区块处理方法,该方法包括:
响应于任一个区块的生成,获取目标区块链的根区块所存储的时间区间;
响应于该区块所包含交易的交易发生时间位于该时间区间内,从该根区块所连接的第一目标数量个子链中,将符合目标条件的该子链确定为目标子链;
响应于该区块通过共识,将该区块添加至该目标区块链的该目标子链上。
一方面,提供了一种基于区块链的数据查询方法,该方法包括:
响应于对目标区块链中目标区块的查询指令,获取该目标区块链的区块索引表,该查询指令携带该目标区块中交易的交易发生时间,该区块索引表中的数据存储单元用于记录该目标区块链中区块的存储位置信息,一个该数据存储单元对应于一个时间标识;
从该区块索引表中确定目标数据存储单元,该目标数据存储单元的时间标 识与该交易发生时间相匹配;
基于该目标数据存储单元中的存储位置信息,在该目标区块链中查找该目标区块。
一方面,提供了一种区块处理装置,该装置包括:
获取模块,用于响应于任一个区块的生成,获取目标区块链的根区块所存储的时间区间;
子链确定模块,用于响应于该区块所包含交易的交易发生时间位于该时间区间内,从该根区块所连接的第一目标数量个子链中,将符合目标条件的该子链确定为目标子链;
添加模块,用于响应于该区块通过共识,将该区块添加至该目标区块链的该目标子链上。
在一种可能实现方式中,该第一目标数量基于该目标区块链所属的区块链系统中区块平均共识时长以及区块生成周期确定。
在一种可能实现方式中,该子链确定模块用于:
确定各个该子链所包含区块的数目;
响应于各个该子链所包含区块的数目不同,将包含区块数目最少的该子链确定为该目标子链;
响应于各个该子链所包含区块的数目相同,在各个该子链中,随机确定一个该子链作为该目标子链。
在一种可能实现方式中,该添加模块用于:
基于该目标子链的子链编号以及该目标子链中区块的顺序号,确定该区块的区块编号,该顺序号用于指示该目标子链中区块的排列次序,该区块编号用于指示该区块在该目标区块链中的存储位置;
将携带该区块编号的该区块,添加在该目标子链上。
在一种可能实现方式中,该添加模块用于:
将该目标子链中区块高度最高的区块的顺序号加一,得到该区块的顺序号;
将该目标子链的子链编号以及该区块的顺序号进行拼接,得到该区块在该目标区块链中的区块编号。
在一种可能实现方式中,该装置还包括:
区块确定模块,用于将该区块的前一个区块确定为候选区块;
比较模块,用于响应于该候选区块的顺序号与该区块的顺序号不是连续递 增的,重新确定该区块的添加位置,执行将该区块添加至该目标子链上的步骤。
在一种可能实现方式中,该装置还包括:
信息存储模块,用于将该区块的存储位置信息存储至该目标区块链的区块索引表中,该区块索引表用于记录该目标区块链中各个区块的区块信息。
在一种可能实现方式中,该区块索引表包括第二目标数量个数据存储单元,一个数据存储单元对应于一个时间标识。
在一种可能实现方式中,该信息存储模块用于:
将该区块的存储位置信息存储至该区块索引表的该目标数据存储单元中,该目标数据存储单元的时间标识与该区块所包含交易的交易发生时间相匹配。
一方面,提供了一种基于区块链的数据查询装置,该装置包括:
获取模块,用于响应于对目标区块链中目标区块的查询指令,获取该目标区块链的区块索引表,该查询指令携带该目标区块中交易数据的交易发生时间,该区块索引表中的数据存储单元用于记录该目标区块链中区块的存储位置信息,一个该数据存储单元对应于一个时间标识;
确定模块,用于从该区块索引表中确定目标数据存储单元,该目标数据存储单元的时间标识与该交易发生时间相匹配;
查找模块,用于基于该目标数据存储单元中的存储位置信息,在该目标区块链中查找该目标区块。
在一种可能实现方式中,该确定模块用于:
获取该目标区块链的根区块中存储的时间区间;
确定该交易发生时间相对于该时间区间的开始时间的时间偏移量;
响应于任一数据存储单元的时间标识与该时间偏移量相同时,将该数据存储单元确定为该目标数据存储单元。
一方面,提供了一种计算机设备,该计算机设备包括一个或多个处理器和一个或多个存储器,该一个或多个存储器中存储有至少一条计算机程序,该至少一条计算机程序由该一个或多个处理器加载并执行以实现该区块处理方法或者基于区块链的数据查询方法所执行的操作。
一方面,提供了一种计算机可读存储介质,该计算机可读存储介质中存储有至少一条计算机程序,该至少一条计算机程序由处理器加载并执行以实现该区块处理方法或者基于区块链的数据查询方法所执行的操作。
附图说明
为了更清楚地说明本公开实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本公开实施例提供的一种区块链系统100的示意图;
图2是本公开实施例提供的一种节点设备的功能架构图;
图3是本公开实施例提供的一种区块处理方法的流程图;
图4是本公开实施例提供的一种目标区块链的示意图;
图5是本公开实施例提供的一种目标区块链数据结构示意图;
图6是本公开实施例提供的一种目标区块链和区块索引表的结构示意图;
图7是本公开实施例提供的一种基于区块链的数据查询方法流程图;
图8是本公开实施例提供的一种区块处理装置的结构示意图;
图9是本公开实施例提供的一种基于区块链的数据查询装置的结构示意图;
图10是本公开实施例提供的一种终端的结构示意图;
图11是本公开实施例提供的一种服务器的结构示意图。
具体实施方式
为使本公开的目的、技术方案和优点更加清楚,下面将结合附图对本公开实施方式作进一步地详细描述。
区块链(blockchain)是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层。
区块链底层平台可以包括用户管理、基础服务、智能合约以及运营监控等处理模块。其中,用户管理模块负责所有区块链参与者的身份信息管理,包括维护公私钥生成(账户管理)、密钥管理以及用户真实身份和区块链地址对应关系维护(权限管理)等,并且在授权的情况下,监管和审计某些真实身份的交易情况,提供风险控制的规则配置(风控审计);基础服务模块部署在所有区块链节点设备上,用来验证业务请求的有效性,并对有效请求完成共识后记 录到存储上,对于一个新的业务请求,基础服务先对接口适配解析和鉴权处理(接口适配),然后通过共识算法将业务信息加密(共识管理),在加密之后完整一致的传输至共享账本上(网络通信),并进行记录存储;智能合约模块负责合约的注册发行以及合约触发和合约执行,开发人员可以通过某种编程语言定义合约逻辑,发布到区块链上(合约注册),根据合约条款的逻辑,调用密钥或者其它的事件触发执行,完成合约逻辑,同时还提供对合约升级注销的功能;运营监控模块主要负责产品发布过程中的部署、配置的修改、合约设置、云适配以及产品运行中的实时状态的可视化输出,例如:告警、监控网络情况、监控节点设备健康状态等。
平台产品服务层提供典型应用的基本能力和实现框架,开发人员可以基于这些基本能力,叠加业务的特性,完成业务逻辑的区块链实现。应用服务层提供基于区块链方案的应用服务给业务参与方进行使用。
区块链构建过程中,由于各个区块上链所需要的时间是不同的,会出现因区块中某一交易超时,而导致区块上链耗时较长的情况。为了确保区块链中的各个区块的连接顺序正确,当一个区块已经生成,但没有达成共识、没有上链时,在这一个区块之后生成的多个区块,即使已经共识完成,也不能连接到区块链上,导致大量区块不能及时上链,会对区块链系统的正常运行造成影响。
因此,在区块链构建过程中,如何对区块进行处理,使共识通过的区块能够及时上链,确保区块链系统的正常运行,是一个重要研究方向。
本公开实施例提供了一种基于区块链技术实现的区块链系统100,以下对该区块链系统的系统架构进行介绍。
图1是本公开实施例提供的一种区块链系统100的示意图,参见图1,该区块链系统100可以包括多个节点设备101,此外,该区块链系统100还可以包括至少一个客户端。
节点设备101可以是网络中的任意形式的计算设备,如服务器、主机、用户终端等。节点设备101与节点设备101之间能够共享数据。其中,节点设备101之间可以基于点对点(Peer To Peer,P2P)协议,建立P2P网络。该P2P协议是一个运行在传输控制协议(Transmission Control Protocol,TCP)协议之上的应用层协议。
可选地,节点设备101的设备类型可以包括智能手机、平板电脑、电子书阅读器、MP3(Moving Picture Experts Group Audio Layer III,动态影像专家压缩标准音频层面3)播放器、MP4(Moving Picture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面4)播放器、膝上型便携计算机或者台式计算机中的至少一种。
每个节点设备101在进行正常工作的过程中,可以接收到输入信息,并基于接收到的输入信息维护该区块链系统内的共享数据。为了保证区块链系统内的信息互通,区块链系统中的每个节点设备之间可以存在信息连接,节点设备之间可以通过上述信息连接进行信息传输。例如,当区块链系统中的任意节点设备接收到输入信息时,区块链系统中的其他节点设备也可以获取该输入信息,将该输入信息作为共享数据中的数据进行存储,使得区块链系统中全部节点设备上存储的数据均一致。
以下,对节点设备101的功能架构进行介绍。
参见图2,图2是本公开实施例提供的一种节点设备的功能架构图,节点设备101从功能上可以划分为硬件层、中间层、操作系统层和应用层,涉及的具体功能可以如下:
1)路由,节点设备具有的基本功能,用于支持节点设备之间的通信。
节点设备除具有路由功能外,还可以具有以下功能:
2)应用,用于部署在区块链中,根据实际业务需求而实现特定业务,记录实现功能相关的数据形成记录数据,在记录数据中携带数字签名以表示任务数据的来源,将记录数据发送到区块链系统中的其他节点设备,供其他节点设备在验证记录数据来源以及完整性成功时,将记录数据添加到临时区块中。
例如,应用实现的业务包括:
2.1)钱包,用于提供进行电子货币的交易的功能,包括发起交易(即,将当前交易的交易记录发送给区块链系统中的其他节点设备,其他节点设备验证成功后,作为承认交易有效的响应,将交易的记录数据写入区块链的临时区块中;当然,钱包还支持查询电子货币地址中剩余的电子货币。
2.2)共享账本,用于提供账目数据的存储、查询和修改等操作的功能,将对账目数据的操作的记录数据发送到区块链系统中的其他节点设备,其他节点设备验证有效后,作为承认账目数据有效的响应,将记录数据写入临时区块中,还可以向发起操作的节点设备发送确认。
2.3)智能合约,计算机化的协议,可以执行某个合约的条款,通过部署在共享账本上的用于在满足一定条件时而执行的代码实现,根据实际的业务需求代码用于完成自动化的交易,例如查询买家所购买商品的物流状态,在买家签收货物后将买家的电子货币转移到商户的地址;当然,智能合约不仅限于执行用于交易的合约,还可以执行对接收的信息进行处理的合约。
3)区块链,包括一系列按照产生的先后时间顺序相互接续的区块(Block),区块一旦加入到区块链中就不会再被移除,区块中记录了区块链系统中节点设备提交的记录数据。
可以理解的是,本公开实施例提供的方法可以由节点设备执行,节点设备为计算机设备,包括但不限于服务器或终端。
图3是本公开实施例提供的一种区块处理方法的流程图,在本公开实施例中以该方法应用于上述区块链系统中的节点设备为例进行说明。参见图3,该方法具体可以包括以下步骤:
301、节点设备响应于任一个新区块的生成,获取目标区块链的根区块所存储的时间区间。
需要说明的是,本公开实施例涉及的“新区块”是指在区块链系统中最新时刻所产生的区块,任一区块在刚生成时均称为“新区块”,本公开实施例涉及的“根区块”是指在区块链系统中产生的第一个区块,也称为“创世区块”。因此,上述步骤301也即是节点设备响应于任一个区块的生成,获取目标区块链的根区块所存储的时间区间。
其中,该节点设备可以为区块链系统中的任一节点设备,该节点设备可以为终端、服务器等,本公开实施例对此不作限定。该目标区块链属于该区块链系统,当然该区块链系统还可以包括其他区块链,本公开实施例对此不作限定。参见图4,图4是本公开实施例提供的一种目标区块链的示意图,该目标区块链401呈树形结构,即该目标区块链401中包括一个根区块402以及与该根区块402相连的多个子链,如图4所示,根区块402可以连接有子链403、子链404以及子链405,一个子链可以包括至少一个区块。在本公开实施例中,该区块链系统可以包括至少一个区块链,各个区块链的结构均与该目标区块链的结构相同。
在本公开实施例中,该目标区块链的根区块中存储有时间区间,该时间区 间可以用于限定该目标区块链中各个区块所包含交易的交易发生时间,交易发生时间在该时间区间内的交易数据可以存储在该目标区块链中。在通常情况下,区块链系统可以按照区块生成周期来生成区块,在每个区块生成周期内可以生成一个新区块,每个区块生成周期可以对应于一个交易发生时间段,在该交易发生时间段内发生的交易,均记入同一区块,例如,第一秒内发生的交易记入一个区块,第二秒内发生的交易记入另一个区块。因此,通过根区块中存储的时间区间,可以确定该目标区块链中所包含区块的数目,控制区块链的数据存储量。不同根区块所存储的时间区间的长度可以相同,也可以不同,即不同区块链所包含的区块数目可以相同,也可以不同。其中,该区块生成周期可以用于指示区块链系统中交易数据的打包周期,例如,将每秒生成的交易数据打包为一个区块,则区块生成周期即为每秒生成一个区块,该区块生成周期可以由开发人员进行设置,本公开实施例对此不作限定。
在一种可能实现方式中,根区块可以不存储交易数据,因此,在区块链系统中,可以采用预先生成的方式,生成各个区块链的根区块,也即是在一个根区块所对应的时间区间到达之前,生成这一个根区块即可。例如,根区块对应的时间区间为23:00至24:00时,区块链系统可以在23:00之前的任一时间生成这一根区块。其中,该任一时间可以是随机确定的,也可以是基于区块链系统的运行状况确定的,例如,可以在数据处理压力较小时生成根区块,本公开实施例对根区块的具体生成时间不作限定。
302、若该新区块所包含交易的交易发生时间位于该时间区间内,则节点设备遍历该根区块所连接的第一目标数量个子链,确定各个子链所包含区块的数目。
在本公开实施例中,该第一目标数量可以基于该目标区块链所属的区块链系统中区块平均共识时长以及区块生成周期确定。例如,该第一目标数量可以基于该区块平均共识时长除以一个区块生成周期的运算结果确定,当该运算结果为整数时,该第一目标数量等于该运算结果,当该运算结果不为整数时,该第一目标数量等于该运算结果加一。其中,该区块平均共识时长可以由对区块链系统中各个区块通过共识的时长进行统计确定。
在一种可能实现方式中,可以基于各个区块的区块编号,确定子链所包含区块的数目。目标区块链中的各个区块可以对应于一个区块编号,该区块编号可以用于指示区块在该目标区块链中的存储位置,一个区块的区块编号可以由 该一个区块所属子链的子链编号以及该一个区块在该所属子链中的顺序号组成,该顺序号即为该一个区块在该所属子链中的排列次序。例如,一个区块的区块编号可以为2.3,则该区块所属子链的子链编号为2,该区块为该所属子链上的第三个区块。在本公开实施例中,该节点设备在遍历各个子链时,可以获取各个子链中最后一个区块的区块编号,基于最后一个区块的区块编号中的顺序号来确定各个子链所包含区块的数目。其中,该子链编号的最大数值等于该第一目标数量。
在本公开实施例中,一个区块链可以包括多个子链,各个子链上均可以添加区块,可以提高区块的添加效率,提高系统的并发处理能力。
303、节点设备基于各个子链所包含区块的数目,确定目标子链。
在一种可能实现方式中,若各个该子链所包含区块的数目不同,则将包含区块数目最少的该子链确定为该目标子链;若各个该子链所包含区块的数目相同,则在各个该子链中,随机确定一个该子链作为该目标子链。在本公开实施例中,将包含区块最少的子链,也即是长度最短的子链作为目标子链,对该目标子链执行后续的区块添加步骤,可以平衡目标区块链中各个子链的长度,从一个较长的时间周期来看,可以达到各个子链的长度基本相同的效果。
换言之,节点设备响应于各个子链所包含区块的数目不同,将包含区块数目最少的子链确定为目标子链;或者,节点设备响应于各个子链所包含区块的数目相同,在各个子链中随机确定一个子链作为目标子链。
需要说明的是,上述步骤302和步骤303是若该新区块所包含交易的交易发生时间位于该时间区间内,则遍历该根区块所连接的第一目标数量个子链,将符合目标条件的该子链作为目标子链的步骤,由于新区块是指最新时刻区块链系统中产生的任一个区块,换言之,上述步骤302-303为节点设备响应于该任一个区块所包含交易的交易发生时间位于该时间区间内,从根区块所连接的第一目标数量个子链中,将符合目标条件的该子链作为目标子链的可能实施方式。
其中,该目标条件可以由开发人员进行设置,本公开实施例对此不作限定,例如,在本公开实施例中,可以将该目标条件设置为子链中所包含区块数目最少。在上述技术方案中,基于目标条件对子链进行筛选,确定出一个目标子链来添加新区块,通过这种目标子链确定方法,可以使区块链的结构更为合理,例如,当该目标条件为子链中所包含区块数目最少时,可以使区块链中各个子链的长度处于较为平衡的状态。
304、节点设备响应于该新区块通过共识,将该新区块添加至该目标区块链的该目标子链上。
由于新区块是指最新时刻区块链系统中产生的任一个区块,上述步骤304也即是节点设备响应于该任一个区块通过共识,将该任一个区块添加至该目标区块链的该目标子链上。
在本公开实施例中,区块链系统中的节点设备可以基于该目标子链的子链编号以及该目标子链中区块的顺序号,确定该新区块的区块编号,将携带该区块编号的该新区块,添加在该目标子链上。其中,该节点设备可以为共识节点设备中的领导节点设备。
由于新区块是指最新时刻区块链系统中产生的任一个区块,换言之,节点设备基于该目标子链的子链编号以及该目标子链中区块的顺序号,确定该任一个区块的区块编号,将携带该区块编号的该任一个区块,添加在该目标子链上。
在一种可能实现方式中,响应于该新区块通过共识,也即是确定该新区块可以存储至该目标子链时,节点设备可以为该新区块添加区块编号。可选地,节点设备可以将该目标子链中区块高度最高的区块的顺序号加一,作为该新区块的顺序号;将该目标子链的子链编号以及该新区块的顺序号进行拼接,得到该新区块在该目标区块链中的区块编号。
由于新区块是指最新时刻区块链系统中产生的任一个区块,换言之,节点设备将该目标子链中区块高度最高的区块的顺序号加一,得到该任一个区块的顺序号;将该目标子链的子链编号以及该任一个区块的顺序号进行拼接,得到该任一个区块在该目标区块链中的区块编号。
例如,该目标子链的子链编号为2,该目标子链中区块高度最高的区块的顺序号为3时,该新区块的区块编号可以为2.4。其中,该顺序号用于指示该目标子链中区块的排列次序,该区块编号用于指示该新区块在该目标区块链中的存储位置。在本公开实施例中,在区块编号生成后,区块链系统中的共识节点设备可以基于区块编号的生成规则,对各个区块的区块编号进行校验。需要说明的是,上述对区块编号构建方法的说明,仅是一种示例性说明,本公开实施例对具体采用哪种区块编号构建方法不作限定。
参见图5,图5是本公开实施例提供的一种目标区块链数据结构示意图,以图5所示的目标区块链为例对区块编号的生成过程进行说明,目标区块链的根区块500中存储有时间区间,当该区块链系统中区块生成周期设置为1秒,区 块平均共识时长为3秒时,则该目标区块链对应的第一目标数量为3,即包含子链的数目为3。在该时间区间内生成第一个区块501时,该目标区块链中除了根区块之外,没有其他区块上链,则第一个区块501通过共识后,可以与该根区块相连接,形成一个子链,其子链编号为1,该第一个区块501的区块编号为1.1;当第二个区块502共识完成后,第一个区块501已经上链,且该目标区块链中子链的数目未达到第一目标数量,则第二个区块502可以与该根区块相连接,形成一个子链,其子链编号为2,该第二个区块502的区块编号为2.1;第三个区块503的上链过程与第二个区块502的上链过程同理,在此不做赘述。当第四个区块504生成后,目标区块链中已经包括目标数量个子链,各个子链中区块的数目相同,则该第四个区块504可以随机选择一个子链,完成上链步骤,例如,该第四个区块504可以选择子链编号为1的子链,区块编号为1.2;第五个区块505的上链过程与第四个区块504的上链过程同理,在此不做赘述。当第六个区块506生成后,当前目标区块链中,长度最短的是子链编号为3的子链,则该第六个区块506共识完成后,需添加至子链编号为3的子链上,由于,第六个区块506的共识过程耗时较长,在第七个区块507通过共识后,该第六个区块506才完成共识,因此,在第七个区块507通过共识时,当前目标区块链中,长度最短的还是子链编号为3的子链,则该第七个区块507先完成上链,连接在子链编号为3的子链上,该第七个区块507的区块编号为3.2,第六个区块506完成共识,同样连接在子链编号为3的子链上,该第六个区块506的区块编号为3.3。
在本公开实施例中,将该新区块添加至该目标子链的尾部,也即是将该新区块与目标子链中区块高度最高的区块相连接之后,还可以对该新区块的添加位置进行验证。在一种可能实现方式中,节点设备可以将该新区块的前一个区块确定为候选区块;将该候选区块的顺序号与该新区块的顺序号进行比较;若该候选区块的顺序号与该新区块的顺序号不是连续递增的,也即是该新的区块没有连接在该目标子链的尾部,则重新确定该新区块的添加位置,执行将该新区块添加至该目标子链上的步骤。这种验证机制,可以确保子链中各个区块的顺序号是顺序递增的,避免子链出现分叉,避免区块乱序。
由于新区块是指最新时刻区块链系统中产生的任一个区块,换言之,节点设备的验证机制是指:将该任一个区块的前一个区块确定为候选区块;响应于该候选区块的顺序号与该任一个区块的顺序号不是连续递增的,重新确定该任 一个区块的添加位置,执行将该任一个区块添加至该目标子链上的步骤。
需要说明的是,本公开实施例对该新区块添加至该目标子链上的具体方法不作限定。
在上述技术方案中,通过为区块添加顺序号以及基于顺序号对区块的存储位置进行验证,可以有效避免子链中区块乱序,避免子链分叉,确保各个区块的存储位置正确,从而确保区块链系统中的数据查询、校验过程可以顺利进行。
本公开实施例提供的技术方案,通过响应于任一个新区块的生成,获取目标区块链的根区块所存储的时间区间;若该新区块所包含交易的交易发生时间位于该时间区间内,则遍历该根区块所连接的第一目标数量个子链,将符合目标条件的该子链作为目标子链;响应于该新区块通过共识,将该新区块添加至该目标区块链的目标子链上。应用上述技术方案,按照区块通过共识的时间,将区块连接至区块链上,无需等待之前生成的区块完成共识,且区块链构建为树形结构,由多个子链构成,多个子链可以同时添加区块,提高了区块的添加效率,使区块可以及时上链,确保区块链系统正常运行。
在通常情况下,区块链上的区块达到一定数目时,会影响系统中数据查询的效率,影响系统运行。在上述区块链系统中,各个区块链均构建为包含一个根区块和多个子链的树形结构,通过各个区块链的根区块中所存储的时间区间,可以灵活地控制各个区块链的区块数量,避免一个区块链中存储的区块数目过多,而增加数据查询难度,确保系统良好运行。基于上述技术方案,还可以对各个根区块建立索引,即区块链系统中可以维护有一个根区块索引表,用于记录各个根区块的存储位置、时间区间等信息。本公开实施例对该根区块索引表的具体构建方法不作限定。
上述实施例主要介绍了一种区块链构建方法,通过构建包含多条子链的树形区块链可以提高区块上链的效率,提高区块链系统的并发处理能力。在本公开实施例中,在区块链构建过程中,区块链系统可以维护有与目标区块链性关联的区块索引表,该区块索引表可以记录目标区块链中各个区块的存储位置信息,便于对目标区块链进行数据查询。
在本公开实施例中,响应于该新区块通过共识,节点设备可以将该新区块的存储位置信息存储至该目标区块链的区块索引表中,该区块索引表用于记录该目标区块链中各个区块的区块信息。其中,该存储位置信息可以为区块编号。
由于新区块是指最新时刻区块链系统中产生的任一个区块,换言之,节点设备将该任一个区块的存储位置信息存储至该目标区块链的区块索引表中。
在一种可能实现方式中,该区块索引表包括第二目标数量个数据存储单元,一个数据存储单元对应于一个时间标识,一个数据存储单元可以存储有固定长度的数据,该固定长度的数据中可以记录有区块的存储位置信息等区块信息,当区块索引表中需要存储的区块信息增加或减少时,可以调整数据存储单元中所存储数据的长度。其中,该第二目标数量的具体数值可以由开发人员进行设置,该固定长度可以由开发人员进行设置,本公开实施例对此不作限定。例如,当区块生成周期为每1秒生成一个区块时,该第二目标数量可以设置为60,一个区块索引表包括60个数据存储单元,即每分钟内生成的区块存储在同一个区块索引表中。
在一本公开实施例中,若该区块索引表中任一数据存储单元的时间标识与该新区块所包含交易的交易发生时间相匹配,则节点设备将该任一数据存储单元确定为目标数据存储单元;将该新区块的存储位置信息存储至该区块索引表的该目标数据存储单元中。
由于新区块是指最新时刻区块链系统中产生的任一个区块,换言之,节点设备将该任一个区块的存储位置信息存储至该区块索引表的目标数据存储单元中,其中,该目标数据存储单元的时间标识与该任一个区块所包含交易的交易发生时间相匹配。
在一种可能实现方式中,该时间标识可以为相对于时间区间开始时刻的时间偏移量,例如,时间区间为23:00至24:00时,时间标识为00:01,也即是相对于23:00的时间偏移量为00:01,则交易发生时间23:01可以与该时间标识相匹配,则存储有23:01所生成交易数据的区块的存储位置信息,可以记录在时间标识为00:01所对应的数据存储单元中。参见图6,图6是本公开实施例提供的一种目标区块链和区块索引表的结构示意图,当时间区间为23:00至24:00时,区块索引表601的数据存储单元602中可以存储有23:01所生成的区块603的存储位置信息。需要说明的是,上述对区块信息存储至区块索引表的方法的说明,仅是一种示例性说明,本公开实施例对具体采用哪种存储方法不作限定。需要说明的是,该时间标识也可以为设置为时间区间中的某一时刻,例如,可以设置为23:01等,本公开实施例对该时间标识的具体形式不作限定。
当然,该数据存储单元还可以存储由区块的其他数据信息,例如,区块的 哈希值等,本公开实施例对此不作限定。
通过在区块链系统中维护区块索引表,可以按照区块所包含交易的交易发生时间顺序记录各个区块的区块信息,例如,区块的存储位置等,便于区块链系统对各个区块进行查询、验证。
基于上述技术方案,在对目标区块链中的数据进行查询时,可以基于目标区块链对应的区块索引表,确定被查询区块存储位置。图7是本公开实施例提供的一种基于区块链的数据查询方法流程图,参见图7,在一种可能实现方式中,该方法具体可以包括以下步骤:
701、节点设备响应于对目标区块链中目标区块的查询指令,获取该目标区块链的区块索引表。
在一种可能实现方式中,该查询指令可以携带该目标区块所包含交易的交易发生时间,该区块索引表中的各个数据存储单元用于记录该目标区块链中各个区块的存储位置信息,一个该数据存储单元对应于一个时间标识。需要说明的是,该区块索引表的构建方式与上述实施例中区块索引表的构建方式相同,在此不做赘述。
702、节点设备将该各个数据存储单元的时间标识与该交易发生时间相匹配,将与该交易发生时间匹配成功的该时间标识所对应的数据存储单元,确定为目标数据存储单元。
上述步骤702也即是节点设备从该区块索引表中确定目标数据存储单元的可能实施方式,其中,该目标数据存储单元的时间标识与该交易发生时间相匹配。
在一种可能实现方式中,该时间标识可以设置为相对于时间区间的开始时间的时间偏移量。在时间标识与区块所包含交易的交易发生时间匹配时,节点设备可以获取该目标区块链的根区块中存储的时间区间;确定该交易发生时间相对于该时间区间的开始时间的时间偏移量;当任一时间标识与该时间偏移量相同时,则确定该任一时间标识与该产生时间匹配成功;将该任一时间标识所对应的数据存储单元确定为该目标数据存储单元。
换言之,在上述过程中,节点设备获取该目标区块链的根区块中存储的时间区间;确定该交易发生时间相对于该时间区间的开始时间的时间偏移量;响应于任一数据存储单元的时间标识与该时间偏移量相同,将该任一数据存储单 元确定为该目标数据存储单元。
在一种可能实现方式中,一个数据存储单元可以存储有固定长度的数据,其中,该固定长度的具体数值可以由开发人员进行设置。在区块索引表中,各个区块的区块信息按照区块所包含交易的交易发生时间顺序存储,在时间标识与区块的交易发生时间匹配时,节点设备可以确定该交易发生时间相对于该时间区间的开始时间的时间偏移量,将该时间偏移量与该固定长度相乘,即可确定目标区块的区块信息在该区块索引表中的存储位置,即确定出存储有该区块信息的目标数据存储单元。
需要说明的是,上述对确定目标数据存储单元的说明,仅是一种示例性说明,本公开实施例对具体采用哪种方法确定该数据存储单元不作限定。
在本公开实施例中,一个数据存储单元存储有一个区块的区块信息,通过区块中所包含交易的交易发生时间来定位数据存储单元,可以确保获取到的区块信息的准确定,即可以确保准确获取到区块的存储位置,提高数据查询结果的准确性。
703、节点设备基于该目标数据存储单元中的存储位置信息,在该目标区块链中查找该目标区块。
在一种可能实现方式中,该存储位置信息可以表示为区块编号,即节点设备获取到该区块编号后,可以基于该区块编号中的子链编号确定该目标区块所属的子链,基于该区块编号中的顺序号确定该目标区块在该子链中的排列次序,从而在该子链中定位到该目标区块,获取该目标区块中的数据信息。
当然,该数据存储单元中还可以存储有目标区块的哈希值等,节点设备可以基于该哈希值与目标区块中的数据信息,对目标区块进行校验。
在上述技术方案中,通过与区块链相关联的区块索引表来记录区块的存储位置,可以有效避免因区块链中区块乱序而导致的数据困难的问题,提高数据查询的效率、准确率。
上述所有可选技术方案,可以采用任意结合形成本公开的可选实施例,在此不再一一赘述。
图8是本公开实施例提供的一种区块处理装置的结构示意图,参见图8,该装置包括:
获取模块801,用于响应于任一个新区块的生成,获取目标区块链的根区块 所存储的时间区间;
也即是说,该获取模块801,用于响应于任一个区块的生成,获取目标区块链的根区块所存储的时间区间;
子链确定模块802,用于若该新区块所包含交易的交易发生时间位于该时间区间内,则遍历该根区块所连接的第一目标数量个子链,将符合目标条件的该子链确定为目标子链;
也即是说,该子链确定模块802,用于响应于该区块所包含交易的交易发生时间位于该时间区间内,从该根区块所连接的第一目标数量个子链中,将符合目标条件的该子链确定为目标子链;
添加模块803,用于响应于该新区块通过共识,将该新区块添加至该目标区块链的该目标子链上;
也即是说,该添加模块803,用于响应于该区块通过共识,将该区块添加至该目标区块链的该目标子链上。
在一种可能实现方式中,该第一目标数量基于该目标区块链所属的区块链系统中区块平均共识时长以及区块生成周期确定。
在一种可能实现方式中,该子链确定模块802用于:
确定各个该子链所包含区块的数目;
若各个该子链所包含区块的数目不同,则将包含区块数目最少的该子链确定为该目标子链;
若各个该子链所包含区块的数目相同,则在各个该子链中,随机确定一个该子链作为该目标子链。
也即是说,该子链确定模块802用于:
确定各个该子链所包含区块的数目;
响应于各个该子链所包含区块的数目不同,将包含区块数目最少的该子链确定为该目标子链;
响应于各个该子链所包含区块的数目相同,在各个该子链中,随机确定一个该子链作为该目标子链。
在一种可能实现方式中,该添加模块803用于:
基于该目标子链的子链编号以及该目标子链中区块的顺序号,确定该新区块的区块编号,该顺序号用于指示该目标子链中区块的排列次序,该区块编号用于指示该新区块在该目标区块链中的存储位置;
将携带该区块编号的该新区块,添加在该目标子链上。
也即是说,该添加模块803用于:
基于该目标子链的子链编号以及该目标子链中区块的顺序号,确定该区块的区块编号,该顺序号用于指示该目标子链中区块的排列次序,该区块编号用于指示该区块在该目标区块链中的存储位置;
将携带该区块编号的该区块,添加在该目标子链上。
在一种可能实现方式中,该添加模块803用于:
将该目标子链中区块高度最高的区块的顺序号加一,作为该新区块的顺序号;
将该目标子链的子链编号以及该新区块的顺序号进行拼接,得到该新区块在该目标区块链中的区块编号。
也即是说,该添加模块803用于:
将该目标子链中区块高度最高的区块的顺序号加一,得到该区块的顺序号;
将该目标子链的子链编号以及该区块的顺序号进行拼接,得到该区块在该目标区块链中的区块编号。
在一种可能实现方式中,该装置还包括:
区块确定模块,用于将该新区块的前一个区块确定为候选区块;
也即是说,该区块确定模块,用于将该区块的前一个区块确定为候选区块;
比较模块,用于将该候选区块的顺序号与该新区块的顺序号进行比较;若该候选区块的顺序号与该新区块的顺序号不是连续递增的,则重新确定该新区块的添加位置,执行将该新区块添加至该目标子链上的步骤;
也即是说,该比较模块,用于响应于该候选区块的顺序号与该区块的顺序号不是连续递增的,重新确定该区块的添加位置,执行将该区块添加至该目标子链上的步骤。
在一种可能实现方式中,该装置还包括:
信息存储模块,用于将该新区块的存储位置信息存储至该目标区块链的区块索引表中,该区块索引表用于记录该目标区块链中各个区块的区块信息。
也即是说,该信息存储模块,用于将该区块的存储位置信息存储至该目标区块链的区块索引表中,该区块索引表用于记录该目标区块链中各个区块的区块信息。
在一种可能实现方式中,该区块索引表包括第二目标数量个数据存储单元, 一个数据存储单元对应于一个时间标识。
在一种可能实现方式中,该信息存储模块用于:
若该区块索引表中任一数据存储单元的时间标识与该新区块所包含交易的交易发生时间相匹配,则将该任一数据存储单元确定为目标数据存储单元;
将该新区块的存储位置信息存储至该区块索引表的该目标数据存储单元中。
也即是说,该信息存储模块用于:
将该区块的存储位置信息存储至该区块索引表的目标数据存储单元中,该目标数据存储单元的时间标识与该区块所包含交易的交易发生时间相匹配。
本公开实施例提供的装置,通过响应于任一个新区块的生成,获取目标区块链的根区块所存储的时间区间;若该新区块所包含交易的交易发生时间位于该时间区间内,则遍历该根区块所连接的第一目标数量个子链,将符合目标条件的该子链作为目标子链;响应于该新区块通过共识,将该新区块添加至该目标区块链的目标子链上。应用上述装置,按照区块通过共识的时间,将区块连接至区块链上,无需等待之前生成的区块完成共识,且区块链由多个子链构成,多个子链可以同时添加区块,提高了区块的添加效率,使区块可以及时上链,确保区块链系统正常运行。
需要说明的是:上述实施例提供的区块处理装置在区块处理时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的区块处理装置与区块处理方法实施例属于同一构思,其具体实现过程详见区块处理方法实施例,这里不再赘述。
图9是本公开实施例提供的一种基于区块链的数据查询装置的结构示意图,参见图9,该装置包括:
获取模块901,用于响应于对目标区块链中目标区块的查询指令,获取该目标区块链的区块索引表,该查询指令携带该目标区块中交易数据的交易发生时间,该区块索引表中的各个数据存储单元用于记录该目标区块链中各个区块的存储位置信息,一个该数据存储单元对应于一个时间标识;也即是说,该区块索引表中的数据存储单元用于记录该目标区块链中区块的存储位置信息;
匹配模块902,用于将该各个数据存储单元的时间标识与该交易发生时间相匹配;
确定模块903,用于将与该交易发生时间匹配成功的该时间标识所对应的数据存储单元,确定为目标数据存储单元;
也即是说,该确定模块903,用于从该区块索引表中确定目标数据存储单元,该目标数据存储单元的时间标识与该交易发生时间相匹配;
查找模块904,用于基于该目标数据存储单元中的存储位置信息,在该目标区块链中查找该目标区块。
在一种可能实现方式中,该匹配模块902用于:
获取该目标区块链的根区块中存储的时间区间;
确定该交易发生时间相对于该时间区间的开始时间的时间偏移量;
当任一时间标识与该时间偏移量相同时,则确定该任一时间标识与该产生时间匹配成功。
也即是说,该确定模块803用于:
获取该目标区块链的根区块中存储的时间区间;
确定该交易发生时间相对于该时间区间的开始时间的时间偏移量;
响应于任一数据存储单元的时间标识与该时间偏移量相同,将该数据存储单元确定为该目标数据存储单元。
需要说明的是:上述实施例提供的基于区块链的数据查询装置在基于区块链进行数据查询时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的基于区块链的数据查询装置与基于区块链的数据查询方法实施例属于同一构思,其具体实现过程详见基于区块链的数据查询方法实施例,这里不再赘述。
上述技术方案所提供的节点设备可以实现为终端或服务器,例如,图10是本公开实施例提供的一种终端的结构示意图。该终端1000可以是:智能手机、平板电脑、MP3播放器(Moving Picture Experts Group Audio Layer III,动态影像专家压缩标准音频层面3)、MP4(Moving Picture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面4)播放器、笔记本电脑或台式电脑。终端 1000还可能被称为用户设备、便携式终端、膝上型终端、台式终端等其他名称。
通常,终端1000包括有:一个或多个处理器1001和一个或多个存储器1002。
处理器1001可以包括一个或多个处理核心,比如4核心处理器、10核心处理器等。处理器1001可以采用DSP(Digital Signal Processing,数字信号处理)、FPGA(Field-Programmable Gate Array,现场可编程门阵列)、PLA(Programmable Logic Array,可编程逻辑阵列)中的至少一种硬件形式来实现。处理器1001也可以包括主处理器和协处理器,主处理器是用于对在唤醒状态下的数据进行处理的处理器,也称CPU(Central Processing Unit,中央处理器);协处理器是用于对在待机状态下的数据进行处理的低功耗处理器。在一些实施例中,处理器1001可以在集成有GPU(Graphics Processing Unit,图像处理器),GPU用于负责显示屏所需要显示的内容的渲染和绘制。一些实施例中,处理器1001还可以包括AI(Artificial Intelligence,人工智能)处理器,该AI处理器用于处理有关机器学习的计算操作。
存储器1002可以包括一个或多个计算机可读存储介质,该计算机可读存储介质可以是非暂态的。存储器1002还可包括高速随机存取存储器,以及非易失性存储器,比如一个或多个磁盘存储设备、闪存存储设备。在一些实施例中,存储器1002中的非暂态的计算机可读存储介质用于存储至少一条计算机程序,该至少一条计算机程序用于被处理器1001所执行以实现本公开中方法实施例提供的区块处理方法以及基于区块链的数据查询方法。
在一些实施例中,终端1000还可选包括有:外围设备接口1003和至少一个外围设备。处理器1001、存储器1002和外围设备接口1003之间可以通过总线或信号线相连。各个外围设备可以通过总线、信号线或电路板与外围设备接口1003相连。可选地,外围设备包括:射频电路1004、显示屏1005、摄像头组件1006、音频电路1007、定位组件1008和电源1009中的至少一种。
外围设备接口1003可被用于将I/O(Input/Output,输入/输出)相关的至少一个外围设备连接到处理器1001和存储器1002。在一些实施例中,处理器1001、存储器1002和外围设备接口1003被集成在同一芯片或电路板上;在一些其他实施例中,处理器1001、存储器1002和外围设备接口1003中的任意一个或两个可以在单独的芯片或电路板上实现,本实施例对此不加以限定。
射频电路1004用于接收和发射RF(Radio Frequency,射频)信号,也称电磁信号。射频电路1004通过电磁信号与通信网络以及其他通信设备进行通信。 射频电路1004将电信号转换为电磁信号进行发送,或者,将接收到的电磁信号转换为电信号。可选地,射频电路1004包括:天线系统、RF收发器、一个或多个放大器、调谐器、振荡器、数字信号处理器、编解码芯片组、用户身份模块卡等等。射频电路1004可以通过至少一种无线通信协议来与其它终端进行通信。该无线通信协议包括但不限于:城域网、各代移动通信网络(2G、3G、4G及5G)、无线局域网和/或WiFi(Wireless Fidelity,无线保真)网络。在一些实施例中,射频电路1004还可以包括NFC(Near Field Communication,近距离无线通信)有关的电路,本公开对此不加以限定。
显示屏1005用于显示UI(User Interface,用户界面)。该UI可以包括图形、文本、图标、视频及其它们的任意组合。当显示屏1005是触摸显示屏时,显示屏1005还具有采集在显示屏1005的表面或表面上方的触摸信号的能力。该触摸信号可以作为控制信号输入至处理器1001进行处理。此时,显示屏1005还可以用于提供虚拟按钮和/或虚拟键盘,也称软按钮和/或软键盘。在一些实施例中,显示屏1005可以为一个,设置终端1000的前面板;在另一些实施例中,显示屏1005可以为至少两个,分别设置在终端1000的不同表面或呈折叠设计;在一些实施例中,显示屏1005可以是柔性显示屏,设置在终端1000的弯曲表面上或折叠面上。甚至,显示屏1005还可以设置成非矩形的不规则图形,也即异形屏。显示屏1005可以采用LCD(Liquid Crystal Display,液晶显示屏)、OLED(Organic Light-Emitting Diode,有机发光二极管)等材质制备。
摄像头组件1006用于采集图像或视频。可选地,摄像头组件1006包括前置摄像头和后置摄像头。通常,前置摄像头设置在终端的前面板,后置摄像头设置在终端的背面。在一些实施例中,后置摄像头为至少两个,分别为主摄像头、景深摄像头、广角摄像头、长焦摄像头中的任意一种,以实现主摄像头和景深摄像头融合实现背景虚化功能、主摄像头和广角摄像头融合实现全景拍摄以及VR(Virtual Reality,虚拟现实)拍摄功能或者其它融合拍摄功能。在一些实施例中,摄像头组件1006还可以包括闪光灯。闪光灯可以是单色温闪光灯,也可以是双色温闪光灯。双色温闪光灯是指暖光闪光灯和冷光闪光灯的组合,可以用于不同色温下的光线补偿。
音频电路1007可以包括麦克风和扬声器。麦克风用于采集用户及环境的声波,并将声波转换为电信号输入至处理器1001进行处理,或者输入至射频电路1004以实现语音通信。出于立体声采集或降噪的目的,麦克风可以为多个,分 别设置在终端1000的不同部位。麦克风还可以是阵列麦克风或全向采集型麦克风。扬声器则用于将来自处理器1001或射频电路1004的电信号转换为声波。扬声器可以是传统的薄膜扬声器,也可以是压电陶瓷扬声器。当扬声器是压电陶瓷扬声器时,不仅可以将电信号转换为人类可听见的声波,也可以将电信号转换为人类听不见的声波以进行测距等用途。在一些实施例中,音频电路1007还可以包括耳机插孔。
定位组件1008用于定位终端1000的当前地理位置,以实现导航或LBS(Location Based Service,基于位置的服务)。定位组件1008可以是基于美国的GPS(Global Positioning System,全球定位系统)、中国的北斗系统、俄罗斯的格雷纳斯系统或欧盟的伽利略系统的定位组件。
电源1009用于为终端1000中的各个组件进行供电。电源1009可以是交流电、直流电、一次性电池或可充电电池。当电源1009包括可充电电池时,该可充电电池可以支持有线充电或无线充电。该可充电电池还可以用于支持快充技术。
在一些实施例中,终端1000还包括有一个或多个传感器1010。该一个或多个传感器1010包括但不限于:加速度传感器1011、陀螺仪传感器1012、压力传感器1013、指纹传感器1014、光学传感器1015以及接近传感器1016。
加速度传感器1011可以检测以终端1000建立的坐标系的三个坐标轴上的加速度大小。比如,加速度传感器1011可以用于检测重力加速度在三个坐标轴上的分量。处理器1001可以根据加速度传感器1011采集的重力加速度信号,控制显示屏1005以横向视图或纵向视图进行用户界面的显示。加速度传感器1011还可以用于游戏或者用户的运动数据的采集。
陀螺仪传感器1012可以检测终端1000的机体方向及转动角度,陀螺仪传感器1012可以与加速度传感器1011协同采集用户对终端1000的3D动作。处理器1001根据陀螺仪传感器1012采集的数据,可以实现如下功能:动作感应(比如根据用户的倾斜操作来改变UI)、拍摄时的图像稳定、游戏控制以及惯性导航。
压力传感器1013可以设置在终端1000的侧边框和/或显示屏1005的下层。当压力传感器1013设置在终端1000的侧边框时,可以检测用户对终端1000的握持信号,由处理器1001根据压力传感器1013采集的握持信号进行左右手识别或快捷操作。当压力传感器1013设置在显示屏1005的下层时,由处理器1001 根据用户对显示屏1005的压力操作,实现对UI界面上的可操作性控件进行控制。可操作性控件包括按钮控件、滚动条控件、图标控件、菜单控件中的至少一种。
指纹传感器1014用于采集用户的指纹,由处理器1001根据指纹传感器1014采集到的指纹识别用户的身份,或者,由指纹传感器1014根据采集到的指纹识别用户的身份。在识别出用户的身份为可信身份时,由处理器1001授权该用户执行相关的敏感操作,该敏感操作包括解锁屏幕、查看加密信息、下载软件、支付及更改设置等。指纹传感器1014可以被设置终端1000的正面、背面或侧面。当终端1000上设置有物理按键或厂商Logo时,指纹传感器1014可以与物理按键或厂商Logo集成在一起。
光学传感器1015用于采集环境光强度。在一个实施例中,处理器1001可以根据光学传感器1015采集的环境光强度,控制显示屏1005的显示亮度。可选地,当环境光强度较高时,调高显示屏1005的显示亮度;当环境光强度较低时,调低显示屏1005的显示亮度。在另一个实施例中,处理器1001还可以根据光学传感器1015采集的环境光强度,动态调整摄像头组件1006的拍摄参数。
接近传感器1016,也称距离传感器,通常设置在终端1000的前面板。接近传感器1016用于采集用户与终端1000的正面之间的距离。在一个实施例中,当接近传感器1016检测到用户与终端1000的正面之间的距离逐渐变小时,由处理器1001控制显示屏1005从亮屏状态切换为息屏状态;当接近传感器1016检测到用户与终端1000的正面之间的距离逐渐变大时,由处理器1001控制显示屏1005从息屏状态切换为亮屏状态。
本领域技术人员可以理解,图10中示出的结构并不构成对终端1000的限定,可以包括比图示更多或更少的组件,或者组合某些组件,或者采用不同的组件布置。
图11是本公开实施例提供的一种服务器的结构示意图,该服务器1100可因配置或性能不同而产生比较大的差异,可以包括一个或多个处理器(Central Processing Units,CPU)1101和一个或多个的存储器1102,其中,该一个或多个存储器1102中存储有至少一条计算机程序,该至少一条计算机程序由该一个或多个处理器1101加载并执行以实现上述各个方法实施例提供的方法。当然,该服务器1100还可以具有有线或无线网络接口、键盘以及输入输出接口等部件, 以便进行输入输出,该服务器1100还可以包括其他用于实现设备功能的部件,在此不做赘述。
在一些实施例中,上述节点设备是指一种计算机设备,该计算机设备包括一个或多个处理器和一个或多个存储器,该一个或多个存储器中存储有至少一条计算机程序,该至少一条计算机程序由该一个或多个处理器加载并执行以实现如下操作:
响应于任一个区块的生成,获取目标区块链的根区块所存储的时间区间;
响应于该区块所包含交易的交易发生时间位于该时间区间内,从所述根区块所连接的第一目标数量个子链中,将符合目标条件的该子链确定为目标子链;
响应于该区块通过共识,将该区块添加至该目标区块链的该目标子链上。
在一些实施例中,该第一目标数量基于该目标区块链所属的区块链系统中区块平均共识时长以及区块生成周期确定。
在一些实施例中,该至少一条计算机程序由该一个或多个处理器加载并执行以实现如下操作:
确定各个该子链所包含区块的数目;
响应于各个该子链所包含区块的数目不同,将包含区块数目最少的该子链确定为该目标子链;
响应于各个该子链所包含区块的数目相同,在各个该子链中,随机确定一个该子链作为该目标子链。
在一些实施例中,该至少一条计算机程序由该一个或多个处理器加载并执行以实现如下操作:
基于该目标子链的子链编号以及该目标子链中区块的顺序号,确定该区块的区块编号,该顺序号用于指示该目标子链中区块的排列次序,该区块编号用于指示该区块在该目标区块链中的存储位置;
将携带该区块编号的该区块,添加在该目标子链上。
在一些实施例中,该至少一条计算机程序由该一个或多个处理器加载并执行以实现如下操作:
将该目标子链中区块高度最高的区块的顺序号加一,得到该区块的顺序号;
将该目标子链的子链编号以及该区块的顺序号进行拼接,得到该区块在该目标区块链中的区块编号。
在一些实施例中,该至少一条计算机程序由该一个或多个处理器加载并执 行以实现如下操作:
将该区块的前一个区块确定为候选区块;
响应于该候选区块的顺序号与该区块的顺序号不是连续递增的,重新确定该区块的添加位置,执行将该区块添加至该目标子链上的步骤。
在一些实施例中,该至少一条计算机程序由该一个或多个处理器加载并执行以实现如下操作:
将该区块的存储位置信息存储至该目标区块链的区块索引表中,该区块索引表用于记录该目标区块链中各个区块的区块信息。
在一些实施例中,该区块索引表包括第二目标数量个数据存储单元,一个数据存储单元对应于一个时间标识。
在一些实施例中,该至少一条计算机程序由该一个或多个处理器加载并执行以实现如下操作:
将该区块的存储位置信息存储至该区块索引表的目标数据存储单元中,该目标数据存储单元的时间标识与该区块所包含交易的交易发生时间相匹配。
在另一些实施例中,上述节点设备是指一种计算机设备,该计算机设备包括一个或多个处理器和一个或多个存储器,该一个或多个存储器中存储有至少一条计算机程序,该至少一条计算机程序由该一个或多个处理器加载并执行以实现如下操作:
响应于对目标区块链中目标区块的查询指令,获取该目标区块链的区块索引表,该查询指令携带该目标区块中交易的交易发生时间,该区块索引表中的数据存储单元用于记录该目标区块链中区块的存储位置信息,一个该数据存储单元对应于一个时间标识;
从该区块索引表中确定目标数据存储单元,该目标数据存储单元的时间标识与该交易发生时间相匹配;
基于该目标数据存储单元中的存储位置信息,在该目标区块链中查找该目标区块。
在另一些实施例中,该至少一条计算机程序由该一个或多个处理器加载并执行以实现如下操作:
获取该目标区块链的根区块中存储的时间区间;
确定该交易发生时间相对于该时间区间的开始时间的时间偏移量;
响应于任一数据存储单元的时间标识与该时间偏移量相同,将该数据存储单元确定为该目标数据存储单元。
在示例性实施例中,还提供了一种计算机可读存储介质,例如包括至少一条计算机程序的存储器,上述至少一条计算机程序可由处理器执行以完成上述实施例中的区块处理方法或者基于区块链的数据查询方法。例如,该计算机可读存储介质可以是只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、只读光盘(Compact Disc Read-Only Memory,CD-ROM)、磁带、软盘和光数据存储设备等。
在一些实施例中,该至少一条计算机程序由处理器加载并执行以实现如下操作:
响应于任一个区块的生成,获取目标区块链的根区块所存储的时间区间;
响应于该区块所包含交易的交易发生时间位于该时间区间内,从所述根区块所连接的第一目标数量个子链中,将符合目标条件的该子链确定为目标子链;
响应于该区块通过共识,将该区块添加至该目标区块链的该目标子链上。
在一些实施例中,该第一目标数量基于该目标区块链所属的区块链系统中区块平均共识时长以及区块生成周期确定。
在一些实施例中,该至少一条计算机程序由处理器加载并执行以实现如下操作:
确定各个该子链所包含区块的数目;
响应于各个该子链所包含区块的数目不同,将包含区块数目最少的该子链确定为该目标子链;
响应于各个该子链所包含区块的数目相同,在各个该子链中,随机确定一个该子链作为该目标子链。
在一些实施例中,该至少一条计算机程序由处理器加载并执行以实现如下操作:
基于该目标子链的子链编号以及该目标子链中区块的顺序号,确定该区块的区块编号,该顺序号用于指示该目标子链中区块的排列次序,该区块编号用于指示该区块在该目标区块链中的存储位置;
将携带该区块编号的该区块,添加在该目标子链上。
在一些实施例中,该至少一条计算机程序由处理器加载并执行以实现如下 操作:
将该目标子链中区块高度最高的区块的顺序号加一,得到该区块的顺序号;
将该目标子链的子链编号以及该区块的顺序号进行拼接,得到该区块在该目标区块链中的区块编号。
在一些实施例中,该至少一条计算机程序由处理器加载并执行以实现如下操作:
将该区块的前一个区块确定为候选区块;
响应于该候选区块的顺序号与该区块的顺序号不是连续递增的,重新确定该区块的添加位置,执行将该区块添加至该目标子链上的步骤。
在一些实施例中,该至少一条计算机程序由处理器加载并执行以实现如下操作:
将该区块的存储位置信息存储至该目标区块链的区块索引表中,该区块索引表用于记录该目标区块链中各个区块的区块信息。
在一些实施例中,该区块索引表包括第二目标数量个数据存储单元,一个数据存储单元对应于一个时间标识。
在一些实施例中,该至少一条计算机程序由处理器加载并执行以实现如下操作:
将该区块的存储位置信息存储至该区块索引表的目标数据存储单元中,该目标数据存储单元的时间标识与该区块所包含交易的交易发生时间相匹配。
在另一些实施例中,该至少一条计算机程序由处理器加载并执行以实现如下操作:
响应于对目标区块链中目标区块的查询指令,获取该目标区块链的区块索引表,该查询指令携带该目标区块中交易的交易发生时间,该区块索引表中的数据存储单元用于记录该目标区块链中区块的存储位置信息,一个该数据存储单元对应于一个时间标识;
从该区块索引表中确定目标数据存储单元,该目标数据存储单元的时间标识与该交易发生时间相匹配;
基于该目标数据存储单元中的存储位置信息,在该目标区块链中查找该目标区块。
在另一些实施例中,该至少一条计算机程序由处理器加载并执行以实现如 下操作:
获取该目标区块链的根区块中存储的时间区间;
确定该交易发生时间相对于该时间区间的开始时间的时间偏移量;
响应于任一数据存储单元的时间标识与该时间偏移量相同,将该数据存储单元确定为该目标数据存储单元。
在一些实施例中,还提供一种包括至少一条程序代码的计算机程序或计算机程序产品,当其在计算机设备上运行时,使得计算机设备执行前述各个实施例所提供的区块处理方法或者基于区块链的数据查询方法中任一种可能实现方式,在此不作赘述。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过计算机程序来指示相关的硬件完成,该计算机程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
上述仅为本公开的可选实施例,并不用以限制本公开,凡在本公开的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本公开的保护范围之内。

Claims (17)

  1. 一种区块处理方法,其中,所述方法包括:
    响应于任一个区块的生成,获取目标区块链的根区块所存储的时间区间;
    响应于所述区块所包含交易的交易发生时间位于所述时间区间内,从所述根区块所连接的第一目标数量个子链中,将符合目标条件的所述子链确定为目标子链;
    响应于所述区块通过共识,将所述区块添加至所述目标区块链的所述目标子链上。
  2. 根据权利要求1所述的方法,其中,所述第一目标数量基于所述目标区块链所属的区块链系统中区块平均共识时长以及区块生成周期确定。
  3. 根据权利要求1所述的方法,其中,所述从所述根区块所连接的第一目标数量个子链中,将符合目标条件的所述子链确定为目标子链,包括:
    确定各个所述子链所包含区块的数目;
    响应于各个所述子链所包含区块的数目不同,将包含区块数目最少的所述子链确定为所述目标子链;
    响应于各个所述子链所包含区块的数目相同,在各个所述子链中,随机确定一个所述子链作为所述目标子链。
  4. 根据权利要求1所述的方法,其中,所述响应于所述区块通过共识,将所述区块添加至所述目标区块链的所述目标子链上,包括:
    基于所述目标子链的子链编号以及所述目标子链中区块的顺序号,确定所述区块的区块编号,所述顺序号用于指示所述目标子链中区块的排列次序,所述区块编号用于指示所述区块在所述目标区块链中的存储位置;
    将携带所述区块编号的所述区块,添加在所述目标子链上。
  5. 根据权利要求4所述的方法,其中,所述基于所述目标子链的子链编号以及所述目标子链中区块的顺序号,确定所述区块的区块编号,包括:
    将所述目标子链中区块高度最高的区块的顺序号加一,得到所述区块的顺 序号;
    将所述目标子链的子链编号以及所述区块的顺序号进行拼接,得到所述区块在所述目标区块链中的区块编号。
  6. 根据权利要求5所述的方法,其中,所述方法还包括:
    将所述区块的前一个区块确定为候选区块;
    响应于所述候选区块的顺序号与所述区块的顺序号不是连续递增的,重新确定所述区块的添加位置,执行将所述区块添加至所述目标子链上的步骤。
  7. 根据权利要求1所述的方法,其中,所述方法还包括:
    将所述区块的存储位置信息存储至所述目标区块链的区块索引表中,所述区块索引表用于记录所述目标区块链中各个区块的区块信息。
  8. 根据权利要求7所述的方法,其中,所述区块索引表包括第二目标数量个数据存储单元,一个数据存储单元对应于一个时间标识。
  9. 根据权利要求8所述的方法,其中,所述将所述区块的存储位置信息存储至所述目标区块链的区块索引表中,包括:
    将所述区块的存储位置信息存储至所述区块索引表的目标数据存储单元中,所述目标数据存储单元的时间标识与所述区块所包含交易的交易发生时间相匹配。
  10. 一种基于区块链的数据查询方法,其中,所述方法包括:
    响应于对目标区块链中目标区块的查询指令,获取所述目标区块链的区块索引表,所述查询指令携带所述目标区块中交易的交易发生时间,所述区块索引表中的数据存储单元用于记录所述目标区块链中区块的存储位置信息,一个所述数据存储单元对应于一个时间标识;
    从所述区块索引表中确定目标数据存储单元,所述目标数据存储单元的时间标识与所述交易发生时间相匹配;
    基于所述目标数据存储单元中的存储位置信息,在所述目标区块链中查找 所述目标区块。
  11. 根据权利要求10所述的方法,其中,所述从所述区块索引表中确定目标数据存储单元,包括:
    获取所述目标区块链的根区块中存储的时间区间;
    确定所述交易发生时间相对于所述时间区间的开始时间的时间偏移量;
    响应于任一数据存储单元的时间标识与所述时间偏移量相同,将所述数据存储单元确定为所述目标数据存储单元。
  12. 一种区块处理装置,其中,所述装置包括:
    获取模块,用于响应于任一个区块的生成,获取目标区块链的根区块所存储的时间区间;
    子链确定模块,用于响应于所述区块所包含交易的交易发生时间位于所述时间区间内,从所述根区块所连接的第一目标数量个子链中,将符合目标条件的所述子链确定为目标子链;
    添加模块,用于响应于所述区块通过共识,将所述区块添加至所述目标区块链的所述目标子链上。
  13. 一种基于区块链的数据查询装置,其中,所述装置包括:
    获取模块,用于响应于对目标区块链中目标区块的查询指令,获取所述目标区块链的区块索引表,所述查询指令携带所述目标区块中交易的交易发生时间,所述区块索引表中的数据存储单元用于记录所述目标区块链中区块的存储位置信息,一个所述数据存储单元对应于一个时间标识;
    确定模块,用于从所述区块索引表中确定目标数据存储单元,所述目标数据存储单元的时间标识与所述交易发生时间相匹配;
    查找模块,用于基于所述目标数据存储单元中的存储位置信息,在所述目标区块链中查找所述目标区块。
  14. 一种计算机设备,其中,所述计算机设备包括一个或多个处理器和一个或多个存储器,所述一个或多个存储器中存储有至少一条计算机程序,所述 至少一条计算机程序由所述一个或多个处理器加载并执行以实现如权利要求1至权利要求9中任一项所述的区块处理方法所执行的操作。
  15. 一种计算机设备,其中,所述计算机设备包括一个或多个处理器和一个或多个存储器,所述一个或多个存储器中存储有至少一条计算机程序,所述至少一条计算机程序由所述一个或多个处理器加载并执行以实现如权利要求10或权利要求11所述的基于区块链的数据查询方法所执行的操作。
  16. 一种计算机可读存储介质,其中,所述计算机可读存储介质中存储有至少一条计算机程序,所述至少一条计算机程序由处理器加载并执行以实现如权利要求1至权利要求9中任一项所述的区块处理方法所执行的操作。
  17. 一种计算机可读存储介质,其中,所述计算机可读存储介质中存储有至少一条计算机程序,所述至少一条计算机程序由处理器加载并执行以实现如权利要求10或权利要求11所述的基于区块链的数据查询方法所执行的操作。
PCT/CN2020/126458 2020-02-18 2020-11-04 区块处理方法、基于区块链的数据查询方法及装置 WO2021164321A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
EP20919567.6A EP4009187A4 (en) 2020-02-18 2020-11-04 BLOCK PROCESSING METHOD AND DEVICE AND DATA REQUEST METHOD AND DEVICE BASED ON A BLOCKCHAIN
JP2022527689A JP7441311B2 (ja) 2020-02-18 2020-11-04 ブロック処理方法、ブロックチェーンに基づくデータ検索方法および装置
KR1020227015836A KR20220074968A (ko) 2020-02-18 2020-11-04 블록 프로세싱 방법 및 장치, 및 블록체인에 기초한 데이터 질의 방법 및 장치
US17/675,511 US20220171776A1 (en) 2020-02-18 2022-02-18 Block processing method and apparatus, and blockchain-based data query method and apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010099538.8A CN111339086B (zh) 2020-02-18 2020-02-18 区块处理方法、基于区块链的数据查询方法及装置
CN202010099538.8 2020-02-18

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/675,511 Continuation US20220171776A1 (en) 2020-02-18 2022-02-18 Block processing method and apparatus, and blockchain-based data query method and apparatus

Publications (1)

Publication Number Publication Date
WO2021164321A1 true WO2021164321A1 (zh) 2021-08-26

Family

ID=71181702

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/126458 WO2021164321A1 (zh) 2020-02-18 2020-11-04 区块处理方法、基于区块链的数据查询方法及装置

Country Status (6)

Country Link
US (1) US20220171776A1 (zh)
EP (1) EP4009187A4 (zh)
JP (1) JP7441311B2 (zh)
KR (1) KR20220074968A (zh)
CN (1) CN111339086B (zh)
WO (1) WO2021164321A1 (zh)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111339086B (zh) * 2020-02-18 2021-04-20 腾讯科技(深圳)有限公司 区块处理方法、基于区块链的数据查询方法及装置
CN111865611B (zh) * 2020-07-17 2023-09-01 卓尔智联(武汉)研究院有限公司 一种数据上链定序的方法、装置及电子设备
CN111914429A (zh) * 2020-08-12 2020-11-10 国网河北省电力有限公司培训中心 基于区块链的电力仿真培训学习数据管理系统及方法
CN112364371B (zh) * 2020-10-16 2024-04-16 杭州甘道智能科技有限公司 基于区块链的疫苗转移监控的装置及方法
CN112487094B (zh) * 2020-12-08 2024-01-19 深圳供电局有限公司 能源区块数据的同步方法、装置、计算机设备和存储介质
CN113343292A (zh) * 2021-05-28 2021-09-03 网易(杭州)网络有限公司 交易编号处理方法、装置、存储介质及计算机设备
CN114244853A (zh) * 2021-11-29 2022-03-25 国网北京市电力公司 大数据共享方法、装置以及大数据共享系统
CN116760632B (zh) * 2023-08-10 2023-11-03 腾讯科技(深圳)有限公司 数据处理方法、装置、设备及可读存储介质
CN117319422B (zh) * 2023-11-28 2024-02-02 天津市城市规划设计研究总院有限公司 一种城市规划领域物联网数据的区块链成块方法及系统

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108712491A (zh) * 2018-05-17 2018-10-26 易链科技(深圳)有限公司 区块链节点、交易信息处理方法、终端设备和介质
CN108960823A (zh) * 2018-03-30 2018-12-07 杭州复杂美科技有限公司 一种区块链多链并发交易系统
CN109213797A (zh) * 2018-09-30 2019-01-15 中国联合网络通信集团有限公司 一种区块链的查询方法及装置
US20190197474A1 (en) * 2004-06-29 2019-06-27 United Parcel Service Of America, Inc. Data Synchronization For Offline Processing
CN110245190A (zh) * 2019-06-11 2019-09-17 南京荣链科技有限公司 一种区块数据分段存储方法、终端及介质
CN111339086A (zh) * 2020-02-18 2020-06-26 腾讯科技(深圳)有限公司 区块处理方法、基于区块链的数据查询方法及装置

Family Cites Families (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3323080B1 (en) 2015-07-14 2020-11-04 Fmr Llc Computationally efficient transfer processing, auditing, and search apparatuses, methods and systems
US10805393B2 (en) * 2015-12-02 2020-10-13 Olea Networks, Inc. System and method for data management structure using auditable delta records in a distributed environment
CN108304475B (zh) 2017-12-28 2020-11-10 比特大陆科技有限公司 数据查询方法、装置及电子设备
CN108647963B (zh) * 2018-05-02 2020-05-12 百度在线网络技术(北京)有限公司 区块链主链的确定方法、装置、服务器和存储介质
CN108830712A (zh) * 2018-05-17 2018-11-16 易链科技(深圳)有限公司 区块生成的方法、装置、设备和介质
CN111899005A (zh) * 2018-05-29 2020-11-06 创新先进技术有限公司 基于区块链的交易处理方法及装置、电子设备
US20190394267A1 (en) 2018-06-26 2019-12-26 Anami Holdings, Inc. Dynamic voting nodes in blockchain networks
CN208781225U (zh) 2018-07-12 2019-04-23 中国科学院深圳先进技术研究院 一种区块链时空数据查询系统及电子设备
CN109522362B (zh) * 2018-10-17 2020-09-15 北京瑞卓喜投科技发展有限公司 基于区块链数据的非完全数据同步方法、系统及设备
CN109471905B (zh) 2018-11-16 2020-08-25 华东师范大学 一种支持时间范围和属性范围复合查询的区块链索引方法
WO2019072312A2 (en) * 2018-12-29 2019-04-18 Alibaba Group Holding Limited SYSTEM AND METHOD FOR DETECTING REJECTION ATTACK
US10681083B2 (en) * 2018-12-29 2020-06-09 Alibaba Group Holding Limited System and method for detecting replay attack
CN110365493B (zh) * 2019-08-22 2020-09-11 电子科技大学 多形态可派生的环状区块链构建方法
CN110601856B (zh) * 2019-09-24 2022-04-29 腾讯科技(深圳)有限公司 一种基于区块链网络的数据交互方法及装置
CN110830260B (zh) * 2019-09-27 2021-09-24 电子科技大学 一种基于区块链的数字签名的时间戳生成方法
CN110689471A (zh) * 2019-09-30 2020-01-14 浙江水利水电学院 一种基于区块链的水资源监测系统及方法
CN110727737B (zh) * 2019-10-29 2022-10-18 南京邮电大学 基于多层次区块链体系架构的智慧医疗数据存储方法
CN110738497B (zh) * 2019-12-19 2020-03-31 腾讯科技(深圳)有限公司 一种数据处理方法、装置、节点设备及存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190197474A1 (en) * 2004-06-29 2019-06-27 United Parcel Service Of America, Inc. Data Synchronization For Offline Processing
CN108960823A (zh) * 2018-03-30 2018-12-07 杭州复杂美科技有限公司 一种区块链多链并发交易系统
CN108712491A (zh) * 2018-05-17 2018-10-26 易链科技(深圳)有限公司 区块链节点、交易信息处理方法、终端设备和介质
CN109213797A (zh) * 2018-09-30 2019-01-15 中国联合网络通信集团有限公司 一种区块链的查询方法及装置
CN110245190A (zh) * 2019-06-11 2019-09-17 南京荣链科技有限公司 一种区块数据分段存储方法、终端及介质
CN111339086A (zh) * 2020-02-18 2020-06-26 腾讯科技(深圳)有限公司 区块处理方法、基于区块链的数据查询方法及装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4009187A4 *

Also Published As

Publication number Publication date
CN111339086A (zh) 2020-06-26
CN111339086B (zh) 2021-04-20
EP4009187A4 (en) 2023-02-08
KR20220074968A (ko) 2022-06-03
JP7441311B2 (ja) 2024-02-29
EP4009187A1 (en) 2022-06-08
JP2023505412A (ja) 2023-02-09
US20220171776A1 (en) 2022-06-02

Similar Documents

Publication Publication Date Title
WO2021164321A1 (zh) 区块处理方法、基于区块链的数据查询方法及装置
KR102350462B1 (ko) 서명 생성 방법, 전자 장치 및 저장 매체
CN109615516B (zh) 资源转移方法、装置、电子设备及存储介质
CN110674022B (zh) 行为数据获取方法、装置及存储介质
CN111245745B (zh) 消息发送方法、装置、节点设备及存储介质
CN111340482B (zh) 冲突检测方法、装置、节点设备及存储介质
CN111080443B (zh) 基于区块链的业务处理方法、装置、设备及存储介质
CN108805560B (zh) 数值整合方法、装置、电子设备及计算机可读存储介质
CN111090687B (zh) 数据处理方法及装置、系统、计算机可读存储介质
WO2020258748A1 (zh) 银行卡绑定的系统、方法、装置、设备及存储介质
CN111241115B (zh) 数据同步方法、装置、设备及存储介质
CN110555780B (zh) 基于区块链的保险数据处理方法、装置、设备及存储介质
CN111192005A (zh) 政务业务处理方法、装置、计算机设备及可读存储介质
CN111260347A (zh) 基于区块链的资源处理方法、装置、设备及存储介质
CN111667371B (zh) 基于区块链的资源聚合方法、系统、设备及存储介质
CN110851510A (zh) 基于区块链的交易系统的数据处理方法及装置
CN110543502A (zh) 基于区块链的信用数据处理方法、装置、设备及存储介质
CN111212074B (zh) 基于区块链的资格认定方法、装置、设备及存储介质
CN110290191B (zh) 资源转移结果处理方法、装置、服务器、终端及存储介质
CN113506086A (zh) 任务发布方法、装置、计算机设备及介质
CN110597840B (zh) 基于区块链的伴侣关系建立方法、装置、设备及存储介质
CN110727894B (zh) 目标素材设置方法、装置、设备及存储介质
CN110659975B (zh) 基于区块链的资源转移方法、装置、设备及存储介质
CN112991069A (zh) 资源处理方法、装置、设备及存储介质
KR102651730B1 (ko) 미디어 데이터의 재생 방법, 장치, 시스템, 기기 및 저장 매체

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

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020919567

Country of ref document: EP

Effective date: 20220302

ENP Entry into the national phase

Ref document number: 20227015836

Country of ref document: KR

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 2022527689

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE