WO2022001375A1 - 基于区块链的数据存储方法、系统和装置 - Google Patents

基于区块链的数据存储方法、系统和装置 Download PDF

Info

Publication number
WO2022001375A1
WO2022001375A1 PCT/CN2021/092931 CN2021092931W WO2022001375A1 WO 2022001375 A1 WO2022001375 A1 WO 2022001375A1 CN 2021092931 W CN2021092931 W CN 2021092931W WO 2022001375 A1 WO2022001375 A1 WO 2022001375A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
data
blockchain
data storage
transaction
Prior art date
Legal status (The legal status 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 status listed.)
Ceased
Application number
PCT/CN2021/092931
Other languages
English (en)
French (fr)
Inventor
栗鸿宇
申作军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Shangke Information Technology Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Shangke Information Technology Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
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 Beijing Jingdong Shangke Information Technology Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Shangke Information Technology Co Ltd
Priority to KR1020237001347A priority Critical patent/KR102699409B1/ko
Priority to US17/916,329 priority patent/US20230153811A1/en
Priority to EP21832030.7A priority patent/EP4174681A4/en
Priority to JP2022564810A priority patent/JP7420972B2/ja
Publication of WO2022001375A1 publication Critical patent/WO2022001375A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06Q—INFORMATION 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/00—Payment architectures, schemes or protocols
    • G06Q20/38—Payment protocols; Details thereof
    • G06Q20/40—Authorisation, 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/401—Transaction verification
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06F—ELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60—Protecting data
    • G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06F—ELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06F—ELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90—Details of database functions independent of the retrieved data types
    • G06F16/903—Querying
    • G06F16/90335—Query processing
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06F—ELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60—Protecting data
    • G06F21/62—Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218—Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06F—ELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70—Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/78—Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure storage of data
    • G06F21/80—Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure storage of data in storage media based on magnetic or optical technology, e.g. disks with sectors
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06F—ELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601—Interfaces specially adapted for storage systems
    • G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/062—Securing storage systems
    • G06F3/0623—Securing storage systems in relation to content
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06F—ELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601—Interfaces specially adapted for storage systems
    • G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638—Organizing or formatting or addressing of data
    • G06F3/064—Management of blocks
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06F—ELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601—Interfaces specially adapted for storage systems
    • G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655—Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0659—Command handling arrangements, e.g. command buffers, queues, command scheduling
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06F—ELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601—Interfaces specially adapted for storage systems
    • G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/067—Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06Q—INFORMATION 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
    • G06Q10/00—Administration; Management
    • G06Q10/04—Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06Q—INFORMATION 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
    • G06Q10/00—Administration; Management
    • G06Q10/06—Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063—Operations research, analysis or management
    • G06Q10/0631—Resource planning, allocation, distributing or scheduling for enterprises or organisations
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • H—ELECTRICITY
    • H04—ELECTRIC COMMUNICATION TECHNIQUE
    • H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00—Traffic control in data switching networks
    • H04L47/10—Flow control; Congestion control
    • H04L47/12—Avoiding congestion; Recovering from congestion
    • H04L47/125—Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
    • H—ELECTRICITY
    • H04—ELECTRIC COMMUNICATION TECHNIQUE
    • H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00—Network arrangements or protocols for supporting network services or applications
    • H04L67/01—Protocols
    • H04L67/10—Protocols in which an application is distributed across nodes in the network
    • H04L67/1097—Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • H—ELECTRICITY
    • H04—ELECTRIC COMMUNICATION TECHNIQUE
    • H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32—Cryptographic 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/3247—Cryptographic 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
    • H—ELECTRICITY
    • H04—ELECTRIC COMMUNICATION TECHNIQUE
    • H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06Q—INFORMATION 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
    • G06Q2220/00—Business processing using cryptography
    • H—ELECTRICITY
    • H04—ELECTRIC COMMUNICATION TECHNIQUE
    • H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00—Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/72—Signcrypting, i.e. digital signing and encrypting simultaneously

Definitions

  • the embodiments of the present application relate to the field of computer technology, in particular to the field of blockchain technology, and in particular to a method, system and device for data storage based on blockchain.
  • Blockchain is a decentralized chain-shaped data structure with the characteristics of non-tampering, scalability, and full synchronization. Because of the use of flood broadcasting to transmit transaction information, it can ensure that all network participants have access to all transaction data. Consistent view.
  • the present application provides a blockchain-based data storage method, system, apparatus, device, and storage medium.
  • a blockchain-based data storage method comprising: in response to receiving a matching result sent by a computing node, acquiring data to be stored of a requesting node, wherein the matching result is based on node information
  • the data storage request is obtained by balanced matching of resources, and the node information is obtained from the first blockchain based on the computing node; a transaction is initiated according to the to-be-stored data of the requesting node, and transaction data corresponding to the to-be-stored data of the requesting node is generated, wherein
  • the transaction data includes: metadata corresponding to the data to be stored by the requesting node; verifying the transaction according to the metadata; receiving the verification result sent by the requesting node; responding to the transaction verification passing and receiving the verification passing sent by the requesting node.
  • the transaction data is stored in a second blockchain that is constructed differently from the first blockchain.
  • the matching result is generated by a computing node
  • the generating process of the matching result includes: receiving a data storage request sent by any requesting node, parsing the data storage request to obtain the data to be stored of the requesting node and the requesting node corresponding to the data to be stored The amount of stored data; according to the amount of storage data of the requesting node, obtain the node information of other nodes from the first blockchain, where the other nodes are used to indicate that they have been registered in the computing node and the available disk capacity is not less than the storage data of the requesting node
  • the node information includes: the IP address of the node, the available disk capacity of the node and the total disk capacity of the node; according to the IP address of the node, the available disk capacity of the node and the total disk capacity of the node, the data balance storage model is used to The data storage request performs resource matching, generates matching results and forwards the matching results to the requesting node and other nodes.
  • the data balance storage model is used to characterize the uniform distribution of the disk usage of other nodes as the desired target.
  • the variance operation of the disk available capacity of other nodes, and the matching result is used to characterize that the requesting node matches one and only one of the other nodes.
  • the matching result is obtained by optimizing in the data balance storage model, and the optimization process of the matching result includes: generating the even graph and the edges in the even graph corresponding to the data storage request according to the data storage request and the node information of other nodes set; judge whether the current set of edges in the even graph satisfies the iterative stop condition, if not, based on the heuristic algorithm, iteratively optimize the optimal solution in the resource matching problem of the current data storage request, and obtain the optimized current
  • the matching result of the resource matching problem of the data storage request and delete all edges in the set of edges that correspond to the optimal solution in the resource matching problem of the current data storage request, and jump to the edge of the current even graph.
  • the iteration stop condition is: judging whether the set of edges in the even graph is is empty, the optimal solution is to choose the minimum value of the variance operation in each iteration.
  • the heuristic algorithm is constructed based on a genetic algorithm or a tabu search algorithm.
  • the method further includes: sending registration information to the computing node; and storing the node information in the first blockchain by initiating a transaction for a preset duration.
  • both the first blockchain and the second blockchain are public chains constructed based on the Bitcoin blockchain technology or the Ethereum blockchain technology.
  • a blockchain-based data storage system comprising: a service node, wherein the service node is configured to execute the above-mentioned blockchain-based data storage method.
  • the system further includes a requesting node; the requesting node is configured to send a data storage request to the computing node; receive the matching result sent by the computing node; use a consensus mechanism to verify the transaction according to the transaction data generated by the service node; In response to the verification passing, the verification passing result is sent to the service node.
  • the requesting node is further configured to send a query instruction to the second blockchain to obtain transaction data corresponding to the query instruction.
  • a blockchain-based data storage device comprising: an obtaining unit configured to obtain the data to be stored of the requesting node in response to receiving the matching result sent by the computing node, The matching result is obtained by performing a balanced matching of resources for the data storage request based on the node information, and the node information is obtained from the first blockchain based on the computing node; the transaction unit is configured to initiate a transaction according to the data to be stored in the requesting node, and generate a Transaction data corresponding to the data to be stored of the requesting node, wherein the transaction data includes: metadata corresponding to the data to be stored of the requesting node; a verification unit, configured to verify the transaction according to the metadata; a receiving unit, configured to receive The verification result sent by the requesting node; the first storage unit is configured to store the transaction data in the second blockchain in response to the transaction verification passing and receiving the verification passing result sent by the requesting node, wherein the second block The way the chain is built is different
  • the matching result in the obtaining unit is generated by the computing node using the following unit: a content parsing unit, configured to receive a data storage request sent by any requesting node, and parse the data storage request to obtain the data to be stored and the data of the requesting node.
  • a content parsing unit configured to receive a data storage request sent by any requesting node, and parse the data storage request to obtain the data to be stored and the data of the requesting node.
  • the node obtaining unit is configured to obtain node information of other nodes from the first blockchain according to the amount of stored data of the requesting node, wherein the other nodes are used to indicate the computing node A network node that has been registered in and whose available disk capacity is not less than the amount of data stored by the requesting node, the node information includes: the IP address of the node, the available disk capacity of the node, and the total disk capacity of the node; the resource matching unit is configured to The IP address, the available disk capacity of the node, and the total disk capacity of the node, use the data balance storage model to perform resource matching on data storage requests, generate matching results and forward the matching results to the requesting node and other nodes, where the data balance storage model is used for Characterize the variance calculation between the storage data volume of the requesting node and the available disk capacity of other nodes, taking the disk usage of other nodes to evenly distribute as the desired target, and the matching result is used to
  • the matching results in the obtaining unit are obtained by optimizing in a data balance storage model, and the matching results are optimized using the following modules: a generating module, configured to generate data with data according to data storage requests and node information of other nodes The even graph and the set of edges in the even graph corresponding to the storage request; the optimization module is configured to determine whether the current set of edges in the even graph satisfies the iteration stop condition, and if not, based on the heuristic algorithm, the current data storage request is The optimal solution in the resource matching problem is iteratively optimized, and the optimized matching result of the resource matching problem of the current data storage request is obtained, and the optimal solution in the resource matching problem of the current data storage request in the set of edges is deleted.
  • a generating module configured to generate data with data according to data storage requests and node information of other nodes The even graph and the set of edges in the even graph corresponding to the storage request
  • the optimization module is configured to determine whether the current set of edges in the even graph satisfies the iter
  • the iteration stopping condition is: judging whether the set of edges in the even graph is empty, and the optimal solution is to select the minimum value of the variance operation in each iteration.
  • the heuristic algorithm in the optimization module is constructed based on a genetic algorithm or a tabu search algorithm.
  • the apparatus further includes: a registration unit configured to send registration information to the computing node; a second storage unit configured to store the node information in the first blockchain by initiating a transaction for a preset duration .
  • both the first blockchain in the acquiring unit and the second blockchain in the first storage unit are public chains constructed based on the Bitcoin blockchain technology or the Ethereum blockchain technology.
  • an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor.
  • the at least one processor executes to enable the at least one processor to perform a method as described in any implementation of the first aspect.
  • the present application provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the method described in any implementation manner of the first aspect .
  • the technology according to the present application adopts the method of obtaining the data to be stored of the requesting node in response to receiving the matching result sent by the computing node, wherein the matching result is obtained by performing balanced matching of resources on the data storage request based on the node information, and the node information is based on the computing node from the first Obtained from a blockchain, initiate a transaction according to the data to be stored of the requesting node, generate transaction data corresponding to the data to be stored of the requesting node, verify the transaction according to the metadata, and receive the verification result sent by the requesting node, In response to the transaction verification passing and receiving the verification passing result sent by the requesting node, the transaction data is stored in the second blockchain, wherein the construction method of the second blockchain is different from that of the first blockchain.
  • a dual public chain security storage solution which avoids the problem of node information being leaked and tampered with in the prior art because it is stored in traditional databases, and solves the problem of unbalanced storage of each node in the blockchain, which leads to a large number of accesses Blocked, nodes unable to provide services normally, and issues that affect the security and stability of the blockchain network, improve the security of remote data storage in the blockchain network.
  • FIG. 1 is a schematic diagram of a first embodiment of a blockchain-based data storage method according to the present application
  • FIG. 2 is a scene diagram that can implement the blockchain-based data storage method according to the embodiment of the present application
  • FIG. 3 is a schematic diagram of a second embodiment of a blockchain-based data storage method according to the present application.
  • FIG. 4 is a schematic structural diagram of an embodiment of a blockchain-based data storage system according to the present application.
  • FIG. 5 is a schematic structural diagram of an embodiment of a blockchain-based data storage device according to the present application.
  • FIG. 6 is a block diagram of an electronic device used to implement the blockchain-based data storage method according to the embodiment of the present application.
  • FIG. 1 shows a schematic diagram 100 of a first embodiment of a blockchain-based data storage method according to the present application.
  • the blockchain-based data storage method includes the following steps:
  • Step 101 in response to receiving the matching result sent by the computing node, obtain the data to be stored of the requesting node.
  • the execution body eg, the node server of the blockchain
  • receives the matching result sent by the computing node it can obtain the data to be stored by the requesting node from other electronic devices or locally through a wired connection or a wireless connection.
  • a computing node can be represented as a node in the blockchain that neither initiates data storage requests nor provides storage services to other nodes, but is only responsible for the calculation and management of resource allocation.
  • the matching result may be obtained by performing balanced matching of resources on the data storage request of the requesting node based on the node information obtained by the computing node from the first blockchain.
  • the requesting node can be represented as a node that needs to borrow storage space from other nodes in the network, and needs to pay a certain service fee.
  • the executive body can be represented as a node server that has enough storage space in the network and is willing to provide storage services for other nodes.
  • the information that can be stored in the first blockchain includes: node ID, node IP address, node storage device type, node disk available capacity, node total capacity, and the like.
  • the above-mentioned wireless connection methods may include but are not limited to 3G, 4G, 5G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or developed in the future.
  • Step 102 Initiate a transaction according to the data to be stored by the requesting node, and generate transaction data corresponding to the data to be stored by the requesting node.
  • the execution body may initiate a transaction according to the data to be stored in the requesting node, and generate transaction data corresponding to the data to be stored in the requesting node.
  • the transaction data may include: metadata corresponding to the data to be stored of the requesting node.
  • Step 103 verifying the transaction according to the metadata.
  • the execution subject may perform encryption verification and signature on the transaction according to the metadata obtained in step 102 .
  • Step 104 Receive the verification passing result sent by the requesting node.
  • the execution body may receive the verification result sent by the requesting node.
  • Step 105 in response to the transaction being verified and receiving the verification result sent by the requesting node, the transaction data is stored in the second blockchain.
  • the transaction data is stored in the second blockchain, where the second blockchain is different from the first blockchain .
  • the information that the second blockchain can store includes: the metadata of the transaction file and the transaction details.
  • the metadata of the transaction file specifically includes the file name, copy coefficient, file data volume, storage location, file owner, etc.
  • the blockchain-based data storage method 200 of this embodiment runs in the electronic device 201 .
  • the electronic device 201 receives the matching result 203 sent by the computing node 202
  • the electronic device 201 first obtains the data to be stored 205 of the requesting node 204, and then the electronic device 201 initiates a transaction according to the data to be stored by the requesting node, and generates a pending data with the requesting node.
  • the transaction data corresponding to the stored data wherein the transaction data includes: metadata corresponding to the data to be stored by the requesting node, and then the electronic device 201 verifies the transaction according to the metadata and receives the verification result sent by the requesting node.
  • the transaction data is stored in the second blockchain.
  • the blockchain-based data storage method adopts the method of obtaining the data to be stored of the requesting node in response to receiving the matching result sent by the computing node, wherein the matching result balances the resources of the data storage request based on the node information
  • the node information is obtained from the first blockchain based on the computing node, initiates a transaction according to the data to be stored of the requesting node, generates transaction data corresponding to the data to be stored of the requesting node, and verifies the transaction according to the metadata, And receive the verification result sent by the requesting node, and in response to the transaction verification passing and receiving the verification passing result sent by the requesting node, store the transaction data in the second blockchain, where the construction of the second blockchain is different from
  • the construction method of the first blockchain proposes a dual public chain security storage scheme, which avoids the problem of leakage and tampering of node information in the existing technology due to storage in traditional databases, and solves the problem of storage in the blockchain.
  • FIG. 3 a schematic diagram 300 of a second embodiment of a blockchain-based data storage method is shown.
  • the flow of the method includes the following steps:
  • Step 301 Send registration information to a computing node.
  • the execution body may send registration information to the computing node as a node that provides data storage services to the outside.
  • Step 302 Store the node information in the first blockchain by initiating a transaction for a preset duration.
  • the execution body may store the node information in the first blockchain by initiating a transaction for a preset duration, as the information for providing the storage service.
  • the first blockchain may be a public chain constructed based on the Bitcoin blockchain technology or the Ethereum blockchain technology.
  • Step 303 in response to receiving the matching result sent by the computing node, obtain the data to be stored of the requesting node.
  • the execution body after receiving the matching result sent by the computing node, acquires the data to be stored of the requesting node.
  • the matching result is generated by the computing node, and the generating process of the matching result may include: receiving a data storage request sent by any requesting node, parsing the data storage request to obtain the data to be stored by the requesting node and the data to be stored by the requesting node and the data to be stored.
  • the node information of other nodes is obtained from the first blockchain, where other nodes are used to indicate that they have been registered in the computing node and the available disk capacity is not less than the storage of the requesting node
  • the network node with the amount of data, the node information includes: the IP address of the node, the available disk capacity of the node and the total disk capacity of the node; according to the IP address of the node, the available disk capacity of the node and the total disk capacity of the node, the data balance storage model is used Perform resource matching on data storage requests, generate matching results and forward the matching results to the requesting node and other nodes, where the data balance storage model is used to characterize the storage data volume of the requesting node with the evenly distributed disk usage of other nodes as the desired target A variance operation with the disk available capacity of other nodes, and the matching result is used to characterize that the requesting node matches one and only one of the other nodes.
  • the matching result is obtained by optimizing in the data balance storage model, and the optimization process of the matching result includes: generating a corresponding data storage request according to the data storage request and node information of other nodes. Even graph and the set of edges in the even graph; determine whether the current set of edges in the even graph satisfies the iteration stop condition, if not, based on the heuristic algorithm, iterate the optimal solution in the resource matching problem of the current data storage request Optimize, get the optimized matching result of the resource matching problem of the current data storage request, delete all edges in the set of edges that correspond to the optimal solution in the resource matching problem of the current data storage request, and jump to judgment Whether the current set of edges in the even graph satisfies the iteration stop condition; if so, the matching result of the resource matching problem of the current data storage request that satisfies the iteration stop condition is used as the matching result obtained by optimization; wherein, the iteration stop condition is: judgment Whether the set of edges
  • the balance problem of remote data storage can be understood as solving the minimum variance (ie fitness) of allocating m request nodes to n service nodes, so that 1 request node can be allocated to exactly 1 service node.
  • Nodes i.e. 1-to-1 relationships.
  • a weighted even graph G(U ⁇ V,E) is constructed, where U is the set of request nodes, V is the set of service nodes, and E is the set of edges in the even graph.
  • the right side of the weight w ij e ij denotes since assigned to v j u i u i resulting increase disk usage.
  • the agreed conditions include: ensure that each request node can be assigned to one service node, because m ⁇ n, there are some cases where some request nodes do not match the service node in the end, so each request node must be assigned to one service node And only assigned to 1 service node.
  • a heuristic algorithm is constructed based on a genetic algorithm or a tabu search algorithm to generate an optimal solution in the resource matching problem of the data storage request.
  • the self-defined genetic algorithm and the tabu search algorithm are used to solve the problem of storage balance and realize a variety of matching algorithms.
  • Step 304 Initiate a transaction according to the data to be stored of the requesting node, and generate transaction data corresponding to the data to be stored of the requesting node.
  • Step 305 verify the transaction according to the metadata.
  • Step 306 Receive the verification result sent by the requesting node.
  • Step 307 in response to the transaction being verified and receiving the verification result sent by the requesting node, the transaction data is stored in the second blockchain.
  • the transaction data is stored in the second blockchain.
  • the second blockchain may be a public chain constructed based on the Bitcoin blockchain technology or the Ethereum blockchain technology, and the construction method of the second blockchain is different from the construction method of the first blockchain.
  • steps 304 , 305 and 306 are basically the same as the operations of steps 102 , 103 and 104 in the embodiment shown in FIG. 1 , and details are not repeated here.
  • the schematic diagram 300 of the blockchain-based data storage method in this embodiment proposes a bitcoin blockchain and an ethereum blockchain
  • the dual public chain security storage solution based on blockchain can solve the problem of information asymmetry and realize cooperative trust and concerted action among multiple subjects.
  • the double-chain structure of the blockchain using the information blockchain/transaction blockchain can be processed separately, which can simplify the application structure, and adopt different hardware facilities according to the requirements of the chain to reduce costs.
  • the two chains can perform parallel operations, and the computing efficiency is greatly improved. It can not only maintain the advantages of the original definition of the blockchain, but also improve the transaction speed and scalability, reduce the delay, and increase the profit model, thereby attracting more users to participate in the blockchain, increasing the scale of the distributed architecture, and further Improve security.
  • the present application provides a blockchain-based data storage system.
  • the system includes: a service node 401 and a request node 402 , wherein the service node is used to execute the above-mentioned blockchain-based data storage system. data storage method.
  • the request node is used to send a data storage request to the computing node; receive the matching result sent by the computing node; use the consensus mechanism to verify the transaction according to the transaction data generated by the service node; in response to the verification pass, send the verification result to the service node. Node sends.
  • the requesting node is further configured to send a query instruction to the second blockchain to obtain transaction data corresponding to the query instruction.
  • the present application provides an embodiment of a data storage device based on blockchain, which is the same as the method embodiment shown in FIG. 1 .
  • the apparatus can be specifically applied to various electronic devices.
  • the blockchain-based data storage device 500 in this embodiment includes: an acquisition unit 501 , a transaction unit 502 , a verification unit 503 , a receiving unit 504 and a first storage unit 505 , wherein the acquisition unit is configured with
  • the acquisition unit is configured with
  • the matching result is obtained by performing a balanced matching of resources for the data storage request based on the node information, and the node information is based on the computing node from the first blockchain.
  • a transaction unit configured to initiate a transaction according to the data to be stored of the requesting node, and generate transaction data corresponding to the data to be stored of the requesting node, wherein the transaction data includes: metadata corresponding to the data to be stored of the requesting node; a verification unit , is configured to verify the transaction according to the metadata; the receiving unit is configured to receive the verification result sent by the requesting node; the first storage unit is configured to pass the verification in response to the transaction and receive the verification sent by the requesting node.
  • the transaction data is stored in the second blockchain, wherein the construction of the second blockchain is different from the construction of the first blockchain.
  • the specific processing of the acquisition unit 501 , the transaction unit 502 , the verification unit 503 , the receiving unit 504 and the first storage unit 505 of the blockchain-based data storage device 500 and the technical effects brought by them can be respectively Referring to the related descriptions of steps 101 to 105 in the embodiment corresponding to FIG. 1 , details are not repeated here.
  • the matching result in the obtaining unit is generated by the computing node using the following unit: a content parsing unit, configured to receive a data storage request sent by any requesting node, and parse the data storage request to obtain The data to be stored of the requesting node and the amount of stored data corresponding to the data to be stored by the requesting node; the node obtaining unit is configured to obtain node information of other nodes from the first blockchain according to the amount of stored data of the requesting node, among which other The node is used to indicate the network node that has been registered in the computing node and the available disk capacity is not less than the amount of data stored by the requesting node.
  • a content parsing unit configured to receive a data storage request sent by any requesting node, and parse the data storage request to obtain The data to be stored of the requesting node and the amount of stored data corresponding to the data to be stored by the requesting node
  • the node obtaining unit is configured to obtain node information of other nodes from the first blockchain
  • the node information includes: the IP address of the node, the available disk capacity of the node, and the total disk capacity of the node; resource matching unit , is configured to use the data balance storage model to perform resource matching on data storage requests according to the IP address of the node, the available disk capacity of the node and the total disk capacity of the node, generate a matching result and forward the matching result to the requesting node and other nodes,
  • the data balance storage model is used to characterize the variance calculation between the storage data volume of the requesting node and the available disk capacity of other nodes, taking the disk usage of other nodes evenly distributed as the desired target, and the matching result is used to characterize the requesting node and other nodes. One and only one node matches.
  • the matching result in the acquiring unit is obtained by optimizing in the data balance storage model, and the matching result is optimized by using the following modules: a generating module, configured to The node information of the even graph and the set of edges in the even graph corresponding to the data storage request are generated; the optimization module is configured to judge whether the current set of edges in the even graph satisfies the iteration stop condition, if not, based on the heuristic algorithm, Iteratively optimize the optimal solution in the resource matching problem of the current data storage request, obtain the optimized matching result of the resource matching problem of the current data storage request, and delete the resource matching the current data storage request in the set of edges Match all edges corresponding to the optimal solution in the problem, and jump to determine whether the current set of edges in the even graph satisfies the iteration stop condition;
  • the matching result is regarded as the matching result obtained by optimization; among them, the iteration stop condition is: judging whether the set of edges in the even graph is empty, and the optimal solution is to
  • the heuristic algorithm in the optimization module is constructed based on a genetic algorithm or a tabu search algorithm, so as to generate an optimal solution in the resource matching problem of the data storage request.
  • the apparatus further includes: a registration unit, configured to send registration information to the computing node; a second storage unit, configured to store the node information by initiating a transaction for a preset duration Deposit into the first blockchain.
  • the first blockchain in the acquisition unit and the second blockchain in the first storage unit are both based on the Bitcoin blockchain technology or the Ethereum blockchain technology
  • the public chain constructed, and the construction method of the second blockchain is different from the construction method of the first blockchain.
  • the present application further provides an electronic device and a readable storage medium.
  • FIG. 6 it is a block diagram of an electronic device according to the blockchain-based data storage method according to an embodiment of the present application.
  • Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers.
  • Electronic devices may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smart phones, wearable devices, and other similar computing devices.
  • the components shown herein, their connections and relationships, and their functions are by way of example only, and are not intended to limit implementations of the application described and/or claimed herein.
  • the electronic device includes: one or more processors 601, a memory 602, and interfaces for connecting various components, including a high-speed interface and a low-speed interface.
  • the various components are interconnected using different buses and may be mounted on a common motherboard or otherwise as desired.
  • the processor may process instructions executed within the electronic device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface.
  • multiple processors and/or multiple buses may be used with multiple memories and multiple memories, if desired.
  • multiple electronic devices may be connected, each providing some of the necessary operations (eg, as a server array, a group of blade servers, or a multiprocessor system).
  • a processor 601 is taken as an example in FIG. 6 .
  • the memory 602 is the non-transitory computer-readable storage medium provided by the present application.
  • the memory stores instructions executable by at least one processor, so that the at least one processor executes the blockchain-based data storage method provided by the present application.
  • the non-transitory computer-readable storage medium of the present application stores computer instructions, and the computer instructions are used to cause the computer to execute the blockchain-based data storage method provided by the present application.
  • the memory 602 as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs and modules, such as program instructions/ modules (for example, the acquisition unit 501, the transaction unit 502, the verification unit 503, the receiving unit 504, and the first storage unit 505 shown in FIG. 5).
  • the processor 601 executes various functional applications and data processing of the server by running the non-transitory software programs, instructions and modules stored in the memory 602, that is, implementing the blockchain-based data storage method in the above method embodiments.
  • the memory 602 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the blockchain-based data storage electronic device data etc. Additionally, memory 602 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 602 may optionally include memory located remotely relative to processor 601 that may be connected to the blockchain-based data storage electronics via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
  • the electronic device based on the blockchain data storage method may further include: an input device 603 and an output device 604 .
  • the processor 601 , the memory 602 , the input device 603 and the output device 604 may be connected by a bus or in other ways, and the connection by a bus is taken as an example in FIG. 6 .
  • the input device 603 can receive input numerical or character information, and generate key signal input related to user settings and function control of the blockchain-based data storage electronic device, such as a touch screen, keypad, mouse, trackpad, touchpad, An input device such as a pointing stick, one or more mouse buttons, trackball, joystick, etc.
  • Output devices 604 may include display devices, auxiliary lighting devices (eg, LEDs), haptic feedback devices (eg, vibration motors), and the like.
  • the display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display, and a plasma display. In some implementations, the display device may be a touch screen.
  • Various implementations of the systems and techniques described herein can be implemented in digital electronic circuitry, integrated circuit systems, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include being implemented in one or more computer programs executable and/or interpretable on a programmable system including at least one programmable processor that The processor, which may be a special purpose or general-purpose programmable processor, may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device an output device.
  • the processor which may be a special purpose or general-purpose programmable processor, may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device an output device.
  • machine-readable medium and “computer-readable medium” refer to any computer program product, apparatus, and/or apparatus for providing machine instructions and/or data to a programmable processor ( For example, magnetic disks, optical disks, memories, programmable logic devices (PLDs), including machine-readable media that receive machine instructions as machine-readable signals.
  • machine-readable signal refers to any signal used to provide machine instructions and/or data to a programmable processor.
  • the systems and techniques described herein may be implemented on a computer having a display device (eg, a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user ); and a keyboard and pointing device (eg, a mouse or trackball) through which a user can provide input to the computer.
  • a display device eg, a CRT (cathode ray tube) or LCD (liquid crystal display) monitor
  • a keyboard and pointing device eg, a mouse or trackball
  • Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (eg, visual feedback, auditory feedback, or tactile feedback); and can be in any form (including acoustic input, voice input, or tactile input) to receive input from the user.
  • the systems and techniques described herein may be implemented on a computing system that includes back-end components (eg, as a data server), or a computing system that includes middleware components (eg, an application server), or a computing system that includes front-end components (eg, a user's computer having a graphical user interface or web browser through which a user may interact with implementations of the systems and techniques described herein), or including such backend components, middleware components, Or any combination of front-end components in a computing system.
  • the components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: Local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
  • a computer system can include clients and servers.
  • Clients and servers are generally remote from each other and usually interact through a communication network.
  • the relationship of client and server arises by computer programs running on the respective computers and having a client-server relationship to each other.
  • a dual public chain security storage solution is proposed, which avoids the problem of leakage and tampering of node information in the prior art due to storage in traditional databases, and solves the problem of The storage situation of each node is unbalanced, which causes a large number of accesses to be blocked, the nodes cannot provide services normally, and the security and stability of the blockchain network are affected, which improves the security of remote data storage in the blockchain network.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • General Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computer Hardware Design (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Strategic Management (AREA)
  • Accounting & Taxation (AREA)
  • Economics (AREA)
  • Human Resources & Organizations (AREA)
  • Finance (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Business, Economics & Management (AREA)
  • Development Economics (AREA)
  • Marketing (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Computing Systems (AREA)
  • Technology Law (AREA)
  • Game Theory and Decision Science (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • Computational Linguistics (AREA)
  • Educational Administration (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请公开了基于区块链的数据存储方法、系统和装置,涉及区块链技术领域,具体实现方案为:响应于接收到计算节点发送的匹配结果,获取请求节点的待存储数据,其中所述匹配结果基于节点信息对数据存储请求进行资源的均衡匹配而得到,所述节点信息基于所述计算节点从第一区块链中获得;根据请求节点的待存储数据发起交易,生成与请求节点的待存储数据对应的交易数据;根据元数据,对交易进行验证;接收请求节点发送的验证通过的结果;响应于交易验证通过并接收到请求节点发送的验证通过的结果,将交易数据存入第二区块链。该方案提出了一种双公有链安全存储方案,提高了在区块链网络中进行远程数据存储的安全性。

Description

基于区块链的数据存储方法、系统和装置
本专利申请要求于2020年6月28日提交的、申请号为202010595040.0、申请人为北京沃东天骏信息技术有限公司及北京京东尚科信息技术有限公司、发明名称为“基于区块链的数据存储方法、系统和装置”的中国专利申请的优先权,该申请的全文以引用的方式并入本申请中。
技术领域
本申请的实施例涉及计算机技术领域,具体涉及区块链技术领域,尤其涉及基于区块链的数据存储方法、系统和装置。
背景技术
区块链是一种去中心化的链形数据结构,具有不可篡改、可扩展、全量同步的特点,因采用泛洪广播的方式传递交易信息,可以保证全网参与者对所有的交易数据具有一致的视图。
在现有的基于区块链网络实现远程数据存储的方案中,一些缺少本地存储空间的用户可以将其数据存储在能够提供足量存储空间的区块链节点中。但是,由于黑客的攻击,可能会泄漏或篡改存储节点的物理位置、磁盘空闲容量、IO流量等信息。
发明内容
本申请提供了一种基于区块链的数据存储方法、系统、装置、设备以及存储介质。
根据本申请的第一方面,提供了一种基于区块链的数据存储方法,该方法包括:响应于接收到计算节点发送的匹配结果,获取请求节点的待存储数据,其中匹配结果基于节点信息对数据存储请求进行资源的均衡匹配而得到,节点信息基于计算节点从第一区块链中获得;根据请求节点的待存储数据发起交易,生成与请求节点的待存储数据对应的交易数据,其中交易数据包括:与请求节点的待存储数据对应的元数据;根据元数据,对 交易进行验证;接收请求节点发送的验证通过的结果;响应于交易验证通过并接收到请求节点发送的验证通过的结果,将交易数据存入第二区块链,其中第二区块链的构建方式区别于第一区块链的构建方式。
在一些实施例中,匹配结果由计算节点生成,匹配结果的生成过程包括:接收任意请求节点发送的数据存储请求,解析数据存储请求以获得请求节点的待存储数据和请求节点与待存储数据对应的存储数据量;根据请求节点的存储数据量,从第一区块链中获取其他节点的节点信息,其中其他节点用于指示在计算节点中已注册并且磁盘可用容量不小于请求节点的存储数据量的网络节点,节点信息包括:节点的IP地址、节点的磁盘可用容量和节点的磁盘总容量;根据节点的IP地址、节点的磁盘可用容量和节点的磁盘总容量,利用数据均衡存储模型对数据存储请求进行资源匹配,生成匹配结果并将匹配结果转发至请求节点和其他节点,其中数据均衡存储模型用于表征将均匀分布其他节点的磁盘使用率作为期望目标进行请求节点的存储数据量与其他节点的磁盘可用容量的方差运算,匹配结果用于表征请求节点与其他节点中的一个且仅一个节点相匹配。
在一些实施例中,匹配结果通过在数据均衡存储模型中优化得到,匹配结果的优化过程包括:根据数据存储请求和其他节点的节点信息,生成与数据存储请求对应的偶图和偶图中边的集合;判断当前的偶图中边的集合是否满足迭代停止条件,若否,基于启发式算法,对当前的数据存储请求的资源匹配问题中的最优解进行迭代优化,得到优化后的当前的数据存储请求的资源匹配问题的匹配结果,并删除边的集合中与当前的数据存储请求的资源匹配问题中的最优解所对应的所有边,跳转至判断当前的偶图中边的集合是否满足迭代停止条件;若是,则将满足迭代停止条件的当前的数据存储请求的资源匹配问题的匹配结果作为优化得到的匹配结果;其中,迭代停止条件为:判断偶图中边的集合是否为空,最优解为在每次迭代中选择方差运算的最小值。
在一些实施例中,启发式算法基于遗传算法或禁忌搜索算法而构建。
在一些实施例中,方法还包括:向计算节点发送注册信息;按预设时长通过发起交易的方式将节点信息存入第一区块链。
在一些实施例中,第一区块链和第二区块链均为基于比特币区块链技术或以太坊区块链技术构建的公有链。
根据本申请的第二方面,提供了一种基于区块链的数据存储系统,系统包括:服务节点,其中,服务节点用于执行上述基于区块链的数据存储方法。
在一些实施例中,系统还包括请求节点;请求节点,用于向计算节点发送数据存储请求;接收计算节点发送的匹配结果;利用共识机制,根据服务节点生成的交易数据,对交易进行验证;响应于验证通过,将验证通过的结果向服务节点发送。
在一些实施例中,请求节点还用于向第二区块链发送查询指令,以得到与查询指令对应的交易数据。
根据本申请的第三方面,提供了一种基于区块链的数据存储装置,该装置包括:获取单元,被配置成响应于接收到计算节点发送的匹配结果,获取请求节点的待存储数据,其中匹配结果基于节点信息对数据存储请求进行资源的均衡匹配而得到,节点信息基于计算节点从第一区块链中获得;交易单元,被配置成根据请求节点的待存储数据发起交易,生成与请求节点的待存储数据对应的交易数据,其中交易数据包括:与请求节点的待存储数据对应的元数据;验证单元,被配置成根据元数据,对交易进行验证;接收单元,被配置成接收请求节点发送的验证通过的结果;第一存储单元,被配置成响应于交易验证通过并接收到请求节点发送的验证通过的结果,将交易数据存入第二区块链,其中第二区块链的构建方式区别于第一区块链的构建方式。
在一些实施例中,获取单元中的匹配结果由计算节点利用如下单元生成:内容解析单元,被配置成接收任意请求节点发送的数据存储请求,解析数据存储请求以获得请求节点的待存储数据和请求节点与待存储数据对应的存储数据量;节点获取单元,被配置成根据请求节点的存储数据量,从第一区块链中获取其他节点的节点信息,其中其他节点用于指示在计算节点中已注册并且磁盘可用容量不小于请求节点的存储数据量的网络节点,节点信息包括:节点的IP地址、节点的磁盘可用容量和节点的磁盘总容量;资源匹配单元,被配置成根据节点的IP地址、节点的磁盘可用容量 和节点的磁盘总容量,利用数据均衡存储模型对数据存储请求进行资源匹配,生成匹配结果并将匹配结果转发至请求节点和其他节点,其中数据均衡存储模型用于表征将均匀分布其他节点的磁盘使用率作为期望目标进行请求节点的存储数据量与其他节点的磁盘可用容量的方差运算,匹配结果用于表征请求节点与其他节点中的一个且仅一个节点相匹配。
在一些实施例中,获取单元中的匹配结果通过在数据均衡存储模型中优化得到,匹配结果利用如下模块进行优化:生成模块,被配置成根据数据存储请求和其他节点的节点信息,生成与数据存储请求对应的偶图和偶图中边的集合;优化模块,被配置成判断当前的偶图中边的集合是否满足迭代停止条件,若否,基于启发式算法,对当前的数据存储请求的资源匹配问题中的最优解进行迭代优化,得到优化后的当前的数据存储请求的资源匹配问题的匹配结果,并删除边的集合中与当前的数据存储请求的资源匹配问题中的最优解所对应的所有边,跳转至判断当前的偶图中边的集合是否满足迭代停止条件;若是,则将满足迭代停止条件的当前的数据存储请求的资源匹配问题的匹配结果作为优化得到的匹配结果;其中,迭代停止条件为:判断偶图中边的集合是否为空,最优解为在每次迭代中选择方差运算的最小值。
在一些实施例中,优化模块中的启发式算法基于遗传算法或禁忌搜索算法而构建。
在一些实施例中,装置还包括:注册单元,被配置成向计算节点发送注册信息;第二存储单元,被配置成按预设时长通过发起交易的方式将节点信息存入第一区块链。
在一些实施例中,获取单元中的第一区块链和第一存储单元中的第二区块链均为基于比特币区块链技术或以太坊区块链技术构建的公有链。
根据本申请的第四方面,提供了一种电子设备,包括:至少一个处理器;以及与至少一个处理器通信连接的存储器;其中,存储器存储有可被至少一个处理器执行的指令,指令被至少一个处理器执行,以使至少一个处理器能够执行如第一方面中任一实现方式描述的方法。
根据本申请的第五方面,本申请提供了一种存储有计算机指令的非瞬 时计算机可读存储介质,其特征在于,计算机指令用于使计算机执行如第一方面中任一实现方式描述的方法。
根据本申请的技术采用响应于接收到计算节点发送的匹配结果,获取请求节点的待存储数据,其中匹配结果基于节点信息对数据存储请求进行资源的均衡匹配而得到,节点信息基于计算节点从第一区块链中获得,根据请求节点的待存储数据发起交易,生成与请求节点的待存储数据对应的交易数据,根据元数据,对交易进行验证,并接收请求节点发送的验证通过的结果,响应于交易验证通过并接收到请求节点发送的验证通过的结果,将交易数据存入第二区块链,其中第二区块链的构建方式区别于第一区块链的构建方式,提出了一种双公有链安全存储方案,避免了现有技术中节点信息因存储在传统数据库中而遭到泄漏和篡改的问题,解决了因区块链中各个节点的存储情况不平衡,导致大量访问被阻塞,节点无法正常提供服务以及影响区块链网络的安全性和稳定性的问题,提高了在区块链网络中进行远程数据存储的安全性。
应当理解,本部分所描述的内容并非旨在标识本申请的实施例的关键或重要特征,也不用于限制本申请的范围。本申请的其它特征将通过以下的说明书而变得容易理解。
附图说明
附图用于更好地理解本方案,不构成对本申请的限定。
图1是根据本申请的基于区块链的数据存储方法的第一实施例的示意图;
图2是可以实现本申请实施例的基于区块链的数据存储方法的场景图;
图3是根据本申请的基于区块链的数据存储方法的第二实施例的示意图;
图4是根据本申请的基于区块链的数据存储系统的一个实施例的结构示意图;
图5是根据本申请的基于区块链的数据存储装置的一个实施例的结构示意图;
图6是用来实现本申请实施例的基于区块链的数据存储方法的电子设备的框图。
具体实施方式
以下结合附图对本申请的示范性实施例做出说明,其中包括本申请实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本申请的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本申请。
图1示出了根据本申请的基于区块链的数据存储方法的第一实施例的示意图100。该基于区块链的数据存储方法,包括以下步骤:
步骤101,响应于接收到计算节点发送的匹配结果,获取请求节点的待存储数据。
在本实施例中,当执行主体(例如区块链的节点服务器)接收到计算节点发送的匹配结果,可以通过有线连接方式或者无线连接方式从其他电子设备或者本地获取请求节点的待存储数据。计算节点可以表示为区块链中既不发起数据存储请求,也不向其他节点提供存储服务,仅负责进行资源分配的计算和管理的节点。匹配结果可以基于计算节点从第一区块链中获取的节点信息对请求节点的数据存储请求进行资源的均衡匹配而得到。请求节点可以表示为需要从网络中的其他节点中借用存储空间的节点,并需支付一定的服务报酬。执行主体可以表示为网络中拥有足够的存储空间,并愿意为其他节点提供存储服务的节点服务器。第一区块链中可以存储的信息包括:节点ID、节点IP地址、节点存储设备类型、节点磁盘可用容量、节点总容量等。上述无线连接方式可以包括但不限于3G、4G、5G连接、WiFi连接、蓝牙连接、WiMAX连接、Zigbee连接、UWB(ultra wideband)连接、以及其他现在已知或将来开发的无线连接方式。
步骤102,根据请求节点的待存储数据发起交易,生成与请求节点的待存储数据对应的交易数据。
在本实施例中,执行主体可以根据请求节点的待存储数据发起交易,生成与请求节点的待存储数据对应的交易数据。交易数据可以包括:与请求节点的待存储数据对应的元数据。
步骤103,根据元数据,对交易进行验证。
在本实施例中,执行主体可以根据步骤102中得到的元数据,对交易进行加密验证并签名。
步骤104,接收请求节点发送的验证通过的结果。
在本实施例中,执行主体可以接收请求节点发送的验证通过的结果。
步骤105,响应于交易验证通过并接收到请求节点发送的验证通过的结果,将交易数据存入第二区块链。
在本实施例中,当执行主体验证交易通过并接收到请求节点发送的验证通过的结果后,将交易数据存入第二区块链,其中第二区块链与第一区块链不相同。第二区块链可以存储的信息包括:交易文件的元数据及交易详情,交易文件的元数据具体包括文件名、副本系数、文件数据量、存储位置、文件所有者等。
需要说明的是,上述交易和交易验证是目前广泛研究和应用的区块链技术中的公知技术,在此不再赘述。
继续参见图2,本实施例的基于区块链的数据存储方法200运行于电子设备201中。当电子设备201接收到计算节点202发送的匹配结果203后,电子设备201首先获取请求节点204的待存储数据205,然后电子设备201根据请求节点的待存储数据发起交易,生成与请求节点的待存储数据对应的交易数据,其中交易数据包括:与请求节点的待存储数据对应的元数据,接着电子设备201根据元数据,对交易进行验证并接收请求节点发送的验证通过的结果,当电子设备201验证交易通过并接收到请求节点发送的验证通过的结果后,将交易数据存入第二区块链。
本申请的上述实施例提供的基于区块链的数据存储方法采用响应于接收到计算节点发送的匹配结果,获取请求节点的待存储数据,其中匹配结果基于节点信息对数据存储请求进行资源的均衡匹配而得到,节点信息基于计算节点从第一区块链中获得,根据请求节点的待存储数据发起交易,生成与请求节点的待存储数据对应的交易数据,根据元数据,对交易进行 验证,并接收请求节点发送的验证通过的结果,响应于交易验证通过并接收到请求节点发送的验证通过的结果,将交易数据存入第二区块链,其中第二区块链的构建方式区别于第一区块链的构建方式,提出了一种双公有链安全存储方案,避免了现有技术中节点信息因存储在传统数据库中而遭到泄漏和篡改的问题,解决了因区块链中各个节点的存储情况不平衡,导致大量访问被阻塞,节点无法正常提供服务以及影响区块链网络的安全性和稳定性的问题,提高了在区块链网络中进行远程数据存储的安全性。
进一步参考图3,其示出了基于区块链的数据存储方法的第二实施例的示意图300。该方法的流程包括以下步骤:
步骤301,向计算节点发送注册信息。
在本实施例中,执行主体可以向计算节点发送注册信息,作为向外部提供数据存储服务的节点。
步骤302,按预设时长通过发起交易的方式将节点信息存入第一区块链。
在本实施例中,执行主体可以按预设时长通过发起交易的方式将节点信息存入第一区块链,作为提供存储服务的信息所用。第一区块链可以为基于比特币区块链技术或以太坊区块链技术构建的公有链。
步骤303,响应于接收到计算节点发送的匹配结果,获取请求节点的待存储数据。
在本实施例中,当执行主体接收到计算节点发送的匹配结果后,获取请求节点的待存储数据。
在本实施例中,匹配结果由计算节点生成,匹配结果的生成过程可以包括:接收任意请求节点发送的数据存储请求,解析数据存储请求以获得请求节点的待存储数据和请求节点与待存储数据对应的存储数据量;根据请求节点的存储数据量,从第一区块链中获取其他节点的节点信息,其中其他节点用于指示在计算节点中已注册并且磁盘可用容量不小于请求节点的存储数据量的网络节点,节点信息包括:节点的IP地址、节点的磁盘可用容量和节点的磁盘总容量;根据节点的IP地址、节点的磁盘可用容量和节点的磁盘总容量,利用数据均衡存储模型对数据存储请求进行资源匹 配,生成匹配结果并将匹配结果转发至请求节点和其他节点,其中数据均衡存储模型用于表征将均匀分布其他节点的磁盘使用率作为期望目标进行请求节点的存储数据量与其他节点的磁盘可用容量的方差运算,匹配结果用于表征请求节点与其他节点中的一个且仅一个节点相匹配。
在本实施例的一些可选的实现方式中,匹配结果通过在数据均衡存储模型中优化得到,匹配结果的优化过程包括:根据数据存储请求和其他节点的节点信息,生成与数据存储请求对应的偶图和偶图中边的集合;判断当前的偶图中边的集合是否满足迭代停止条件,若否,基于启发式算法,对当前的数据存储请求的资源匹配问题中的最优解进行迭代优化,得到优化后的当前的数据存储请求的资源匹配问题的匹配结果,并删除边的集合中与当前的数据存储请求的资源匹配问题中的最优解所对应的所有边,跳转至判断当前的偶图中边的集合是否满足迭代停止条件;若是,则将满足迭代停止条件的当前的数据存储请求的资源匹配问题的匹配结果作为优化得到的匹配结果;其中,迭代停止条件为:判断偶图中边的集合是否为空,最优解为在每次迭代中选择方差运算的最小值。利用偶图中边的权重表示导致其他节点的磁盘使用率上升的方式,提出了一种高效的启发式匹配算法,解决远程分布式数据存储不均衡的问题,实现了大规模数据可以在无资源调度节点的去中心化网络中均衡存储。
进一步举例说明,可以将远程数据存储的均衡性问题理解为是求解出将m个请求节点分配给n个服务节点的最小方差(即适应度),使得1个请求节点能够恰好分配给1个服务节点(即1对1的关系)。构造了一个加权偶图G(U∪V,E),其中U为请求节点的集合,V为服务节点的集合,E为偶图中边的集合。令U的大小为m,V的大小为n,u i表示集合U的第i个节点,i∈{1,2,…,m},v j表示集合V的第j个节点,j∈{1,2,…,n},边e ij表示请求节点u i将数据存储在服务节点v j中,且e ij∈E,e ij=(u i,v j)。在方案中,G是一个完全偶图。在不失一般性的前提下,我们假设m<n,并且u i待存储数据的存储数据量总是小于v j的磁盘可用容量。
这里使用边e ij的权重w ij表示由于将u i分配给v j而导致u i上升的磁盘使用率。令P={p j}表示V中节点的磁盘使用率集合,其中p j表示v j的磁 盘使用率。令X={x ij}表示最终的匹配结果集,其中x ij使用二进制表示,x ij=1表示u i分配至v j,x ij=0表示其他情况。
计算方差值的公式为:
Figure PCTCN2021092931-appb-000001
优化目标是找到X={x ij},使得P={p j}可以均匀分布。其中约定条件包括:确保每一个请求节点都可以分配到1个服务节点,因为m<n,存在某些请求节点最终没有匹配到服务节点的情况,所以需要每个请求节点都必须分配到1个且仅分配到1个服务节点。
在本实施例的一些可选的实现方式中,启发式算法基于遗传算法或禁忌搜索算法而构建,以生成数据存储请求的资源匹配问题中的最优解。在启发式算法上采用自定义遗传算法和禁忌搜索算法来解决存储均衡问题,实现多种匹配算法。
步骤304,根据请求节点的待存储数据发起交易,生成与请求节点的待存储数据对应的交易数据。
步骤305,根据元数据,对交易进行验证。
步骤306,接收请求节点发送的验证通过的结果。
步骤307,响应于交易验证通过并接收到请求节点发送的验证通过的结果,将交易数据存入第二区块链。
在本实施例中,当执行主体验证交易通过并接收到请求节点发送的验证通过的结果后,将交易数据存入第二区块链。第二区块链可以为基于比特币区块链技术或以太坊区块链技术构建的公有链,且第二区块链的构建方式区别于第一区块链的构建方式。
在本实施例中,步骤304、305和306的具体操作与图1所示的实施例中的步骤102、103和104的操作基本相同,在此不再赘述。
从图3中可以看出,与图1对应的实施例相比,本实施例中的基于区块链的数据存储方法的示意图300提出了一种基于比特币区块链和以太坊区块链的双公有链安全存储方案,基于区块链能够解决信息不对称问题, 实现多个主体之间的协作信任与一致行动。采用信息区块链/交易区块链的区块链的双链式结构,分开处理,可以简化应用结构,并根据链的要求采用不同的硬件设施,降低成本。两条链可以进行并行运算,运算效率得到大大提高。既可以保持原始定义区块链的优势特点,又可以提高交易速度和可扩展性,降低延迟,增加盈利模式,从而吸引更多用户参与到区块链中,增大分布式架构的规模,进一步提高安全性。
进一步参考图4,本申请提供了一种基于区块链的数据存储系统,如图4所示,该系统包括:服务节点401和请求节点402,其中,服务节点用于执行上述基于区块链的数据存储方法。请求节点,用于向计算节点发送数据存储请求;接收计算节点发送的匹配结果;利用共识机制,根据服务节点生成的交易数据,对交易进行验证;响应于验证通过,将验证通过的结果向服务节点发送。
在系统中,请求节点还用于向第二区块链发送查询指令,以得到与查询指令对应的交易数据。
进一步参考图5,作为对上述图1~3所示方法的实现,本申请提供了一种基于区块链的数据存储装置的一个实施例,该装置实施例与图1所示的方法实施例相对应,该装置具体可以应用于各种电子设备中。
如图5所示,本实施例的基于区块链的数据存储装置500包括:获取单元501、交易单元502、验证单元503、接收单元504和第一存储单元505,其中,获取单元,被配置成响应于接收到计算节点发送的匹配结果,获取请求节点的待存储数据,其中匹配结果基于节点信息对数据存储请求进行资源的均衡匹配而得到,节点信息基于计算节点从第一区块链中获得;交易单元,被配置成根据请求节点的待存储数据发起交易,生成与请求节点的待存储数据对应的交易数据,其中交易数据包括:与请求节点的待存储数据对应的元数据;验证单元,被配置成根据元数据,对交易进行验证;接收单元,被配置成接收请求节点发送的验证通过的结果;第一存储单元,被配置成响应于交易验证通过并接收到请求节点发送的验证通过的结果,将交易数据存入第二区块链,其中第二区块链的构建方式区别于第一区块链的构建方式。
在本实施例中,基于区块链的数据存储装置500的获取单元501、交易单元502、验证单元503、接收单元504和第一存储单元505的具体处理及其所带来的技术效果可分别参考图1对应的实施例中的步骤101到步骤105的相关说明,在此不再赘述。
在本实施例的一些可选的实现方式中,获取单元中的匹配结果由计算节点利用如下单元生成:内容解析单元,被配置成接收任意请求节点发送的数据存储请求,解析数据存储请求以获得请求节点的待存储数据和请求节点与待存储数据对应的存储数据量;节点获取单元,被配置成根据请求节点的存储数据量,从第一区块链中获取其他节点的节点信息,其中其他节点用于指示在计算节点中已注册并且磁盘可用容量不小于请求节点的存储数据量的网络节点,节点信息包括:节点的IP地址、节点的磁盘可用容量和节点的磁盘总容量;资源匹配单元,被配置成根据节点的IP地址、节点的磁盘可用容量和节点的磁盘总容量,利用数据均衡存储模型对数据存储请求进行资源匹配,生成匹配结果并将匹配结果转发至请求节点和其他节点,其中数据均衡存储模型用于表征将均匀分布其他节点的磁盘使用率作为期望目标进行请求节点的存储数据量与其他节点的磁盘可用容量的方差运算,匹配结果用于表征请求节点与其他节点中的一个且仅一个节点相匹配。
在本实施例的一些可选的实现方式中,获取单元中的匹配结果通过在数据均衡存储模型中优化得到,匹配结果利用如下模块进行优化:生成模块,被配置成根据数据存储请求和其他节点的节点信息,生成与数据存储请求对应的偶图和偶图中边的集合;优化模块,被配置成判断当前的偶图中边的集合是否满足迭代停止条件,若否,基于启发式算法,对当前的数据存储请求的资源匹配问题中的最优解进行迭代优化,得到优化后的当前的数据存储请求的资源匹配问题的匹配结果,并删除边的集合中与当前的数据存储请求的资源匹配问题中的最优解所对应的所有边,跳转至判断当前的偶图中边的集合是否满足迭代停止条件;若是,则将满足迭代停止条件的当前的数据存储请求的资源匹配问题的匹配结果作为优化得到的匹配结果;其中,迭代停止条件为:判断偶图中边的集合是否为空,最优解 为在每次迭代中选择方差运算的最小值。
在本实施例的一些可选的实现方式中,优化模块中的启发式算法基于遗传算法或禁忌搜索算法而构建,以生成数据存储请求的资源匹配问题中的最优解。
在本实施例的一些可选的实现方式中,装置还包括:注册单元,被配置成向计算节点发送注册信息;第二存储单元,被配置成按预设时长通过发起交易的方式将节点信息存入第一区块链。
在本实施例的一些可选的实现方式中,获取单元中的第一区块链和第一存储单元中的第二区块链均为基于比特币区块链技术或以太坊区块链技术构建的公有链,且第二区块链的构建方式区别于第一区块链的构建方式。
根据本申请的实施例,本申请还提供了一种电子设备和一种可读存储介质。
如图6所示,是根据本申请实施例的基于区块链的数据存储方法的电子设备的框图。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本申请的实现。
如图6所示,该电子设备包括:一个或多个处理器601、存储器602,以及用于连接各部件的接口,包括高速接口和低速接口。各个部件利用不同的总线互相连接,并且可以被安装在公共主板上或者根据需要以其它方式安装。处理器可以对在电子设备内执行的指令进行处理,包括存储在存储器中或者存储器上以在外部输入/输出装置(诸如,耦合至接口的显示设备)上显示GUI的图形信息的指令。在其它实施方式中,若需要,可以将多个处理器和/或多条总线与多个存储器和多个存储器一起使用。同样,可以连接多个电子设备,各个设备提供部分必要的操作(例如,作为服务器阵列、一组刀片式服务器、或者多处理器系统)。图6中以一个处理器601为例。
存储器602即为本申请所提供的非瞬时计算机可读存储介质。其中,存储器存储有可由至少一个处理器执行的指令,以使至少一个处理器执行本申请所提供的基于区块链的数据存储方法。本申请的非瞬时计算机可读存储介质存储计算机指令,该计算机指令用于使计算机执行本申请所提供的基于区块链的数据存储方法。
存储器602作为一种非瞬时计算机可读存储介质,可用于存储非瞬时软件程序、非瞬时计算机可执行程序以及模块,如本申请实施例中的基于区块链的数据存储方法对应的程序指令/模块(例如,附图5所示的获取单元501、交易单元502、验证单元503、接收单元504和第一存储单元505)。处理器601通过运行存储在存储器602中的非瞬时软件程序、指令以及模块,从而执行服务器的各种功能应用以及数据处理,即实现上述方法实施例中的基于区块链的数据存储方法。
存储器602可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据基于区块链的数据存储电子设备的使用所创建的数据等。此外,存储器602可以包括高速随机存取存储器,还可以包括非瞬时存储器,例如至少一个磁盘存储器件、闪存器件、或其他非瞬时固态存储器件。在一些实施例中,存储器602可选包括相对于处理器601远程设置的存储器,这些远程存储器可以通过网络连接至基于区块链的数据存储电子设备。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
基于区块链的数据存储方法的电子设备还可以包括:输入装置603和输出装置604。处理器601、存储器602、输入装置603和输出装置604可以通过总线或者其他方式连接,图6中以通过总线连接为例。
输入装置603可接收输入的数字或字符信息,以及产生与基于区块链的数据存储电子设备的用户设置以及功能控制有关的键信号输入,例如触摸屏、小键盘、鼠标、轨迹板、触摸板、指示杆、一个或者多个鼠标按钮、轨迹球、操纵杆等输入装置。输出装置604可以包括显示设备、辅助照明装置(例如,LED)和触觉反馈装置(例如,振动电机)等。该显示设备可以包括但不限于,液晶显示器(LCD)、发光二极管(LED)显示器和等离子体显示器。在一些实施方式中,显示设备可以是触摸屏。
此处描述的系统和技术的各种实施方式可以在数字电子电路系统、集成电路系统、专用ASIC(专用集成电路)、计算机硬件、固件、软件、和/或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和/或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。
这些计算程序(也称作程序、软件、软件应用、或者代码)包括可编程处理器的机器指令,并且可以利用高级过程和/或面向对象的编程语言、和/或汇编/机器语言来实施这些计算程序。如本文使用的,术语“机器可读介质”和“计算机可读介质”指的是用于将机器指令和/或数据提供给可编程处理器的任何计算机程序产品、设备、和/或装置(例如,磁盘、光盘、存储器、可编程逻辑装置(PLD)),包括,接收作为机器可读信号的机器指令的机器可读介质。术语“机器可读信号”指的是用于将机器指令和/或数据提供给可编程处理器的任何信号。
为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。
可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质 的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)和互联网。
计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。
根据本申请实施例的技术方案,提出了一种双公有链安全存储方案,避免了现有技术中节点信息因存储在传统数据库中而遭到泄漏和篡改的问题,解决了因区块链中各个节点的存储情况不平衡,导致大量访问被阻塞,节点无法正常提供服务以及影响区块链网络的安全性和稳定性的问题,提高了在区块链网络中进行远程数据存储的安全性。
应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本申请中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本申请公开的技术方案所期望的结果,本文在此不进行限制。
上述具体实施方式,并不构成对本申请保护范围的限制。本领域技术人员应该明白的是,根据设计要求和其他因素,可以进行各种修改、组合、子组合和替代。任何在本申请的精神和原则之内所作的修改、等同替换和改进等,均应包含在本申请保护范围之内。

Claims (15)

  1. 一种基于区块链的数据存储方法,所述方法包括:
    响应于接收到计算节点发送的匹配结果,获取请求节点的待存储数据,其中所述匹配结果基于节点信息对数据存储请求进行资源的均衡匹配而得到,所述节点信息基于所述计算节点从第一区块链中获得;
    根据所述请求节点的待存储数据发起交易,生成与所述请求节点的待存储数据对应的交易数据,其中所述交易数据包括:与所述请求节点的待存储数据对应的元数据;
    根据所述元数据,对所述交易进行验证;
    接收所述请求节点发送的验证通过的结果;
    响应于所述交易验证通过并接收到所述请求节点发送的验证通过的结果,将所述交易数据存入第二区块链,其中所述第二区块链的构建方式区别于所述第一区块链的构建方式。
  2. 根据权利要求1所述的方法,其中,所述匹配结果由所述计算节点生成,所述匹配结果的生成过程包括:
    接收任意请求节点发送的数据存储请求,解析所述数据存储请求以获得请求节点的待存储数据和所述请求节点与待存储数据对应的存储数据量;
    根据所述请求节点的存储数据量,从所述第一区块链中获取其他节点的节点信息,其中所述其他节点用于指示在所述计算节点中已注册并且磁盘可用容量不小于所述请求节点的存储数据量的网络节点,所述节点信息包括:所述节点的IP地址、所述节点的磁盘可用容量和所述节点的磁盘总容量;
    根据所述节点的IP地址、所述节点的磁盘可用容量和所述节点的磁盘总容量,利用数据均衡存储模型对所述数据存储请求进行资源匹配,生成匹配结果并将所述匹配结果转发至所述请求节点和所述其他节点,其中所述数据均衡存储模型用于表征将均匀分布所述 其他节点的磁盘使用率作为期望目标进行所述请求节点的存储数据量与所述其他节点的磁盘可用容量的方差运算,所述匹配结果用于表征所述请求节点与其他节点中的一个且仅一个节点相匹配。
  3. 根据权利要求2所述的方法,其中,所述匹配结果通过在数据均衡存储模型中优化得到,所述匹配结果的优化过程包括:
    根据所述数据存储请求和所述其他节点的节点信息,生成与所述数据存储请求对应的偶图和所述偶图中边的集合;
    判断当前的所述偶图中边的集合是否满足迭代停止条件,若否,基于启发式算法,对当前的所述数据存储请求的资源匹配问题中的最优解进行迭代优化,得到优化后的当前的所述数据存储请求的资源匹配问题的匹配结果,并删除所述边的集合中与当前的所述数据存储请求的资源匹配问题中的最优解所对应的所有边,跳转至所述判断当前的所述偶图中边的集合是否满足迭代停止条件;若是,则将满足迭代停止条件的当前的所述数据存储请求的资源匹配问题的匹配结果作为优化得到的匹配结果;
    其中,所述迭代停止条件为:判断所述偶图中边的集合是否为空,所述最优解为在每次迭代中选择所述方差运算的最小值。
  4. 根据权利要求3所述的方法,其中,所述启发式算法基于遗传算法或禁忌搜索算法而构建。
  5. 根据权利要求1所述的方法,还包括:
    向所述计算节点发送注册信息;按预设时长通过发起交易的方式将节点信息存入所述第一区块链。
  6. 根据权利要求1所述的方法,其中,所述第一区块链和所述第二区块链均为基于比特币区块链技术或以太坊区块链技术构建的公有链。
  7. 一种基于区块链的数据存储系统,所述系统包括:服务节点,其中,所述服务节点用于执行如权利要求1-6任意一项的基于区块链的数据存储方法。
  8. 根据权利要求7所述的系统,其中,所述系统还包括请求节点;
    所述请求节点,用于向所述计算节点发送数据存储请求;接收所述计算节点发送的匹配结果;利用共识机制,根据所述服务节点生成的交易数据,对所述交易进行验证;响应于验证通过,将所述验证通过的结果向所述服务节点发送。
  9. 根据权利要求7所述的系统,其中,所述请求节点还用于向所述第二区块链发送查询指令,以得到与查询指令对应的交易数据。
  10. 一种基于区块链的数据存储装置,所述装置包括:
    获取单元,被配置成响应于接收到计算节点发送的匹配结果,获取请求节点的待存储数据,其中所述匹配结果基于节点信息对数据存储请求进行资源的均衡匹配而得到,所述节点信息基于所述计算节点从第一区块链中获得;
    交易单元,被配置成根据所述请求节点的待存储数据发起交易,生成与所述请求节点的待存储数据对应的交易数据,其中所述交易数据包括:与所述请求节点的待存储数据对应的元数据;
    验证单元,被配置成根据所述元数据,对所述交易进行验证;
    接收单元,被配置成接收所述请求节点发送的验证通过的结果;
    第一存储单元,被配置成响应于所述交易验证通过并接收到所述请求节点发送的验证通过的结果,将所述交易数据存入第二区块链,其中所述第二区块链的构建方式区别于所述第一区块链的构建方式。
  11. 根据权利要求10所述的装置,其中,所述获取单元中的所述 匹配结果由所述计算节点生成,所述匹配结果的生成过程包括:
    内容解析单元,被配置成接收任意请求节点发送的数据存储请求,解析所述数据存储请求以获得请求节点的待存储数据和所述请求节点与待存储数据对应的存储数据量;
    节点获取单元,被配置成根据所述请求节点的存储数据量,从所述第一区块链中获取其他节点的节点信息,其中所述其他节点用于指示在所述计算节点中已注册并且磁盘可用容量不小于所述请求节点的存储数据量的网络节点,所述节点信息包括:所述节点的IP地址、所述节点的磁盘可用容量和所述节点的磁盘总容量;
    资源匹配单元,被配置成根据所述节点的IP地址、所述节点的磁盘可用容量和所述节点的磁盘总容量,利用数据均衡存储模型对所述数据存储请求进行资源匹配,生成匹配结果并将所述匹配结果转发至所述请求节点和所述其他节点,其中所述数据均衡存储模型用于表征将均匀分布所述其他节点的磁盘使用率作为期望目标进行所述请求节点的存储数据量与所述其他节点的磁盘可用容量的方差运算,所述匹配结果用于表征所述请求节点与其他节点中的一个且仅一个节点相匹配。
  12. 根据权利要求11所述的装置,其中,所述获取单元中的所述匹配结果通过在数据均衡存储模型中优化得到,所述匹配结果利用如下模块进行优化:
    生成模块,被配置成根据所述数据存储请求和所述其他节点的节点信息,生成与所述数据存储请求对应的偶图和所述偶图中边的集合;
    优化模块,被配置成判断当前的所述偶图中边的集合是否满足迭代停止条件,若否,基于启发式算法,对当前的所述数据存储请求的资源匹配问题中的最优解进行迭代优化,得到优化后的当前的所述数据存储请求的资源匹配问题的匹配结果,并删除所述边的集合中与当前的所述数据存储请求的资源匹配问题中的最优解所对应的所有边,跳转至所述判断当前的所述偶图中边的集合是否满足迭 代停止条件;若是,则将满足迭代停止条件的当前的所述数据存储请求的资源匹配问题的匹配结果作为优化得到的匹配结果;其中,所述迭代停止条件为:判断所述偶图中边的集合是否为空,所述最优解为在每次迭代中选择所述方差运算的最小值。
  13. 根据权利要求10所述的装置,还包括:
    注册单元,被配置成向所述计算节点发送注册信息;
    第二存储单元,被配置成按预设时长通过发起交易的方式将节点信息存入所述第一区块链。
  14. 一种电子设备,其特征在于,包括:
    至少一个处理器;以及
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行权利要求1-6中任一项所述的方法。
  15. 一种存储有计算机指令的非瞬时计算机可读存储介质,其特征在于,所述计算机指令用于使所述计算机执行权利要求1-6中任一项所述的方法。
PCT/CN2021/092931 2020-06-28 2021-05-11 基于区块链的数据存储方法、系统和装置 Ceased WO2022001375A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
KR1020237001347A KR102699409B1 (ko) 2020-06-28 2021-05-11 블록체인 기반 데이터 저장 방법, 시스템 및 장치
US17/916,329 US20230153811A1 (en) 2020-06-28 2021-05-11 Blockchain-based data storage method, system and apparatus
EP21832030.7A EP4174681A4 (en) 2020-06-28 2021-05-11 METHOD, SYSTEM AND DEVICE FOR BLOCKCHAIN-BASED DATA STORAGE
JP2022564810A JP7420972B2 (ja) 2020-06-28 2021-05-11 ブロックチェーンベースのデータを記憶するための方法、システム及び装置

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010595040.0 2020-06-28
CN202010595040.0A CN111866085B (zh) 2020-06-28 2020-06-28 基于区块链的数据存储方法、系统和装置

Publications (1)

Publication Number Publication Date
WO2022001375A1 true WO2022001375A1 (zh) 2022-01-06

Family

ID=72989331

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/092931 Ceased WO2022001375A1 (zh) 2020-06-28 2021-05-11 基于区块链的数据存储方法、系统和装置

Country Status (6)

Country Link
US (1) US20230153811A1 (zh)
EP (1) EP4174681A4 (zh)
JP (1) JP7420972B2 (zh)
KR (1) KR102699409B1 (zh)
CN (1) CN111866085B (zh)
WO (1) WO2022001375A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115118727A (zh) * 2022-08-26 2022-09-27 北京数牍科技有限公司 分布式计算架构的数据传输方法、装置、设备及存储介质
CN115396122A (zh) * 2022-10-27 2022-11-25 聚梦创新(北京)软件技术有限公司 消息处理方法、装置、电子设备及存储介质
CN116257588A (zh) * 2023-02-27 2023-06-13 西安电子科技大学广州研究院 一种面向工业物联网的区块链交易存储分配方法
US12099522B2 (en) 2022-01-27 2024-09-24 Shanghai Tree-Graph Blockchain Institute Method and system for reducing storage overhead of blockchain nodes, and storage medium

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111694502B (zh) * 2019-03-14 2023-05-30 北京沃东天骏信息技术有限公司 区块链数据存储方法、装置、设备及存储介质
CN112308915B (zh) 2020-03-30 2025-02-25 北京沃东天骏信息技术有限公司 用于定位快递包裹的方法和装置
CN111866085B (zh) * 2020-06-28 2021-12-14 北京沃东天骏信息技术有限公司 基于区块链的数据存储方法、系统和装置
CN113761102B (zh) * 2020-11-18 2024-07-16 北京沃东天骏信息技术有限公司 数据处理方法、装置、服务器、系统和存储介质
CN113296707A (zh) * 2021-05-31 2021-08-24 尧领有限公司 磁盘存储方法及系统、区块链节点、计算机可读存储介质
CN113254180B (zh) * 2021-06-03 2023-10-10 杭州海康威视数字技术股份有限公司 一种数据匹配方法、装置、电子设备及存储介质
CN113934374B (zh) * 2021-09-28 2024-12-03 北京理工大学 一种基于遗传算法的区块链多副本分配和存储方法
US12174870B2 (en) * 2023-02-09 2024-12-24 Ramp Business Corporation Documentation record retrieval and transaction matching
CN116226138B (zh) * 2023-05-08 2023-07-25 湖南三湘银行股份有限公司 一种基于区块链的信息漏洞处理方法及装置
CN116403671B (zh) * 2023-06-08 2023-09-22 武汉大学人民医院(湖北省人民医院) 一种应用于医疗场景下的数据风险识别方法
US12706859B1 (en) * 2024-02-06 2026-08-11 Citibank, N.A. Encrypted autonomous agent execution using cross-verification methods in distributed systems
CN118611858B (zh) * 2024-08-08 2024-10-29 湖北省楚天云有限公司 基于区块链的供应链信息数据安全共享方法及系统
CN119512473B (zh) * 2025-01-20 2025-04-01 湖南础润科技有限公司 一种基于区块链的贸易平台数据可信存储方法及系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108696594A (zh) * 2018-05-27 2018-10-23 佛山市虚拟现实大数据产业研究院有限公司 一种市场监管区块链的大数据传输负载均衡方法及装置
US20180359089A1 (en) * 2017-06-07 2018-12-13 At&T Intellectual Property I, L.P. Blockchain-based social media history maps
CN110263047A (zh) * 2019-06-28 2019-09-20 深圳前海微众银行股份有限公司 一种数据中心节点分配方法、装置、系统及计算机设备
CN111866085A (zh) * 2020-06-28 2020-10-30 北京沃东天骏信息技术有限公司 基于区块链的数据存储方法、系统和装置

Family Cites Families (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006227928A (ja) * 2005-02-17 2006-08-31 Yamaha Corp 記憶領域貸借システム、サーバ装置およびプログラム
US20170091726A1 (en) * 2015-09-07 2017-03-30 NXT-ID, Inc. Low bandwidth crypto currency transaction execution and synchronization method and system
US10366062B1 (en) * 2016-03-28 2019-07-30 Amazon Technologies, Inc. Cycled clustering for redundancy coded data storage systems
CN107018125B (zh) * 2017-02-17 2019-08-09 阿里巴巴集团控股有限公司 一种区块链系统、数据存储方法及装置
CN107196900B (zh) * 2017-03-24 2020-04-24 创新先进技术有限公司 一种共识校验的方法及装置
CN107395665B (zh) * 2017-05-22 2020-04-24 创新先进技术有限公司 一种区块链业务受理及业务共识方法及装置
US10554753B2 (en) 2017-07-06 2020-02-04 Acronis International Gmbh System and method for service level agreement based data storage and verification
US10469248B2 (en) * 2017-10-17 2019-11-05 Amrican Express Travel Related Services Company, Inc. API request and response balancing and control on blockchain
US10671492B2 (en) * 2017-12-18 2020-06-02 International Business Machines Corporation Forecast recommended backup destination
US11659023B2 (en) * 2017-12-28 2023-05-23 Cilag Gmbh International Method of hub communication
CN108805701B (zh) * 2018-04-19 2022-06-07 深圳市迅雷网络技术有限公司 多区块链跨链交易处理系统及方法、区块链系统及存储介质
US10841237B2 (en) * 2018-04-23 2020-11-17 EMC IP Holding Company LLC Decentralized data management across highly distributed systems
CN108764925A (zh) * 2018-05-31 2018-11-06 李沁福 一种基于区块链技术的综合业务平台
CN110708269B (zh) * 2018-07-10 2022-04-12 北京京东尚科信息技术有限公司 区块链数据传输方法、区块链节点和计算机可读存储介质
US10911240B2 (en) * 2018-07-23 2021-02-02 Hitachi, Ltd. Off-chain blockchain storage with validation
US20200092084A1 (en) * 2018-09-18 2020-03-19 TERNiO, LLC System and methods for operating a blockchain network
CN109447631B (zh) * 2018-09-19 2024-02-09 平安科技(深圳)有限公司 客户端、服务器、基于区块链的交易方法和存储介质
US11238223B2 (en) * 2018-10-19 2022-02-01 Oracle International Corporation Systems and methods for intelligently predicting accurate combinations of values presentable in data fields
CN109543455B (zh) * 2018-11-06 2021-07-13 联动优势科技有限公司 一种区块链的数据归档方法及装置
CN109559227A (zh) * 2018-11-29 2019-04-02 咪咕文化科技有限公司 一种跨区块链网络的交易方法、装置及存储介质
CN110266644B (zh) * 2019-05-20 2021-04-06 创新先进技术有限公司 结合代码标注与交易类型的收据存储方法和节点
WO2019170167A2 (en) * 2019-05-31 2019-09-12 Alibaba Group Holding Limited System and method for providing privacy and security protection in blockchain-based private transactions
CN110517145B (zh) * 2019-08-29 2023-02-24 深圳市网心科技有限公司 基于多区块链间的数据交易方法及相关设备
JP6671617B1 (ja) * 2019-12-11 2020-03-25 株式会社ブルーキャッスル ブロックチェーン技術と分散ストレージ技術とにより実現した分散型ストレージプラットフォームおよびアプリケーションプログラム
CN111259428B (zh) * 2020-01-22 2024-07-19 腾讯科技(深圳)有限公司 基于区块链的数据处理方法、装置、节点设备及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180359089A1 (en) * 2017-06-07 2018-12-13 At&T Intellectual Property I, L.P. Blockchain-based social media history maps
CN108696594A (zh) * 2018-05-27 2018-10-23 佛山市虚拟现实大数据产业研究院有限公司 一种市场监管区块链的大数据传输负载均衡方法及装置
CN110263047A (zh) * 2019-06-28 2019-09-20 深圳前海微众银行股份有限公司 一种数据中心节点分配方法、装置、系统及计算机设备
CN111866085A (zh) * 2020-06-28 2020-10-30 北京沃东天骏信息技术有限公司 基于区块链的数据存储方法、系统和装置

Non-Patent Citations (1)

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

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US12099522B2 (en) 2022-01-27 2024-09-24 Shanghai Tree-Graph Blockchain Institute Method and system for reducing storage overhead of blockchain nodes, and storage medium
CN115118727A (zh) * 2022-08-26 2022-09-27 北京数牍科技有限公司 分布式计算架构的数据传输方法、装置、设备及存储介质
CN115118727B (zh) * 2022-08-26 2022-11-29 北京数牍科技有限公司 分布式计算架构的数据传输方法、装置、设备及存储介质
CN115396122A (zh) * 2022-10-27 2022-11-25 聚梦创新(北京)软件技术有限公司 消息处理方法、装置、电子设备及存储介质
CN115396122B (zh) * 2022-10-27 2023-04-25 聚梦创新(北京)软件技术有限公司 消息处理方法、装置、电子设备及存储介质
CN116257588A (zh) * 2023-02-27 2023-06-13 西安电子科技大学广州研究院 一种面向工业物联网的区块链交易存储分配方法

Also Published As

Publication number Publication date
US20230153811A1 (en) 2023-05-18
JP2023523611A (ja) 2023-06-06
KR20230023019A (ko) 2023-02-16
CN111866085B (zh) 2021-12-14
CN111866085A (zh) 2020-10-30
KR102699409B1 (ko) 2024-08-28
EP4174681A1 (en) 2023-05-03
EP4174681A4 (en) 2024-08-14
JP7420972B2 (ja) 2024-01-23

Similar Documents

Publication Publication Date Title
CN111866085A (zh) 基于区块链的数据存储方法、系统和装置
CN113039568B (zh) 多租户区块链网络中的轻量级节点
US10785029B2 (en) Systems and methods for pairing on-premise clusters to clouds using identity service providers
US10050991B2 (en) System and method for monitoring network vulnerabilities
US11157467B2 (en) Reducing response time for queries directed to domain-specific knowledge graph using property graph schema optimization
CN112437006B (zh) 基于api网关的请求控制方法、装置、电子设备和存储介质
US9419852B1 (en) Systems and methods for identifying and characterizing client devices
WO2023056946A1 (zh) 一种数据缓存方法、装置和电子设备
US10104170B2 (en) System and method of assigning resource consumers to resources using constraint programming
WO2022111313A1 (zh) 一种请求处理方法及微服务系统
CN105357250B (zh) 一种数据运营系统
US10630589B2 (en) Resource management system
US20210042311A1 (en) Dynamic prioritization of attributes to determine search space size of each term, then index on those sizes as attributes
US20220405386A1 (en) Privacy preserving ensemble learning as a service
Adrian et al. Analysis of K-means algorithm for VM allocation in cloud computing
CN111770176A (zh) 流量调度方法及装置
CN109947736A (zh) 实时计算的方法和系统
US8484249B1 (en) Graph transformations to correct violations of service level objectives in a data center
TW200939047A (en) Processor-server hybrid system for processing data
WO2023088462A1 (zh) 用于处理数据的方法、装置、设备以及存储介质
CN110020271A (zh) 用于缓存管理的方法和系统
US11954181B2 (en) System and method for managing virtual hardware licenses of hardware resources accessed via application instances
CN115190159A (zh) 会话控制方法、装置、电子设备及介质
CN114793234B (zh) 消息处理方法、装置、设备和存储介质
CN112153338A (zh) 视频分发方法、装置、电子设备及存储介质

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2022564810

Country of ref document: JP

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 20237001347

Country of ref document: KR

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2021832030

Country of ref document: EP

Effective date: 20230130