Data storage method and system based on block chain and storage medium

By receiving and hierarchizing the data transmitted by user equipment in the blockchain data storage and uploading it to multiple cloud storage devices, the problem of high data leakage risk in the blockchain-based data storage in the prior art is solved, and high-security data transmission and storage are achieved.

CN120145447AActive Publication Date: 2025-06-13SHANGRAO ACAD OF SCI CLOUD COMPUTING CENT BIG DATA RES INST
View PDF 12 Cites 0 Cited by

Patent Information

Application Number
CN202510229815.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-28
Publication Date
2025-06-13
Estimated Expiration
2045-02-28

AI Technical Summary

Technical Problem

The blockchain-based data storage method in the prior art has a high risk of data leakage, especially when using cloud devices for data storage.

Method used

By receiving the unencrypted data and encrypted data transmitted by the user equipment, it is divided into data sets of different levels according to the confidentiality level of the data, and uploading these data sets to multiple corresponding levels of cloud storage devices. Meanwhile, the third data describing the original data is uploaded to the blockchain so that other users can determine the currently existing data based on the third data and make requests for access. This method stores complete data through multiple cloud storage devices, realizes decentralized storage, and uses slicing and reordering to ensure that the correct merged data can only be obtained when all cloud storage devices and data requesting devices are normal.

Benefits of technology

Through this method, the security of data transmission is greatly improved, the risk of data leakage is reduced, and the immutability, transparency and traceability of data access information is ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120145447A_ABST
    Figure CN120145447A_ABST
Patent Text Reader

Abstract

The invention provides a block chain-based data storage method and system and a storage medium, and the method comprises the steps: receiving a first data set to be stored by user equipment, and carrying out the secrecy level division of the first data set to determine a second data set, uploading the data in the second data set to a plurality of cloud storage devices of corresponding levels to enable the cloud storage devices to determine slice data of different serial numbers; receiving request information and an authority identifier of the data request equipment to determine verification information, and uploading the verification information to the block chain, so that the cloud storage equipment determines a serial number of accessible slice data; accessing the target cloud storage device to obtain the slice data, merging the slice data according to the data merging sequence determined by the data request device to determine merged data, and judging whether the merged data corresponds to the request information or not; and if yes, sending the merged data to a data request device. According to the method and the device, the problem of relatively high data leakage risk of a block chain-based data storage method adopting cloud equipment in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information security technology, and particularly to a data storage method, system and storage medium based on blockchain. Background Art

[0002] A blockchain network is a distributed data storage network, which has characteristics such as decentralization (i.e., not relying on a third party), non-tamperability, full traceability, traceability, collective maintenance, and public transparency, and has been widely applied to various fields of social life. The blockchain network consists of multiple nodes. When a new block is generated in the blockchain network, each node can, through data synchronization technology, store the data corresponding to the new block in the blockchain ledger maintained by the node to obtain the complete ledger data of the blockchain network. A node storing the complete ledger data is called a full node.

[0003] This method makes the blockchain storage technology not applicable to all scenarios. For example, for audio and video data that requires a large amount of storage, due to the large amount of stored data and the different storage capabilities of each node on the blockchain, it is difficult and costly to maintain full nodes.

[0004] Therefore, in the prior art, there is a technology that combines cloud storage and blockchain. The main data is stored through cloud storage technology, and the secondary data is stored through blockchain and permission authentication is performed, thereby solving the problem that blockchain cannot store large-scale audio and video data, and retaining the transparency and traceability characteristics of blockchain. However, this method involves the transmission of multi-party data, and any data leakage of any party will affect data security, greatly increasing the risk of data leakage. Summary of the Invention

[0005] Based on this, the object of the present invention is to provide a data storage method, system and storage medium based on blockchain, aiming to solve the problem of high data leakage risk in the prior art method of using cloud devices for data storage based on blockchain.

[0006] According to a data storage method based on blockchain of an embodiment of the present invention, the method includes:

[0007] Receiving a first data set to be stored by a user device, and determining a second data set according to the confidentiality level of the data in the first data set. The first data set at least includes non-encrypted data and encrypted data determined by the user device according to the original data. The second data set at least includes first-level data and second-level data. The first-level data includes the non-encrypted data, and the second-level data includes the non-encrypted data and the encrypted data;

[0008] Upload the data at different levels in the second dataset to multiple cloud storage devices at corresponding levels, so that the cloud storage devices determine the sliced data with different serial numbers, and upload the third data describing the original data to the blockchain constructed by multiple user devices and cloud storage devices;

[0009] Receive the request information and permission identifier of the data request device to determine the verification information and upload it to the blockchain, so that the cloud storage device determines the serial numbers of the accessible sliced data according to the verification information;

[0010] Access the corresponding cloud storage device to obtain the sliced data, receive the data merging order determined by the data request device according to the verification information to determine the merged data, and determine whether the merged data corresponds to the request information;

[0011] If so, send the merged data to the data request device.

[0012] In addition, a data storage method based on blockchain according to the above embodiments of the present invention may further have the following additional technical features:

[0013] Further, the steps of the cloud storage device slicing and sequencing data by a preset method include:

[0014] Slice the data by a preset slicing method to determine multiple sliced data in the correct order;

[0015] Number the cloud storage devices at the same level, and according to the number of the cloud storage device, determine that the serial number of the sliced data corresponding to the order and the number is the first digit, and the serial number of the previous sliced data of the first sliced data is the last digit.

[0016] Further, the steps of determining the verification information include:

[0017] Determine the request time and the level information of the requested access data according to the request information;

[0018] Determine a random number according to the request information through a preset random number algorithm;

[0019] Determine the corresponding hash algorithm according to the level information, and perform a hash operation on the random number through the hash algorithm to obtain a verification hash value;

[0020] Merge the permission identifier, the level information and the verification hash value as the verification information and upload it to the blockchain.

[0021] Further, the steps of the cloud storage device determining the serial numbers of the accessible sliced data according to the verification information include:

[0022] Judge whether itself is an access object according to the level information, and judge whether the data request device has the permission according to the permission information;

[0023] If itself is an access object and the data request device has the permission, determine the random number according to the verification hash value and the hash mapping table;

[0024] Determine the serial number of the slice data that can be accessed according to the random number, which is consistent with the serial number of the slice data that can be accessed by the cloud storage device of the same level.

[0025] Further, the step in which the data request device determines the data merging order according to the verification information includes:

[0026] Determine the random number according to the verification hash value and the hash mapping table;

[0027] Determine the sorting value through a preset formula according to the random number;

[0028] Arrange the numbers of the cloud storage devices in sequence in a clockwise direction to form a data chain with the first and last connected;

[0029] Select the number that is the same as the sorting value as the first one, and sequentially select each number along the data chain in the clockwise direction to determine the data merging order;

[0030] The preset formula is

[0031]

[0032] where X is the random number, n max is the total number of numbers in the data chain, and n is the sorting value.

[0033] Further, all the slice data are set in the non-volatile memory. After the step of determining the serial number of the slice data that can be accessed according to the random number, it includes:

[0034] Copy the slice data that can be accessed to the volatile memory according to the serial number and limit the number of accesses, and delete the slice data in the volatile memory after the number of accesses is consumed.

[0035] Further, after the step of judging whether the merged data and the request information are corresponding, it includes:

[0036] If the merged data is non-readable data or the merged data does not correspond to the request information, delete the received slice data and the merged data;

[0037] And generate a security warning and upload it to the blockchain to indicate that there are security issues with the data request device or the cloud storage device.

[0038] Another object of the present invention is to provide a blockchain-based data storage system, the system comprising:

[0039] A receiving module, configured to receive a first data set to be stored by a user device, and determine a second data set according to the confidentiality level of the data in the first data set. The first data set at least includes non-encrypted data and encrypted data determined by the user device according to the original data. The second data set at least includes first-level data and second-level data. The first-level data includes the non-encrypted data, and the second-level data includes the non-encrypted data and the encrypted data;

[0040] A storage module, configured to upload data of different levels in the second data set to multiple corresponding-level cloud storage devices, so that the cloud storage devices determine slice data of different serial numbers, and upload third data describing the original data to a blockchain constructed by multiple user devices and cloud storage devices;

[0041] A verification module, configured to receive a request message and a permission identifier of a data request device, determine verification information and upload it to the blockchain, so that the cloud storage device determines the serial numbers of the accessible slice data according to the verification information;

[0042] A judgment module, configured to access the corresponding cloud storage device to obtain the slice data, receive the data merging order determined by the data request device according to the verification information to determine merged data, and judge whether the merged data corresponds to the request message;

[0043] A transmission module, configured to, when the merged data is readable data and corresponds to the request message, send the merged data to the data request device.

[0044] Another object of the embodiments of the present invention is to provide a storage medium, on which a computer program is stored, and when the program is executed by a processor, the steps of the above-mentioned blockchain-based data storage method are implemented.

[0045] Another object of the embodiments of the present invention is to provide an electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the steps of the above-mentioned blockchain-based data storage method are implemented.

[0046] In the present invention, by receiving unencrypted data and encrypted data for device transmission, the intermediate server transmits the data to different cloud storage devices corresponding to different levels according to the confidentiality levels of the respective data, and uploads the third data to the blockchain, so that other users can determine the existing data based on the third data and request access according to their needs; by setting multiple cloud storage devices at the same level and all receiving the complete data corresponding to the level, decentralization is achieved, so that after any cloud storage device is damaged, the complete data can be obtained through other cloud storage devices.

[0047] Then, the cloud storage device slices the data using the same method to obtain slice data with the same quantity and content, and reorders the slice data of different cloud storage devices so that the slice data with the same serial number in different cloud storage devices is different, so that when obtaining data subsequently, the slice data with the same serial number in different cloud storage devices can be integrated into complete data in a specific order. Furthermore, only when each cloud storage device and the data request device are normal can the intermediate server obtain the correct slice data of each one, and integrate the data according to the correct order provided by the data request device to obtain the correct merged data. If the merged data is normal, it contains unencrypted data. Furthermore, based on the unencrypted data and the request information, it can be determined whether the merged data is normal. If it is normal, it can be determined that the cloud storage device and the data request device are both operating normally. Thus, the merged data can be sent to the data request device, and the data request device decrypts the encrypted data using the key it possesses to obtain the confidential data. Through this method, zero-knowledge proof between each cloud storage device and the data request device is achieved, and if any one device has a problem, the correct merged data cannot be obtained. Moreover, each data request is equivalent to a security verification of each device, thus greatly improving the security of data transmission and reducing the risk of data leakage.

[0048] In addition, the intermediate server, the cloud storage device, and the data request device cannot independently obtain the decrypted confidential data, further reducing the risk of data leakage. In addition, the determination of the slice data corresponding to the serial number by each cloud storage device and the determination of the correct merging order by the data request device are both determined according to the verification information transmitted by the intermediate server to the blockchain, thus ensuring the non-tamperability, transparency, and traceability of the data access information. Therefore, the present invention solves the problem of high data leakage risk in the prior art's method of using cloud devices for data storage based on the blockchain. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 It is a flowchart of the data storage method based on the blockchain in the first embodiment of the present invention;

[0050] Figure 2It is a structural block diagram of a blockchain-based data storage system in the second embodiment of the present invention;

[0051] Figure 3 It is a structural schematic diagram of an electronic device in the third embodiment of the present invention;

[0052] The following specific embodiments will further illustrate the present invention in conjunction with the above-mentioned drawings. Specific Embodiments

[0053] To facilitate the understanding of the present invention, the present invention will be described more comprehensively below with reference to the relevant drawings. Several embodiments of the present invention are shown in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, these embodiments are provided to make the disclosure of the present invention more thorough and comprehensive.

[0054] It should be noted that when an element is referred to as being "fixedly provided on" another element, it can be directly on the other element or there may also be an intermediate element. When an element is considered to be "connected" to another element, it can be directly connected to the other element or there may be an intermediate element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are only for the purpose of illustration.

[0055] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.

[0056] Embodiment 1

[0057] Please refer to Figure 1 , which shows a blockchain-based data storage method in the first embodiment of the present invention. The method specifically includes steps S01 - S05.

[0058] S01. Receive a first data set to be stored by a user device, and determine a second data set according to the confidentiality level of the data in the first data set. The first data set at least includes non-encrypted data and encrypted data determined by the user device according to the original data. The second data set at least includes first-level data and second-level data. The first-level data includes the non-encrypted data, and the second-level data includes the non-encrypted data and the encrypted data.

[0059] By way of example and not limitation, in some alternative embodiments, the security levels can also be divided into first-level security, second-level security, third-level security, etc. according to the degree of confidentiality. Data at different security levels is encrypted using different encryption algorithms. Thus, the first data set can include unencrypted data, first-level encrypted data, second-level encrypted data, and third-level encrypted data. Consequently, the second data set can include first-level data, second-level data, third-level data, and fourth-level data. Among them, the first-level data includes unencrypted data, the second-level data includes unencrypted data and first-level encrypted data, the third-level data includes unencrypted data, first-level encrypted data, and second-level encrypted data, and the fourth-level data includes unencrypted data, first-level encrypted data, second-level encrypted data, and third-level encrypted data. This enables the method to also be applicable to usage scenarios with multi-level security requirements, thereby further enhancing the security of the data.

[0060] S02, Upload the data at different levels in the second data set to multiple cloud storage devices corresponding to the levels, so that the cloud storage devices determine the sliced data with different serial numbers, and upload the third data describing the original data to the blockchain constructed by multiple user devices and cloud storage devices.

[0061] Specifically, the steps for the cloud storage device to slice and number the data through a preset method include: slicing the data through a preset slicing method to determine multiple sliced data in the correct order; numbering the cloud storage devices at the same level, and according to the number of the cloud storage device, determining that the serial number of the sliced data corresponding to the order and the number is the first digit, and the serial number of the previous sliced data of the first sliced data is the last digit. By sending files at the same level to multiple cloud storage devices to achieve decentralized storage, then slicing the data by each cloud storage device, and respectively obtaining and integrating partial sliced data from different cloud storage devices to obtain the complete required data, thereby avoiding the situation where data in some cloud storage devices is leaked or insecure, resulting in data leakage. In addition, after the order of the sliced data by each cloud storage device is adjusted, it is also impossible to determine the accurate data order. Thus, even if the data in the cloud storage device is leaked, it takes a lot of time to determine the accurate order and decrypt the encrypted data, so that there is enough time to respond to the data leakage. For ease of understanding, an example of numbering the sliced data is now given. The data is sliced to obtain the first slice, the second slice, and the third slice in the normal order. When the number of the cloud storage device is one, the serial number of the first slice is marked as one, the serial number of the second slice is marked as two, and the serial number of the third slice is marked as three. When the number of the cloud storage device is two, the serial number of the second slice is marked as one, the serial number of the third slice is marked as two, and the serial number of the first slice is marked as three. It should be noted that the number of sliced data generated after slicing the data is greater than the number of cloud storage devices at the corresponding level.

[0062] S03 receives the request information and permission identifier of the data request device, determines the verification information and uploads it to the blockchain, so that the cloud storage device determines the serial numbers of the slice data that can be accessed according to the verification information.

[0063] Specifically, the steps for determining the verification information include: determining the request time and the level information of the requested access data according to the request information; determining a random number according to the request information through a preset random number algorithm; determining the corresponding hash algorithm according to the level information, and performing a hash operation on the random number through the hash algorithm to obtain a verification hash value; merging the permission identifier, the level information, and the verification hash value as the verification information and uploading it to the blockchain. By determining the subsequent verification hash value through real-time request information and a preset random number algorithm, the effect of dynamic random verification is achieved, further enhancing the security of the method. In addition, in actual implementation, a hash value can be obtained by performing a hash operation on the request time in the request information, that is, year, month, day, hour, minute, and second, through any hash algorithm, selecting any preset number of characters in the hash value for sorting to obtain a string, obtaining the order of each character in the string in the public character table, and determining a digital string as the random number. Furthermore, the size and quantity of the random number are within a preset range, and the hash value determined by the corresponding hash algorithm is also limited. The cloud storage device can determine the corresponding random number through one-by-one comparison. In addition, a corresponding hash algorithm can also be set on the cloud storage device, and the same verification hash value is obtained by inputting different numbers once to determine the random number.

[0064] Further, the step of the cloud storage device determining the sequence numbers of the accessible slice data according to the verification information includes: judging whether itself is an access object according to the level information and judging whether the data request device has the permission according to the permission information; if itself is an access object and the data request device has the permission, determining the random number according to the verification hash value and the hash mapping table; determining the sequence numbers of the accessible slice data according to the random number, and the sequence numbers of the accessible slice data of cloud storage devices at the same level are the same. Specifically, when the range of the random number is set between the range of the sequence numbers of the slice data, the corresponding sequence numbers and slice data can be determined through the random numbers. When the range of the random number is enhanced to improve confidentiality, the number of data slices is reduced, and the data processing speed is increased, so that the random number is greater than the sequence number. Therefore, it is necessary to process the random number additionally to obtain a target number, and select the slice data with the same target number as the accessed slice data. By way of example and not limitation, the method for processing the random number may be to divide the random number by the number of slices for current data slicing to obtain a remainder. That is, when the data is sliced into three parts each time, divide by three. When the remainder is 0, the target number is the number of slices for current data slicing, which is three when the data is sliced into three parts each time. When the remainder is not 0, the target number is the remainder.

[0065] Still further, all the slice data are set in a non-volatile memory. After the step of determining the sequence numbers of the accessible slice data according to the random number, it includes: copying the accessible slice data to a volatile memory according to the sequence numbers and limiting the number of accesses, and deleting the slice data in the volatile memory after the number of accesses is consumed. Specifically, in specific implementation, the cloud storage device places the data to be accessed in the volatile memory and limits the number of accesses, so that the intermediate server accesses the data according to the permission. Then, after the access, the data is removed, further enhancing the security of the data. And through the volatile memory, when suffering from an external hardware malicious attack, the volatile memory will be powered off, and the data in the volatile memory will be cleared.

[0066] S04. Access the corresponding cloud storage device to obtain the slice data, receive the data merging order determined by the data request device according to the verification information to determine the merged data, and judge whether the merged data corresponds to the request information.

[0067] Specifically, the step in which the data request device determines the data merging order according to the verification information includes: determining the random number according to the verification hash value and the hash mapping table; determining the sorting value through a preset formula according to the random number; arranging the numbers of the cloud storage devices in sequence in a clockwise direction to form a data chain with the first and last connected; selecting the number consistent with the sorting value as the first one, and sequentially selecting each number along the data chain in the clockwise direction to determine the data merging order;

[0068] The preset formula is

[0069]

[0070] where X is the random number, n max is the total number of numbers in the data chain, and n is the sorting value. By arranging the sliced data of different cloud storage devices differently and the method for determining the aligned data merging order, accurate data can be obtained only when each cloud storage device and the data request device are operating normally, thereby realizing zero-knowledge verification between each cloud storage device and the data request device. Moreover, each data request is equivalent to a security verification, greatly improving the security. And when performing the security verification, no relevant keys are involved, and the verification is carried out through an intermediate server. Each cloud storage device and the data request device are not aware of the verification result. Therefore, when there are insecure conditions in each cloud storage device and the data request device, there is more time for countermeasures and processing.

[0071] In addition, before verification, the data has been transmitted to the intermediate server through the cloud storage device, avoiding the situation of large access volume and slow data transmission of the cloud storage device. And after being verified and determined by the intermediate server, the merged data can be sent to the data request device, further avoiding the risk of data leakage.

[0072] S05, if so, send the merged data to the data request device.

[0073] By way of example and not limitation, in the following optional embodiments, if the merged data is non-readable data or the merged data does not correspond to the requested information, the received slice data and the merged data are deleted; and a security warning is generated and uploaded to the blockchain to indicate that there are security issues with the data request device or the cloud storage device. Since data transmission is implemented through an intermediate server and the final security verification is carried out by the intermediate server, when there are security issues, the intermediate server can cut off access or even physically shut down after sending a security warning. Since there is no intersection between each cloud storage device and data request device and they do not know each other's addresses, any device having security issues can be avoided from affecting other devices through disconnection by the intermediate server. In addition, the intermediate server can store the received slice data and the merged data after merging in volatile memory, and when the intermediate server is physically offline, these data will also disappear, thereby further improving the security of this method.

[0074] In summary, in the above-described embodiments of the present invention, the blockchain-based data storage method receives non-encrypted data and encrypted data for device transmission, enabling the intermediate server to transmit them to different corresponding-level cloud storage devices according to the confidentiality levels of the respective data, and uploading the third data to the blockchain, allowing other users to determine the currently existing data based on the third data for requesting access according to requirements. By setting multiple cloud storage devices at the same level and all receiving the complete corresponding-level data, decentralization is achieved. After any cloud storage device is damaged, complete data can be obtained through other cloud storage devices. Then, the cloud storage devices slice the data using the same method to obtain slice data with the same quantity and content, and reorder the slice data of different cloud storage devices so that the slice data with the same serial number in different cloud storage devices is different. When obtaining data subsequently, the slice data with the same serial number in different cloud storage devices can be integrated into complete data in a specific order. Thus, only when all cloud storage devices and data request devices are normal can the intermediate server obtain the correct slice data of each item and integrate the data according to the correct order provided by the data request device to obtain the correct merged data. If the merged data is normal, it contains non-encrypted data. Therefore, based on the non-encrypted data and request information, it can be determined whether the merged data is normal. If it is normal, it can be determined that both the cloud storage devices and the data request device are operating normally, and thus the merged data can be sent to the data request device, enabling the data request device to decrypt the encrypted data using the key it possesses to obtain the confidential data. Through this method, zero-knowledge proof between each cloud storage device and data request device is achieved. If any device has a problem, the correct merged data cannot be obtained, and each data request is equivalent to a security verification of each device, thereby greatly improving the security of data transmission, reducing the risk of data leakage, and preventing the intermediate server, cloud storage devices, and data request devices from independently obtaining the decrypted confidential data, further reducing the risk of data leakage. In addition, the determination of the slice data with the corresponding serial number by each cloud storage device and the determination of the correct merging order by the data request device are both based on the verification information transmitted by the intermediate server to the blockchain, thus ensuring the non-tamperability, transparency, and traceability of data access information. Therefore, the present invention solves the problem of high data leakage risk in the prior art's blockchain-based method of using cloud devices for data storage.

[0075] Embodiment 2

[0076] Please refer to Figure 2, shown is a structural block diagram of a blockchain-based data storage system proposed in the second embodiment of the present invention. The blockchain-based data storage system 200 includes: a receiving module 210, a storage module 220, a verification module 230, a judgment module 240, and a transmission module 250, where:

[0077] The receiving module 210 is configured to receive a first data set to be stored by a user device, and determine a second data set according to the confidentiality level of the data in the first data set. The first data set at least includes non-encrypted data and encrypted data determined by the user device according to the original data. The second data set at least includes first-level data and second-level data. The first-level data includes the non-encrypted data, and the second-level data includes the non-encrypted data and the encrypted data;

[0078] The storage module 220 is configured to upload data of different levels in the second data set to multiple corresponding-level cloud storage devices, so that the cloud storage devices determine sliced data of different serial numbers, and upload third data describing the original data to a blockchain constructed by multiple user devices and cloud storage devices;

[0079] The verification module 230 is configured to receive a request message and a permission identifier of a data request device to determine verification information and upload it to the blockchain, so that the cloud storage device determines the serial numbers of the accessible sliced data according to the verification information;

[0080] The judgment module 240 is configured to access the corresponding cloud storage device to obtain the sliced data, receive the data merging order determined by the data request device according to the verification information to determine the merged data, and judge whether the merged data corresponds to the request message;

[0081] The transmission module 250 is configured to, when the merged data is readable data and corresponds to the request message, send the merged data to the data request device.

[0082] The functions or operation steps implemented when the above modules are executed are substantially the same as those in the above method embodiment, and will not be elaborated here.

[0083] Embodiment Three

[0084] On the other hand, the present invention also proposes an electronic device. Please refer to Figure 3 , shown is a schematic diagram of the electronic device in the third embodiment of the present invention, including a memory 20, a processor 10, and a computer program 30 stored on the memory and executable on the processor. When the processor 10 executes the computer program 30, it implements the blockchain-based data storage method as described above.

[0085] Among them, in some embodiments, the processor 10 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips, and is used to run the program code stored in the memory 20 or process data, such as executing an access restriction program, etc.

[0086] Among them, the memory 20 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, a hard disk, a multimedia card, a card-type memory (such as an SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 20 may be an internal storage module of the electronic device in some embodiments, such as the hard disk of the electronic device. The memory 20 may also be an external storage device of the electronic device in other embodiments, such as a plug-in hard disk equipped on the electronic device, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the memory 20 may also include both an internal storage module and an external storage device of the electronic device. The memory 20 can be used not only to store application software and various types of data of the electronic device, but also to temporarily store data that has been output or will be output.

[0087] It should be noted that Figure 3 the shown structure does not constitute a limitation on the electronic device. In other embodiments, the electronic device may include fewer or more components than shown in the figure, or combine some components, or have a different component layout.

[0088] The embodiment of the present invention also proposes a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the data storage method based on the blockchain as described above.

[0089] Those skilled in the art can understand that the logic and / or steps represented in the flowchart or described in other ways herein, for example, can be considered as a definite sequence list of executable instructions for implementing a logical function, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or in combination with these instruction execution systems, apparatus, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.

[0090] More specific examples (a non-exhaustive list) of computer-readable media include the following: electrical connections (electronic devices) having one or more wirings, portable computer diskettes (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber devices, and portable compact disc read-only memory (CDROM). Additionally, the computer-readable media can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or otherwise processing as appropriate, and then storing it in a computer memory.

[0091] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGA), field programmable gate arrays (FPGA), etc.

[0092] In the description of this specification, the description with reference to terms such as "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0093] The above embodiments merely represent several implementation manners of the present invention, and their descriptions are relatively specific and detailed, but should not be construed as limiting the scope of the patent of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present invention, several modifications and improvements can still be made, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention should be subject to the appended claims.

Claims

1. A data storage method based on blockchain, characterized in that: The method comprises, Receive a first data set to be stored by a user device, and determine a second data set according to the confidentiality level of data in the first data set, wherein the first data set at least includes non-encrypted data and encrypted data determined by the user device according to original data, and the second data set at least includes primary data and secondary data, wherein the primary data includes the non-encrypted data, and the secondary data includes the non-encrypted data and the encrypted data; Uploading the data of different levels in the second data set to a plurality of cloud storage devices of corresponding levels, so that the cloud storage device determines the slice data of different sequence numbers, and uploading the third data describing the original data to the blockchain constructed by the plurality of user devices and the cloud storage device; Receive request information and permission identification from a data requesting device to determine verification information and upload it to the blockchain, so that the cloud storage device determines the serial number of the accessible slice data according to the verification information; Accessing the corresponding cloud storage device to obtain the slice data, receiving the data merging order determined by the data requesting device according to the verification information to determine the merged data, and determining whether the merged data corresponds to the request information; If yes, the combined data is sent to the data requesting device.

2. The data storage method based on blockchain according to claim 1 is characterized in that: The cloud storage device slices and sequences the data using a preset method to determine the sliced ​​data with different sequence numbers, including: Slicing the data using a preset slicing method to determine a plurality of sliced ​​data in a correct order; The cloud storage devices at the same level are numbered, and according to the number of the cloud storage device, the sequence number of the slice data corresponding to the number is determined as the first bit, and the sequence number of the slice data preceding the first bit of the slice data is the last bit.

3. The data storage method based on blockchain according to claim 2 is characterized in that: The step of determining the verification information comprises: Determine the request time and level information of the requested access data according to the request information; Determine a random number using a preset random number algorithm according to the request information; Determine a corresponding hash algorithm according to the level information, and perform a hash operation on the random number using the hash algorithm to obtain a verification hash value; The authority identifier, the level information and the verification hash value are combined as verification information and uploaded to the blockchain.

4. The data storage method based on blockchain according to claim 3 is characterized in that: The step of determining, by the cloud storage device, the sequence number of the accessible slice data according to the verification information comprises: Determine whether the device is an access object according to the level information and determine whether the data requesting device has the authority according to the authority information; If the device itself is the access object and the data requesting device has the authority, the random number is determined according to the verification hash value and the hash mapping table; The serial numbers of the accessible slice data are determined according to the random number, and the serial numbers of the accessible slice data of the cloud storage devices at the same level are consistent.

5. The data storage method based on blockchain according to claim 4 is characterized in that: The step of the data requesting device determining the data merging order according to the verification information comprises: Determine the random number according to the verification hash value and the hash mapping table; Determine a ranking value according to the random number using a preset formula; Arrange the numbers of the cloud storage devices in order clockwise to form a data chain with the first one connected; The number consistent with the sorting value is selected as the first one, and each number is selected in sequence along the data chain pointer to determine the data merging order; The preset formula is: Wherein, X is the random number, n max is the total number of numbers in the data chain, and n is the sorting value.

6. The data storage method based on blockchain according to claim 4 is characterized in that: All the slice data are set in a non-volatile memory, and the step of determining the sequence number of the accessible slice data according to the random number includes: The accessible slice data is copied to a volatile memory according to the sequence number and the number of accesses is limited, and the slice data in the volatile memory is deleted after the number of accesses is consumed.

7. The data storage method based on blockchain according to claim 1 is characterized in that: The step of determining whether the combined data corresponds to the request information includes: If the merged data is unreadable data or the merged data does not correspond to the request information, deleting the received slice data and the merged data; A security warning is generated and uploaded to the blockchain to indicate that there is a security problem with the data requesting device or the cloud storage device.

8. A data storage system based on blockchain, characterized in that: For implementing the blockchain-based data storage method according to any one of claims 1 to 7, the system comprises: a receiving module, configured to receive a first data set to be stored by a user device, and determine a second data set according to a confidentiality level of data in the first data set, wherein the first data set at least includes non-encrypted data and encrypted data determined by the user device according to original data, and the second data set at least includes primary data and secondary data, wherein the primary data includes the non-encrypted data, and the secondary data includes the non-encrypted data and the encrypted data; A storage module, used to upload data of different levels in the second data set to a plurality of cloud storage devices of corresponding levels, so that the cloud storage device determines slice data of different sequence numbers, and upload third data describing the original data to a blockchain constructed by the plurality of user devices and the cloud storage device; A verification module, used to receive request information and an authority identifier from a data requesting device, to determine verification information and upload it to the blockchain, so that the cloud storage device determines the serial number of the accessible slice data according to the verification information; a judgment module, configured to access the corresponding cloud storage device to obtain the slice data, receive the data merging order determined by the data request device according to the verification information to determine the merged data, and judge whether the merged data corresponds to the request information; A transmission module is used to send the combined data to the data requesting device when the combined data is readable data and corresponds to the request information.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the blockchain-based data storage method as described in any one of claims 1 to 7 are implemented.

10. An electronic device, characterized in that: It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the blockchain-based data storage method as described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Blockchain-based distributed storage method

    CN108111585A

  • Block chain distributed storage method, data reading method and device and storage medium

    CN110175212A

  • File storage method and device based on block chain, terminal equipment and medium

    CN111198862A

  • Data storage management method on blockchain

    CN111427897A

  • Data storage method and device based on block chain

    CN111866123A