CN115052008B - Block chain data under-chain storage method based on cloud storage - Google Patents

Block chain data under-chain storage method based on cloud storage Download PDF

Info

Publication number
CN115052008B
CN115052008B CN202210586470.5A CN202210586470A CN115052008B CN 115052008 B CN115052008 B CN 115052008B CN 202210586470 A CN202210586470 A CN 202210586470A CN 115052008 B CN115052008 B CN 115052008B
Authority
CN
China
Prior art keywords
block
array
character string
stored
entering
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.)
Active
Application number
CN202210586470.5A
Other languages
Chinese (zh)
Other versions
CN115052008A (en
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.)
Nanjing University of Posts and Telecommunications
Original Assignee
Nanjing University of Posts and Telecommunications
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 Nanjing University of Posts and Telecommunications filed Critical Nanjing University of Posts and Telecommunications
Priority to CN202210586470.5A priority Critical patent/CN115052008B/en
Publication of CN115052008A publication Critical patent/CN115052008A/en
Application granted granted Critical
Publication of CN115052008B publication Critical patent/CN115052008B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols 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]
    • 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/23Updating
    • G06F16/2308Concurrency control
    • G06F16/2315Optimistic concurrency control
    • G06F16/2322Optimistic concurrency control using timestamps
    • 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/23Updating
    • G06F16/2379Updates performed during online database operations; commit processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9024Graphs; Linked lists
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/906Clustering; Classification
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0442Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply asymmetric encryption, i.e. different keys for encryption and decryption
    • 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/3236Cryptographic 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 using cryptographic hash functions
    • H04L9/3239Cryptographic 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 using cryptographic hash functions involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Storage Device Security (AREA)

Abstract

The invention relates to a block chain data chain lower storage method based on cloud storage, which classifies and packages by block creation time and marks blocks participated by user nodes in a block set, thereby reducing the storage pressure of block chain link points and improving the storage and retrieval efficiency; specifically, the blocks with the local preservation time exceeding the preset duration are packed, and a description character string is generated and stored on a chain according to the number of the blocks in the block set and the blocks of the record user participating in the transaction; carrying out asymmetric encryption on the packaged block set to obtain a digital signature and uploading the digital signature and the packaged file together to a cloud; by applying the strategy, the uploading cloud storage frequency can be reduced, the storage performance is improved, the block link points store the block set information, the access efficiency is improved, and the blocks are ensured to be non-counterfeitable and non-tamperable by asymmetric encryption and multiple backup.

Description

Block chain data under-chain storage method based on cloud storage
Technical Field
The invention relates to a cloud storage-based blockchain data under-chain storage method, and belongs to the technical field of blockchain cloud storage.
Background
The blockchain is a chained data structure formed by sequentially connecting data blocks according to time sequence, and guarantees a distributed account book which is not falsified, forged, completely traceable and decentralized in a cryptography mode.
With the wide application of the blockchain technology, a great number of applications are carried on the blockchain, each node not only needs to perform great calculation to obtain the accounting right of the block, but also needs to store the data of all the blocks in the blockchain system, and with the increase of service data in the blockchain, each block node fully stores the copies of all the block data, so that great data redundancy occurs.
In a blockchain system, two technical routes of on-chain storage and under-chain storage are provided for the problem of blockchain storage expandability, namely, the under-chain storage expansion is a method for transferring data content in a block from an original block to the under-chain storage system, and only pointers and other non-data information pointing to the data are stored in a block body so as to solve the problem of blockchain storage expandability. When the complete data is required to be stored, the original data is stored in a non-blockchain system, and meanwhile, a unique identifier of the data is generated according to a certain rule and returned to the blockchain system; when complete data needs to be accessed, original data is searched in the non-blockchain storage system through unique identification of the data.
In the prior art, cloud-based under-chain storage is adopted, if a new block is generated by a block chain, the new block is directly uploaded to cloud storage, and high-frequency synchronous work can cause great performance waste. On the other hand, the transaction recorded in the block has higher timeliness in a period of time after the generation of the block, the accessed frequency is higher, the accessed frequency is reduced after a certain period of time is exceeded, and the transaction is recorded as an account book. If a user accesses a block within a short time after the block is generated, the block needs to be downloaded from the cloud, so that the access performance is reduced, and the access cost is increased.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a block chain data under-chain storage method based on cloud storage, which packs and marks blocks participating in transactions of user nodes according to time-efficiency of the blocks, reduces storage pressure of the chain link points of the blocks and improves storage and retrieval efficiency.
The invention adopts the following technical scheme for solving the technical problems: the invention designs a block chain data chain lower storage method based on cloud storage, which is characterized in that a block is generated according to a normal program based on a block chain system Blockchain, after verification by a user node UN, each block is added into a block linked list BLK in sequence according to a block-out sequence, a block head contains block creation Time Time, a block contains transaction list Transactions, and the following steps A to E are executed according to a preset period, and storage is executed;
step A, initializing a block dynamic array BA to be stored, a related timestamp dynamic array TL, initializing a settlement time string ST as a current timestamp, and entering a step B;
b, based on a block chain table BLK, obtaining continuous blocks with the difference value between the block creation Time and the settlement Time string ST not smaller than a preset duration threshold value and blocks with user nodes UN participating in transactions, adding the blocks into a to-be-stored block dynamic array BA, adding the block creation Time of each block with the user nodes UN participating in transactions into a related timestamp dynamic array TL, and then entering a step C;
step C, deleting each block belonging to the dynamic array BA of the block to be stored in the block linked list BLK, updating the block linked list BLK, and then entering the step D;
step D, constructing a description information character string BA.info corresponding to the dynamic array BA of the block to be stored, and constructing a correlation character string BA.correlation corresponding to the dynamic array BA of the block to be stored and the dynamic array TL of the correlation timestamp, so as to form a block array description character string BA.des, and then entering the step E;
and E, saving the block dynamic array BA to be stored as a block array file BA.file in json format, and describing the character string BA.des and the block array file BA.file aiming at the block array to realize the local saving of the user node UN and the saving on a block chain.
As a preferred embodiment of the present invention, the step B includes the following steps B1 to B6;
step B1, initializing a parameter i to be equal to 1, and entering a step B2;
b2, judging whether the difference value between the block creation Time of the ith block in the block chain table BLK and the settlement Time character string ST is not smaller than a preset duration threshold value, if yes, adding the ith block in the block chain table BLK into a dynamic array BA of the block to be stored, adding 1 for updating the value of the i, and then entering a step B3; otherwise, entering a step B4;
b3, judging whether i is larger than the number of blocks in the block chain table BLK, if yes, entering a step B4, otherwise, returning to the step B2;
step B4., traversing the dynamic array BA of the block to be stored, adding the block creation Time of each block in which the transaction list Transactions public field contains the user node UN account information UN.account into the related timestamp dynamic array TL; then judging whether the transaction list Transactions public field of the last block in the dynamic array BA of the block to be stored contains user node UN account information UN.account, if yes, defining k=the block number +1 in the dynamic array BA of the block to be stored, and entering a step B5; otherwise, entering into the step C;
step B5., judging whether the k-th block transaction list Transactions public field in the block chain table BLK contains user node UN account information un.account, if yes, adding the k-th block in the block chain table BLK into a block dynamic array to be stored BA, adding the block creation Time of the k-th block in the block chain table BLK into a related timestamp dynamic array TL, adding 1 to the value of k for updating, and then entering step B6; otherwise, entering the step C;
step B6. judges whether k is greater than the number of blocks in the block linked list BLK, if yes, step C is entered, otherwise step B5 is returned.
As a preferred technical solution of the present invention, the step D includes the following steps:
firstly, forming a description information character string BA.info according to the block creation Time of the first block, the block creation Time of the last block and the number of blocks in the dynamic array BA of the blocks to be stored;
then dynamically array TL length cnt according to related timestamp un If cnt un Equal to 0, define the correlationThe sex character string ba.relationship is No transaction records; if cnt un If the Time is not equal to 0, traversing the block creation Time Time of each block in the dynamic array BA of the block to be stored to obtain the longest common prefix substring str0, dividing the block creation Time Time into str0 and the rest str respectively, and then forming a correlation character string BA.correlation in the following manner;
BA.relativity=cnt un +str0+“:”+str+“,”+str+“,”...+str+“。”
and finally, merging the description information character string BA.info and the correlation character string BA.correlation in json format to form a block array description character string BA.des.
As a preferred technical scheme of the invention: the step E comprises the following steps E1 to E7;
step E1, saving a block dynamic array BA to be stored as a block array file BA.file in json format, carrying out hash calculation on a block array file BA.file character string to obtain a block array hash BA.hash, carrying out asymmetric encryption on the block array hash by applying a private key character string UN.PrivateKey of a user node UN to obtain a digital signature character string BA.signature, and then entering step E2;
step E2, calling object storage services OBS provided by preset public cloud spaces respectively, or calling object storage services OBS provided by internal cloud spaces, obtaining storage spaces and addresses of the corresponding cloud spaces, forming an address array URL by the addresses, and then entering step E3;
step E3., using the called object storage service OBS, packing and uploading the block array file ba.file and the digital signature character string ba.signature to the cloud space corresponding to the corresponding address in the address array URL, waiting for the return data response of the corresponding cloud space, and entering step E4;
step E4. reads the acknowledgement character ack in the response of the returned data, and if the acknowledgement character ack is successfully stored, step E5 is entered; otherwise, returning to the step E2;
step E5., using the address array URL and the response of the returned data as field names, generating a json-format address file URL.file, performing hash calculation on the URL.file character string to obtain a corresponding address file hash URL.hash, and then entering step E6;
step E6. establishes a block address comparison table BUT, takes the block array description character string ba.des and the address file hash url.hash as key value pairs, writes the key value pairs into the block address comparison table BUT, and the user node UN locally stores the block address comparison table BUT, and then enters step E7;
step E7. generates a formal block on the blockchain, including a block header H and a block body B, wherein the block header H stores the block array hash ba.hash and the settlement time string ST, and the block body B stores the block array description string ba.des, the correlation string ba.correlation, and the block address lookup table BUT.
Compared with the prior art, the method for storing the blockchain data under the chain based on cloud storage has the following technical effects:
according to the cloud storage-based block chain data link lower storage method, the blocks are classified and packed through the block creation time, and the blocks in which user nodes participate in a block set are marked, so that the storage pressure of block chain link points is reduced, and the storage and retrieval efficiency is improved; specifically, the blocks with the local preservation time exceeding the preset duration are packed, and a description character string is generated and stored on a chain according to the number of the blocks in the block set and the blocks of the record user participating in the transaction; carrying out asymmetric encryption on the packaged block set to obtain a digital signature and uploading the digital signature and the packaged file together to a cloud; by applying the strategy, the uploading cloud storage frequency can be reduced, the storage performance is improved, the block link points store the block set information, the access efficiency is improved, and the blocks are ensured to be non-counterfeitable and non-tamperable by asymmetric encryption and multiple backup.
Drawings
FIG. 1 is a flow chart of a method for storing under a blockchain data chain based on cloud storage.
Detailed Description
The following describes the embodiments of the present invention in further detail with reference to the drawings.
The invention designs a block chain data chain lower storage method based on cloud storage, as shown in fig. 1, blocks are generated according to normal program based on a block chain system Blockchain, after verification by a user node UN, each block is added into a block linked list BLK in sequence according to the block output sequence, a block head contains block creation Time Time, a block contains transaction list Transactions, and when a preset period such as daily Greenwich mean Time 23 is used, the following steps A to E are executed for storage.
Step A, initializing a block dynamic array BA to be stored, a related timestamp dynamic array TL, and initializing a settlement time string ST as a current timestamp, and entering a step B.
And B, based on the block chain table BLK, obtaining continuous blocks with the difference value between the block creation Time and the settlement Time string ST not smaller than a preset duration threshold value such as 7 x 8600000 and blocks with the user node UN participating in the transaction, adding the blocks into the to-be-stored block dynamic array BA, adding the block creation Time of the blocks with the user node UN participating in the transaction into the related timestamp dynamic array TL, and then entering the step C.
In practical applications, the above step B is specifically performed as follows steps B1 to B6.
Step B1. The initialization parameter i is equal to 1 and step B2 is entered.
B2, judging whether the difference between the block creation Time of the ith block in the block chain table BLK and the settlement Time string ST is not less than a preset duration threshold value such as 7 x 86000000, if yes, adding the ith block in the block chain table BLK into the block to be stored dynamic array BA, adding 1 for updating the value of i, and then entering the step B3; otherwise, step B4 is entered.
And B3, judging whether i is greater than the number of blocks in the block chain table BLK, if so, entering a step B4, otherwise, returning to the step B2.
Step B4., traversing the dynamic array BA of the block to be stored, adding the block creation Time of each block in which the transaction list Transactions public field contains the user node UN account information UN.account into the related timestamp dynamic array TL; then judging whether the transaction list Transactions public field of the last block in the dynamic array BA of the block to be stored contains user node UN account information UN.account, if yes, defining k=the block number +1 in the dynamic array BA of the block to be stored, and entering a step B5; otherwise, enter step C.
Step B5., judging whether the k-th block transaction list Transactions public field in the block chain table BLK contains user node UN account information un.account, if yes, adding the k-th block in the block chain table BLK into a block dynamic array to be stored BA, adding the block creation Time of the k-th block in the block chain table BLK into a related timestamp dynamic array TL, adding 1 to the value of k for updating, and then entering step B6; otherwise, enter step C.
Step B6. judges whether k is greater than the number of blocks in the block linked list BLK, if yes, step C is entered, otherwise step B5 is returned.
And C, deleting each block belonging to the dynamic array BA of the block to be stored in the block linked list BLK, updating the block linked list BLK, and then entering the step D.
And D, constructing a description information character string BA.info corresponding to the dynamic array BA of the block to be stored, and constructing a correlation character string BA.correlation corresponding to the dynamic array BA of the block to be stored and the dynamic array TL of the correlation timestamp, so as to form a block array description character string BA.des, and then entering the step E.
The specific design of the step D is as follows:
firstly, according to the block creation Time of the first block in the dynamic array BA of the block to be stored, the block creation Time of the last block and the number of the blocks in the dynamic array BA of the block to be stored, a description information character string BA.info is formed according to the following structural mode;
BA.info=“{“startTime”:GT i ,“endTime”:GT k ,“size”:BA.length}”
then dynamically array TL length cnt according to related timestamp un If cnt un Equal to 0, define the correlation string ba.correlation as No transaction records; if cnt un If the Time is not equal to 0, traversing the block creation Time Time of each block in the dynamic array BA of the block to be stored to obtain the longest common prefix substring str0, dividing the block creation Time Time into str0 and the rest str respectively, and then forming a correlation character string BA.correlation in the following manner;
BA.relativity=cnt un +str0+“:”+str+“,”+str+“,”...+str+“。”
and finally, merging the description information character string BA.info and the correlation character string BA.correlation in json format to form a block array description character string BA.des.
And E, saving the block dynamic array BA to be stored as a block array file BA.file in json format, and describing the character string BA.des and the block array file BA.file aiming at the block array to realize the local saving of the user node UN and the saving on a block chain.
In practical applications, the step E includes the following steps E1 to E7.
Step E1, saving the block dynamic array BA to be stored as a block array file BA.file in json format, carrying out hash calculation on a block array file BA.file character string to obtain a block array hash BA.hash, carrying out asymmetric encryption on the block array hash BA.hash by applying a private key character string UN.PrivateKey of a user node UN to obtain a digital signature character string BA.signature, and then entering step E2.
Step E2, calling object storage services OBS provided by preset public cloud spaces such as the public cloud space 1, the public cloud space 2 and the public cloud space 3 respectively, or calling the object storage services OBS provided by the internal cloud space, obtaining storage spaces and addresses of the corresponding cloud spaces, forming an address array URL by the addresses, and then entering step E3.
Step E3. applies the called object storage service OBS, packages and uploads the block array file ba.file and the digital signature character string ba.signature to the cloud space corresponding to the corresponding address in the address array URL, waits for the return data response of the corresponding cloud space, and proceeds to step E4.
Step E4. reads the acknowledgement character ack in the response of the returned data, and if the acknowledgement character ack is successfully stored, step E5 is entered; otherwise, returning to the step E2.
Step E5. uses the address array URL and the response of the returned data as field names to generate a json-format address file url.file, and performs hash computation on the url.file string to obtain a corresponding address file hash url.hash, and then step E6 is entered.
Step E6. establishes a block address lookup table BUT, writes the block array description string ba.des and the address file hash url.hash as key pairs into the block address lookup table BUT, and the user node UN locally saves the block address lookup table BUT, and then proceeds to step E7.
Step E7. generates a formal block on the blockchain, including a block header H and a block body B, wherein the block header H stores the block array hash ba.hash and the settlement time string ST, and the block body B stores the block array description string ba.des, the correlation string ba.correlation, and the block address lookup table BUT.
According to the block chain data link lower storage method based on cloud storage, in practical application, the blocks in the block set are classified and packed according to the block creation time, and the blocks in which user nodes participate are marked, so that the block chain link point storage pressure is reduced, and the storage and retrieval efficiency is improved; specifically, the blocks with the local preservation time exceeding the preset duration are packed, and a description character string is generated and stored on a chain according to the number of the blocks in the block set and the blocks of the record user participating in the transaction; carrying out asymmetric encryption on the packaged block set to obtain a digital signature and uploading the digital signature and the packaged file together to a cloud; by applying the strategy, the uploading cloud storage frequency can be reduced, the storage performance is improved, the block link points store the block set information, the access efficiency is improved, and the blocks are ensured to be non-counterfeitable and non-tamperable by asymmetric encryption and multiple backup.
The embodiments of the present invention have been described in detail with reference to the drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge of those skilled in the art without departing from the spirit of the present invention.

Claims (4)

1. The method for storing the blockchain data under the chain based on cloud storage is characterized by comprising the following steps of: generating blocks according to normal program based on a Blockchain system Blockchain, after verification by a user node UN, sequentially adding each block into a Blockchain table BLK according to a blockout sequence, wherein a blockhead comprises a blockcreation Time Time, a blockblock comprises a transaction list Transactions, and executing the following steps A to E according to a preset period, and executing storage;
step A, initializing a block dynamic array BA to be stored, a related timestamp dynamic array TL, initializing a settlement time string ST as a current timestamp, and entering a step B;
b, based on a block chain table BLK, obtaining continuous blocks with the difference value between the block creation Time and the settlement Time string ST not smaller than a preset duration threshold value and blocks with user nodes UN participating in transactions, adding the blocks into a to-be-stored block dynamic array BA, adding the block creation Time of each block with the user nodes UN participating in transactions into a related timestamp dynamic array TL, and then entering a step C;
step C, deleting each block belonging to the dynamic array BA of the block to be stored in the block linked list BLK, updating the block linked list BLK, and then entering the step D;
step D, constructing a description information character string BA.info corresponding to the dynamic array BA of the block to be stored, and constructing a correlation character string BA.correlation corresponding to the dynamic array BA of the block to be stored and the dynamic array TL of the correlation timestamp, so as to form a block array description character string BA.des, and then entering the step E;
and E, saving the block dynamic array BA to be stored as a block array file BA.file in json format, and describing the character string BA.des and the block array file BA.file aiming at the block array to realize the local saving of the user node UN and the saving on a block chain.
2. The cloud storage-based blockchain data undersea storage method of claim 1, wherein: the step B comprises the following steps B1 to B6;
step B1, initializing a parameter i to be equal to 1, and entering a step B2;
b2, judging whether the difference value between the block creation Time of the ith block in the block chain table BLK and the settlement Time character string ST is not smaller than a preset duration threshold value, if yes, adding the ith block in the block chain table BLK into a dynamic array BA of the block to be stored, adding 1 for updating the value of the i, and then entering a step B3; otherwise, entering a step B4;
b3, judging whether i is larger than the number of blocks in the block chain table BLK, if yes, entering a step B4, otherwise, returning to the step B2;
step B4., traversing the dynamic array BA of the block to be stored, adding the block creation Time of each block in which the transaction list Transactions public field contains the user node UN account information UN.account into the related timestamp dynamic array TL; then judging whether the transaction list Transactions public field of the last block in the dynamic array BA of the block to be stored contains user node UN account information UN.account, if yes, defining k=the block number +1 in the dynamic array BA of the block to be stored, and entering a step B5; otherwise, entering into the step C;
step B5., judging whether the k-th block transaction list Transactions public field in the block chain table BLK contains user node UN account information un.account, if yes, adding the k-th block in the block chain table BLK into a block dynamic array to be stored BA, adding the block creation Time of the k-th block in the block chain table BLK into a related timestamp dynamic array TL, adding 1 to the value of k for updating, and then entering step B6; otherwise, entering the step C;
step B6. judges whether k is greater than the number of blocks in the block linked list BLK, if yes, step C is entered, otherwise step B5 is returned.
3. The cloud storage-based blockchain data undersea storage method of claim 1, wherein: the step D comprises the following steps:
firstly, forming a description information character string BA.info according to the block creation Time of the first block, the block creation Time of the last block and the number of blocks in the dynamic array BA of the blocks to be stored;
then dynamically array TL length cnt according to related timestamp un If cnt un Equal to 0, define the correlation string ba.correlation as No transaction records; if cnt un If the Time is not equal to 0, traversing the block creation Time Time of each block in the dynamic array BA of the block to be stored to obtain the longest common prefix substring str0, dividing the block creation Time Time into str0 and the rest str respectively, and then forming a correlation character string BA.correlation in the following manner;
BA.relativity=cnt un +str0+“:”+str+“,”+str+“,”...+str+“。”
and finally, merging the description information character string BA.info and the correlation character string BA.correlation in json format to form a block array description character string BA.des.
4. The cloud storage-based blockchain data undersea storage method of claim 1, wherein: the step E comprises the following steps E1 to E7;
step E1, saving a block dynamic array BA to be stored as a block array file BA.file in json format, carrying out hash calculation on a block array file BA.file character string to obtain a block array hash BA.hash, carrying out asymmetric encryption on the block array hash by applying a private key character string UN.PrivateKey of a user node UN to obtain a digital signature character string BA.signature, and then entering step E2;
step E2, calling object storage services OBS provided by preset public cloud spaces respectively, or calling object storage services OBS provided by internal cloud spaces, obtaining storage spaces and addresses of the corresponding cloud spaces, forming an address array URL by the addresses, and then entering step E3;
step E3., using the called object storage service OBS, packing and uploading the block array file ba.file and the digital signature character string ba.signature to the cloud space corresponding to the corresponding address in the address array URL, waiting for the return data response of the corresponding cloud space, and entering step E4;
step E4. reads the acknowledgement character ack in the response of the returned data, and if the acknowledgement character ack is successfully stored, step E5 is entered; otherwise, returning to the step E2;
step E5., using the address array URL and the response of the returned data as field names, generating a json-format address file URL.file, performing hash calculation on the URL.file character string to obtain a corresponding address file hash URL.hash, and then entering step E6;
step E6. establishes a block address comparison table BUT, takes the block array description character string ba.des and the address file hash url.hash as key value pairs, writes the key value pairs into the block address comparison table BUT, and the user node UN locally stores the block address comparison table BUT, and then enters step E7;
step E7. generates a formal block on the blockchain, including a block header H and a block body B, wherein the block header H stores the block array hash ba.hash and the settlement time string ST, and the block body B stores the block array description string ba.des, the correlation string ba.correlation, and the block address lookup table BUT.
CN202210586470.5A 2022-05-26 2022-05-26 Block chain data under-chain storage method based on cloud storage Active CN115052008B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210586470.5A CN115052008B (en) 2022-05-26 2022-05-26 Block chain data under-chain storage method based on cloud storage

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210586470.5A CN115052008B (en) 2022-05-26 2022-05-26 Block chain data under-chain storage method based on cloud storage

Publications (2)

Publication Number Publication Date
CN115052008A CN115052008A (en) 2022-09-13
CN115052008B true CN115052008B (en) 2023-07-25

Family

ID=83158974

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210586470.5A Active CN115052008B (en) 2022-05-26 2022-05-26 Block chain data under-chain storage method based on cloud storage

Country Status (1)

Country Link
CN (1) CN115052008B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117271528B (en) * 2023-11-16 2024-02-06 佳瑛科技有限公司 Table key character storage method and system based on block chain technology

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106534317A (en) * 2016-11-17 2017-03-22 杭州云象网络技术有限公司 Disaster recovery cloud storage system construction method based on block chain technology
CN109165224A (en) * 2018-08-24 2019-01-08 东北大学 A kind of indexing means being directed to keyword key on block chain database
WO2021068728A1 (en) * 2019-10-10 2021-04-15 深圳前海微众银行股份有限公司 Methods and apparatus for generating state tree of block and validating on-chain data

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106534317A (en) * 2016-11-17 2017-03-22 杭州云象网络技术有限公司 Disaster recovery cloud storage system construction method based on block chain technology
CN109165224A (en) * 2018-08-24 2019-01-08 东北大学 A kind of indexing means being directed to keyword key on block chain database
WO2021068728A1 (en) * 2019-10-10 2021-04-15 深圳前海微众银行股份有限公司 Methods and apparatus for generating state tree of block and validating on-chain data

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于区块链技术的轻量化分布式云存储系统设计;赖力潜;刘学东;钟伟豪;;大众标准化(第18期);全文 *
基于区块链的云存储安全研究进展;徐堃等;计算机科学;第48卷(第11期);全文 *

Also Published As

Publication number Publication date
CN115052008A (en) 2022-09-13

Similar Documents

Publication Publication Date Title
CN109542979B (en) Fast synchronization and simple data storage mode of block chain system
CN104794123B (en) A kind of method and device building NoSQL database indexes for semi-structured data
CN110689349B (en) Transaction hash value storage and searching method and device in blockchain
CN113329031A (en) Method and device for generating state tree of block
US20230109969A1 (en) Data processing method and apparatus based on node internal memory, device and medium
CN102929936B (en) Log recording method, log inquiring method and system
CN103885887B (en) User data storage method, read method and system
CN110599169B (en) Data processing method, device, terminal and medium
CN102821138A (en) Metadata distributed storage method applicable to cloud storage system
CN110263014A (en) Block chain storage system and method towards timing type data
CN112800065A (en) Efficient data retrieval method based on improved block storage structure
CN115052008B (en) Block chain data under-chain storage method based on cloud storage
CN103176754A (en) Reading and storing method for massive amounts of small files
CN103379160A (en) Difference synchronizing method for oversized file
CN109194646A (en) A kind of safety certification data access method based on block chain
CN106777387A (en) A kind of Internet of Things big data access method based on HBase
CN103970875A (en) Parallel repeated data deleting method
CN102521312B (en) Storage method of file index, and file system
CN101082935B (en) Non-only indexes search method for internal memory data
WO2023093041A1 (en) Block chain state data processing method
WO2019153660A1 (en) Transaction processing method and apparatus, and computer device and storage medium
CN109582735A (en) A kind of block chain blocks of knowledge storage system
CN114791788B (en) Data storage method and device based on block chain
CN114461730B (en) Self-adaptive block data compression method based on remainder system
Huang et al. PChord: a distributed hash table for P2P network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant