WO2022100679A1 - 一种数据通信方法、装置、计算机设备及存储介质 - Google Patents

一种数据通信方法、装置、计算机设备及存储介质 Download PDF

Info

Publication number
WO2022100679A1
WO2022100679A1 PCT/CN2021/130209 CN2021130209W WO2022100679A1 WO 2022100679 A1 WO2022100679 A1 WO 2022100679A1 CN 2021130209 W CN2021130209 W CN 2021130209W WO 2022100679 A1 WO2022100679 A1 WO 2022100679A1
Authority
WO
WIPO (PCT)
Prior art keywords
transaction
node
statistical proof
list
transactions
Prior art date
Application number
PCT/CN2021/130209
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 EP21891199.8A priority Critical patent/EP4191498A4/en
Publication of WO2022100679A1 publication Critical patent/WO2022100679A1/zh
Priority to US18/072,621 priority patent/US20230089134A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/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/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • 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/2228Indexing structures
    • 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
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • 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
    • 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/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/401Transaction verification
    • 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/12Transmitting and receiving encryption devices synchronised or initially set up in a particular manner
    • 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/3247Cryptographic 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 digital signatures
    • 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
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/56Financial cryptography, e.g. electronic payment or e-cash

Definitions

  • This application relates to the field of Internet technology, and specifically to blockchain data communication technology.
  • Blockchain is a bookkeeping technology that can achieve consistent storage of data, is difficult to tamper with, and prevents denial, that is, distributed ledger technology; blockchain requires multi-party maintenance, and uses cryptography to ensure transmission and access security.
  • public chain public chain
  • private chain private chain
  • consortium chain consortium chain
  • the blockchain in the prior art is generally a peer-to-peer (P2P, Peer To Peer) network composed of nodes.
  • P2P peer-to-peer
  • public chains such as Bitcoin and Ethereum
  • consortium chains such as Fabric and Terdermint are formed based on the P2P network.
  • the nodes in the P2P network are peer-to-peer, that is, the existing P2P network is a single-layer network.
  • the business node can only synchronize the transaction data on the chain related to itself from the consensus node. And the business node can only unconditionally trust the data returned by the consensus node to itself.
  • the data sent by the consensus node to the business node may be inaccurate or incomplete, that is, the data received by the business node is invalid, so how to verify the validity of the on-chain transaction data synchronized by the business node is the current research hot spot.
  • the embodiments of the present application provide a data communication method, apparatus, computer equipment, and storage medium, which can verify the validity of an associated transaction received by a lightweight node.
  • an embodiment of the present application provides a data communication method, which is executed by a lightweight node, and the method includes:
  • Receive data from an associated block that has an associated relationship with the lightweight node the data includes associated transactions associated with the lightweight node in the associated block, and a list of statistical proof transactions
  • the corresponding transaction visible address and the number of the transaction visible address in the associated block are encrypted and obtained;
  • the encryption path set includes the encryption path of the associated transaction and the encryption path of the statistical proof transaction list;
  • the validity degree of the associated transaction is determined; the validity degree is used to characterize the accuracy and completeness of the associated transaction.
  • an embodiment of the present application provides a data communication method, which is executed by all nodes, and the method includes:
  • the associated block is a block that has an associated relationship with the lightweight node;
  • the associated block includes multiple A list of transactions and a statistical proof transaction; the plurality of transactions have their respective corresponding transaction visible addresses;
  • the statistical proof transaction list includes a plurality of statistical proof transactions, and the statistical proof transaction is a transaction visible address corresponding to the transaction , and the number of the transaction visible address in the associated block is encrypted;
  • An associated transaction associated with the lightweight node is filtered out from the plurality of transactions included in the associated block, and an encryption path set is determined based on the filtered associated transaction, where the encryption path set includes the associated transaction The encryption path of and the encryption path of the statistical proof transaction list;
  • An aspect of an embodiment of the present application provides a data communication device, where the data communication device includes:
  • a receiving unit configured to receive data from an associated block having an associated relationship with the lightweight node, the data including the associated transaction associated with the lightweight node in the associated block and a list of statistical proof transactions,
  • the association block includes a plurality of transactions and the statistical proof transaction list, the plurality of transactions have their respective corresponding transaction visible addresses, the statistical proof transaction list includes a plurality of statistical proof transactions, and the statistical proof transaction It is obtained by encrypting the transaction visible address corresponding to the transaction and the number of the transaction visible address in the associated block;
  • an identification unit for identifying the target index of the lightweight node in the statistical proof transaction list
  • an obtaining unit configured to obtain an encrypted path set based on the associated transaction, where the encrypted path set includes the encrypted path of the associated transaction and the encrypted path of the statistical proof transaction list;
  • a determining unit configured to determine the validity degree of the associated transaction according to the statistical proof transaction list, the target index and the set of encryption paths; the validity degree is used to characterize the accuracy and completeness of the associated transaction Spend.
  • An aspect of an embodiment of the present application provides a data communication device, where the data communication device includes:
  • a receiving unit configured to receive a data synchronization request sent by a lightweight node, and search for an associated block corresponding to the lightweight node;
  • the associated block is a block that has an associated relationship with the lightweight node;
  • the association The block includes a plurality of transactions and a list of statistical proof transactions; the plurality of transactions have their respective corresponding transaction visible addresses;
  • the statistical proof transaction list includes a plurality of statistical proof transactions, and the statistical proof transactions are for the transaction.
  • the corresponding transaction visible address and the number of the transaction visible address in the associated block are encrypted and obtained;
  • an extraction unit configured to extract the statistical proof transaction list from the associated block, and identify the target index of the lightweight node in the statistical proof list
  • the extraction unit is further configured to filter out the associated transactions associated with the lightweight node from the plurality of transactions included in the associated block, and determine an encryption path set based on the filtered associated transactions, the encryption The path set includes the encrypted path of the associated transaction and the encrypted path of the statistical proof transaction list;
  • a sending unit configured to send the statistical proof transaction list, the target index, the associated transaction and the encryption path set to the light node, so that the light node can prove the transaction list according to the statistical proof , the target index, and the set of encryption paths to determine the degree of validity of the associated transaction; the degree of validity is used to characterize the accuracy and completeness of the associated transaction.
  • An aspect of the embodiments of the present application provides a computer device, including a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the methods in the foregoing embodiments.
  • An aspect of the embodiments of the present application provides a computer storage medium, where the computer storage medium stores a computer program, the computer program includes program instructions, and when the program instructions are executed by a processor, the methods in the foregoing embodiments are executed.
  • the embodiments of the present application provide a computer program product or computer program.
  • the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium.
  • the computer instructions are executed by a processor of a computer device, the execution methods in the above embodiments.
  • the lightweight node can receive a list of statistical certification transactions from the associated block, the list of statistical certification transactions includes a plurality of statistical certification transactions, and the statistical certification transactions are corresponding to the transactions included in the associated block
  • the transaction visible address and the number of transaction visible addresses in the associated block are encrypted, and the lightweight node can identify its own target index in the statistical proof transaction list, and filter out the multiple transactions included in the associated block.
  • the accuracy of related transactions is used to indicate whether the related transactions are accurate.
  • the integrity of the related party transaction is used to characterize whether the related party transaction is complete.
  • the so-called accurate related party transaction means that the content related to the related party transaction has not been tampered with, and the so-called complete related party transaction means that the content related to the related party transaction is not missing.
  • the light-weight node in this application obtains the plaintext associated transaction related to itself in the associated block, the encrypted path of the associated transaction, and the encrypted statistical proof transaction in the associated block, and verifies the associated transaction related to itself based on the obtained information
  • the lightweight node will not obtain plaintext transactions that have nothing to do with itself.
  • the verification of the validity of the associated transactions related to itself is realized, ensuring that The validity of the data transmitted in the data communication process improves the quality and efficiency of the data communication.
  • 1A is a schematic structural diagram of a blockchain data sharing system provided by an embodiment of the present application.
  • FIG. 1B is a schematic structural diagram of a blockchain provided by an embodiment of the present application.
  • 1C is a schematic flowchart of a block generation provided by an embodiment of the present application.
  • FIG. 2 is a schematic structural diagram of a data communication system provided by an embodiment of the present application.
  • 3A is a schematic diagram of a scenario of a data communication method provided by an embodiment of the present application.
  • 3B is a schematic diagram of a scenario of another data communication method provided by an embodiment of the present application.
  • 3C is a schematic diagram of a scenario of another data communication method provided by an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of a data communication method provided by an embodiment of the present application.
  • FIG. 5 is a schematic flowchart of another data communication method provided by an embodiment of the present application.
  • 6A is a schematic flowchart of obtaining an encrypted path provided by an embodiment of the present application.
  • 6B is a schematic diagram of a statistical proof transaction list provided by an embodiment of the present application.
  • FIG. 7 is a schematic flowchart of another data communication method provided by an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a data communication device provided by an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of another data communication device provided by an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of a computer device provided by an embodiment of the present application.
  • Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, and application technology based on cloud computing business models. Cloud computing technology will become an important support. Background services of technical network systems require a lot of computing and storage resources, such as video websites, picture websites and more portal websites. With the high development and application of the Internet industry, each item may have its own identification mark in the future, which needs to be transmitted to the back-end system for logical processing. Data of different levels will be processed separately. System backing support can only be achieved through cloud computing.
  • Cloud storage is a new concept extended and developed on the concept of cloud computing.
  • Distributed cloud storage system (hereinafter referred to as storage system) refers to the functions of cluster application, grid technology and distributed storage file system.
  • a storage system that integrates a large number of different types of storage devices (also called storage nodes) in the network through application software or application interfaces to work together to provide external data storage and service access functions.
  • the statistical proof transaction list and related transactions in the blockchain involved in this application are And the set of encrypted paths can be realized by the cloud storage technology in the cloud technology. That is, the blockchain is stored on the "cloud” through cloud storage technology. When it is necessary to store the statistical proof transaction list, associated transactions and encrypted path sets on the blockchain, these data can be uploaded to the "cloud” through cloud storage technology. ”, and when you need to read these data, you can also read data from the blockchain on the “cloud” at any time, which can reduce the storage requirements for terminal equipment and expand the application of blockchain scope.
  • Blockchain is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • Blockchain which is essentially a decentralized database, is a series of data blocks generated using technologies associated with cryptographic methods. Each data block contains a batch of network transaction information. It is used to verify the validity of its 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.
  • FIG. 1A is a schematic structural diagram of a blockchain data sharing system provided by an embodiment of the present application.
  • the data sharing system 100 is a system for realizing data sharing between nodes.
  • the data sharing system 100 It may include multiple nodes 101 and multiple nodes 201 , the multiple nodes 101 may be respective clients in the data sharing system 100 , and the multiple nodes 201 may be respective servers in the data sharing system 100 .
  • the storage space and computing power of the node 201 will be greater than the storage space and computing power of the node 101 .
  • each node in the data sharing system there may be an information connection between each node in the data sharing system, and information transmission may be performed between the nodes through the above-mentioned information connection.
  • information transmission may be performed between the nodes through the above-mentioned information connection.
  • all nodes 201 in the data sharing system 100 obtain the input information according to the consensus algorithm, and store the input information as shared data, so that the data sharing system The data stored on all nodes 201 in 100 are consistent.
  • due to factors such as different storage spaces of node 101 and node 201 or business requirements for any node 101 in the data sharing system 100, when any node 101 receives input information, only data related to the node itself is stored.
  • each node 201 in the blockchain data sharing system 100 can store a complete blockchain, and the complete blockchain includes information related to each node 101 and each node 201 Each node 101 only stores transaction data related to itself, and each node 101 can request any node 201 for transaction data related to itself.
  • each node in the blockchain data sharing system 100 shown in FIG. 1A further include: routing. Routing is a basic function possessed by nodes and is used to support communication between nodes.
  • each node 101 and each node 201 can communicate with each other, and the communication between the node 101 and the node 201 can be achieved by implementing the communication through the routing function of the node 101 or through the routing function of the node 201. .
  • the node 201 in the data sharing system 100 may be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a basic cloud that provides cloud services, CDN, and big data and artificial intelligence platforms. Cloud servers for computing services.
  • the node 101 may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, a vehicle terminal, etc., but is not limited thereto.
  • FIG. 1B is a schematic structural diagram of a blockchain provided by an embodiment of the present application.
  • the blockchain consists of multiple blocks.
  • Each block includes a block header and a block body.
  • the block header of the founding block stores the input information characteristic value, version number, timestamp and difficulty value. Except for the founding block
  • the block headers of other blocks store the input information feature value, version number, timestamp, the block header feature value and difficulty value of the parent block, and the block body of each block stores the input information.
  • the input information can also include a list of statistical proof transactions generated based on these transactions, and the list of statistical proof transactions can also be regarded as a transaction.
  • FIG. 1C is a schematic flowchart of generating a new block provided by an embodiment of the present application.
  • the node where the blockchain is located receives the initiated transaction, it verifies the transaction, stores it in the memory pool after verification, and generates a statistical proof transaction list based on all transactions in the memory pool (all transactions in the memory pool and all transactions in the memory pool).
  • the generated list of statistical proof transactions can be collectively referred to as input information), and updates the hash tree used to record the input information.
  • the information can be stored correspondingly, the block header and the block body can be generated, and the current block can be obtained. Subsequently, the newly generated blocks are sent to other nodes in the blockchain data sharing system where they are located, and the newly generated blocks are verified by other nodes. added to the blockchain where it is stored.
  • FIG. 2 is a schematic structural diagram of a data communication system provided by an embodiment of the present application.
  • the system architecture includes: a lightweight node cluster 100 and a full node cluster 200, wherein the lightweight node cluster 100 includes a lightweight node 101, a lightweight node 102, a lightweight node 103 and a lightweight node 104, and the full node cluster 200 includes a full Node 201 , full node 202 , full node 203 , and full node 204 .
  • the lightweight node cluster 100 is in the first blockchain network
  • the full node cluster 200 is in the second blockchain network.
  • the first blockchain network is different from the second blockchain network.
  • the first blockchain network It is the underlying network of the second blockchain network.
  • the nodes in the first blockchain network only store the associated transactions related to themselves, and the nodes in the second blockchain network store the associated transactions of all nodes in the first blockchain network.
  • the first blockchain network is a public network
  • the second blockchain network is a private network
  • the first blockchain network and the second blockchain network together constitute a blockchain network.
  • the blockchain network involved in the embodiments of this application is a two-layer blockchain network, which can realize data isolation between nodes and can be applied to resource data issuers, etc., which have relatively high requirements on confidentiality and privacy.
  • merchant A and merchant B can issue electronic invoices on the blockchain, that is, store the electronic invoices on the chain, but only the institutional server that maintains the blockchain will store the electronic invoices of all merchants.
  • the institutional server will only return the invoice issued by merchant A (or merchant B) to merchant A (or merchant B), thus realizing the transaction between merchants.
  • Data isolation that is, by making nodes in different blockchain networks to synchronize different data, so as to meet the needs of privacy and confidentiality.
  • the number of lightweight nodes in the lightweight node cluster 100 in this embodiment of the present application is only for example, and in other feasible embodiments, the number of nodes in the lightweight node cluster 100 and the full node 200 may be Adjust according to specific business scenarios.
  • the number of nodes in the lightweight node cluster 100 may be five or eight, and the number of nodes in the full node cluster 200 may also be six, seven, etc. No specific limitation is made.
  • each lightweight node in the lightweight node cluster 100 establishes a communication connection with each other. network or wired network.
  • each full node in the full node cluster 200 also establishes a communication connection with each other.
  • the full node 201, the full node 202, the full node 203 and the full node 204 can be connected through a wireless network or a wired network. to communicate.
  • any lightweight node in the lightweight node cluster 100 can communicate with any full-scale node in the full-scale node cluster 200 through network routing.
  • the lightweight node may send the data synchronization request to the full node in the full node cluster 200 with the best communication quality with the lightweight node; the light node may also send the data synchronization request to the full node The full node in the cluster 200 that is closest to the light node; the light node can also send a data synchronization request to the full node elected by all full nodes in the full node cluster 200 through a consensus algorithm.
  • consensus algorithms include but are not limited to Proof of Work (PoW) algorithm, Proof of Stake (PoS) algorithm, Delegated Proof of Stake (DPoS) algorithm, Practical Byzantine Fault Tolerance (Practical Byzantine) Fault Tolerance, PBFT) algorithm, etc.
  • the communication between the light node 101 and the full node 201 is taken as an example for specific description.
  • the lightweight node 101 sends a data synchronization request to the full node 201, and the full node 201 responds to the data synchronization request sent by the lightweight node 101 and searches for the associated block corresponding to the lightweight node 101;
  • the light-weight node 101 has an associated block; it includes multiple transactions and a list of statistical certification transactions; multiple transactions have their respective corresponding transaction visible addresses; the list of statistical certification transactions includes multiple statistical certification transactions, wherein any statistical certification
  • the proof transaction is obtained by encrypting any transaction visible address of the transaction contained in the associated block and the visible transaction quantity of the transaction visible address in the associated block.
  • the full node 201 extracts the statistical proof transaction list from the associated block, and identifies the target index of the light node 101 in the statistical proof transaction list.
  • the full node 201 filters out the associated transaction associated with the light node 101 from the associated block, and determines an encryption path set based on the filtered associated transaction, where the encryption path set includes the encryption path of the associated transaction and the statistical proof transaction list. Encrypted path; the full node 201 sends the statistical proof transaction list, target index, associated transaction and encrypted path set to the lightweight node 101 .
  • the lightweight node 101 after the lightweight node 101 receives the statistical proof transaction list, target index, associated transaction and encrypted path set sent by the full node 201, it can determine the accuracy of the associated transaction according to the encrypted path set, That is to check whether the related transaction is accurate and whether the related transaction has been illegally tampered with; and, according to the target index and the statistical proof transaction list, the completeness of the related transaction can be determined, that is, whether the related transaction is complete and whether the related content of the related transaction is verified. There is a missing.
  • nodes in the blockchain network involved in the embodiments of this application may be mobile phones, tablet computers, notebook computers, handheld computers, mobile internet devices (MIDs, mobile internet devices), vehicles, roadside devices, Aircraft, wearable devices, and smart devices with data processing functions such as smart watches, smart bracelets, and pedometers can also be used.
  • the device types corresponding to each node can be the same or different.
  • FIG. 3A is a schematic diagram of a scenario of a data communication method provided by an embodiment of the present application.
  • the data communication method provided in this application can be applied to the electronic invoice business scenario.
  • the service node involved in the embodiment of FIG. 3A may be a client oriented to a resource data issuer, an enterprise, or a consumer.
  • the service node is specifically in the service layer, and the service node may belong to a secure private network, a public cloud network, a private cloud network, and the like.
  • the secure private network includes local institutions
  • the public cloud network includes business service providers, reimbursement service providers, and KA (Key Account) enterprises, etc.
  • the private cloud network includes payment service providers, circulation service providers, and KA enterprises.
  • the proxy node can be in the routing proxy layer, and the proxy node can provide P2P services, routing services, certificate caching and authentication services.
  • the core network consensus layer is composed of one or more core blockchains, such as core chain 1, core chain 2, etc. Each core chain is jointly maintained by all nodes in the blockchain through communication connections, and different core chains Different services may be included, eg, core chain 1 for service 1, core chain 2 for service 2, and core chain N for service N.
  • Each core chain can include several full nodes, which can generate and execute smart contracts or permission contracts, cache and store data in the blockchain, and publish blocks to the blockchain network.
  • the proxy node can act as an isolation between the business layer and the core consensus network layer, and the business layer, the routing agent layer and the core consensus network layer together form a blockchain network, which can It is used in business scenarios with high confidentiality such as resource data issuers.
  • the business node in the business layer can submit a data synchronization request to the core consensus network layer through the routing agent layer.
  • the business service provider can send the data synchronization request (ticket) Synchronization request) is sent to the full node in the core consensus network layer with the best communication quality with the business service provider, or the business service provider can send a data synchronization request (ticket synchronization request) to the core consensus network layer.
  • the distance between the business service provider The nearest full node, or the business service provider can send the acquisition request (ticket synchronization request) to the target full node, and the target full node can be all the full nodes on the core chain corresponding to the ticket business in the core consensus network layer through the consensus algorithm election
  • the target full nodes elected by the consensus algorithm on each core chain can be updated periodically to achieve the confidentiality and fairness of the block data in the blockchain.
  • the ticket synchronization request includes the identity information of the business service provider. After receiving the ticket synchronization request sent by the business node, the full nodes in the consensus layer of the core network can obtain the identity information of the business service provider in the ticket synchronization request, and then, for the business service provider identity information for verification.
  • the identity information of the business service provider may be an authoritative digital certificate obtained by the business service provider from a certificate authority (Certificate Authority, CA) agency, and all nodes can verify the authoritative digital certificate of the business service provider. If the authoritative digital certificate of the business provider passes the verification, the associated block corresponding to the business service provider can be obtained.
  • CA Certificate Authority
  • FIG. 3B is a schematic diagram of a scenario of another data communication method provided by an embodiment of the present application.
  • the light node 1, the light node 2 and the light node 3 are in the first blockchain network, and the full node 1, the full node 2 and the full node 3 are in the second blockchain network.
  • Light node 1 initiates a transaction X to full node 1 (the specific content of transaction X can be that user 1 of light node 1 transfers an electronic ticket), transaction X includes multiple transaction visible addresses (multiple transaction visible addresses) It can be specified by user 1 of lightweight node 1. For example, user 1 can specify that the transaction visible address includes the node address of lightweight node 2.
  • the node address of lightweight node 1 is usually defaulted to the transaction visible address of transaction X), full Node 1 broadcasts transaction X to the second blockchain network, so that all nodes in the second blockchain network store transaction X in their respective transaction pools (assuming that before storing transaction X, the transaction pool has Transaction 1 and transaction 2 are stored, and the transaction visible addresses of transaction 1 and transaction 2 both include the node address of lightweight node 2). All nodes can perform blockchain consensus on each transaction in the transaction pool. After the consensus is passed, the full node 1 counts the transaction visible addresses corresponding to each transaction in the transaction pool, that is, the number of transaction visible addresses corresponding to transaction 1, transaction 2, and transaction X. The transaction visible address and the transaction visible number of each transaction visible address are encrypted separately to obtain a list of statistical proof transactions.
  • the full node 1 can generate an associated block according to the statistical proof transaction list, transaction 1, transaction 2 and transaction X, as shown in block 3 in Figure 3B, which is the statistical proof of full node 1
  • full node 1 receives the data synchronization request sent by light node 2, full node 1 can extract the statistical proof transaction list from the associated block, and identify the target index of light node 2 in the statistical proof transaction list, Since the visible address of the transaction existing in the above block 3 includes the node address of the light node 2, the full node 1 can use the block 3 as the associated block of the light node 2. Then, full node 1 can determine the Merkel path of the statistical proof transaction list in block 3, the Merkel path of transaction 1, the Merkel path of transaction 2, and the Merkel path of transaction X.
  • the Merkle path of the statistical proof transaction list, the Merkle path of transaction 1, the Merkle path of transaction 2, and the Merkle path of transaction X may be collectively referred to as the set of encrypted paths.
  • the full node 1 sends the statistical proof transaction list, target index, associated transactions (ie, transaction 1, transaction 2, and transaction X) and the set of encrypted paths to the lightweight node 2. Since the transaction visible addresses of transaction 1, transaction 2 and transaction X in block 3 all include the node address of lightweight node 2, transaction 1, transaction 2 and transaction X here are all related transactions of lightweight node 2.
  • FIG. 3C is a schematic diagram of a scenario of another data communication method provided by an embodiment of the present application.
  • the lightweight node After receiving the statistical proof transaction list, target index, transaction 1, transaction 2, transaction X and encrypted path set sent by the full node, the lightweight node can determine transaction 1 and transaction 2 according to the statistical proof transaction list, target index and encrypted path set. and the validity result of transaction X.
  • the validity results may include accuracy results and completeness results.
  • the lightweight node 2 can determine the accuracy results of transaction 1, transaction 2 and transaction X according to the set of encryption paths, that is, verify whether the contents of transaction 1, transaction 2 and transaction X have been tampered with; according to the target index, statistical proof
  • the transaction list and the encryption path of the statistical proof transaction list are used to determine the integrity results of transaction 1, transaction 2 and transaction X, that is, to check whether the contents of transaction 1, transaction 2 and transaction X are missing.
  • the data communication methods provided by the embodiments of the present application can be applied to business scenarios such as resource data issuers and companies, and based on the two-layer blockchain network provided by the embodiments of the present application, isolation between data can be achieved , after the lightweight node requests the business node for the associated transaction related to the lightweight node itself, the validity of the associated transaction obtained by the lightweight node can be proved through the statistical proof transaction list, which not only guarantees the storage of the blockchain network.
  • the security of data also meets the application requirements of lightweight nodes that need to verify the validity of associated transactions.
  • FIG. 4 is a schematic flowchart of a data communication method provided by an embodiment of the present application.
  • the method is applied to a blockchain network, the blockchain network includes a first blockchain network and a second blockchain network, the first blockchain network includes lightweight nodes, and the second blockchain network includes full nodes.
  • the operation steps of the method can be performed by a computer device, and the computer device can be a light-weight node or a full-scale node.
  • This embodiment mainly describes the interaction process between the lightweight node and the full node, and the method includes but is not limited to the following steps S410-S450:
  • Step S410 The light node sends a data synchronization request to the full node.
  • the lightweight nodes can be Simple Payment Verification (SPV) nodes
  • the full nodes can be consensus nodes. All nodes can store a complete blockchain, wherein the blockchain includes associated transactions of all nodes in the first blockchain network.
  • the light node can send a data synchronization request to the full node, where the data synchronization request is used to request the full node for an associated transaction related to the light node itself.
  • the lightweight node can package and encapsulate the time period, its own node address, its own identity information, its own digital signature and the business type of the data to be synchronized into a data synchronization request, and then Send data synchronization requests to all nodes.
  • the characteristics of lightweight nodes include but are not limited to: not always online; do not need to save the entire blockchain, just save the block header of each block; do not need to save all transactions on the chain, only save the related ones. transactions, etc.
  • the characteristics of full nodes include but are not limited to: always online; maintaining complete blockchain information on the local hard disk; monitoring transaction information on the blockchain network to verify the legitimacy of each transaction; deciding which transactions can be packaged into the zone block; monitor the blocks dug by other miners, verify their legitimacy and mining, etc.
  • the lightweight node can be the client where the consumer is located, the consumer can include individual consumers or enterprise consumers, etc., the full node can be the client where the bill service provider is located, and the bill service The client where the merchant is located stores all electronic invoices consumed by consumers.
  • the client where the bill service provider is located is in the second blockchain network, and the second blockchain network may include one or more blockchains.
  • the second blockchain network includes multiple blockchains, Each blockchain can be differentiated according to different businesses or locations.
  • the second blockchain network includes blockchain 1, blockchain 2, and blockchain 3.
  • Blockchain 1 can be responsible for the electronic data corresponding to business 1.
  • Invoice business 1 blockchain 2 can be responsible for electronic invoice business 2 corresponding to business 2
  • blockchain 3 can be responsible for electronic invoice business 3 corresponding to business 3.
  • the ticket service provider can determine which block the client of the business service provider corresponding to the enterprise maintains according to the business type. chain.
  • the lightweight node in the first blockchain network may send a data synchronization request to the full node in the second blockchain network with the best communication quality with the lightweight node, or the first blockchain network
  • the lightweight node in the blockchain network can send a data synchronization request to the full node in the second blockchain network that is closest to the lightweight node, or the lightweight node in the first blockchain network can synchronize the data
  • the request is sent to any full node in the second blockchain network, or the lightweight node in the first blockchain network sends the data synchronization request to the target full node in the second blockchain network, and the target full node It is a node elected by all nodes in the second blockchain network through a consensus algorithm.
  • Step S420 The full node receives the data synchronization request sent by the lightweight node, and searches for the associated block corresponding to the lightweight node.
  • the associated block is a block that has an associated relationship with the lightweight node in the blockchain; the associated block can be a real-time block associated with the lightweight node in the blockchain network, or it can be It is the historical block associated with the lightweight node in the blockchain network.
  • the associated block includes multiple transactions and a list of statistical proof transactions; multiple transactions have their respective corresponding transaction visible addresses.
  • the data synchronization request includes the identity information of the lightweight node, then the full node can obtain the identity information of the lightweight node from the data synchronization request, and then the full node can perform the data synchronization on the obtained lightweight node.
  • identity information for verification.
  • the identity information may include the digital signature of the lightweight node, which is obtained by the lightweight node signing the data synchronization request according to the private key of the lightweight node; after the full node receives the identity information from the lightweight node , the digital signature of the lightweight node can be verified according to the public key of the lightweight node. If the verification is successful, it means that the identity verification of the lightweight node has passed. In this way, the validity of the identity of the lightweight node is verified, which is beneficial to improve the data security between the lightweight node and the full node, and ensure that the data is transmitted to the legal lightweight node.
  • the identity information can also include the digital certificate of the lightweight node, and the digital certificate can be a public key certificate system (Public Key Infrastructure, PKI). Can be issued by an authority such as a CA authority.
  • the full node can verify the digital certificate of the lightweight node. Specifically, the keyword in the digital certificate can be obtained through the keyword extraction algorithm, and the target image in the digital certificate can be identified through the image recognition algorithm. If the digital certificate of the lightweight node is verified, it means that the identity verification of the lightweight node is passed.
  • the full node can obtain the node address of the lightweight node, and then obtain the associated block corresponding to the lightweight node in the blockchain according to the node address of the lightweight node. If a transaction contained in a block on the blockchain contains at least one transaction whose transaction visible address includes the node address of the lightweight node, the block is an associated block that is associated with the lightweight node.
  • the process of generating the node address may include: generating the node address based on a key pair, specifically, each key pair includes a private key and a public key.
  • the private key is a number, usually chosen randomly by a random algorithm.
  • a one-way encryption function can be used to generate a public key.
  • a one-way cryptographic hash function can be used to generate a Bitcoin address, a node address, where each node in the blockchain network corresponds to a unique node address.
  • Step S430 All nodes extract a list of statistical proof transactions from the associated block, and identify the target index of the lightweight node in the list of statistical proof transactions; the associated transactions associated with the lightweight nodes, and determine an encryption path set based on the filtered associated transactions.
  • the statistical proof transaction list includes a plurality of statistical proof transactions, and each statistical proof transaction is obtained by encrypting the transaction visible address corresponding to the transaction included in the associated block and the number of the transaction visible address in the associated block.
  • encryption algorithms can be used for encryption processing, including but not limited to: Message-Digest Algorithm 5 (MD5), Secure Hash Algorithm 256 (Secure Hash Algorithm256, SHA256), Algorithm 512 (Secure Hash Algorithm512, SHA512), Secure Hash Algorithm 384 (Secure Hash Algorithm384, SHA384), Secure Hash Algorithm 1 (Secure Hash Algorithm 1, SHA-1), etc., hash operation message authentication code algorithm (Hash- based Message Authentication Code, HMAC), AES algorithm, DES algorithm, 3DES algorithm, RSA algorithm and ECC algorithm, etc.
  • HMAC hash operation message authentication code algorithm
  • HMAC Hash based
  • the number of associated transactions associated with a lightweight node may be one or multiple, and the associated transaction may include transactions initiated by the lightweight node, and associated transactions may also include transactions received by the lightweight node , and associated transactions can also include transactions witnessed by lightweight nodes. If the transaction visible address of a transaction in the associated block includes the node address of the lightweight node, then the transaction is a transaction associated with the lightweight node (the transaction visible address can be manually designated by the transaction initiator). It is worth noting that if a transaction in the associated block is initiated by a lightweight node, the node address of the lightweight node must be the transaction-visible address of the transaction.
  • the encrypted path set includes the encrypted path of the associated transaction and the encrypted path of the statistical proof transaction list.
  • the encrypted path may be a Merkel path.
  • the plurality of statistical proof transactions included in the statistical proof transaction list are arranged in order, specifically, the plurality of statistical proof transactions are arranged according to the appearance order of the transactions included in the associated block by the visible address of the transaction.
  • the target index of the light node in the statistical proof transaction list can be 1, 2, 3..., and through the target index, the target statistical proof transaction corresponding to the light node in the statistical proof transaction list can be obtained.
  • the transaction visible address of any transaction can be manually set by the transaction initiator, and the number of transaction visible addresses can be one or more.
  • the number of transaction visible addresses refers to the number of multiple transactions associated with the transaction visible address in the associated block.
  • the lightweight node A initiates a transaction X
  • the lightweight node A can specify the transaction visible address of the transaction X
  • B and C that is, the lightweight node A
  • Transaction X is visible to light node B and light node C. Therefore, for light node A, light node B and light node C, transaction X is their associated transaction.
  • the transaction visible addresses of transaction X include A, B, and C.
  • Step S440 The full node sends the statistical proof transaction list, the target index, the associated transaction and the encryption path set to the lightweight node.
  • the full node if the identity information of the light node is verified by the full node, the full node sends the statistical proof transaction list, target index, associated transaction and encryption path set to the light node.
  • the full node can also send the block header of the associated block to the lightweight node, where the block header of the associated block includes but is not limited to: the version number of the associated block, input information feature value, timestamp, difficulty value and block Merkel root etc.
  • Step S450 The lightweight node determines the validity degree of the associated transaction according to the statistical proof transaction list, the target index and the set of encryption paths; the validity degree is used to characterize the accuracy and completeness of the associated transaction Spend.
  • the effectiveness of the related party transaction may include the accuracy of the related party transaction and the completeness of the related party transaction.
  • the lightweight node can check whether the associated transaction is accurate according to the set of encrypted paths, that is, whether the associated transaction has been tampered with, so as to obtain the accuracy; the lightweight node can verify the accuracy according to the target index, the statistical proof transaction list and the statistical proof transaction list
  • the encryption path is used to check whether the affiliated transaction is complete, that is, to check whether the content of the affiliated transaction is missing, so as to obtain the integrity.
  • the lightweight node before determining the validity of the associated transaction according to the statistical proof transaction list, target index, associated transaction and encryption path set, the lightweight node can obtain the identity information of the full node, the identity information may specifically include The digital signature of the full node, the digital signature is obtained by the full node signing the statistical proof transaction list, target index, associated transaction and encrypted path set according to the private key of the full node.
  • the lightweight node After the lightweight node obtains the identity information of the full node, it can verify the digital signature of the full node according to the public key of the full node. If the verification is successful, it means that the verification of the full node's identity information has passed. In this way, the data security between the light nodes and the full nodes can be improved.
  • the data communication method provided by the embodiments of this application can be applied to a two-layer blockchain network including a first blockchain network and a second blockchain network, where the light nodes are in the first blockchain network, and the full nodes are in the first blockchain network.
  • data exchange can be performed between the lightweight node and the full node.
  • the lightweight node can send a data synchronization request to the full node.
  • the full node receives the data synchronization request from the lightweight node, it can Send its associated association transaction to this lightweight node.
  • the statistical proof transaction list puts the number of visible addresses of each transaction into the block, but does not put the relevant transaction plaintext.
  • any node in the blockchain network obtains the statistical proof transaction list, Since all transaction information is not available, the statistical proof transaction corresponding to each node address cannot be calculated.
  • the set of encrypted paths ensures that the transaction unit is correct without tampering, and the statistics prove that the transaction list ensures that the total number of related transactions obtained is consistent with the chain, without tampering.
  • the two proofs are superimposed, it can be fully believed that the obtained data is the data available to the node in the block, and all the necessary information is complete. In this way, without revealing the number of visible addresses of other transactions, each lightweight node can verify the correctness and integrity of its own synchronization data, which ensures the security isolation of sensitive business data and the validity proof after security isolation. The isolation of data between lightweight nodes and full nodes is improved, and data security is improved.
  • FIG. 5 is a schematic flowchart of another data processing method provided by an embodiment of the present application.
  • the method is applied to a blockchain network, the blockchain network includes a first blockchain network and a second blockchain network, the first blockchain network includes lightweight nodes, and the second blockchain network includes full nodes.
  • the operational steps of the method may be performed by a computer device, and the computer device may be a lightweight node.
  • This embodiment mainly describes the verification process of the associated transaction by the lightweight node, and the method includes but is not limited to the following steps S510-S540:
  • Step S510 Receive data from an associated block that has an associated relationship with the lightweight node, the data includes associated transactions associated with the lightweight node in the associated block, and a list of statistical proof transactions, the The associated block includes a plurality of transactions and the statistical proof transaction list, the plurality of transactions have their respective corresponding transaction visible addresses, the statistical proof transaction list includes a plurality of statistical proof transactions, and the statistical proof transaction is a pair of The transaction visible address corresponding to the transaction and the number of the transaction visible address in the associated block are encrypted and obtained.
  • Step S520 Identify the target index of the lightweight node in the statistical proof transaction list.
  • the light node receives the list of statistical proof transactions sent by the full node and extracted from the associated block; and receives the target index of the light node identified in the list of statistical proof transactions sent by the full node, or , the lightweight node can also identify its own target index from the received list of statistical proof transactions.
  • the list of statistical proof transactions includes a plurality of statistical proof transactions, and the plurality of statistical proof transactions are arranged according to the appearance order of the visible addresses of the transactions.
  • the statistical proof transaction list may include statistical proof transaction 1, statistical proof transaction 2, and statistical proof transaction 3, wherein the statistical proof transaction 1 is the transaction visible address 1 of the transaction included in the associated block, and the transaction visible address 1 in the association
  • the number m1 in the block is obtained by encrypting it.
  • the statistics prove that transaction 2 is obtained by encrypting the transaction visible address 2 of the transaction included in the associated block and the number m2 of the transaction visible address 2 in the associated block.
  • the statistics prove that the transaction 3 is obtained by encrypting the transaction visible address 3 of the transaction included in the associated block and the number m3 of the transaction visible address 3 in the associated block. If the transaction visible address 1, transaction visible address 2, and transaction visible address 3 appear in the transaction in the order of transaction visible address 1, transaction visible address 2, and transaction visible address 3, then the statistics prove the transaction list.
  • the order can be: Statistical Proof Transaction 1, Statistical Proof of Transaction 2, Statistical Proof of Transaction 3.
  • the light node can also receive the associated transaction associated with the light node extracted from the associated block by the full node.
  • the transaction quantity of the related transaction can be one or more.
  • Step S530 Obtain an encryption path set based on the associated transaction, where the encryption path set includes the encryption path of the associated transaction and the encryption path of the statistical proof transaction list.
  • the lightweight node receives the encrypted path set sent by the full node.
  • the encryption path set includes the encryption path of the associated transaction, and the number of transactions of the associated transaction can be one or more. Since the statistics prove that the transaction list itself is also a transaction, the encryption path set also includes the encryption path of the statistics certificate transaction list. For example, if the number of related transactions is n, and the related transactions are x1, x2, x3, ..., xn, the encrypted path set includes the encrypted path of x1, the encrypted path of x2, the encrypted path of x3, . .., the encrypted path of xn and the encrypted path of the statistical proof transaction list.
  • FIG. 6A is a schematic flowchart of obtaining an encryption path provided by an embodiment of the present application.
  • the encryption path can be a Merkle path that can be obtained through a Merkle tree.
  • the encryption paths corresponding to transaction x1 are: N1 and N5, and the encryption paths corresponding to transaction x2 are: N0 and N5.
  • the encryption paths corresponding to x3 are: N3 and N4, and the encryption paths corresponding to transaction x4 are: N2 and N4.
  • the list of related transactions and statistical proof transactions can be any one of transaction x1, transaction x2, transaction x3 and transaction x4.
  • Step S540 Determine the validity degree of the associated transaction according to the statistical proof transaction list, the target index and the encryption path set; the validity degree is used to characterize the accuracy and completeness of the associated transaction.
  • the degree of validity may include accuracy and completeness.
  • the lightweight node can verify the accuracy of the associated transaction based on the set of encrypted paths and obtain its accuracy; it can verify whether the associated transaction is complete and obtain its integrity based on the target index, the statistical proof transaction list and the encrypted path of the statistical proof transaction list. .
  • the number of associated transactions is multiple, the multiple associated transactions include a first associated transaction and a second associated transaction, and the encryption paths of the multiple associated transactions include a first encryption path corresponding to the first associated transaction The second encryption path corresponding to the second associated transaction.
  • the lightweight node determines the first Merkel root according to the first associated transaction and the first encryption path, and the lightweight node determines the second Merkel root according to the second associated transaction and the second encryption path. Then, the lightweight node receives the block Merkel root of the associated block, and if the first Merkel root, the second Merkel root, and the block Merkel root are all the same, the lightweight node determines that the associated transaction is accurate. If at least two Merkel roots in the first Merkel root, the second Merkel root, and the block Merkel root are different, the light node determines that the associated transaction is inaccurate.
  • the encryption paths corresponding to transaction x1 are: N1 and N5
  • the encryption paths corresponding to transaction x2 are: N0 and N5
  • transaction x3 The corresponding encryption paths are: N3 and N4
  • the encryption paths corresponding to transaction x4 are: N2 and N4.
  • the light node can determine the first Merkel root according to the transactions x1, N1 and N5, specifically: the light node performs a hash operation on the transaction x1 through a hash algorithm to obtain hash(x1), and then, the light node The node performs hash operation on hash(x1) and N1 again to get hash[hash(x1)+N1]. Finally, the lightweight node performs hash operation on hash[hash(x1)+N1] and N5 to get hash ⁇ hash[hash(x1)+N1]+N5 ⁇ is the Merkle root root1.
  • the Merkel root of the block obtained by the lightweight node is Root. If root1, root2, root3, and root4 are all the same as Root, the lightweight node determines the accuracy of the associated transaction as accurate.
  • root1 is the same as Root
  • root2 is the same as Root
  • root3 is different from Root
  • root4 is different from Root
  • the lightweight node determines the accuracy of transaction x1 and transaction x2, and the transaction x3 and transaction x4 are not accurate, and then the lightweight node determines the association The accuracy of the transaction is inaccurate.
  • the lightweight node determines the Merkel root corresponding to the associated transaction based on the associated transaction and its corresponding encryption path, and then corrects the Merkel root corresponding to the associated transaction and the block Merkel root of the associated block.
  • To verify whether the related transaction has been tampered with that is, to determine the accuracy of the related transaction. Efficient and accurate verification can be achieved to ensure the reliability of the accuracy results obtained from the verification.
  • the lightweight node verifies whether the statistical proof transaction list is valid based on the encryption path of the statistical proof transaction list, and whether the statistical proof transaction list is valid or not correspondingly indicates whether the statistical proof transaction list has been tampered with. Specifically, the light node determines whether the statistical proof transaction list is valid through the encryption path of the statistical proof transaction list. For details, please refer to the execution steps of the above lightweight node to determine the accuracy of the related transaction through the encrypted path of the related transaction and related transaction. It is not repeated here.
  • the lightweight node verification determines that the statistical proof transaction list is valid
  • the transaction number of the associated transaction is received from the associated block, and the target statistics corresponding to the target index are searched in the statistical proof transaction list.
  • Prove the transaction Perform an overlay operation on the number of transactions and the node address of the lightweight node to obtain the target overlay value, and perform an encryption operation on the target overlay value through an encryption algorithm to obtain the target business transaction of the lightweight node; if the target statistics prove that the transaction is the same as the target business transaction , the lightweight node determines that the associated transaction is complete.
  • the lightweight node performs the superposition operation on the number of transactions and the node address, and obtains the target superposition value: address1+m1, and then the light node performs the hash operation on the target superposition value through the hash algorithm to obtain hash(address1+m1), and further , the lightweight node encrypts the hash(address1+m1) through the message authentication code algorithm (Message Authentication Code, MAC) to obtain MAC[hash(address1+m1)], which is the target business transaction of the lightweight node.
  • MAC message Authentication Code
  • 6B is a schematic diagram of a statistical proof transaction list provided by an embodiment of the present application. If the target index is 1, the lightweight node obtains the target statistical proof transaction MAC[hash from the statistical proof transaction list according to the target index 1. (address1+m1)]. Finally, if the target business transaction is the same as the target statistical proof transaction, it can be determined that the related transaction is complete, and if the target business transaction is different from the target statistical proof transaction, it can be determined that the related transaction is incomplete.
  • the light-weight node proves the transaction, the number of transactions and its own node address according to the statistics to prove the transaction list, the target statistics related to itself in the statistics to prove the transaction list, and the node address.
  • Check whether the received affiliated transaction is missing that is, verify the integrity of the affiliated transaction. The completeness can be determined efficiently and accurately, that is, under the condition that only a relatively simplified verification process needs to be performed, whether the related transaction is missing can be accurately verified.
  • the lightweight node can prove the transaction list through associated transactions, encrypted path sets, and statistics. And the encrypted path of the statistical proof transaction list to determine whether the related transaction is accurate and complete.
  • the lightweight node can determine the accuracy of the associated transaction according to the set of encryption paths; and can determine the integrity of the associated transaction according to the target index, the statistical proof transaction list, and the encryption path of the statistical proof transaction list.
  • the lightweight node can perform subsequent processing based on the associated transaction.
  • the lightweight node directly performs post-processing according to the associated transaction after obtaining the associated transaction, which can further improve the efficiency of the associated transaction. accuracy.
  • FIG. 7 is a schematic flowchart of another data processing method provided by an embodiment of the present application.
  • the method is applied to a blockchain network, the blockchain network includes a first blockchain network and a second blockchain network, the first blockchain network includes lightweight nodes, and the second blockchain network includes full nodes.
  • the operation steps of the method can be performed by a computer device, and the computer device can be a full node.
  • This embodiment mainly describes the process of all nodes responding to the data synchronization request.
  • the method includes but is not limited to the following steps S710-S740:
  • Step S710 Receive a data synchronization request sent by a lightweight node, and search for an associated block corresponding to the lightweight node;
  • the associated block is a block that has an associated relationship with the lightweight node;
  • the associated block including a plurality of transactions and a list of statistical proof transactions;
  • the plurality of transactions have their respective corresponding transaction visible addresses;
  • the statistical proof transaction list includes a plurality of statistical proof transactions, and the statistical proof transactions are corresponding to the transactions
  • the transaction visible address and the number of the transaction visible address in the associated block are encrypted.
  • the data synchronization request includes the identity information of the lightweight node.
  • the full node can obtain the identity information of the lightweight node, and verify the identity information of the lightweight node. If the identity information of the light node is verified by the full nodes, the associated block corresponding to the light node can be obtained. It should be noted that, for details of the operation steps for the full node to verify the identity information of the light node, refer to the specific operation process of the full node in step S420 in the embodiment of FIG.
  • the full node receives the pending transaction, and the pending transaction includes multiple transaction visible addresses; the full node counts the number of visible addresses for each transaction in the pending transaction; further, for each transaction visible address and The number of transactions visible to each transaction visible address is encrypted, and a list of transactions is statistically proven.
  • the full node obtains the pending transaction initiated by any lightweight node in the first blockchain network.
  • the lightweight node A initiates a pending transaction x1
  • the lightweight node A can specify the first blockchain network. Which lightweight nodes can see the pending transaction x1, the node address corresponding to the designated lightweight node is the transaction visible address, if the lightweight node A specifies the lightweight node B and the lightweight node C can see the pending transaction x1, Assuming that the node address of the lightweight node A is address1, the node address of the lightweight node B is address2, and the node address of the lightweight node C is address3, the transaction visible addresses of the pending transaction x1 are address1, address2 and address3, and so on. , the number of pending transactions can be multiple.
  • the full node generates a list of statistical proof transactions according to the transaction visible addresses included in the pending transaction and the number of transaction visible addresses; the number of visible addresses for each transaction is effectively put into the block, but the relevant
  • the clear text of the transaction is put in, when any node in the blockchain network obtains the list of statistical proof transactions, because there is no all transaction information, it is impossible to calculate the statistical proof transaction corresponding to each node address, which ensures that the nodes in the blockchain network
  • the statistical proof transaction list includes a first statistical proof transaction and a second statistical proof transaction
  • the multiple transaction visible addresses include the first transaction visible address and the second transaction visible address. All nodes encrypt the visible addresses of the first transaction and the number of visible addresses of the first transaction to obtain the first statistical proof transaction; encrypt the visible addresses of the second transaction and the number of visible addresses of the second transaction to obtain the second statistical proof trade.
  • the full node combines the first statistical proof transaction and the second statistical proof transaction into a statistical proof transaction list, wherein, if the order of appearance of the visible address of the first transaction in the pending transaction is higher than that of the visible address of the second transaction in the pending transaction , the order of the first statistical proof transaction in the statistical proof transaction list takes precedence over the order of the second statistical proof transaction in the statistical proof transaction list.
  • the encryption algorithm used should be consistent with the encryption algorithm used when the lightweight node encrypts the target superposition value to obtain the target statistical proof transaction in the embodiment of FIG.
  • the hash value is obtained by the hash operation, and then the hash value is operated by the message authentication code algorithm to obtain each statistical proof transaction.
  • the encryption processing method here is not unique.
  • the encryption processing can also be performed through the HMAC algorithm, as long as it is consistent with the encryption processing method of the target superposition value by the subsequent lightweight node, which is not limited in this embodiment of the present application.
  • the full node can count the number of visible addresses for each transaction in the order of appearance, that is, the full node counts the corresponding numbers of the transaction visible addresses address1, address2, address3, address4, and address5 in turn, assuming m1, m2, m3, and m4 respectively.
  • m5 the corresponding relationship between the transaction visible address and quantity can be shown in Table 1.1:
  • the full nodes perform the superposition operation on the visible address and the number of each transaction to obtain multiple superimposed values, and then encrypt the multiple superimposed values respectively to obtain the statistical proof transaction list.
  • the data structure of the statistical proof transaction list can be is the form.
  • the index of the node whose node address is "address1" is 1 in the statistical proof transaction list
  • the index of the node whose node address is "address2” is 2 in the statistical proof transaction list
  • the node whose node address is "address4" has an index of 4 in the statistical proof transaction list
  • the node whose node address is "address5" has an index of 5 in the statistical proof transaction list.
  • the full node generates an associated block according to the list of statistical proof transactions and pending transactions. Specifically, the full node can take the list of statistical proof transactions as the first transaction, and then take the pending transactions as the next transaction of the first transaction. Transactions, generate associated blocks according to each transaction, and store the associated blocks in the blockchain, where the pending transactions stored in the blockchain can be called transactions.
  • the full node generates the statistical proof transaction list in the above way, which can ensure that the statistical proof transactions in the generated statistical proof transaction list are in a reasonable order, so as to facilitate the identification of the target index corresponding to the lightweight node, and help improve the determination of the association of the lightweight node. Efficiency of transaction efficiency results.
  • the full node that generates the associated block according to the statistical proof transaction list and the pending transaction is the first full node, and the first full node generates the associated block according to the statistical proof transaction list and the pending transaction.
  • the associated block can be published to multiple second full nodes in the second blockchain network, so that each second full node can perform blockchain consensus on the associated block. If the blockchain consensus is passed, the first full node will publish the associated block to the second blockchain network and store it in the blockchain.
  • the second full node is all nodes in the second blockchain network except the first full node.
  • the full node obtains the associated block corresponding to the light node, which may be obtained by means of block height. Specifically, after the full node receives the data synchronization request sent by the light node, The node address of the lightweight node can be obtained, and then the block containing the node address of the full node in the blockchain stored by the full node can be determined. The full node will contain the node address of the light node. The block corresponding to the maximum height block, as the associated block corresponding to the lightweight node.
  • Step S720 Extract a statistical proof transaction list from the associated block, and identify the target index of the lightweight node in the statistical proof list.
  • all nodes extract the list of statistical proof transactions from the associated block
  • the first transaction extracted from the block body of the associated block can be used as the list of statistical proof transactions
  • all nodes extract the light weight from the associated block.
  • the target index of the light node in the statistical proof transaction list can be that the full node searches the statistical proof transaction list for the target index of the light node in the statistical proof transaction list according to the node address of the light node.
  • Step S730 Filter out the associated transactions associated with the lightweight node from the plurality of transactions included in the associated block, and determine an encryption path set based on the filtered associated transactions, where the encryption path set includes all the associated transactions.
  • the full node extracts the associated transaction associated with the lightweight node from the associated block.
  • the associated transaction associated with the lightweight node may include transactions initiated by the lightweight node, transactions received by the lightweight node, and transactions witnessed by the lightweight node. trade. For example, if transaction x1 is assumed to be initiated by a lightweight node, then transaction x1 can be an associated transaction of the lightweight node, and transaction x2 is assumed to be received by the lightweight node, then transaction x2 can be an associated transaction of the lightweight node, and transaction x3 It is initiated by node 1, but the transaction visible address of transaction x3 includes a lightweight node, then transaction x3 can also be an associated transaction of a lightweight node.
  • the full node can use the node address of the lightweight node as a transaction visible address, and obtain the transaction corresponding to the transaction visible address in the associated block, which is the associated transaction of the lightweight node, and the number of associated transactions Can be one or more.
  • Step S740 Send the statistical proof transaction list, the target index, the associated transaction, and the set of encryption paths to the lightweight node, so that the lightweight node can prove the transaction list, the The target index and the set of encryption paths are used to determine the validity degree of the associated transaction; the validity degree is used to characterize the accuracy and completeness of the associated transaction.
  • all nodes in the second blockchain network send the statistical proof transaction list, target index, associated transaction and encrypted path set to the first blockchain network through the network routing service in the blockchain network.
  • Lightweight Node the operation steps of the light node determining the validity degree of the associated transaction according to the statistical proof transaction list, the target index and the set of encryption paths may refer to the execution steps of the light node in step S540 in the embodiment of FIG. 5 for details. Repeat.
  • the full nodes in the second blockchain network after the full nodes in the second blockchain network receive the data synchronization request sent by the lightweight nodes in the first blockchain network, they can perform identity verification on the lightweight nodes, After the full nodes pass the identity verification of the light nodes, the full nodes send the data to be synchronized by the light nodes, including the statistical proof transaction list, target index, associated transactions, and encrypted path sets, to the light nodes.
  • the statistical proof transaction list effectively puts the number of visible addresses of each transaction into the block, but does not put the relevant transaction plaintext.
  • any node in the blockchain network obtains the statistical proof transaction list, because there is no All transaction information, so it is impossible to calculate the statistical proof transaction corresponding to each node address. Therefore, the security of data exchange between nodes in a blockchain network can be improved.
  • FIG. 8 is a schematic structural diagram of a data communication apparatus provided by an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a data communication apparatus provided by an embodiment of the present application.
  • the data communication apparatus may be applied to the lightweight nodes in the method embodiments corresponding to FIG. 5 to FIG. 6B .
  • the data communication device may be a computer program (including program code) running in a lightweight node, for example, the data communication device is an application software; the device may be used to execute corresponding steps in the methods provided by the embodiments of the present application.
  • the data communication device may include:
  • a receiving unit 810 configured to receive data from an associated block with an associated relationship with the lightweight node, where the data includes associated transactions associated with the lightweight node in the associated block and a list of statistical proof transactions , the association block includes a plurality of transactions and the statistical proof transaction list, the plurality of transactions have their respective corresponding transaction visible addresses, the statistical proof transaction list includes a plurality of statistical proof transactions, the statistical proof The transaction is obtained by encrypting the transaction visible address corresponding to the transaction and the number of the transaction visible address in the associated block;
  • an identification unit 820 configured to identify the target index of the lightweight node in the statistical proof transaction list
  • an obtaining unit 830 configured to obtain an encrypted path set based on the associated transaction, where the encrypted path set includes the encrypted path of the associated transaction and the encrypted path of the statistical proof transaction list;
  • a determination unit 840 configured to determine the validity degree of the associated transaction according to the statistical proof transaction list, the target index and the set of encryption paths; the validity degree is used to characterize the accuracy and completeness of the associated transaction Spend.
  • the determining unit 840 is specifically configured to:
  • the statistical proof transaction list Based on the target index, the statistical proof transaction list, and the encryption path of the statistical proof transaction list, it is verified whether the associated transaction is complete, and the completeness is obtained.
  • the number of associated transactions is multiple, the multiple associated transactions include a first associated transaction and a second associated transaction, and the encryption paths of the multiple associated transactions include the first encryption path and the second encryption path corresponding to the second associated transaction;
  • the determining unit 840 is specifically used for:
  • the determining unit 840 is specifically configured to:
  • the determining unit 840 is specifically configured to:
  • the target statistical proof transaction the target statistical proof transaction, the number of transactions, and the node address of the lightweight node, it is verified whether the associated transaction is complete, and the completeness is obtained.
  • the determining unit 840 is specifically configured to:
  • the lightweight node can pass the associated transaction, encrypted path set, statistical proof The transaction list and the encryption path of the statistical proof transaction list to determine the validity result of the related transaction.
  • the lightweight node can determine the accuracy of the associated transaction according to the set of encryption paths; and determine the integrity of the associated transaction according to the target index, the statistical proof transaction list, and the encryption path of the statistical proof transaction list.
  • the lightweight node determines the validity degree of the associated transaction, it can perform subsequent processing according to the associated transaction based on the validity degree.
  • the lightweight node directly performs subsequent processing according to the associated transaction after obtaining the associated transaction, which can further improve the associated transaction. accuracy of transactions.
  • FIG. 9 is a schematic structural diagram of a data communication apparatus provided by an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of a data communication apparatus provided by an embodiment of the present application.
  • the data communication apparatus may be applied to all nodes in the method embodiment corresponding to FIG. 7 .
  • the data communication device may be a computer program (including program code) running in all nodes, for example, the data communication device is an application software; the device may be used to execute corresponding steps in the methods provided by the embodiments of the present application.
  • the data communication device may include:
  • the receiving unit 910 is configured to receive a data synchronization request sent by a lightweight node, and search for an associated block corresponding to the lightweight node; the associated block is a block that has an associated relationship with the lightweight node; the The associated block includes a plurality of transactions and a list of statistical proof transactions; the plurality of transactions have their respective corresponding transaction visible addresses; the statistical proof transaction list includes a plurality of statistical proof transactions, and the statistical proof transactions are for the The transaction visible address corresponding to the transaction and the number of the transaction visible address in the associated block are encrypted.
  • the extraction unit 920 is configured to extract a statistical proof transaction list from the associated block, and identify the target index of the lightweight node in the statistical proof list.
  • the extraction unit 920 is further configured to filter out the associated transactions associated with the lightweight node from the plurality of transactions included in the associated block, and determine an encryption path set based on the filtered associated transactions, and the encryption The path set includes the encrypted path of the associated transaction and the encrypted path of the statistical proof transaction list.
  • the sending unit 930 is configured to send the statistical proof transaction list, the target index, the associated transaction and the set of encryption paths to the lightweight node, so that the lightweight node can prove the transaction according to the statistics
  • the list, the target index, and the set of encryption paths determine the degree of validity of the associated transaction; the degree of validity is used to characterize the accuracy and completeness of the associated transaction.
  • the data processing apparatus further includes: an acquisition unit 940 , a statistics unit 950 , and a processing unit 960 .
  • an obtaining unit 940 configured to receive a pending transaction, where the pending transaction includes multiple transaction visible addresses;
  • a statistical unit 950 configured to count the number of visible addresses of each transaction in the to-be-processed transaction
  • the processing unit 960 is configured to perform encryption processing for each transaction visible address and the number of each transaction visible address respectively, to obtain a list of statistical proof transactions;
  • the processing unit 960 is further configured to generate an associated block according to the statistical proof transaction list and the to-be-processed transaction, and store the associated block in the blockchain.
  • the statistical proof transaction list includes a first statistical proof transaction and a second statistical proof transaction
  • the multiple transaction visible addresses include a first transaction visible address and a second transaction visible address
  • the processing unit 960 is specifically used for:
  • the data synchronization request includes the identity information of the lightweight node
  • the sending unit 930 sends the statistical proof transaction list, the target index, the associated transaction and the encrypted path set to the lightweight node, including:
  • the statistical proof transaction list, the target index, the associated transaction and the set of encryption paths are sent to the lightweight node.
  • the blockchain network corresponding to the blockchain includes a first blockchain network and a second blockchain network
  • the lightweight node is a node in the first blockchain network
  • the lightweight node is used to store the associated transactions of the lightweight node
  • the full node is used to store the blockchain
  • the blockchain includes the associated transactions of all nodes in the first blockchain network.
  • all nodes in the second blockchain network can perform identity verification on the lightweight nodes in response to the data synchronization request sent by the lightweight nodes in the first blockchain network.
  • the full-scale node After the full-scale node passes the identity verification of the light-weight node, the full-scale node sends the data that the light-weight node needs to synchronize, including the statistical proof transaction list, target index, associated transaction and encryption path set to the light-weight node.
  • Statistics prove that the transaction list effectively puts the number of visible addresses of the transaction into the block, but does not put the relevant transaction plaintext. Any node in the blockchain network obtains the statistical proof transaction list. Since there is no full transaction information, Therefore, it is impossible to calculate the statistical proof transaction corresponding to each node address. Therefore, the security of data exchange between nodes in a blockchain network can be improved.
  • FIG. 10 is a schematic structural diagram of a computer device provided by an embodiment of the present application.
  • the light-weight node in the embodiments corresponding to FIGS. 4 to 7 may be a computer device 1000 , as shown in FIG.
  • Signal receiver 1016 is used to receive or transmit data via cellular interface 1010 , WIFI interface 1012 , . . . , or NFC interface 1014 .
  • the encoder 1006 encodes the received data into a computer-processable data format.
  • a computer program is stored in the memory 1008, and the processor 1004 is configured to perform the steps in any one of the above method embodiments through the computer program.
  • the memory 1008 may include volatile memory (eg, dynamic random access memory DRAM), and may also include non-volatile memory (eg, one-time programmable read-only memory OTPROM). In some examples, memory 1008 may further include memory located remotely from processor 1004, which may be connected to computer device 1000 through a network.
  • User interface 1002 may include: keyboard 1018 and display 1020 .
  • the processor 1004 may be configured to call the computer program stored in the memory 1008 to implement the data communication method on the light-weight node side in the above method embodiments, or the full-scale data communication method in the above method embodiments The data communication method on the node side.
  • the computer device 1000 described in the embodiments of the present application executes the description of the data communication methods in the foregoing embodiments corresponding to FIG. 4 to FIG. 7 , and can also execute the data communication methods in the foregoing embodiments corresponding to FIG. The description of the device will not be repeated here. In addition, the description of the beneficial effects of using the same method will not be repeated.
  • the embodiment of the present application also provides a computer storage medium, and the computer storage medium stores a computer program executed by the aforementioned data processing apparatus, and the computer program includes program instructions.
  • the processor executes the above program instructions,
  • the methods in the foregoing embodiments corresponding to FIG. 4 to FIG. 7 can be performed, and therefore, detailed descriptions will not be repeated here.
  • the description of the beneficial effects of using the same method will not be repeated.
  • program instructions may be deployed on one computer device, or executed on multiple computer devices located at one site, or alternatively, distributed across multiple sites and interconnected by a communications network, Multiple computer devices distributed in multiple locations and interconnected by a communication network can form a blockchain system.
  • a computer program product or computer program comprising computer instructions stored in a computer readable storage medium.
  • the processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device can execute the methods in the embodiments corresponding to FIG. 4 to FIG. Repeat.
  • the above-mentioned storage medium may be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM) or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • General Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • General Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Finance (AREA)
  • Data Mining & Analysis (AREA)
  • Computing Systems (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种数据通信方法、装置、计算机设备(1000)以及存储介质,该方法是:接收关联区块中的统计证明交易列表,并识别轻量节点在统计证明交易列表中的目标索引,统计证明交易列表包括多个统计证明交易,统计证明交易是对关联区块包括的交易对应的交易可见地址、以及交易可见地址在关联区块中的数量进行加密处理得到的;接收关联区块中与轻量节点关联的关联交易、以及加密路径集合,加密路径集合包括关联交易的加密路径以及统计证明交易列表的加密路径;根据统计证明交易列表、目标索引以及加密路径集合,确定关联交易的有效程度(S450)。通过所述方法,能够验证轻量节点获取到的关联交易的有效性。

Description

一种数据通信方法、装置、计算机设备及存储介质
本申请要求于2020年11月16日提交中国专利局、申请号为2020112795166、申请名称为“一种数据处理方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及互联网技术领域,具体涉及区块链数据通信技术。
背景技术
区块链是一种能够实现数据一致存储、难以篡改、防止抵赖的记账技术,也就是分布式账本技术;区块链需要多方共同维护,并且使用密码学保证传输和访问安全。区块链分为三种类型:公有链、私有链和联盟链。
现有技术中的区块链普遍是节点之间组成的点对点(P2P,Peer To Peer)网络,例如,比特币、以太坊等公有链、以及Fabric、Terdermint等联盟链均是基于P2P网络形成的,P2P网络中节点与节点之间是对等的,即现有的P2P网络是单层网络。
为了保护不同节点的数据隐私,就存在数据隔离的业务需求,业务节点向区块链网络中的共识节点发送数据同步请求后,业务节点只能从共识节点同步与自身相关的链上交易数据,并且业务节点只能无条件信任共识节点返回给自身的数据。在很多情况下,共识节点向业务节点发送的数据可能是不准确或者不完整的,即业务节点所接收的数据是无效的,那么如何验证业务节点同步的链上交易数据的有效性是当前研究热点。
发明内容
本申请实施例提出了一种数据通信方法、装置、计算机设备以及存储介质,能够验证轻量节点接收到的关联交易的有效性。
本申请实施例一方面提供了一种数据通信方法,由轻量节点执行,所述方法包括:
从与所述轻量节点具有关联关系的关联区块中接收数据,所述数据包括所述关联区块中与所述轻量节点关联的关联交易、以及统计证明交易列表,所述关联区块中包括多个交易以及所述统计证明交易列表,所述多个交易具有其各自对应的交易可见地址,所述统计证明交易列表包括多个统计证明交易,所述统计证明交易是对所述交易对应的交易可见地址、以及所述交易可见地址在所述关联区块中的数量进行加密处理得到的;
在所述统计证明交易列表中识别所述轻量节点的目标索引;
基于所述关联交易获取加密路径集合,所述加密路径集合包括所述关联交易的加密路径以及所述统计证明交易列表的加密路径;
根据所述统计证明交易列表、所述目标索引以及所述加密路径集合,确 定所述关联交易的有效程度;所述有效性程度用于表征所述关联交易的准确度以及完整度。
本申请实施例一方面提供了一种数据通信方法,由全量节点执行,所述方法包括:
接收轻量节点发送的数据同步请求,查找与所述轻量节点对应的关联区块;所述关联区块是与所述轻量节点具有关联关系的区块;所述关联区块中包括多个交易以及统计证明交易列表;所述多个交易具有其各自对应的交易可见地址;所述统计证明交易列表包括多个统计证明交易,所述统计证明交易是对所述交易对应的交易可见地址、以及所述交易可见地址在所述关联区块中的数量进行加密处理得到的;
从所述关联区块中提取所述统计证明交易列表,并在所述统计证明列表中识别所述轻量节点的目标索引;
从所述关联区块包括的所述多个交易中过滤出与所述轻量节点关联的关联交易,并基于所过滤出的关联交易确定加密路径集合,所述加密路径集合包括所述关联交易的加密路径以及所述统计证明交易列表的加密路径;
将所述统计证明交易列表、所述目标索引、所述关联交易以及所述加密路径集合发送至所述轻量节点,以使所述轻量节点根据所述统计证明交易列表、所述目标索引以及所述加密路径集合,确定所述关联交易的有效程度;所述有效程度用于表征所述关联交易的准确度以及完整度。
本申请实施例一方面提供了一种数据通信装置,所述数据通信装置包括:
接收单元,用于从与所述轻量节点具有关联关系的关联区块中接收数据,所述数据包括所述关联区块中与所述轻量节点关联的关联交易、以及统计证明交易列表,所述关联区块中包括多个交易以及所述统计证明交易列表,所述多个交易具有其各自对应的交易可见地址,所述统计证明交易列表包括多个统计证明交易,所述统计证明交易是对所述交易对应的交易可见地址、以及所述交易可见地址在所述关联区块中的数量进行加密处理得到的;
识别单元,用于在所述统计证明交易列表中识别所述轻量节点的目标索引;
获取单元,用于基于所述关联交易获取加密路径集合,所述加密路径集合包括所述关联交易的加密路径以及所述统计证明交易列表的加密路径;
确定单元,用于根据所述统计证明交易列表、所述目标索引以及所述加密路径集合,确定所述关联交易的有效程度;所述有效性程度用于表征所述关联交易的准确度以及完整度。
本申请实施例一方面提供了一种数据通信装置,所述数据通信装置包括:
接收单元,用于接收轻量节点发送的数据同步请求,查找与所述轻量节 点对应的关联区块;所述关联区块是与所述轻量节点具有关联关系的区块;所述关联区块中包括多个交易以及统计证明交易列表;所述多个交易具有其各自对应的交易可见地址;所述统计证明交易列表包括多个统计证明交易,所述统计证明交易是对所述交易对应的交易可见地址、以及所述交易可见地址在所述关联区块中的数量进行加密处理得到的;
提取单元,用于从所述关联区块中提取所述统计证明交易列表,并在所述统计证明列表中识别所述轻量节点的目标索引;
提取单元,还用于从所述关联区块中包括的所述多个交易中过滤出与所述轻量节点关联的关联交易,并基于所过滤出的关联交易确定加密路径集合,所述加密路径集合包括所述关联交易的加密路径以及所述统计证明交易列表的加密路径;
发送单元,用于将所述统计证明交易列表、所述目标索引、所述关联交易以及所述加密路径集合发送至所述轻量节点,以使所述轻量节点根据所述统计证明交易列表、所述目标索引以及所述加密路径集合,确定所述关联交易的有效程度;所述有效程度用于表征所述关联交易的准确度以及完整度。
本申请实施例一方面提供了一种计算机设备,包括存储器和处理器,存储器存储有计算机程序,计算机程序被处理器执行时,使得处理器执行上述各实施例中的方法。
本申请实施例一方面提供了一种计算机存储介质,计算机存储介质存储有计算机程序,计算机程序包括程序指令,程序指令当被处理器执行时,执行上述各实施例中的方法。
本申请实施例一方面提供了一种计算机程序产品或计算机程序,计算机程序产品或计算机程序包括计算机指令,计算机指令存储在计算机可读存储介质中,计算机指令被计算机设备的处理器执行时,执行上述各实施例中的方法。
通过本申请实施例的数据通信方法,轻量节点可以从关联区块中接收到统计证明交易列表,统计证明交易列表包括多个统计证明交易,统计证明交易是对关联区块包括的交易对应的交易可见地址、以及交易可见地址在关联区块中的数量进行加密处理得到的,轻量节点可以在统计证明交易列表中识别自身的目标索引,以及从关联区块包括的多个交易中过滤出与自身关联的关联交易,并基于所过滤出的关联交易确定加密路径集合,该加密路径集合中包括关联交易的加密路径、以及统计证明交易列表的加密路径,进而,轻量节点可以根据上述统计证明交易列表、目标索引以及加密路径集合,确定与自身相关的关联交易的有效程度,即确定与自身相关的关联交易的准确度以及完整度,关联交易的准确度用于表征关联交易是否准确,关联交易的完整度用于表征关联交易是否完整,所谓关联交易准确是指与关联交易相关的内容没有被篡改,所谓关联交易完整是指与关联交易相关的内容不存在缺 失。本申请中的轻量节点获取关联区块中与自身相关的明文关联交易、关联交易的加密路径以及该关联区块中加密的统计证明交易,并基于所获取的信息验证与自身相关的关联交易的有效程度,同时轻量节点不会获取与自身无关的明文交易,如此,在保证数据隔离即数据通信安全性的前提下,实现了对于与自身相关的关联交易的有效性的验证,保证了数据通信过程中传输的数据的有效性,提高了数据通信质量和效率。
附图说明
图1A是本申请实施例提供的一种区块链数据共享系统的结构示意图;
图1B是本申请实施例提供的一种区块链的结构示意图;
图1C是本申请实施例提供的一种区块生成的流程示意图;
图2是本申请实施例提供的一种数据通信系统的结构示意图;
图3A是本申请实施例提供的一种数据通信方法的场景示意图;
图3B是本申请实施例提供的另一种数据通信方法的场景示意图;
图3C是本申请实施例提供的另一种数据通信方法的场景示意图;
图4是本申请实施例提供的一种数据通信方法的流程示意图;
图5是本申请实施例提供的另一种数据通信方法的流程示意图;
图6A是本申请实施例提供的一种获取加密路径的流程示意图;
图6B是本申请实施例提供的一种统计证明交易列表的示意图;
图7是本申请实施例提供的另一种数据通信方法的流程示意图;
图8是本申请实施例提供的一种数据通信装置的结构示意图;
图9是本申请实施例提供的另一种数据通信装置的结构示意图;
图10是本申请实施例提供的一种计算机设备的结构示意图。
具体实施方式
需要说明的是,本申请实施例涉及到区块链以及云技术,为了方便更好地理解本申请实施例,下面首先对区块链以及云技术相关术语以及技术进行详细说明。
云技术(Cloud technology)是基于云计算商业模式应用的网络技术、信息技术、整合技术、管理平台技术、应用技术等的总称,可以组成资源池,按需所用,灵活便利。云计算技术将变成重要支撑。技术网络系统的后台服务需要大量的计算、存储资源,如视频网站、图片类网站和更多的门户网站。伴随着互联网行业的高度发展和应用,将来每个物品都有可能存在自己的识别标志,需要传输到后台系统进行逻辑处理,不同程度级别的数据将会分开处理,各类行业数据皆需要强大的系统后盾支撑,只能通过云计算来实现。
云存储(cloud storage)是在云计算概念上延伸和发展出来的一个新的概念,分布式云存储系统(以下简称存储系统)是指通过集群应用、网格技术以及分布存储文件系统等功能,将网络中大量各种不同类型的存储设备(存 储设备也称之为存储节点)通过应用软件或应用接口集合起来协同工作,共同对外提供数据存储和业务访问功能的一个存储系统。
由于区块链中涉及到大量的数据计算以及数据存储服务,大量的数据计算以及数据存储服务需要花费大量的计算机运营成本,因此本申请涉及到的区块链中的统计证明交易列表、关联交易以及加密路径集合均可以通过云技术中的云存储技术实现。即,将区块链通过云存储技术存储在“云”上,当需要将统计证明交易列表、关联交易以及加密路径集合存储至区块链时,可以通过云存储技术将这些数据上传到“云”上的区块链中,且当需要读取这些数据时,也可以随时从“云”上的区块链中读取数据,如此可以降低对终端设备的存储要求,扩大区块链的应用范围。
区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用与密码学方法相关联的技术产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层。
请参见图1A,图1A是本申请实施例提供的一种区块链数据共享系统的结构示意图,数据共享系统100是用于实现节点与节点之间数据共享的系统,该数据共享系统100中可以包括多个节点101和多个节点201,多个节点101可以是数据共享系统100中各个客户端,多个节点201可以是数据共享系统100中各个服务器。通常来说,节点201的存储空间和计算能力会大于节点101的存储空间和计算能力。为了保证数据共享系统内的信息互通,数据共享系统中各个节点之间可以存在信息连接,节点之间可以通过上述信息连接进行信息传输。例如,当数据共享系统100中的任意节点201接收到输入信息时,数据共享系统100中的全部节点201便根据共识算法获取该输入信息,将该输入信息作为共享数据进行存储,使得数据共享系统100中全部节点201上存储的数据均一致。但是,由于节点101和节点201的存储空间不同或者业务需求等因素,对于数据共享系统100中的任意节点101来说,任意节点101接收到输入信息时,只会存储与节点自身相关的数据。
需要说明的是,本申请实施例提供的区块链数据共享系统100中每个节点201上可以存储完整的区块链,完整的区块链中包括与每个节点101和每个节点201相关的交易数据,而每个节点101中只会存储与自身相关的交易数据,每个节点101可以向任意节点201请求与自身相关的交易数据。
进一步地,图1A所示的区块链数据共享系统100中各节点涉及的功能还包括:路由,路由是节点具有的基本功能,用于支持节点之间的通信。
具体的,每个节点101与每个节点201之间可以相互通信,节点101与节点201之间进行通信的方式可以为,通过节点101的路由功能实现通信, 或者通过节点201的路由功能实现通信。
数据共享系统100中的节点201可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、CDN、以及大数据和人工智能平台等基础云计算服务的云服务器。节点101可以是智能手机、平板电脑、笔记本电脑、台式计算机、智能音箱、智能手表、车载终端等,但并不局限于此。
对于数据共享系统100中的每个节点201,均存储一条相同的区块链。区块链由多个区块组成,请参见图1B,图1B是本申请实施例提供的一种区块链的结构示意图。区块链由多个区块组成,各个区块中均包括区块头和区块主体,创始块的区块头中存储有输入信息特征值、版本号、时间戳和难度值,除创始块以外的其他区块的区块头中存储有输入信息特征值、版本号、时间戳、父区块的区块头特征值和难度值,各个区块的区块主体中均存储有输入信息,在本申请中输入信息除了可以包括节点发起的交易,还可以包括基于这些交易生成的统计证明交易列表,该统计证明交易列表也可以被认为是一个交易。
生成区块链中的各个区块时,请参见图1C,图1C是本申请实施例提供的一种生成新区块的流程示意图。区块链所在的节点接收到发起的交易后,对该交易进行校验,完成校验后存储至内存池,基于内存池中的所有交易生成统计证明交易列表(内存池中所有的交易以及所生成的统计证明交易列表可以被统称为输入信息),并更新用于记录输入信息的哈希树。
之后,当计算得到小于随机数阈值的随机数时,便可将信息对应存储,生成区块头和区块主体,得到当前区块。随后,将新生成的区块分别发送给其所在的区块链数据共享系统中的其他节点,由其他节点对新生成的区块进行校验,并在完成校验后将新生成的区块添加至其存储的区块链中。
请参见图2,图2是本申请实施例提供的一种数据通信系统的架构示意图。该系统架构包括:轻量节点集群100和全量节点集群200,其中,轻量节点集群100包括轻量节点101、轻量节点102、轻量节点103以及轻量节点104,全量节点集群200包括全量节点201、全量节点202、全量节点203以及全量节点204。其中,轻量节点集群100处于第一区块链网络中,全量节点集群200处于第二区块链网络中,第一区块链网络不同于第二区块链网络,第一区块链网络为第二区块链网络的底层网络。
具体的,第一区块链网络中的节点只存储与自身相关的关联交易,第二区块链网络中的节点存储第一区块链网络中所有节点的关联交易。例如,第一区块链网络为公有网络,第二区块链网络为私有网络,并且第一区块链网络与第二区块链网络共同构成区块链网络。基于以上描述,本申请实施例涉及的区块链网络为双层区块链网络,可以实现节点与节点之间的数据隔离, 可以应用于资源数据发行机构等对保密性以及隐私性要求比较高的业务场景中,例如,商户A和商户B可以在区块链上开具电子发票,即将电子发票存储在链上,但只有维护区块链的机构服务器会存储所有商户的电子发票。当商户A(或者商户B)向机构服务器请求链上的电子发票时,机构服务器只会向商户A(或者商户B)返回商户A(或者商户B)自己开具的发票,如此实现商户之间的数据隔离性,即通过使得节点处于不同的区块链网络,实现不同数据的同步,从而达到隐私保密的需求。
需要说明的是,本申请实施例中的轻量节点集群100中的轻量节点的数量仅用于示例,在其他可行的实施例中,轻量节点集群100以及全量节点200中的节点数量可以根据具体业务场景进行调整,例如,轻量节点集群100中的节点数量还可以为五个、八个,全量节点集群200中的节点数量还可以为六个、七个等等,本申请对此不做具体限定。
具体实现时,轻量节点集群100中的每个轻量节点之间相互建立通信连接,具体的,轻量节点101、轻量节点102、轻量节点103以及轻量节点104之间可以通过无线网或者有线网的方式进行通信。同理,全量节点集群200中的每个全量节点之间也相互建立通信连接,具体的,全量节点201、全量节点202、全量节点203以及全量节点204之间可以通过无线网或者有线网的方式进行通信。并且,轻量节点集群100中的任意轻量节点可以与全量节点集群200中的任意全量节点之间通过网络路由的方式进行通信。
在一种可能的实现方式中,轻量节点可以将数据同步请求发送给全量节点集群200中与该轻量节点通信质量最好的全量节点;轻量节点也可以将数据同步请求发送给全量节点集群200中与该轻量节点距离最近的全量节点;轻量节点还可以将数据同步请求发送给全量节点集群200中所有全量节点通过共识算法选举出来的全量节点。其中,共识算法包括但不限于工作量证明(Proof of Work,PoW)算法、权益证明(Proof of Stake,PoS)算法、授权权益证明(Delegated Proof of Stake,DPoS)算法、实用拜占庭容错(Practical Byzantine Fault Tolerance,PBFT)算法等。
在一种可能的实现方式中,以轻量节点101与全量节点201进行通信为例进行具体说明。轻量节点101向全量节点201发送数据同步请求,全量节点201响应轻量节点101发送的数据同步请求,查找与轻量节点101对应的关联区块;该关联区块是在区块链中与轻量节点101具有关联关系的区块;其中包括多个交易以及统计证明交易列表;多个交易具有其各自对应的交易可见地址;统计证明交易列表包括多个统计证明交易,其中,任一统计证明交易是对关联区块包含的交易的任一交易可见地址、以及该交易可见地址在关联区块中的交易可见数量进行加密处理得到的。全量节点201从该关联区块中提取统计证明交易列表,并在统计证明交易列表中识别轻量节点101的目标索引。全量节点201从关联区块中过滤出与轻量节点101关联的关联 交易,并基于所过滤出的关联交易确定加密路径集合,该加密路径集合包括该关联交易的加密路径以及统计证明交易列表的加密路径;全量节点201将统计证明交易列表、目标索引、关联交易以及加密路径集合发送至轻量节点101。
在一种可能的实现方式中,轻量节点101接收到全量节点201发送的统计证明交易列表、目标索引、关联交易以及加密路径集合之后,可以根据该加密路径集合,确定关联交易的准确度,即校验关联交易是否准确,关联交易是否被非法篡改;以及,可以根据该目标索引以及该统计证明交易列表,确定关联交易的完整度,即校验关联交易是否完整,关联交易相关的内容是否存在缺失。
需要说明的是,本申请实施例涉及的区块链网络中的所有节点均可以是手机、平板电脑、笔记本电脑、掌上电脑、移动互联网设备(MID,mobile internet device)、车辆、路边设备、飞行器、可穿戴设备,还可以是例如智能手表、智能手环、计步器等具有数据处理功能的智能设备,每个节点对应的设备类型可以相同,也可以不相同。
可以理解的是,本申请实施例描述的数据通信系统是为了更加清楚的说明本申请实施例的技术方案,并不构成对于本申请实施例提供的技术方案的限定,本领域普通技术人员可知,随着系统架构的演变和新业务场景的出现,本申请实施例提供的技术方案对于类似的技术问题同样适用。
请参见图3A,图3A是本申请实施例提供的一种数据通信方法的场景示意图。本申请提供的数据通信方法可以应用于电子发票业务场景中。具体的,图3A实施例中涉及的业务节点可以是面向资源数据发行机构、企业或者消费者等的客户端。业务节点具体处于业务层中,业务节点可以属于安全专网、公有云网络以及私有云网络等。其中,安全专网包括地方机构,公有云网络包括业务服务商、报销服务商以及KA(Key Account),重点客户)企业等,私有云网络包括支付服务商、流转服务商以及KA企业等。代理节点可以处于路由代理层中,代理节点可以提供P2P服务、路由服务、证书缓存以及认证服务。核心网络共识层由一条或者多条核心区块链共同组成,例如核心链1、核心链2等等,每条核心链由区块链中的全量节点通过通信连接共同维护,并且不同的核心链可以包括不同的业务,例如,核心链1代表业务1、核心链2代表业务2以及核心链N代表业务N。每条核心链中可以包括若干个全量节点,全量节点可以生成并执行智能合约或者权限合约、缓存以及存储区块链中的数据以及发布区块至区块链网络中。
需要说明的是,代理节点可以起到对业务层以及核心共识网络层之间的隔离作用,并且业务层、路由代理层以及核心共识网络层共同组成一个区块链网络,该区块链网络可以应用于资源数据发行机构等具有高保密性的业务 场景中。
在一种可能的实现方式中,业务层中的业务节点可以通过路由代理层向核心共识网络层提交数据同步请求,以业务节点是业务服务商为例,业务服务商可以将数据同步请求(票据同步请求)发送至核心共识网络层中与该业务服务商通信质量最好的全量节点,或者业务服务商可以将数据同步请求(票据同步请求)发送至核心共识网络层中与该业务服务商距离最近的全量节点,或者业务服务商可以将获取请求(票据同步请求)发送至目标全量节点,该目标全量节点可以是核心共识网络层中对应票据业务的核心链上所有的全量节点通过共识算法选举出来的全量节点,需要说明的是,每条核心链上通过共识算法选举出来的目标全量节点可以周期性的更新,以实现区块链中区块数据的保密性以及公平性。票据同步请求包括业务服务商的身份信息,核心网络共识层中的全量节点接收到业务节点发送的票据同步请求之后,可以获取票据同步请求中业务服务商的身份信息,然后,对该业务服务商的身份信息进行校验。其中,业务服务商的身份信息可以是业务服务商从证书授权(Certificate Authority,CA)机构获取到的权威数字证书,全量节点可以对业务服务商的权威数字证书进行校验,若对该业务服务商的权威数字证书校验通过,则可以获取与业务服务商对应的关联区块。
在一种可能的实现方式中,如图3B所示,图3B是本申请实施例提供的另一种数据通信方法的场景示意图。轻量节点1、轻量节点2和轻量节点3处于第一区块链网络中,全量节点1、全量节点2和全量节点3处于第二区块链网络中。轻量节点1向全量节点1发起一笔交易X(交易X的具体内容可以是轻量节点1的用户1转出一张电子票据),交易X包括多个交易可见地址(多个交易可见地址可以是轻量节点1的用户1指定的,例如用户1可以指定交易可见地址包括轻量节点2的节点地址,轻量节点1的节点地址通常会被默认为交易X的交易可见地址),全量节点1将交易X广播至第二区块链网络中,以使第二区块链网络中各个全量节点均将交易X存储在各自的交易池中(假设在存储交易X之前,交易池中已经存储了交易1和交易2,且交易1和交易2的交易可见地址都包括轻量节点2的节点地址)。全量节点可以对交易池中的每个交易都进行区块链共识。共识通过之后,全量节点1分别统计交易池中每个交易对应的交易可见地址,即统计交易1、交易2以及交易X各自对应的交易可见地址的交易可见数量;然后,全量节点1对每个交易可见地址以及每个交易可见地址的交易可见数量分别进行加密处理,得到统计证明交易列表。由于统计证明交易列表本身也是一笔交易,因此全量节点1可以根据统计证明交易列表、交易1、交易2以及交易X生成关联区块,如图3B中区块3,即为全量节点1统计证明交易列表、根据交易1,交易2、交易X和所统计的证明交易列表生成的关联区块。
此后,全量节点1如若接收到轻量节点2发送的数据同步请求,全量节 点1可以从关联区块中提取统计证明交易列表,并在该统计证明交易列表中识别轻量节点2的目标索引,由于上述区块3中存在的交易可见地址包括轻量节点2的节点地址,因此全量节点1可以将区块3作为轻量节点2的关联区块。然后,全量节点1可以确定区块3中统计证明交易列表的默克尔路径、交易1的默克尔路径、交易2的默克尔路径以及交易X的默克尔路径。具体的,可以将统计证明交易列表的默克尔路径,交易1的默克尔路径,交易2的默克尔路径和交易X的默克尔路径统称为加密路径集合。最后,全量节点1将统计证明交易列表、目标索引、关联交易(即交易1、交易2以及交易X)以及加密路径集合发送至轻量节点2。由于区块3中交易1、交易2以及交易X的交易可见地址均包括轻量节点2的节点地址,此处的交易1、交易2以及交易X均是轻量节点2的关联交易。
在一种可能的实现方式中,如图3C所示,图3C是本申请实施例提供的另一种数据通信方法的场景示意图。轻量节点接收到全量节点发送的统计证明交易列表、目标索引、交易1、交易2、交易X以及加密路径集合后,可以根据统计证明交易列表、目标索引以及加密路径集合确定交易1、交易2和交易X的有效性结果。其中,有效性结果可以包括准确性结果和完整性结果。具体的,轻量节点2可以根据加密路径集合,确定交易1、交易2以及交易X的准确性结果,即校验交易1、交易2以及交易X的内容是否被篡改;根据目标索引、统计证明交易列表以及统计证明交易列表的加密路径,确定交易1、交易2以及交易X的完整性结果,即校验交易1、交易2以及交易X的内容是否存在缺失。
需要说明的是,本申请实施例提供的数据通信方法可以应用于资源数据发行机构、公司等业务场景中,基于本申请实施例提供的双层区块链网络,可以实现数据之间的隔离性,可以在轻量节点向业务节点请求与该轻量节点本身相关的关联交易之后,通过统计证明交易列表证明轻量节点所获得的关联交易的有效性,既保障了区块链网络中存储的数据的安全性,又满足了轻量节点需要校验关联交易的有效性的应用需求。
请参见图4,图4是本申请实施例提供的一种数据通信方法的流程示意图。该方法应用于区块链网络,区块链网络包括第一区块链网络和第二区块链网络,第一区块链网络包括轻量节点,第二区块链网络包括全量节点。该方法的操作步骤可由计算机设备执行,计算机设备可以是轻量节点,也可以是全量节点。本实施例主要描述轻量节点和全量节点之间的交互过程,该方法包括但不限于如下步骤S410~S450:
步骤S410:轻量节点向全量节点发送数据同步请求。
具体实现时,轻量节点可以为简单支付验证(Simplified Payment Verification,SPV)节点,全量节点可以为共识节点。全量节点可以存储完 整区块链,其中,区块链包括第一区块链网络中所有节点的关联交易。轻量节点可以向全量节点发送数据同步请求,该数据同步请求用于向全量节点请求与该轻量节点自身相关的关联交易。
在一种可能的实现方式中,轻量节点可以将时间段、自身的节点地址、自身的身份信息、自身的数字签名以及自身所需同步的数据的业务类型打包并封装为数据同步请求,进而将数据同步请求发送至全量节点。
在区块链网络中,轻量节点的特点包括但不限于:不是一直在线;不用保存整个区块链,只要保存每个区块的块头;不用保存链上全部交易,只保存与自己相关的交易等。全量节点的特点包括但不限于:一直在线;在本地硬盘上维护完整的区块链信息;监听区块链网络上的交易信息,验证每个交易的合法性;决定哪些交易可以被打包到区块里;监听别的矿工挖出来的区块,验证其合法性以及挖矿等。
举例来说,在电子发票业务场景中,轻量节点可以为消费者所在的客户端,消费者可以包括个人消费者或者企业消费者等,全量节点可以为票据服务商所在的客户端,票据服务商所在的客户端中存储有所有消费者消费的电子发票。其中,票据服务商所在的客户端处于第二区块链网络中,第二区块链网络中可以包括一条或者多条区块链,当第二区块链网络包括多条区块链时,每条区块链可是根据业务或者地点的不同进行区分,例如,第二区块链网络包括区块链1、区块链2以及区块链3,区块链1可以负责业务1对应的电子发票业务1,区块链2可以负责业务2对应的电子发票业务2以及区块链3可以负责业务3对应的电子发票业务3。这种情况下,若企业向票据服务商发送数据同步请求,该数据同步请求包括业务类型,则票据服务商可以根据业务类型,确定该企业对应的业务服务商所在的客户端维护哪条区块链。
在一种可能的实现方式中,第一区块链网络中的轻量节点可以将数据同步请求发送至第二区块链网络中与该轻量节点通信质量最好的全量节点,或者第一区块链网络中的轻量节点可以将数据同步请求发送至第二区块链网络中与该轻量节点距离最近的全量节点,或者第一区块链网络中的轻量节点可以将数据同步请求发送至第二区块链网络中任一全量节点,或者,第一区块链网络中的轻量节点将数据同步请求发送至第二区块链网络中的目标全量节点,该目标全量节点是由第二区块链网络中所有全量节点通过共识算法选举出来的节点。
步骤S420:全量节点接收轻量节点发送的数据同步请求,查找与所述轻量节点对应的关联区块。
其中,关联区块是在区块链中与轻量节点具有关联关系的区块;具有关联关系的区块可以是区块链网络中与该轻量节点具有关联关系的实时区块,也可以是区块链网络中与该轻量节点具有关联关系的历史区块。该关联区块 中包括多个交易以及统计证明交易列表;多个交易具有其各自对应的交易可见地址。
在一种可能的实现方式中,数据同步请求包括轻量节点的身份信息,则全量节点可以从该数据同步请求中获取轻量节点的身份信息,然后,全量节点可以对获取到的轻量节点的身份信息进行校验。具体实现时,身份信息可以包括轻量节点的数字签名,该数字签名是轻量节点根据轻量节点的私钥对数据同步请求进行签名处理得到的;全量节点接收来自轻量节点的身份信息之后,可以根据轻量节点的公钥,对轻量节点的数字签名进行校验,若校验成功,则表明轻量节点的身份校验通过。通过这种方式,对轻量节点身份的合法性进行校验,有利于提高轻量节点与全量节点之间的数据安全性,保证将数据传输给合法的轻量节点。
另外,身份信息还可以包含轻量节点的数字证书,该数字证书可以是公钥证书体系(Public Key Infrastructure,PKI),在公钥证书体系中,数字证书是一个公钥拥有者的身份证明,可以由权威机构例如CA机构颁发。全量节点可以校验轻量节点的数字证书,具体可以通过关键字提取算法获取数字证书中的关键字,以及通过图像识别算法识别数字证书中的目标图像,全量节点根据获取到的关键字以及目标图像等,对轻量节点的数字证书进行校验,若对轻量节点的数字证书校验通过,则表明轻量节点的身份校验通过。
在一种可能的实现方式中,全量节点可以获取轻量节点的节点地址,进而根据轻量节点的节点地址在区块链中获取与轻量节点对应的关联区块。若区块链上某个区块包含的交易中,存在至少一个交易的交易可见地址包括该轻量节点的节点地址,那么该区块就是与轻量节点具有关联关系的关联区块。
其中,节点地址的生成过程可以包括:基于密钥对生成节点地址,具体的,每个密钥对包括一个私钥和一个公钥。私钥是一个数字,通常是通过随机算法随机选出的。基于私钥,可以使用椭圆曲线乘法这个单向加密函数产生一个公钥。基于公钥,可以使用一个单向加密哈希函数生成比特币地址,即节点地址,其中,区块链网络中的每个节点对应一个唯一的节点地址。
步骤S430:全量节点从所述关联区块中提取统计证明交易列表,并在所述统计证明交易列表中识别轻量节点的目标索引;以及,从关联区块包括的多个交易中过滤出与所述轻量节点关联的关联交易,并基于所过滤出的关联交易确定加密路径集合。
具体实现时,统计证明交易列表包括多个统计证明交易,每个统计证明交易是对关联区块包括的交易对应的交易可见地址、以及该交易可见地址在关联区块中的数量进行加密处理得到的,具体可以采用加密算法进行加密处理,加密算法包括但不限于:消息摘要算法第五版(Message-Digest Algorithm 5,MD5)、安全散列算法256(Secure Hash Algorithm256,SHA256)、安全 散列算法512(Secure Hash Algorithm512,SHA512)、安全散列算法384(Secure Hash Algorithm384,SHA384)、安全散列算法1(Secure Hash Algorithm 1,SHA-1)等、哈希运算消息认证码算法(Hash-based Message Authentication Code,HMAC)、AES算法、DES算法、3DES算法、RSA算法以及ECC算法等。
具体实现时,与轻量节点关联的关联交易的数量可以为一个,也可以为多个,并且,关联交易可以包括由轻量节点发起的交易,关联交易也可以包括由轻量节点接收的交易,关联交易还可以包括由轻量节点见证的交易。若关联区块中某个交易的交易可见地址包括轻量节点的节点地址,那么该交易就是与轻量节点关联的交易(交易可见地址可以是交易发起方人工指定的)。值得注意的是,若关联区块中某个交易是由轻量节点发起的,那么该轻量节点的节点地址必然是该交易的交易可见地址。
另外,加密路径集合包括关联交易的加密路径以及统计证明交易列表的加密路径,具体的,加密路径可以为默克尔路径。其中,统计证明交易列表中包括的多个统计证明交易是按照顺序排列的,具体是指,多个统计证明交易是按照交易可见地址在关联区块包含的交易的出现顺序排列的。同时,轻量节点在统计证明交易列表中的目标索引可以是1、2、3...,通过目标索引,可以获取轻量节点在统计证明交易列表中对应的目标统计证明交易。
其中,任意一笔交易的交易可见地址可以由交易发起者人为设定,交易可见地址的数量可以为一个或者多个。交易可见地址的数量是指该交易可见地址在关联区块中所关联的多个交易的数量。
举例来说,假设轻量节点A的节点地址为A,轻量节点A发起一笔交易X,轻量节点A可以指定该交易X的交易可见地址,假设为B、C,即轻量节点A指定轻量节点B以及轻量节点C可见交易X,因此,对于轻量节点A、轻量节点B和轻量节点C来说,交易X均是其的关联交易。对于交易X来说,交易X的交易可见地址包括A、B以及C。
步骤S440:全量节点向轻量节点发送所述统计证明交易列表、所述目标索引、所述关联交易以及所述加密路径集合。
在一种可能的实现方式中,若全量节点对轻量节点的身份信息校验通过,则全量节点将统计证明交易列表、目标索引、关联交易以及加密路径集合发送至该轻量节点。另外,全量节点还可以将关联区块的区块头也发送至该轻量节点,其中,关联区块的区块头包括但不限于:关联区块的版本号、输入信息特征值、时间戳、难度值以及区块默克尔根等。
步骤S450:轻量节点根据所述统计证明交易列表、所述目标索引以及所述加密路径集合,确定所述关联交易的有效程度;所述有效程度用于表征所述关联交易的准确度以及完整度。
具体实现时,关联交易的有效程度可以包括关联交易的准确度以及关联 交易的完整度。具体的,轻量节点可以根据加密路径集合,校验关联交易是否准确,即校验关联交易是否被篡改,从而得到准确度;轻量节点可以根据目标索引、统计证明交易列表以及统计证明交易列表的加密路径,校验关联交易是否完整,即校验关联交易的内容是否存在缺失,从而得到完整度。
在一种可能的实现方式中,轻量节点根据统计证明交易列表、目标索引、关联交易以及加密路径集合,确定关联交易的有效程度之前,可以获取全量节点的身份信息,该身份信息具体可以包括全量节点的数字签名,该数字签名是全量节点根据全量节点的私钥,对统计证明交易列表、目标索引、关联交易以及加密路径集合进行签名处理得到的。轻量节点获取全量节点的身份信息之后,可以根据全量节点的公钥,对全量节点的数字签名进行校验,若校验成功,则表明该全量节点的身份信息校验通过。通过这种方式,能够提高轻量节点与全量节点之间的数据安全性。
本申请实施例提供的数据通信方法,可以应用于包括第一区块链网络和第二区块链网络的双层区块链网络,轻量节点处于第一区块链网络中,全量节点处于第二区块链网络中,轻量节点与全量节点之间可以进行数据交流,具体的,轻量节点可以向全量节点发送数据同步请求,全量节点接收到轻量节点的数据同步请求之后,可以向该轻量节点发送其关联的关联交易。在本方案中,统计证明交易列表将每个交易可见地址的数量放入了区块中,但又没有将相关的交易明文放入,区块链网络中任一节点获得统计证明交易列表时,由于没有全部交易信息,因此无法计算出每个节点地址对应的统计证明交易。加密路径集合保证了交易单体正确无篡改,统计证明交易列表保证了所得的关联交易总数和链上的一致,无篡改。两个证明叠加,可以完全相信所得到的数据就是区块中该节点可获得的数据,且应有的全部信息均完备。如此,在不泄露其他交易可见地址的数量的情况下,每个轻量节点可以验证自身同步数据的正确性和完整性,保证了敏感业务数据的安全隔离以及安全隔离之后的有效性证明,实现了轻量节点与全量节点之间数据的隔离性,提高了数据的安全性。
请参见图5,图5是本申请实施例提供的另一种数据处理方法的流程示意图。该方法应用于区块链网络,区块链网络包括第一区块链网络和第二区块链网络,第一区块链网络包括轻量节点,第二区块链网络包括全量节点。该方法的操作步骤可由计算机设备执行,计算机设备可以是轻量节点。本实施例主要描述轻量节点对关联交易的验证过程,该方法包括但不限于如下步骤S510~S540:
步骤S510:从与所述轻量节点具有关联关系的关联区块中接收数据,所述数据包括所述关联区块中与所述轻量节点关联的关联交易、以及统计证明交易列表,所述关联区块中包括多个交易以及所述统计证明交易列表,所 述多个交易具有其各自对应的交易可见地址,所述统计证明交易列表包括多个统计证明交易,所述统计证明交易是对所述交易对应的交易可见地址、以及所述交易可见地址在所述关联区块中的数量进行加密处理得到的。
步骤S520:在所述统计证明交易列表中识别所述轻量节点的目标索引。
具体实现时,轻量节点接收全量节点发送的其从关联区块中提取的统计证明交易列表;以及接收全量节点发送的其在统计证明交易列表中识别出的该轻量节点的目标索引,或者,轻量节点也可以从所接收的统计证明交易列表中识别自身的目标索引。
其中,统计证明交易列表包括多个统计证明交易,多个统计证明交易按照交易可见地址的出现顺序进行排列,具体排列方式可以为顺位排列、逆位排列等等。例如,统计证明交易列表可以包括统计证明交易1、统计证明交易2以及统计证明交易3,其中,统计证明交易1是对关联区块包括的交易的交易可见地址1、以及交易可见地址1在关联区块中的数量m1进行加密处理得到的,同理,统计证明交易2是对关联区块包括的交易的交易可见地址2、以及交易可见地址2在关联区块中的数量m2进行加密处理得到的,统计证明交易3是对关联区块包括的交易的交易可见地址3、以及交易可见地址3在关联区块中的数量m3进行加密处理得到的。若交易可见地址1、交易可见地址2以及交易可见地址3在交易中的出现顺序依次为交易可见地址1,交易可见地址2,交易可见地址3,那么,统计证明交易列表中统计证明交易的排列顺序可以为:统计证明交易1,统计证明交易2,统计证明交易3。
此外,轻量节点还可以接收全量节点从关联区块中提取的、与该轻量节点关联的关联交易。关联交易的交易数量可以为一个或者多个。
步骤S530:基于所述关联交易获取加密路径集合,所述加密路径集合包括所述关联交易的加密路径以及所述统计证明交易列表的加密路径。
具体实现时,轻量节点接收全量节点发送的加密路径集合。其中,加密路径集合包括关联交易的加密路径,关联交易的交易数量可以为一个或者多个,由于统计证明交易列表本身也是一个交易,因此加密路径集合还包括统计证明交易列表的加密路径。举例来说,若关联交易的数量为n个,关联交易分别为x1,x2,x3,...,xn,则加密路径集合包括x1的加密路径,x2的加密路径,x3的加密路径,...,xn的加密路径和统计证明交易列表的加密路径。
在一种可能的实现方式中,如图6A所示,图6A是本申请实施例提供的一种获取加密路径的流程示意图。加密路径具体可以为可以是通过默克尔树得到的默克尔路径,对于交易x1来说,交易x1对应的加密路径为:N1和N5,交易x2对应的加密路径为:N0和N5,交易x3对应的加密路径为:N3和N4,交易x4对应的加密路径为:N2和N4。其中,关联交易和统计 证明交易列表可以为交易x1,交易x2,交易x3以及交易x4中的任一交易。
步骤S540:根据所述统计证明交易列表、所述目标索引以及所述加密路径集合,确定所述关联交易的有效程度;所述有效程度用于表征所述关联交易的准确度以及完整度。
具体实现时,有效性程度可以包括准确度和完整度。轻量节点可以基于加密路径集合,校验关联交易是否准确,得到其准确度;可以基于目标索引、统计证明交易列表以及统计证明交易列表的加密路径,校验关联交易是否完整,得到其完整度。
在一种可能的实现方式中,关联交易的数量为多个,多个关联交易包括第一关联交易和第二关联交易,多个关联交易的加密路径包括第一关联交易对应的第一加密路径和第二关联交易对应的第二加密路径。轻量节点根据第一关联交易以及第一加密路径,确定第一默克尔根,轻量节点根据第二关联交易以及第二加密路径,确定第二默克尔根。然后,轻量节点接收关联区块的区块默克尔根,若第一默克尔根、第二默克尔根以及区块默克尔根均相同,则轻量节点确定关联交易准确。若第一默克尔根、第二默克尔根以及区块默克尔根中存在至少两个默克尔根不相同,则轻量节点确定关联交易不准确。
举例来说,如图6A,假设关联交易包括交易x1,交易x2,交易x3以及交易x4,交易x1对应的加密路径为:N1和N5,交易x2对应的加密路径为:N0和N5,交易x3对应的加密路径为:N3和N4,交易x4对应的加密路径为:N2和N4。那么,轻量节点根据交易x1,N1和N5,可以确定第一默克尔根,具体为:轻量节点通过哈希算法对交易x1进行哈希运算,得到hash(x1),然后,轻量节点再次对hash(x1)和N1进行哈希运算,得到hash[hash(x1)+N1],最后,轻量节点对hash[hash(x1)+N1]和N5进行哈希运算,得到hash{hash[hash(x1)+N1]+N5},即默克尔根root1,同理,轻量节点可以得到交易x2对应的默克尔根root2=hash{hash[hash(x2)+N0]+N5},轻量节点可以得到交易x3对应的默克尔根root3=hash{hash[hash(x3)+N3]+N4},轻量节点可以得到交易x4对应的默克尔根root4=hash{hash[hash(x4)+N2]+N4}。轻量节点获取区块默克尔根为Root,若root1、root2、root3、root4均与Root相同,则轻量节点确定关联交易的准确性结果为具有准确性。若root1与Root相同,root2与Root相同,root3与Root不相同,root4与Root不相同,则轻量节点确定交易x1和交易x2的准确,交易x3和交易x4不准确,进而轻量节点确定关联交易的准确度为不准确。
轻量节点通过上述方式,基于关联交易及其对应的加密路径,确定关联交易对应的默克尔根,进而根据关联交易对应的默克尔根和关联区块的区块默克尔根,校验关联交易是否被篡改,即确定关联交易的准确度。可以实现高效且准确地校验,保证校验得到的准确性结果的可靠性。
在一种可能的实现方式中,轻量节点基于统计证明交易列表的加密路径,校验统计证明交易列表是否有效,统计证明交易列表是否有效相应地表征统计证明交易列表是否被篡改。具体的,轻量节点通过统计证明交易列表的加密路径,确定统计证明交易列表是否有效,具体可以参考以上轻量节点通过关联交易和关联交易的加密路径,确定关联交易的准确度的执行步骤,在此不再赘述。
在一种可能的实现方式中,若轻量节点校验确定统计证明交易列表有效,则从关联区块中接收关联交易的交易数量,以及在统计证明交易列表中查找与目标索引对应的目标统计证明交易。对交易数量和轻量节点的节点地址进行叠加运算,得到目标叠加值,并通过加密算法对目标叠加值进行加密运算,得到轻量节点的目标业务交易;若目标统计证明交易与目标业务交易相同,则轻量节点确定关联交易完整。
举例来说,假设关联交易的交易数量为m1个,轻量节点的节点地址为address1。轻量节点对交易数量和节点地址进行叠加运算,得到目标叠加值为:address1+m1,然后轻量节点通过哈希算法对目标叠加值进行哈希运算,得到hash(address1+m1),进一步地,轻量节点通过消息认证码算法(Message Authentication Code,MAC)对hash(address1+m1)进行加密,得到MAC[hash(address1+m1)],即轻量节点的目标业务交易。如图6B,图6B为本申请实施例提供的一种统计证明交易列表的示意图,若目标索引为1,则轻量节点根据目标索引1在统计证明交易列表中获取目标统计证明交易MAC[hash(address1+m1)]。最后,若目标业务交易与目标统计证明交易相同,则可以确定关联交易完整,若目标业务交易与目标统计证明交易不相同,则可以确定关联交易不完整。
轻量节点通过上述方式,在校验统计证明交易列表有效的情况下,根据该统计证明交易列表、该统计证明交易列表中与自身相关的目标统计证明交易、交易数量和自身的节点地址,校验所接收的关联交易是否存在缺失,即校验关联交易的完整度。可以高效且准确地确定该完整度,即在仅需执行较简化的校验流程的情况下,即可准确地校验关联交易是否存在缺失。
通过本申请实施例提供的方法,在双层区块链网络的基础之上,轻量节点在向全量节点同步与自身相关的关联交易之后,可以通过关联交易、加密路径集合、统计证明交易列表以及统计证明交易列表的加密路径,确定关联交易是否准确以及是否完整。具体的,轻量节点可以根据加密路径集合,确定关联交易的准确度;以及可以根据目标索引、统计证明交易列表以及统计证明交易列表的加密路径,确定关联交易的完整度。轻量节点在确定关联交易具有有效程度之后,可以基于关联交易进行后续处理,相比于现有技术中轻量节点获得关联交易之后直接根据关联交易进行后处续理,可以进一步提高关联交易的准确性。
请参见图7,图7是本申请实施例所提供的另一种数据处理方法的流程示意图。该方法应用于区块链网络,区块链网络包括第一区块链网络和第二区块链网络,第一区块链网络包括轻量节点,第二区块链网络包括全量节点。该方法的操作步骤可由计算机设备执行,计算机设备可以是全量节点。本实施例主要描述全量节点响应数据同步请求的过程,该方法包括但不限于如下步骤S710~S740:
步骤S710:接收轻量节点发送的数据同步请求,查找与所述轻量节点对应的关联区块;所述关联区块是与所述轻量节点具有关联关系的区块;所述关联区块中包括多个交易以及统计证明交易列表;所述多个交易具有其各自对应的交易可见地址;所述统计证明交易列表包括多个统计证明交易,所述统计证明交易是对所述交易对应的交易可见地址、以及所述交易可见地址在所述关联区块中的数量进行加密处理得到的。
具体实现时,数据同步请求包括轻量节点的身份信息,全量节点接收到轻量节点发送的数据同步请求之后,可以获取轻量节点的身份信息,并对轻量节点的身份信息进行校验,若全量节点对轻量节点的身份信息校验通过,则可以获取轻量节点对应的关联区块。需要说明的是,全量节点对轻量节点的身份信息进行校验的操作步骤具体可参见上述图4实施例的步骤S420中全量节点的具体操作过程,本申请实施例在此不再赘述。
在一种可能的实现方式中,全量节点接收待处理交易,待处理交易包括多个交易可见地址;全量节点统计待处理交易中每个交易可见地址的数量;进而,针对每个交易可见地址以及每个交易可见地址的交易可见数量进行加密处理,得到统计证明交易列表。
举例来说,全量节点获取第一区块链网络中任意轻量节点发起的待处理交易,假设轻量节点A发起一笔待处理交易x1,轻量节点A可以指定第一区块链网络中哪些轻量节点可以看见这笔待处理交易x1,被指定的轻量节点对应的节点地址即为交易可见地址,若轻量节点A指定轻量节点B和轻量节点C可见待处理交易x1,假设轻量节点A的节点地址为address1,轻量节点B的节点地址为address2,轻量节点C的节点地址为address3,则待处理交易x1的交易可见地址为address1、address2和address3,以此类推,待处理交易的数量可以为多个。
全量节点通过上述方式,根据待处理交易包括的交易可见地址以及交易可见地址的数量,生成统计证明交易列表;有效地将每个交易可见地址的数量放入了区块中,但又没有将相关的交易明文放入,当区块链网络中任一节点获得统计证明交易列表时,由于没有全部交易信息,因此无法计算出每个节点地址对应的统计证明交易,保证了区块链网络中节点与节点之间数据通信的安全性,并且有利于轻量节点基于该统计证明交易列表,校验与其相关 的关联交易是否准确以及是否完整。
在一种可能的实现方式中,统计证明交易列表包括第一统计证明交易以及第二统计证明交易,多个交易可见地址包括第一交易可见地址和第二交易可见地址。全量节点对第一交易可见地址以及第一交易可见地址的数量进行加密处理,得到第一统计证明交易;对第二交易可见地址以及第二交易可见地址的数量进行加密处理,得到第二统计证明交易。进而,全量节点将第一统计证明交易以及第二统计证明交易组合为统计证明交易列表,其中,若第一交易可见地址在待处理交易中的出现顺序优先于第二交易可见地址在待处理交易中的出现顺序,则第一统计证明交易在统计证明交易列表中的排列顺序优先于第二统计证明交易在统计证明交易列表中的排列顺序。
需要说明的是,全量节点对第一交易可见地址和第一交易可见地址的数量进行加密处理,得到第一统计证明交易,以及对第二交易可见地址和第二交易可见地址的数量进行加密处理,得到第二统计证明交易,所采用的加密算法,应当与图5实施例中轻量节点对目标叠加值进行加密处理得到目标统计证明交易时采用的加密算法一致,即先对叠加值进行哈希运算得到哈希值,然后再通过消息认证码算法对哈希值进行运算,得到每个统计证明交易。当然,此处的加密处理的方式不唯一,例如,还可以通过HMAC算法进行加密处理,只要与后续轻量节点对目标叠加值加密处理的方式一致即可,本申请实施例对此不作限定。
举例来说,全量节点可以按照出现顺序统计每个交易可见地址的数量,即全量节点依次统计交易可见地址address1、address2、address3、address4和address5各自对应数量,假设分别为m1、m2、m3、m4和m5,交易可见地址和数量之间的对应关系可以如表1.1所示:
表1.1
address1 m1
address2 m2
address3 m3
address4 m4
address5 m5
然后,全量节点将每个交易可见地址和及其数量进行叠加运算,得到多个叠加值,然后再对多个叠加值分别进行加密处理,得到统计证明交易列表,统计证明交易列表的数据结构可以是表格。在生成统计证明交易列表时,还需要确定每个统计证明交易对应的节点地址,并且确定每个节点地址在统计证明交易列表中的索引。
具体的,统计证明交易列表可以如表1.2所示:
表1.2
Index1 MAC[hash(address1+m1)]
Index2 MAC[hash(address2+m2)]
Index3 MAC[hash(address3+m3)]
Index4 MAC[hash(address4+m4)]
Index5 MAC[hash(address5+m5)]
如表1.2所示,节点地址为“address1”的节点在统计证明交易列表中的索引为1,节点地址为“address2”的节点在统计证明交易列表中的索引为2,节点地址为“address3”的节点在统计证明交易列表中的索引为3,节点地址为“address4”的节点在统计证明交易列表中的索引为4,节点地址为“address5”的节点在统计证明交易列表中的索引为5。
最后,全量节点根据统计证明交易列表和待处理交易生成关联区块,具体的,全量节点可以将统计证明交易列表作为第一笔交易,然后将待处理交易依次作为第一笔交易的下一笔交易,根据每笔交易生成关联区块,并将关联区块存储至区块链,其中,存储至区块链中的待处理交易均可称为交易。
全量节点通过上述方式生成统计证明交易列表,可以保证所生成的统计证明交易列表中各统计证明交易的排序合理,从而便于从中识别轻量节点对应的目标索引,有助于提高轻量节点确定关联交易的有效性结果的效率。
在一种可能的实现方式中,假设根据统计证明交易列表和待处理交易生成关联区块的全量节点为第一全量节点,第一全量节点根据统计证明交易列表和待处理交易生成关联区块之后,可以将该关联区块发布至第二区块链网络中的多个第二全量节点,以使每个第二全量节点对关联区块进行区块链共识。若区块链共识通过,则第一全量节点将关联区块发布至第二区块链网络中,并存储至区块链。其中,第二全量节点为第二区块链网络中除第一全量节点以外的所有节点。
在一种可能的实现方式中,全量节点获取与轻量节点对应的关联区块,可以是通过区块高度的方式进行获取,具体的,全量节点接收到轻量节点发送的数据同步请求后,可以获取轻量节点的节点地址,进而确定该全量节点储存的区块链中包含全量节点的节点地址的区块,全量节点将包含轻量节点的节点地址的中的区块高度最大对应的区块,作为与轻量节点对应的关联区块。
步骤S720:从所述关联区块中提取统计证明交易列表,并在所述统计证明列表中识别所述轻量节点的目标索引。
具体实现时,全量节点从关联区块中提取统计证明交易列表,可以将从关联区块的区块体中提取到的第一笔交易作为统计证明交易列表,全量节点从关联区块中提取轻量节点在统计证明交易列表中的目标索引,具体方式可以为,全量节点根据轻量节点的节点地址,在统计证明交易列表中查找轻量节点在统计证明交易列表中的目标索引。
步骤S730:从所述关联区块包括的所述多个交易中过滤出与所述轻量 节点关联的关联交易,并基于所过滤出的关联交易确定加密路径集合,所述加密路径集合包括所述关联交易的加密路径以及所述统计证明交易列表的加密路径。
具体实现时,全量节点从关联区块中提取与轻量节点关联的关联交易,与轻量节点关联的关联交易可以包括轻量节点发起的交易、轻量节点接收的交易以及轻量节点见证的交易。举例来说,交易x1假设是轻量节点发起的,则交易x1可以为轻量节点的关联交易,交易x2假设是轻量节点接收的,则交易x2可以为轻量节点的关联交易,交易x3是节点1发起的,但是交易x3的交易可见地址包括轻量节点,则交易x3也可以为轻量节点的关联交易。也就是说,全量节点可以将轻量节点的节点地址作为一个交易可见地址,在关联区块中获取到该交易可见地址所对应的交易,即为该轻量节点的关联交易,关联交易的数量可以为一个或者多个。
步骤S740:将所述统计证明交易列表、所述目标索引、所述关联交易以及所述加密路径集合发送至所述轻量节点,以使所述轻量节点根据所述统计证明交易列表、所述目标索引以及所述加密路径集合,确定所述关联交易的有效程度;所述有效程度用于表征所述关联交易的准确度以及完整度。
具体实现时,第二区块链网络中的全量节点通过区块链网络中的网络路由服务,将统计证明交易列表、目标索引、关联交易以及加密路径集合发送至第一区块链网络中的轻量节点。其中,轻量节点根据统计证明交易列表、目标索引以及加密路径集合,确定关联交易的有效程度的操作步骤具体可参见图5实施例中步骤S540中轻量节点的执行步骤,本申请在此不再赘述。
通过本申请实施例所提供的方法,第二区块链网络中的全量节点接收到第一区块链网络中的轻量节点发送的数据同步请求之后,可以对轻量节点进行身份校验,当全量节点对轻量节点身份校验通过后,全量节点才将轻量节点所需同步的数据,包括统计证明交易列表、目标索引、关联交易以及加密路径集合,发送至所述轻量节点。统计证明交易列表有效地将每个交易可见地址的数量放入了区块中,但又没有将相关的交易明文放入,当区块链网络中任一节点获得统计证明交易列表时,由于没有全部交易信息,因此无法计算出每个节点地址对应的统计证明交易。因此,可以提高区块链网络中节点与节点之间数据交流的安全性。
请参见图8,图8是本申请实施例提供的一种数据通信装置的结构示意图。图8是本申请实施例所提供的一种数据通信装置的结构示意图。该数据通信装置可应用于图5~图6B对应的方法实施例中的轻量节点。数据通信装置可以是运行于轻量节点中的一个计算机程序(包括程序代码),例如该数据通信装置为一个应用软件;该装置可以用于执行本申请实施例提供的方法中的相应步骤。该数据通信装置可包括:
接收单元810,用于从与所述轻量节点具有关联关系的关联区块中接收数据,所述数据包括所述关联区块中与所述轻量节点关联的关联交易、以及统计证明交易列表,所述关联区块中包括多个交易以及所述统计证明交易列表,所述多个交易具有其各自对应的交易可见地址,所述统计证明交易列表包括多个统计证明交易,所述统计证明交易是对所述交易对应的交易可见地址、以及所述交易可见地址在所述关联区块中的数量进行加密处理得到的;
识别单元820,用于在所述统计证明交易列表中识别所述轻量节点的目标索引;
获取单元830,用于基于所述关联交易获取加密路径集合,所述加密路径集合包括所述关联交易的加密路径以及所述统计证明交易列表的加密路径;
确定单元840,用于根据所述统计证明交易列表、所述目标索引以及所述加密路径集合,确定所述关联交易的有效程度;所述有效程度用于表征所述关联交易的准确度以及完整度。
在一种可能的实现方式中,确定单元840具体用于:
基于所述加密路径集合,校验所述关联交易是否准确,得到所述准确度;
基于所述目标索引、所述统计证明交易列表以及所述统计证明交易列表的加密路径,校验所述关联交易是否完整,得到所述完整度。
在一种可能的实现方式中,关联交易的数量为多个,所述多个关联交易包括第一关联交易和第二关联交易,所述多个关联交易的加密路径包括第一关联交易对应的第一加密路径和第二关联交易对应的第二加密路径;
确定单元840具体用于:
根据所述第一关联交易以及所述第一加密路径,确定第一默克尔根,根据所述第二关联交易以及所述第二加密路径,确定第二默克尔根;
基于所述第一默克尔根和所述第二默克尔根,校验所述关联交易是否准确,得到所述准确度。
在一种可能的实现方式中,确定单元840具体用于:
接收所述关联区块的区块默克尔根;
若所述第一默克尔根、所述第二默克尔根以及所述区块默克尔根均相同,则确定所述关联交易准确;
若所述第一默克尔根、所述第二默克尔根以及所述区块默克尔根中存在至少两个默克尔根不相同,则确定所述关联交易不准确。
在一种可能的实现方式中,确定单元840具体用于:
根据所述统计证明交易列表的加密路径,校验所述统计证明交易列表是否有效;
若校验确定所述统计证明交易列表有效,则从所述关联区块中接收所述关联交易的交易数量;
在所述统计证明交易列表中查找所述目标索引对应的目标统计证明交易;
根据所述统计证明交易列表、所述目标统计证明交易、所述交易数量以及所述轻量节点的节点地址,校验所述关联交易是否完整,得到所述完整度。
在一种可能的实现方式中,确定单元840具体用于:
对所述交易数量和所述轻量节点的节点地址进行叠加运算,得到目标叠加值,并通过加密算法对所述目标叠加值进行加密运算,得到所述轻量节点的目标业务交易;
若所述目标统计证明交易与所述目标业务交易相同,则确定所述关联交易完整。
通过本申请实施例提供的数据通信装置,在双层区块链网络的基础之上,轻量节点在向全量节点同步与自身相关的关联交易之后,可以通过关联交易、加密路径集合、统计证明交易列表以及统计证明交易列表的加密路径,确定关联交易的有效性结果。具体的,轻量节点可以根据加密路径集合,确定关联交易的准确度;根据目标索引、统计证明交易列表、以及统计证明交易列表的加密路径,确定关联交易的完整度。轻量节点确定出关联交易的有效程度之后,可以基于该有效程度根据关联交易进行后续处理,相比于现有技术中轻量节点获得关联交易之后直接根据关联交易进行后续处理,可以进一步提高关联交易的准确性。
请参见图9,图9是本申请实施例提供的一种数据通信装置的结构示意图。图9是本申请实施例所提供的一种数据通信装置的结构示意图。该数据通信装置可应用于图7对应的方法实施例中的全量节点。数据通信装置可以是运行于全量节点中的一个计算机程序(包括程序代码),例如该数据通信装置为一个应用软件;该装置可以用于执行本申请实施例提供的方法中的相应步骤。该数据通信装置可包括:
接收单元910,用于接收轻量节点发送的数据同步请求,查找与所述轻量节点对应的关联区块;所述关联区块是与所述轻量节点具有关联关系的区块;所述关联区块中包括多个交易以及统计证明交易列表;所述多个交易具有其各自对应的交易可见地址;所述统计证明交易列表包括多个统计证明交易,所述统计证明交易是对所述交易对应的交易可见地址、以及所述交易可见地址在所述关联区块中的数量进行加密处理得到的。
提取单元920,用于从所述关联区块中提取统计证明交易列表,并在所述统计证明列表中识别所述轻量节点的目标索引。
提取单元920,还用于从所述关联区块包括的所述多个交易中过滤出与所述轻量节点关联的关联交易,并基于所过滤出的关联交易确定加密路径集合,所述加密路径集合包括所述关联交易的加密路径以及所述统计证明交易 列表的加密路径。
发送单元930,用于将所述统计证明交易列表、所述目标索引、所述关联交易以及所述加密路径集合发送至所述轻量节点,以使所述轻量节点根据所述统计证明交易列表、所述目标索引以及所述加密路径集合,确定所述关联交易的有效程度;所述有效程度用于表征所述关联交易的准确度以及完整度。
在一种可能的实现方式中,该数据处理装置还包括:获取单元940、统计单元950、处理单元960。
获取单元940,用于接收待处理交易,所述待处理交易包括多个交易可见地址;
统计单元950,用于统计所述待处理交易中每个交易可见地址的数量;
处理单元960,用于针对每个交易可见地址以及每个交易可见地址的数量分别进行加密处理,得到统计证明交易列表;
处理单元960,还用于根据所述统计证明交易列表和所述待处理交易生成关联区块,并将所述关联区块存储至区块链。
在一种可能的实现方式中,统计证明交易列表包括第一统计证明交易以及第二统计证明交易,所述多个交易可见地址包括第一交易可见地址和第二交易可见地址;
处理单元960具体用于:
对第一交易可见地址以及第一交易可见地址的数量进行加密处理,得到所述第一统计证明交易;
对第二交易可见地址以及第二交易可见地址的数量进行加密处理,得到所述第二统计证明交易;
将所述第一统计证明交易以及所述第二统计证明交易组合为所述统计证明交易列表,若所述第一交易可见地址在所述待处理交易中的出现顺序优先于所述第二交易可见地址在所述待处理交易中的出现顺序,则所述第一统计证明交易在所述统计证明交易列表中的排列顺序优先于所述第二统计证明交易在所述统计证明交易列表中的排列顺序。
在一种可能的实现方式中,数据同步请求包括所述轻量节点的身份信息;
发送单元930将所述统计证明交易列表、所述目标索引、所述关联交易以及所述加密路径集合发送至所述轻量节点,包括:
对所述轻量节点的身份信息进行校验;
若对所述身份信息校验通过,则将所述统计证明交易列表、所述目标索引、所述关联交易以及所述加密路径集合发送至所述轻量节点。
在一种可能的实现方式中,区块链对应的区块链网络包括第一区块链网络和第二区块链网络,所述轻量节点是第一区块链网络中的节点,所述轻量 节点用于存储所述轻量节点的关联交易,所述全量节点用于存储所述区块链,所述区块链包括所述第一区块链网络中所有节点的关联交易。
通过本申请实施例提供的数据通信装置,第二区块链网络中的全量节点响应第一区块链网络中的轻量节点发送的数据同步请求,可以对轻量节点进行身份校验,当全量节点对轻量节点身份校验通过后,全量节点将轻量节点需要同步的数据,包括统计证明交易列表、目标索引、关联交易以及加密路径集合发送至所述轻量节点。统计证明交易列表有效地将交易可见地址的数量放入了区块中,但又没有将相关的交易明文放入,区块链网络中任一节点获得统计证明交易列表,由于没有全部交易信息,因此无法计算出每个节点地址对应的统计证明交易。因此,可以提高区块链网络中节点与节点之间数据交流的安全性。
请参见图10,图10是本申请实施例提供的一种计算机设备的结构示意图。上述图4~图7对应实施例中的轻量节点可以为计算机设备1000,如图10所示,计算机设备1000可以包括:用户接口1002、处理器1004、编码器1006以及存储器1008。信号接收器1016用于经由蜂窝接口1010、WIFI接口1012、...、或NFC接口1014接收或者发送数据。编码器1006将接收到的数据编码为计算机处理的数据格式。存储器1008中存储有计算机程序,处理器1004被设置为通过计算机程序执行上述任一项方法实施例中的步骤。存储器1008可包括易失性存储器(例如,动态随机存取存储器DRAM),还可以包括非易失性存储器(例如,一次性可编程只读存储器OTPROM)。在一些实例中,存储器1008可进一步包括相对于处理器1004远程设置的存储器,这些远程存储器可以通过网络连接至计算机设备1000。用户接口1002可以包括:键盘1018和显示器1020。
在图10所示的计算机设备1000中,处理器1004可以用于调用存储器1008中存储计算机程序,以实现上文方法实施例中轻量节点侧的数据通信方法、或者上文方法实施例中全量节点侧的数据通信方法。
应当理解,本申请实施例中所描述的计算机设备1000执行前文图4到图7所对应实施例中对数据通信方法的描述,也可执行前文图8和图9所对应实施例中对数据通信装置的描述,在此不再赘述。另外,对采用相同方法的有益效果描述,也不再进行赘述。
本申请实施例还提供了一种计算机存储介质,且计算机存储介质中存储有前文提及的数据处理装置所执行的计算机程序,且该计算机程序包括程序指令,当处理器执行上述程序指令时,能够执行前文图4到图7所对应实施例中的方法,因此,这里将不再进行赘述。另外,对采用相同方法的有益效果描述,也不再进行赘述。对于本申请所涉及的计算机存储介质实施例中未披露的技术细节,请参照本申请方法实施例的描述。作为示例,程序指令可 以被部署在一个计算机设备上,或者在位于一个地点的多个计算机设备上执行,又或者,在分布在多个地点且通过通信网络互连的多个计算机设备上执行,分布在多个地点且通过通信网络互连的多个计算机设备可以组成区块链系统。
根据本申请的一个方面,提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备可以执行前文图4到图7所对应实施例中的方法,因此,这里将不再进行赘述。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,上述程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,上述存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。
以上所揭露的仅为本申请的部分实施例而已,当然不能以此来限定本申请之权利范围,本领域普通技术人员可以理解实现上述实施例的全部或部分流程,并依本申请权利要求所作的等同变化,仍属于发明所涵盖的范围。

Claims (16)

  1. 一种数据通信方法,由轻量节点执行,所述方法包括:
    从与所述轻量节点具有关联关系的关联区块中接收数据,所述数据包括所述关联区块中与所述轻量节点关联的关联交易、以及统计证明交易列表,所述关联区块中包括多个交易以及所述统计证明交易列表,所述多个交易具有其各自对应的交易可见地址,所述统计证明交易列表包括多个统计证明交易,所述统计证明交易是对所述交易对应的交易可见地址、以及所述交易可见地址在所述关联区块中的数量进行加密处理得到的;
    在所述统计证明交易列表中识别所述轻量节点的目标索引;
    基于所述关联交易获取加密路径集合,所述加密路径集合包括所述关联交易的加密路径以及所述统计证明交易列表的加密路径;
    根据所述统计证明交易列表、所述目标索引以及所述加密路径集合,确定所述关联交易的有效程度;所述有效性程度用于表征所述关联交易的准确度以及完整度。
  2. 根据权利要求1所述的方法,所述根据所述统计证明交易列表、所述目标索引以及所述加密路径集合,确定所述关联交易的有效程度,包括:
    基于所述加密路径集合,校验所述关联交易是否准确,得到所述准确度;
    基于所述目标索引、所述统计证明交易列表以及所述统计证明交易列表的加密路径,校验所述关联交易是否完整,得到所述完整度。
  3. 根据权利要求2所述的方法,所述关联交易的数量为多个,所述多个关联交易包括第一关联交易和第二关联交易,所述多个关联交易的加密路径包括所述第一关联交易对应的第一加密路径和所述第二关联交易对应的第二加密路径;
    所述基于所述加密路径集合,校验所述关联交易是否准确,得到所述准确度,包括:
    根据所述第一关联交易以及所述第一加密路径,确定第一默克尔根;
    根据所述第二关联交易以及所述第二加密路径,确定第二默克尔根;
    基于所述第一默克尔根和所述第二默克尔根,校验所述关联交易是否准确,得到所述准确度。
  4. 根据权利要求3所述的方法,所述基于所述第一默克尔根和所述第二默克尔根,校验所述关联交易是否准确,得到所述准确度,包括:
    接收所述关联区块的区块默克尔根;
    若所述第一默克尔根、所述第二默克尔根以及所述区块默克尔根均相同,则确定所述关联交易准确;
    若所述第一默克尔根、所述第二默克尔根以及所述区块默克尔根中存在至少两个默克尔根不相同,则确定所述关联交易不准确。
  5. 根据权利要求2所述的方法,所述基于所述目标索引、所述统计证 明交易列表以及所述统计证明交易列表的加密路径,校验所述关联交易是否完整,得到所述完整度,包括:
    根据所述统计证明交易列表的加密路径,校验所述统计证明交易列表是否有效;
    若校验确定所述统计证明交易列表有效,则从所述关联区块中接收所述关联交易的交易数量;
    在所述统计证明交易列表中查找所述目标索引对应的目标统计证明交易;
    根据所述统计证明交易列表、所述目标统计证明交易、所述交易数量以及所述轻量节点的节点地址,校验所述关联交易是否完整,得到所述完整度。
  6. 根据权利要求5所述的方法,所述根据所述目标统计证明交易、所述交易数量以及所述轻量节点的节点地址,校验所述关联交易是否完整,得到所述完整度,包括:
    对所述交易数量和所述轻量节点的节点地址进行叠加运算,得到目标叠加值,并通过加密算法对所述目标叠加值进行加密运算,得到所述轻量节点的目标业务交易;
    若所述目标统计证明交易与所述目标业务交易相同,则确定所述关联交易完整。
  7. 一种数据通信方法,由全量节点执行,所述方法包括:
    接收轻量节点发送的数据同步请求,查找与所述轻量节点对应的关联区块;所述关联区块是与所述轻量节点具有关联关系的区块;所述关联区块中包括多个交易以及统计证明交易列表;所述多个交易具有其各自对应的交易可见地址;所述统计证明交易列表包括多个统计证明交易,所述统计证明交易是对所述交易对应的交易可见地址、以及所述交易可见地址在所述关联区块中的数量进行加密处理得到的;
    从所述关联区块中提取所述统计证明交易列表,并在所述统计证明列表中识别所述轻量节点的目标索引;
    从所述关联区块包括的所述多个交易中过滤出与所述轻量节点关联的关联交易,并基于所过滤出的关联交易确定加密路径集合,所述加密路径集合包括所述关联交易的加密路径以及所述统计证明交易列表的加密路径;
    将所述统计证明交易列表、所述目标索引、所述关联交易以及所述加密路径集合发送至所述轻量节点,以使所述轻量节点根据所述统计证明交易列表、所述目标索引以及所述加密路径集合,确定所述关联交易的有效程度;所述有效程度用于表征所述关联交易的准确度以及完整度。
  8. 根据权利要求7所述的方法,所述方法还包括:
    接收待处理交易,所述待处理交易包括多个交易可见地址;
    统计所述待处理交易中每个交易可见地址的数量;
    针对每个交易可见地址以及每个交易可见地址的数量分别进行加密处理,得到统计证明交易列表;
    根据所述统计证明交易列表和所述待处理交易生成所述关联区块,并将所述关联区块存储至区块链。
  9. 根据权利要求8所述的方法,所述统计证明交易列表包括第一统计证明交易以及第二统计证明交易,所述多个交易可见地址包括第一交易可见地址和第二交易可见地址;
    所述针对每个交易可见地址以及每个交易可见地址的数量分别进行加密处理,得到统计证明交易列表,包括:
    对所述第一交易可见地址以及所述第一交易可见地址的数量进行加密处理,得到所述第一统计证明交易;
    对所述第二交易可见地址以及所述第二交易可见地址的数量进行加密处理,得到所述第二统计证明交易;
    将所述第一统计证明交易以及所述第二统计证明交易组合为所述统计证明交易列表,若所述第一交易可见地址在所述待处理交易中的出现顺序优先于所述第二交易可见地址在所述待处理交易中的出现顺序,则所述第一统计证明交易在所述统计证明交易列表中的排列顺序优先于所述第二统计证明交易在所述统计证明交易列表中的排列顺序。
  10. 根据权利要求7所述的方法,所述数据同步请求包括所述轻量节点的身份信息;
    所述将所述统计证明交易列表、所述目标索引、所述关联交易以及所述加密路径集合发送至所述轻量节点,包括:
    对所述轻量节点的身份信息进行校验;
    若对所述身份信息校验通过,则将所述统计证明交易列表、所述目标索引、所述关联交易以及所述加密路径集合发送至所述轻量节点。
  11. 根据权利要求7~10中任一项所述的方法,所述区块链对应的区块链网络包括第一区块链网络和第二区块链网络,所述轻量节点是所述第一区块链网络中的节点,所述轻量节点用于存储所述轻量节点的关联交易,所述全量节点用于存储所述区块链,所述区块链包括所述第一区块链网络中所有节点的关联交易。
  12. 一种数据通信装置,所述数据处理装置包括:
    接收单元,用于从与所述轻量节点具有关联关系的关联区块中接收数据,所述数据包括所述关联区块中与所述轻量节点关联的关联交易、以及统计证明交易列表,所述关联区块中包括多个交易以及所述统计证明交易列表,所述多个交易具有其各自对应的交易可见地址,所述统计证明交易列表包括多个统计证明交易,所述统计证明交易是对所述交易对应的交易可见地址、以及所述交易可见地址在所述关联区块中的数量进行加密处理得到的;
    识别单元,用于在所述统计证明交易列表中识别所述轻量节点的目标索引;
    获取单元,用于基于所述关联交易获取加密路径集合,所述加密路径集合包括所述关联交易的加密路径以及所述统计证明交易列表的加密路径;
    确定单元,用于根据所述统计证明交易列表、所述目标索引以及所述加密路径集合,确定所述关联交易的有效程度;所述有效程度用于表征所述关联交易的准确度以及完整度。
  13. 一种数据通信装置,所述数据处理装置包括:
    接收单元,用于接收轻量节点发送的数据同步请求,查找与所述轻量节点对应的关联区块;所述关联区块是与所述轻量节点具有关联关系的区块;所述关联区块中包括多个交易以及统计证明交易列表;所述多个交易具有其各自对应的交易可见地址;所述统计证明交易列表包括多个统计证明交易,所述统计证明交易是对所述交易对应的交易可见地址、以及所述交易可见地址在所述关联区块中的数量进行加密处理得到的;
    提取单元,用于从所述关联区块中提取所述统计证明交易列表,并在所述统计证明列表中识别所述轻量节点的目标索引;
    提取单元,还用于从所述关联区块中包括的所述多个交易中过滤出与所述轻量节点关联的关联交易,并基于所过滤出的关联交易确定加密路径集合,所述加密路径集合包括所述关联交易的加密路径以及所述统计证明交易列表的加密路径;
    发送单元,用于将所述统计证明交易列表、所述目标索引、所述关联交易以及所述加密路径集合发送至所述轻量节点,以使所述轻量节点根据所述统计证明交易列表、所述目标索引以及所述加密路径集合,确定所述关联交易的有效程度;所述有效程度用于表征所述关联交易的准确度以及完整度。
  14. 一种计算机设备,包括存储器以及处理器,所述存储器存储一组程序代码,所述处理器调用所述存储器中存储的程序代码,用于执行1~6或7~11中任一项所述的方法。
  15. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时使所述处理器执行如权利要求1~6或7~11中任一项所述的方法。
  16. 一种计算机程序产品,包括指令,当其在计算机上运行时,使得计算机实现如权利要求1~6或7~11中任一项所述的方法。
PCT/CN2021/130209 2020-11-16 2021-11-12 一种数据通信方法、装置、计算机设备及存储介质 WO2022100679A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP21891199.8A EP4191498A4 (en) 2020-11-16 2021-11-12 DATA COMMUNICATION METHOD AND APPARATUS, COMPUTER DEVICE AND STORAGE MEDIUM
US18/072,621 US20230089134A1 (en) 2020-11-16 2022-11-30 Data communication method and apparatus, computer device, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011279516.6A CN112085504B (zh) 2020-11-16 2020-11-16 一种数据处理方法、装置、计算机设备及存储介质
CN202011279516.6 2020-11-16

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/072,621 Continuation US20230089134A1 (en) 2020-11-16 2022-11-30 Data communication method and apparatus, computer device, and storage medium

Publications (1)

Publication Number Publication Date
WO2022100679A1 true WO2022100679A1 (zh) 2022-05-19

Family

ID=73730420

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/130209 WO2022100679A1 (zh) 2020-11-16 2021-11-12 一种数据通信方法、装置、计算机设备及存储介质

Country Status (4)

Country Link
US (1) US20230089134A1 (zh)
EP (1) EP4191498A4 (zh)
CN (2) CN112085504B (zh)
WO (1) WO2022100679A1 (zh)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112085504B (zh) * 2020-11-16 2021-02-09 腾讯科技(深圳)有限公司 一种数据处理方法、装置、计算机设备及存储介质
CN112883117B (zh) * 2020-12-24 2022-03-15 腾讯科技(深圳)有限公司 一种数据同步方法、设备以及计算机可读存储介质
CN112651754A (zh) * 2020-12-30 2021-04-13 杭州趣链科技有限公司 网约车信息安全的验证方法、系统和服务器
CN113435896B (zh) * 2021-05-18 2022-05-31 腾讯科技(深圳)有限公司 一种交易验证方法、装置、设备及存储介质
US11902426B2 (en) * 2021-06-26 2024-02-13 Ceremorphic, Inc. Efficient storage of blockchain in embedded device
CN113255014B (zh) * 2021-07-07 2021-09-28 腾讯科技(深圳)有限公司 一种基于区块链的数据处理方法以及相关设备
CN115388931B (zh) * 2022-10-27 2023-02-03 河北省科学院应用数学研究所 传感器异常数据的可信监测方法、监测终端及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109242500A (zh) * 2018-09-20 2019-01-18 百度在线网络技术(北京)有限公司 区块链交易有效性验证方法、装置及存储介质
US20190213333A1 (en) * 2017-12-01 2019-07-11 Alan Health And Science D/B/A Onpaceplus Decentralized data authentication system for creation of integrated lifetime health records
CN110708170A (zh) * 2019-12-13 2020-01-17 腾讯科技(深圳)有限公司 一种数据处理方法、装置以及计算机可读存储介质
CN111242617A (zh) * 2020-01-02 2020-06-05 支付宝(杭州)信息技术有限公司 用于执行交易正确性验证的方法及装置
US20200328889A1 (en) * 2018-03-29 2020-10-15 NEC Laboratories Europe GmbH Method and system of preserving privacy for usage of lightweight blockchain clients
CN112085504A (zh) * 2020-11-16 2020-12-15 腾讯科技(深圳)有限公司 一种数据处理方法、装置、计算机设备及存储介质

Family Cites Families (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106372533B (zh) * 2016-09-14 2020-04-21 中国银联股份有限公司 基于区块链技术的内容存储方法
CN107079058B (zh) * 2016-12-23 2019-05-31 深圳前海达闼云端智能科技有限公司 区块链节点的业务执行方法、装置及节点设备
CN109214818B (zh) * 2017-06-30 2021-06-15 华为技术有限公司 一种跨链交易方法及装置
KR102417067B1 (ko) * 2017-12-08 2022-07-05 한국전자통신연구원 블록 체인 네트워크의 노드에서 수행되는 블록 생성 방법 및 장치
CN108200203B (zh) * 2018-02-06 2020-11-06 北京奇虎科技有限公司 基于双层网络的区块链系统
CN110166411B (zh) * 2018-02-13 2022-05-06 华为技术有限公司 一种数据传输方法、装置和网络节点
CN109345388B (zh) * 2018-09-20 2020-09-08 百度在线网络技术(北京)有限公司 区块链智能合约验证方法、装置及存储介质
CN109885615B (zh) * 2019-01-24 2020-09-22 华东师范大学 一种基于索引的面向区块链轻客户端的范围查询可验证查询方法
CN113874898A (zh) * 2019-02-15 2021-12-31 区块链控股有限公司 用于通过区块链网络实现转账的计算机实现的系统和方法
CN110287262A (zh) * 2019-06-28 2019-09-27 中国科学技术大学 有效保护用户隐私的比特币交易查询方法
SG11202001989WA (en) * 2019-07-11 2020-04-29 Alibaba Group Holding Ltd Shared blockchain data storage
CN110912707B (zh) * 2019-11-22 2021-09-10 腾讯科技(深圳)有限公司 基于区块链的数字证书处理方法、装置、设备及存储介质
CN110889729B (zh) * 2019-11-29 2024-03-26 腾讯科技(深圳)有限公司 一种基于区块链网络的数据验证方法和装置
CN111159293B (zh) * 2019-12-25 2023-06-20 杭州加密矩阵科技有限公司 一种基于轻节点技术的跨链信息验证方法
CN111209343B (zh) * 2020-01-22 2022-02-22 腾讯科技(深圳)有限公司 节点数据同步方法、装置、设备以及存储介质
CN111475575B (zh) * 2020-04-09 2021-08-10 腾讯科技(深圳)有限公司 基于区块链的数据同步方法、装置及计算机可读存储介质
CN111680031B (zh) * 2020-04-21 2021-10-15 华东师范大学 一种针对区块链轻客户端的基于sgx的可验证范围查询方法
CN111597567B (zh) * 2020-05-14 2022-03-04 腾讯科技(深圳)有限公司 数据处理方法、装置、节点设备及存储介质
CN111680049A (zh) * 2020-05-15 2020-09-18 杭州趣链科技有限公司 一种基于区块链的物联网数据的处理方法及其处理装置
CN111832079B (zh) * 2020-07-16 2024-01-30 湖南大学 Epc全球网络中一种基于区块链的查询结果完整性验证方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190213333A1 (en) * 2017-12-01 2019-07-11 Alan Health And Science D/B/A Onpaceplus Decentralized data authentication system for creation of integrated lifetime health records
US20200328889A1 (en) * 2018-03-29 2020-10-15 NEC Laboratories Europe GmbH Method and system of preserving privacy for usage of lightweight blockchain clients
CN109242500A (zh) * 2018-09-20 2019-01-18 百度在线网络技术(北京)有限公司 区块链交易有效性验证方法、装置及存储介质
CN110708170A (zh) * 2019-12-13 2020-01-17 腾讯科技(深圳)有限公司 一种数据处理方法、装置以及计算机可读存储介质
CN111242617A (zh) * 2020-01-02 2020-06-05 支付宝(杭州)信息技术有限公司 用于执行交易正确性验证的方法及装置
CN112085504A (zh) * 2020-11-16 2020-12-15 腾讯科技(深圳)有限公司 一种数据处理方法、装置、计算机设备及存储介质

Non-Patent Citations (1)

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

Also Published As

Publication number Publication date
CN112749969A (zh) 2021-05-04
EP4191498A4 (en) 2024-01-17
CN112749969B (zh) 2022-08-09
US20230089134A1 (en) 2023-03-23
EP4191498A1 (en) 2023-06-07
CN112085504A (zh) 2020-12-15
CN112085504B (zh) 2021-02-09

Similar Documents

Publication Publication Date Title
WO2022100679A1 (zh) 一种数据通信方法、装置、计算机设备及存储介质
TWI725655B (zh) 用於在可信執行環境中執行子邏輯代碼的程式執行和資料證明的方法、設備和系統
CN111737724B (zh) 一种数据处理方法、装置、智能设备及存储介质
CN109462587B (zh) 区块链分层共识方法、区块链网络系统及区块链节点
CN111556120B (zh) 基于区块链的数据处理方法、装置、存储介质及设备
AU2019204708B2 (en) Retrieving public data for blockchain networks using highly available trusted execution environments
WO2021179655A1 (zh) 跨区块链的数据迁移方法、装置、设备及存储介质
US11283627B2 (en) Method and apparatus for generating blockchain transaction
CN112926982B (zh) 一种交易数据处理方法、装置、设备及存储介质
US11153069B2 (en) Data authentication using a blockchain approach
WO2022193985A1 (zh) 一种数据处理方法、装置、设备及存储介质
CN112685505B (zh) 一种交易数据处理方法、装置、计算机设备及存储介质
US20230316273A1 (en) Data processing method and apparatus, computer device, and storage medium
CN110032545A (zh) 基于区块链的文件存储方法、系统及电子设备
US10693646B2 (en) Event execution using a blockchain approach
US20230037932A1 (en) Data processing method and apparatus based on blockchain network, and computer device
CN112152778B (zh) 一种节点管理方法、装置、及电子设备
CN113259130B (zh) 一种交易数据处理方法、装置、设备以及介质
CN109951490A (zh) 基于区块链的网页防篡改方法、系统及电子设备
CN113837760B (zh) 数据处理方法、装置、计算机设备以及存储介质
CN113255014B (zh) 一种基于区块链的数据处理方法以及相关设备
Srikanth et al. An efficient Key Agreement and Authentication Scheme (KAAS) with enhanced security control for IIoT systems
da Costa et al. Securing light clients in blockchain with DLCP
Benrebbouh et al. Enhanced secure and efficient mutual authentication protocol in iot-based energy internet using blockchain
Manoj Developing a Systematic Blockchain System for Security and Privacy Management in Iot

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

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2021891199

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2021891199

Country of ref document: EP

Effective date: 20230302

NENP Non-entry into the national phase

Ref country code: DE