CN115052008A - Block chain data link down-link storage method based on cloud storage - Google Patents

Block chain data link down-link storage method based on cloud storage Download PDF

Info

Publication number
CN115052008A
CN115052008A CN202210586470.5A CN202210586470A CN115052008A CN 115052008 A CN115052008 A CN 115052008A CN 202210586470 A CN202210586470 A CN 202210586470A CN 115052008 A CN115052008 A CN 115052008A
Authority
CN
China
Prior art keywords
block
array
character string
stored
file
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.)
Granted
Application number
CN202210586470.5A
Other languages
Chinese (zh)
Other versions
CN115052008B (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

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/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 link down-link storage method based on cloud storage, which classifies and packs through block creation time, marks blocks in which user nodes participate in a block set, reduces the storage pressure of block chain nodes, and improves the storage and retrieval efficiency; specifically, blocks with local storage time exceeding a preset time length are packaged, and a description character string is generated and stored on a chain according to the number of the blocks in a block set and the blocks for recording user participation in transaction; carrying out asymmetric encryption on the packed block set to obtain a digital signature and uploading the digital signature and a packed file to a cloud terminal; by applying the strategy, the uploading cloud storage frequency can be reduced, the storage performance is improved, the block set information is stored by the block chain nodes, the access efficiency is improved, and the block cannot be forged and tampered by asymmetric encryption and multiple backup.

Description

Block chain data link down-link storage method based on cloud storage
Technical Field
The invention relates to a block chain data link down-storage method based on cloud storage, and belongs to the technical field of block chain cloud storage.
Background
The block chain is a chain data structure formed by connecting data blocks in sequence according to a time sequence, and a distributed account book which is not falsifiable, counterfeitable, completely traceable and decentralized is ensured in a cryptographic mode.
With the wide application of the blockchain technology, a large number of applications are carried on the blockchain, each node not only needs to perform a large number of calculations to obtain the accounting right of the block, but also needs to store the data of all blocks in the blockchain system, and as the number of service data in the blockchain increases, each blockchain node stores copies of all block data in full, and a large amount of data redundancy occurs.
In a block chain system, two technical routes of on-chain storage and off-chain storage are provided for solving the problem of block chain storage expandability, the off-chain storage expansion is to transfer data contents in a block from an original block to an off-chain storage system, and only pointers and other non-data information pointing to the data are stored in the block so as to solve the problem of block chain storage expandability. When the complete data needs to be stored, storing the original data into a non-block chain system, simultaneously generating a unique identifier of the data according to a certain rule, and returning the unique identifier to the block chain system; when the complete data needs to be accessed, the original data is searched in the non-blockchain storage system through the unique identification of the data.
In the prior art, cloud-based offline storage is adopted, if a block chain generates a new block, the new block is directly uploaded to the cloud storage, and high-frequency synchronous operation causes great performance waste. On the other hand, the transaction recorded in the block is higher in timeliness and higher in access frequency within a period of time after the block is generated, the access frequency is reduced after a certain period of time, and more transactions are recorded as the account book. If the user accesses the block in 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 link down-storage method based on cloud storage, and the blocks in which user nodes participate in transaction are packed and marked according to the timeliness of the blocks, so that the storage pressure of the chain nodes of the blocks is reduced, and the storage and retrieval efficiency is improved.
In order to solve the technical problems, the invention adopts the following technical scheme: the invention designs a block chain data link down-link storage method based on cloud storage, blocks are generated according to normal programs based on a block chain system Blockchain, after the blocks are verified by a user node UN, the blocks are sequentially added into a block chain table BLK according to the block generation sequence, a block head comprises a block creation Time (Time), a block body comprises transaction lists Transactions, and the following steps A to E are executed according to a preset period to execute storage;
step A, initializing a block dynamic array BA to be stored, a related time stamp dynamic array TL and a settlement time character string ST as a current time stamp, and entering a step B;
b, based on a block linked list BLK, obtaining continuous blocks of which the difference value between the block creation Time Time and the settlement Time character string ST is not less than a preset Time length threshold value and blocks of which the user node UN participates in the transaction, adding the blocks into a dynamic array BA of the block to be stored, adding the block creation Time Time of the blocks of which the user node UN participates in the transaction into a related Time stamp dynamic array TL, and then entering the step C;
c, deleting each block in the block linked list BLK, which belongs to the dynamic array BA of the block to be stored, updating the block linked list BLK, and then entering the step D;
d, constructing a description information character string BA.info corresponding to the block dynamic array BA to be stored, constructing a correlation character string BA.relationship corresponding to the block dynamic array BA to be stored and the correlation time stamp dynamic array TL, further constructing a block array description character string BA.des, and entering the step E;
and E, saving the dynamic array BA of the block to be stored into a json format block array file BA.file, and realizing local saving of the user node UN and saving on a block chain aiming at the block array description character string BA.des and the block array file BA.file.
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 step B2;
step B2, judging whether the difference value between the block creation Time Time of the ith block in the block linked list BLK and the settlement Time character string ST is not less than a preset Time length threshold value, if so, adding the ith block in the block linked list BLK into the block dynamic array BA to be stored, updating by adding 1 to the value of i, and then entering the step B3; otherwise, go to step B4;
b3, judging whether i is larger than the number of the blocks in the block linked list BLK, if so, entering the step B4, otherwise, returning to the step B2;
step B4., traversing the block dynamic array BA to be stored, adding the block creation Time Time of each block in which the transaction list Transactions public field contains the 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 to-be-stored block dynamic array BA contains user node UN account information UN. account, if yes, defining k as the block number +1 in the to-be-stored block dynamic array BA, and entering step B5; otherwise, entering the step C;
step B5., judging whether the common field of Transactions of the kth block transaction list in the block linked list BLK contains user node UN account information UN. account, if yes, adding the kth block in the block linked list BLK into a dynamic array BA of the block to be stored, adding the block creation Time of the kth block in the block linked list BLK into a dynamic array TL of a relevant timestamp, adding 1 to update the value of k, and then entering step B6; otherwise, entering the step C;
step B6. judges whether k is larger 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, according to the block creation Time of the first block in the block dynamic array BA to be stored, the block creation Time of the last block and the number of blocks in the block dynamic array BA to be stored, a description information character string BA.info is formed;
then the TL length cnt of the dynamic array is determined according to the relevant time stamp un If cnt un If equal to 0, defining the correlation character string BA. relationship as No transaction records; if cnt un If the Time is not equal to 0, traversing the block creation Time of each block in the to-be-stored block dynamic array BA, acquiring the longest common prefix substring str0, respectively dividing the block creation Time into str0 and the rest str, and then forming a correlation string BA. relationship according to the following mode;
BA.relativity=cnt un +str0+“:”+str+“,”+str+“,”...+str+“。”
and finally, merging the description information character string BA.info and the correlation character string BA.relationship in a 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, storing a block dynamic array BA to be stored into a json format block array file BA.file, performing hash calculation on a block array file BA.file character string to obtain a block array hash BA.hash, then performing asymmetric encryption on the block array hash BA.hash by using 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 respectively provided by preset public cloud spaces, or calling object storage services OBS provided by internal cloud spaces, obtaining storage spaces and addresses of corresponding cloud spaces, forming address array URLs by the addresses, and then entering step E3;
step E3., applying the called object storage service OBS, packaging 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 returned data response of the corresponding cloud space, and entering step E4;
step E4. reads the acknowledge character ack in the returned data response, if the acknowledge character ack is successfully stored, step E5 is entered; otherwise, returning to the step E2;
e5., generating json format address file URL by using the address array URL and the return data response as field names, performing hash calculation on the URL file character string to obtain corresponding address file hash URL.hash, and entering step E6;
step E6., establishing a block address comparison table BUT, writing a block array description character string BA.des and an address file hash URL.hash as a key value pair into the block address comparison table BUT, locally saving the block address comparison table BUT by a user node UN, and then entering step E7;
step E7. is to generate a formal block on the block chain, which includes a block head H and a block body B, wherein the block head H stores a block array hash ba.hash and a settlement time string ST, and the block body B stores a block array description string ba.des, a correlation string ba.relationship, and a block address mapping table BUT.
Compared with the prior art, the block chain data link down-link storage method based on cloud storage has the following technical effects that:
according to the block chain data link down storage method based on cloud storage, the blocks are classified and packaged 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 the block chain nodes is reduced, and the storage and retrieval efficiency is improved; specifically, blocks with local storage time exceeding a preset time length are packaged, and a description character string is generated and stored on a chain according to the number of the blocks in a block set and the blocks for recording user participation in transaction; carrying out asymmetric encryption on the packed block set to obtain a digital signature and uploading the digital signature and a packed file to a cloud terminal; by applying the strategy, the uploading cloud storage frequency can be reduced, the storage performance is improved, the block set information is stored by the block chain nodes, the access efficiency is improved, and the block cannot be forged and tampered by asymmetric encryption and multiple backup.
Drawings
Fig. 1 is a flowchart of a block chain data link down storage method based on cloud storage according to the present invention.
Detailed Description
The following description will explain embodiments of the present invention in further detail with reference to the accompanying drawings.
The invention designs a block chain data link down storage method based on cloud storage, as shown in fig. 1, blocks are generated according to a normal program based on a block chain system Blockchain, after the blocks are verified by a user node UN, the blocks are sequentially added into a block chain table BLK according to the block generation sequence, the block head comprises a block creation Time Time, the block body comprises transaction lists Transactions, and the following steps A to E are executed to execute storage according to a preset period such as Greenwich mean Time 23 every day.
And step A, initializing a block to be stored dynamic array BA, a related time stamp dynamic array TL and a settlement time character string ST as a current time stamp, and entering the step B.
And step B, obtaining continuous blocks in which the difference between the block creation Time and the settlement Time character string ST is not less than a preset Time threshold value such as 7 x 86400000 and blocks in which the user node UN participates in the transaction based on the block linked list BLK, adding the blocks into the dynamic array BA of the blocks to be stored, adding the block creation Time of the blocks in which the user node UN participates in the transaction into the dynamic array TL of the relevant Time stamp, and then entering the step C.
In practical applications, the step B specifically performs the following steps B1 to B6.
Step B1. initialization parameter i equals 1 and step B2 is entered.
Step B2, judging whether the difference value between the block creation Time Time and the settlement Time character string ST of the ith block in the block linked list BLK is not less than a preset Time length threshold value such as 7 x 86400000, if so, adding the ith block in the block linked list BLK into the block dynamic array BA to be stored, adding 1 for updating the value of i, and then entering the step B3; otherwise, go to step B4.
And B3, judging whether the i is greater than the number of the blocks in the block linked list BLK, if so, entering the step B4, otherwise, returning to the step B2.
Step B4., traversing the block dynamic array BA to be stored, adding the block creation Time Time of each block in which the transaction list Transactions public field contains the 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 to-be-stored block dynamic array BA contains user node UN account information UN. account, if yes, defining k as the block number +1 in the to-be-stored block dynamic array BA, and entering step B5; otherwise, the step C is entered.
Step B5., judging whether the common field of Transactions of the kth block transaction list in the block linked list BLK contains user node UN account information UN. account, if yes, adding the kth block in the block linked list BLK into a dynamic array BA of the block to be stored, adding the block creation Time of the kth block in the block linked list BLK into a dynamic array TL of a relevant timestamp, adding 1 to update the value of k, and then entering step B6; otherwise, entering the step C.
Step B6. determines 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 in the block linked list BLK, which belongs to the dynamic array BA of the block to be stored, 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 block dynamic array BA to be stored, constructing a correlation character string BA.correlation corresponding to the block dynamic array BA to be stored and the correlation timestamp dynamic array TL, further constructing a block array description character string BA.des, and entering the step E.
The step D is specifically designed and executed as follows:
firstly, according to the block creation Time of the first block in the block dynamic array BA to be stored, the block creation Time of the last block and the number of blocks in the block dynamic array BA 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 the TL length cnt of the dynamic array is determined according to the relevant time stamp un If cnt un If equal to 0, defining the correlation character string BA. relationship as No transaction records; if cnt un If the sum of the lengths of the two sub-strings is not equal to 0, traversing the block creation Time of each block in the dynamic array BA of the blocks to be stored, acquiring the substring str0 of the longest common prefix, dividing the block creation Time into str0 and the rest str, and then forming a correlation string BA. relationship according to the following mode;
BA.relativity=cnt un +str0+“:”+str+“,”+str+“,”...+str+“。”
and finally, merging the description information character string BA.info and the correlation character string BA.relationship in a json format to form a block array description character string BA.des.
And E, saving the dynamic array BA of the block to be stored into a json format block array file BA.file, and realizing local saving of the user node UN and saving on a block chain aiming at the block array description character string BA.des and the block array file BA.file.
In practical applications, the step E includes the following steps E1 to E7.
Step E1, saving the block dynamic array BA to be stored into a block array file BA.file in a json format, performing hash calculation on a block array file BA.file character string to obtain a block array hash BA.hash, then performing asymmetric encryption on the block array hash BA.hash by using 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 an object storage service OBS provided by each preset public cloud space, such as the public cloud space 1, the public cloud space 2, and the public cloud space 3, or calling an object storage service OBS provided by an internal cloud space, and obtaining a storage space and each address of a corresponding cloud space, and then, forming an address array URL from each address, 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 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 acknowledge character ack in the returned data response, if the acknowledge character ack is successfully stored, step E5 is entered; otherwise, the procedure returns to step E2.
In step E5., the address array URL and the return data response are used as field names to generate an address file url.file in json format, hash calculation is performed on the url.file character string to obtain a corresponding address file hash url.hash, and then the process proceeds to step E6.
Step E6., a block address mapping table BUT is established, the block array description character string ba.des and the address file hash url.hash are used as key value pairs, written into the block address mapping table BUT locally stored by the user node UN, and then step E7 is entered.
Step E7. is to generate a formal block on the block chain, which includes a block head H and a block body B, wherein the block head H stores a block array hash ba.hash and a settlement time string ST, and the block body B stores a block array description string ba.des, a correlation string ba.relationship, and a block address mapping table BUT.
According to the block chain data link down storage method based on cloud storage, in practical application, the blocks are classified and packaged through block creation time, and blocks in which user nodes participate in a block set are marked, so that the storage pressure of block chain nodes is reduced, and the storage and retrieval efficiency is improved; specifically, blocks with local storage time exceeding a preset time length are packaged, and a description character string is generated and stored on a chain according to the number of the blocks in a block set and the blocks for recording user participation in transaction; carrying out asymmetric encryption on the packed block set to obtain a digital signature and uploading the digital signature and a packed file to a cloud terminal; by applying the strategy, the uploading cloud storage frequency can be reduced, the storage performance is improved, the block set information is stored by the block chain nodes, the access efficiency is improved, and the block cannot be forged and tampered 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 gist of the present invention.

Claims (4)

1. The method for storing the block chain data under the chain based on the cloud storage is characterized by comprising the following steps: generating blocks according to a normal program based on a block chain system Blockchain, sequentially adding each block into a block chain table BLK according to a block output sequence after being verified by a user node UN, executing the following steps A to E according to a preset period, and storing, wherein a block head comprises a block creation Time (Time) and a block body comprises transaction lists;
step A, initializing a block to be stored dynamic array BA, a related time stamp dynamic array TL and a settlement time character string ST as a current time stamp, and entering step B;
b, based on a block linked list BLK, obtaining continuous blocks of which the difference value between the block creation Time Time and the settlement Time character string ST is not less than a preset Time length threshold value and blocks of which the user node UN participates in the transaction, adding the blocks into a dynamic array BA of the block to be stored, adding the block creation Time Time of the blocks of which the user node UN participates in the transaction into a related Time stamp dynamic array TL, and then entering the step C;
c, deleting each block in the block linked list BLK belonging to the block dynamic array BA to be stored, updating the block linked list BLK, and then entering the step D;
d, constructing a description information character string BA.info corresponding to the block dynamic array BA to be stored, constructing a correlation character string BA.relationship corresponding to the block dynamic array BA to be stored and the correlation time stamp dynamic array TL, further constructing a block array description character string BA.des, and entering the step E;
and E, saving the dynamic array BA of the block to be stored into a json format block array file BA.file, and realizing local saving of the user node UN and saving on a block chain aiming at the block array description character string BA.des and the block array file BA.file.
2. The method for storing the blockchain data under the chain based on the cloud storage 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 step B2;
step B2, judging whether the difference value between the block creation Time Time of the ith block in the block linked list BLK and the settlement Time character string ST is not less than a preset Time length threshold value, if so, adding the ith block in the block linked list BLK into the block dynamic array BA to be stored, updating by adding 1 to the value of i, and then entering the step B3; otherwise, go to step B4;
b3, judging whether i is larger than the number of the blocks in the block linked list BLK, if so, entering the step B4, otherwise, returning to the step B2;
step B4., traversing the dynamic array BA of the block to be stored, and adding the block creation Time Time of each block in which the transaction list Transactions public field contains the UN account information UN of the user node into the dynamic array TL of the relevant timestamp; then, judging whether the transaction list Transactions public field of the last block in the to-be-stored block dynamic array BA contains user node UN account information UN. account, if yes, defining k as the block number +1 in the to-be-stored block dynamic array BA, and entering step B5; otherwise, entering the step C;
b5., judging whether the public field of the k block transaction list Transactions in the block linked list BLK contains the user node UN account information UN. account, if yes, adding the k block in the block linked list BLK into the dynamic array BA of the block to be stored, adding the block creation Time of the k block in the block linked list BLK into the dynamic array TL of the relevant timestamp, adding 1 to update the value of k, and then entering step B6; otherwise, entering the step C;
step B6. determines 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 method for storing the blockchain data under the chain based on the cloud storage of claim 1, wherein: the step D comprises the following steps:
firstly, according to the block creation Time of the first block in the block dynamic array BA to be stored, the block creation Time of the last block and the number of blocks in the block dynamic array BA to be stored, a description information character string BA.info is formed;
then the TL length cnt of the dynamic array is determined according to the relevant time stamp un If cnt un If equal to 0, defining the correlation character string BA. relationship as No transaction records; if cnt un If the Time is not equal to 0, traversing the block creation Time of each block in the to-be-stored block dynamic array BA, acquiring the longest common prefix substring str0, respectively dividing the block creation Time into str0 and the rest str, and then forming a correlation string BA. relationship according to the following mode;
BA.relativity=cnt un +str0+“:”+str+“,”+str+“,”...+str+“。”
and finally, merging the description information character string BA.info and the correlation character string BA.relationship in a json format to form a block array description character string BA.des.
4. The method for storing the blockchain data under the chain based on the cloud storage 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 into a block array file BA.file in a json format, performing hash calculation on a block array file BA.file character string to obtain a block array hash BA.hash, then performing asymmetric encryption on the block array hash BA.hash by using 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 respectively provided by preset public cloud spaces or calling object storage services OBS provided by internal cloud spaces, obtaining storage spaces and addresses of corresponding cloud spaces, forming address array URLs by the addresses, and entering step E3;
step E3., applying the called object storage service OBS, packaging 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 returned data response of the corresponding cloud space, and entering step E4;
step E4. reads the acknowledge character ack in the returned data response, if the acknowledge character ack is successfully stored, step E5 is entered; otherwise, returning to the step E2;
step E5., using the address array URL and the return data response as field names, generating address file URL.file in json format, and performing hash calculation on the URL.file character string to obtain corresponding address file hash URL.hash, and then entering step E6;
step E6., establishing a block address comparison table BUT, writing a block array description character string BA.des and an address file Hash URL.hash as a key value pair into the block address comparison table BUT, locally storing the block address comparison table BUT by a user node UN, and then entering step E7;
step E7. generates a formal block on the block chain, which includes a block header H and a block body B, wherein the block header H stores a block array hash ba.
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 true CN115052008A (en) 2022-09-13
CN115052008B 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)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117271528A (en) * 2023-11-16 2023-12-22 佳瑛科技有限公司 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
徐堃等: "基于区块链的云存储安全研究进展", 计算机科学, vol. 48, no. 11 *
赖力潜;刘学东;钟伟豪;: "基于区块链技术的轻量化分布式云存储系统设计", 大众标准化, no. 18 *

Cited By (2)

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

Also Published As

Publication number Publication date
CN115052008B (en) 2023-07-25

Similar Documents

Publication Publication Date Title
CN110602148B (en) Method and device for generating state tree of block and verifying data on chain
CN109542979B (en) Fast synchronization and simple data storage mode of block chain system
WO2021017436A1 (en) Blockchain state data synchronization method and apparatus, and electronic device
US20230109969A1 (en) Data processing method and apparatus based on node internal memory, device and medium
TW202101249A (en) Hierarchical storage method and device based on block chain and electronic equipment
CN102122285B (en) Data cache system and data inquiry method
CN101901248B (en) Method and device for creating and updating Bloom filter and searching elements
JP2022547956A (en) How to index blockchain data and how to store blockchain data
CN109977077A (en) Model file storage method, device, readable storage medium storing program for executing and computer equipment
CN112559448B (en) Data state migration method and device, computer equipment and storage medium
CN110263014A (en) Block chain storage system and method towards timing type data
TW201740294A (en) Model training method and device
CN108124012A (en) A kind of distributed caching computational methods based on hash algorithm
WO2023011022A1 (en) Blockchain-based data processing method, and device and computer-readable storage medium
CN101082935B (en) Non-only indexes search method for internal memory data
CN115052008A (en) Block chain data link down-link storage method based on cloud storage
CN106777387A (en) A kind of Internet of Things big data access method based on HBase
CN111080290A (en) Block chain transaction execution and data storage method based on account classification
CN116561231B (en) Alliance chain data processing method based on split chain technology
CN102207964B (en) Real-time massive data index construction method and system
CN112269839A (en) Data storage method and device in block chain, electronic equipment and storage medium
CN115221176A (en) Block chain data storage method and device and electronic equipment
CN116701452A (en) Data processing method, related device, storage medium and program product
CN113656504A (en) Block chain transaction submitting, editing and inquiring method based on time sequence attribute
CN115129781A (en) Data processing method and device, electronic equipment and storage medium

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