A data storage method, system and storage medium based on blockchain

By dividing data levels in the blockchain and using verification information to determine the slice data serial number of the cloud storage device, the problem of data leakage risk in blockchain data storage is solved, security verification and decentralized storage are achieved, and the security and integrity of data transmission are ensured.

CN120145447BActive Publication Date: 2025-09-09SHANGRAO ACAD OF SCI CLOUD COMPUTING CENT BIG DATA RES INST
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The existing blockchain-based data storage method has a high risk of data leakage, especially when combined with cloud storage, the security of data transmission is difficult to guarantee.

Method used

By receiving the data set from the user's device and dividing it into different levels of data sets according to the confidentiality level, uploading it to the cloud storage device of the corresponding level, and recording the third data describing the data in the blockchain, the verification information is used to determine the accessible slice data sequence number, decentralized storage and dynamic random verification are achieved to ensure the security of data transmission.

Benefits of technology

It achieves security verification of data transmission, reduces the risk of data leakage, ensures the non-tamperability, transparency and traceability of data access, and can still obtain complete data when the device is damaged.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120145447B_ABST
    Figure CN120145447B_ABST
Patent Text Reader

Abstract

The present invention provides a blockchain-based data storage method, system, and storage medium. The method includes: receiving a first data set to be stored by a user device, dividing the first data set into confidentiality levels to determine a second data set, uploading the data in the second data set to multiple cloud storage devices of corresponding levels so that the cloud storage devices can determine slice data of different serial numbers; receiving 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 can determine the serial numbers of accessible slice data; accessing a target cloud storage device to obtain slice data and merging the slice data according to a data merging order determined by the data requesting device to determine merged data and determine whether the merged data corresponds to the request information; if so, sending the merged data to the data requesting device. The present invention solves the problem that the existing blockchain-based data storage method using cloud devices for data storage has a high risk of data leakage.
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 in particular to a data storage method, system, and storage medium based on blockchain. Background Art

[0002] The blockchain network is a distributed data storage network characterized by decentralization (i.e., independence from third parties), immutability, full traceability, traceability, collective maintenance, and transparency. It has been widely adopted in various areas of social life. A blockchain network consists of multiple nodes. When a new block is generated in the blockchain network, each node uses data synchronization technology to store the data corresponding to the new block in the blockchain ledger maintained by that node, thus obtaining the complete ledger data of the blockchain network. A node that stores this complete ledger data is called a full node.

[0003] This approach means that blockchain storage technology is not suitable for all scenarios. For example, when a large amount of audio and video data needs to be stored, the storage capacity of each node on the blockchain varies, making full node maintenance difficult and costly.

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

[0005] Based on this, the purpose of the present invention is to provide a blockchain-based data storage method, system and storage medium, aiming to solve the problem that the existing blockchain-based data storage method using cloud devices has a high risk of data leakage.

[0006] A data storage method based on blockchain according to an embodiment of the present invention includes:

[0007] receiving a first data set to be stored by a user device, and determining a second data set based on a confidentiality level of data in the first data set, wherein the first data set includes at least unencrypted data and encrypted data determined by the user device based on original data, and the second data set includes at least primary data and secondary data, wherein the primary data includes the unencrypted data, and the secondary data includes the unencrypted data and the encrypted data;

[0008] Uploading data of different levels in the second data set to multiple cloud storage devices of corresponding levels, so that the cloud storage devices determine slice data of different sequence numbers, and uploading third data describing the original data to a blockchain constructed by the multiple user devices and cloud storage devices;

[0009] 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;

[0010] 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;

[0011] If yes, the combined data is sent to the data requesting device.

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

[0013] Furthermore, the cloud storage device may slice and sequence the data using a preset method, including:

[0014] Slicing the data using a preset slicing method to determine a plurality of sliced ​​data in a correct order;

[0015] 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 to be the first, and the sequence number of the slice data preceding the first slice data is the last.

[0016] Furthermore, the step of determining the verification information includes:

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

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

[0019] 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;

[0020] The authority identifier, the level information and the verification hash value are combined as verification information and uploaded to the blockchain.

[0021] Furthermore, the step of determining, by the cloud storage device, the serial number of the accessible slice data according to the verification information includes:

[0022] Determine whether the device itself is an access target based on the level information and determine whether the data requesting device has the authority based on the authority information;

[0023] If the device itself is the access object and the data requesting device has the authority, determining the random number according to the verification hash value and the hash mapping table;

[0024] 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.

[0025] Furthermore, the step of the data requesting device determining 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 a ranking value according to the random number using a preset formula;

[0028] Arrange the numbers of the cloud storage devices in order clockwise to form a data chain with the first one connected;

[0029] The number that is consistent with the sort value is selected as the first one, and each number is selected in sequence along the data chain according to the pointer to determine the data merging order;

[0030] The preset formula is:

[0031]

[0032] in, X is the random number, is the total number of numbers in the data chain, is the sort value.

[0033] Furthermore, all the slice data are set in a non-volatile memory, and after the step of determining the serial number of the accessible slice data according to the random number, the following steps are included:

[0034] 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.

[0035] Furthermore, after the step of determining whether the merged data corresponds to the request information, the following steps are included:

[0036] 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;

[0037] 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.

[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 based on a confidentiality level of data in the first data set, wherein the first data set includes at least unencrypted data and encrypted data determined by the user device based on original data, and the second data set includes at least primary data and secondary data, wherein the primary data includes the unencrypted data, and the secondary data includes the unencrypted data and the encrypted data;

[0040] a storage module, configured 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 devices determine 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 cloud storage devices;

[0041] A verification module is used to receive the request information and permission identifier of the data requesting device to determine the verification information and upload it to the blockchain, so that the cloud storage device can determine the serial number 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 requesting device according to the verification information to determine the merged data, and judge whether the merged data corresponds to the request information;

[0043] A transmission module is configured to send the combined data to the data requesting device when the combined data is readable data and corresponds to the request information.

[0044] Another object of an embodiment of the present invention is to provide a storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-mentioned blockchain-based data storage method.

[0045] Another object of an embodiment of the present invention is to provide an electronic device, comprising 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 steps of the above-mentioned blockchain-based data storage method are implemented.

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

[0047] Then, the data is sliced ​​using the same method through the cloud storage device to obtain slice data of the same number and content, and the slice data of different cloud storage devices are reordered so that the slice data with the same serial number in different cloud storage devices are different, so that when subsequent data is acquired, the slice data with the same serial number in different cloud storage devices can be integrated into complete data in a specific order. Only when all cloud storage devices and data request devices are normal can the intermediate server obtain the correct slice data 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. Then, it can be judged whether the merged data is normal through the non-encrypted data and the request information. If normal, it can be determined that the cloud storage device and the data request device are operating normally, so that the merged data can be sent to the data request device, so that the data request device can decrypt the encrypted data according to its own key to obtain the confidential data. This method realizes zero-knowledge proof between each cloud storage device and the data request device. If there is a problem with any device, the correct merged data cannot be obtained. Each data request is equivalent to a security verification of each device, which greatly improves the security of data transmission and reduces the risk of data leakage.

[0048] Furthermore, the intermediate server, cloud storage device, and data request device are all unable to independently obtain the decrypted confidential data, further reducing the risk of data leakage. Furthermore, each cloud storage device determines the corresponding serial number of the sliced ​​data, and the data request device determines the correct merge order, all based on the verification information transmitted to the blockchain by the intermediate server, thereby ensuring the immutability, transparency, and traceability of data access information. Therefore, this invention solves the problem of a high risk of data leakage in the existing blockchain-based data storage methods using cloud devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 Flowchart of the blockchain-based data storage method in the first embodiment of the present invention;

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

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

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

[0053] To facilitate understanding of the present invention, the present invention will be described more fully below with reference to the accompanying drawings. The drawings illustrate several embodiments of the present invention. However, the present invention may be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and comprehensive understanding of the present invention.

[0054] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly attached to the other element or there may be an intermediate element. When an element is referred to as being "connected to" another element, it may be directly connected to the other element or there may be an intermediate element. The terms "vertical," "horizontal," "left," "right," and similar expressions used herein are for illustrative purposes only.

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

[0056] Example 1

[0057] See also Figure 1 , shown is a blockchain-based data storage method in the first embodiment of the present invention, and the method specifically includes steps S01 to S05.

[0058] S01. Receive a first data set that a user device intends to store, and determine a second data set based on the confidentiality level of data in the first data set, wherein the first data set includes at least unencrypted data and encrypted data determined by the user device based on original data, and the second data set includes at least primary data and secondary data, wherein the primary data includes the unencrypted data, and the secondary data includes the unencrypted data and the encrypted data.

[0059] By way of example and not limitation, in some optional embodiments, confidentiality levels can be further divided into level one, level two, and level three according to the degree of confidentiality. Data at different confidentiality levels are encrypted using different encryption algorithms. Thus, a first data set can include unencrypted data, level one encrypted data, level two encrypted data, and level three encrypted data, and a second data set can include level one data, level two data, level three data, and level four data, wherein level one data includes unencrypted data, level two data includes unencrypted data and level one encrypted data, level three data includes unencrypted data, level one encrypted data, and level two encrypted data, and level four data includes unencrypted data, level one encrypted data, level two encrypted data, and level three encrypted data. This allows the method to be used in scenarios requiring multi-level confidentiality, thereby further enhancing data security.

[0060] S02, uploading the data of different levels in the second data set to multiple cloud storage devices of corresponding levels, so that the cloud storage device determines the slice data of different serial numbers, and uploading the third data describing the original data to the blockchain constructed by the multiple user devices and cloud storage devices.

[0061] Specifically, the step of slicing and serializing the data by the cloud storage device using a preset method includes: slicing the data using 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 sequence number of the sliced ​​data corresponding to the number is the first digit, and the sequence number of the sliced ​​data preceding the first digit is the last digit. Decentralized storage is achieved by sending files of the same level to multiple cloud storage devices, then slicing the data through each cloud storage device, and respectively obtaining partial sliced ​​data from different cloud storage devices for integration to obtain the complete required data, thereby avoiding data leakage or insecurity of some cloud storage devices, which leads to data leakage. In addition, after each cloud storage device adjusts the order of the sliced ​​data, it is still impossible to determine the exact data order. Therefore, even if the data of the cloud storage device is leaked, it takes a lot of time to determine the exact order and decrypt the encrypted data, so that there is enough time to respond to the data leak. To facilitate understanding, let's take an example of slice data serialization. Slicing the data yields the first, second, and third slices in normal order. If the cloud storage device is numbered one, the first slice is numbered one, the second slice is numbered two, and the third slice is numbered three. If the cloud storage device is numbered two, the second slice of the second slice is numbered one, the third slice is numbered two, and the first slice is numbered three. It should be noted that the number of slices generated by slicing the data is greater than the number of cloud storage devices of the corresponding level.

[0062] S03, receiving the request information and permission identification of the data requesting device to determine the 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.

[0063] Specifically, the step of determining verification information includes: determining the request time and level information of the requested access data based on the request information; determining a random number based on the request information using a preset random number algorithm; determining a corresponding hash algorithm based on the level information, and performing a hash operation on the random number using the hash algorithm to obtain a verification hash value; and combining the permission identifier, the level information, and the verification hash value as verification information and uploading it to the blockchain. By determining subsequent verification hash values ​​using real-time request information and a preset random number algorithm, dynamic random verification is achieved, further enhancing the security of the method. Furthermore, in a specific implementation, the request time (i.e., year, month, day, hour, minute, and second) in the request information can be hashed using any hash algorithm to obtain a hash value. A preset number of arbitrary characters in the hash value are selected and sorted to obtain a string. The order of each character in the string in a public character table is obtained to determine a string of numbers that is 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 by one-to-one comparison. In addition, the corresponding hash algorithm can also be set on the cloud storage device to determine the random number by inputting different numbers at a time and obtaining the same verification hash value.

[0064] Furthermore, the step of the cloud storage device determining the serial number of the accessible slice data based on the verification information includes: determining whether the cloud storage device is an access object based on the level information and determining whether the data requesting device has the authority based on the authority information; if the cloud storage device is an access object and the data requesting device has the authority, determining the random number based on the verification hash value and the hash mapping table; determining the serial number of the accessible slice data based on the random number, and the serial numbers of the accessible slice data of the cloud storage device at the same level are consistent. Specifically, when the range of the random number is set to be between the serial number range of the slice data, the corresponding serial number and slice data can be determined by the random number. When the range of the random number is set to be between the serial number range of the slice data, in order to enhance the confidentiality, reduce the number of data slices, and increase the data processing speed, the random number may be greater than the serial number. Therefore, the random number needs to be additionally processed to obtain the target number, and the slice data with the same serial number as the target number is selected as the slice data to be accessed. 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 currently being segmented to obtain a remainder, that is, each time the data is segmented into three parts, divide it by three. When the remainder is 0, the target number is the number of slices currently being segmented, and each time the data is segmented into three parts, it is three. When the remainder is not 0, the target number is the remainder.

[0065] Furthermore, all the slice data are set in a non-volatile memory, and the step of determining the serial number of the accessible slice data according to the random number includes: copying the accessible slice data to a volatile memory according to the serial number and limiting the number of accesses, and deleting the slice data in the volatile memory after the number of accesses is consumed. Specifically, during the specific implementation, the cloud storage device places the data to be accessed in a volatile memory and limits the number of accesses, so that the intermediate server accesses the data according to the authority, and then removes the data after the access, thereby further enhancing the security of the data, and through the volatile memory. When subjected to a malicious attack on external hardware, the volatile memory will be in a power-off state, and the data in the volatile memory will be cleared.

[0066] S04, 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.

[0067] Specifically, the step of the data requesting device determining 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 a ranking value according to the random number using a preset formula; arranging the numbers of the cloud storage devices in a clockwise order to form a data chain connected in the first place; selecting the number consistent with the ranking value as the first place, and selecting each number in turn along the data chain clockwise to determine the data merging order;

[0068] The preset formula is:

[0069]

[0070] in, X is the random number, is the total number of numbers in the data chain, The sorting value is described. By arranging data using different slices on different cloud storage devices and determining the order for merging aligned data, accurate data can only be obtained when all cloud storage devices and data requesting devices are operating normally. This enables zero-knowledge verification between each cloud storage device and the data requesting device, and each data request is equivalent to a security verification, greatly improving security. Furthermore, during security verification, no relevant keys are involved, and verification is performed through an intermediate server. Neither the cloud storage device nor the data requesting device is aware of the verification results. This allows more time to counter and address any insecurity issues with each cloud storage device or data requesting device.

[0071] In addition, before verification, the data has been transmitted to the intermediate server through the cloud storage device, thus avoiding the situation where the cloud storage device has a large number of accesses and slow data transmission. After verification and confirmation by the intermediate server, the merged data can be sent to the data requesting device, thereby further avoiding the risk of data leakage.

[0072] S05: If yes, send the combined data to the data requesting device.

[0073] By way of example and not limitation, in the following optional embodiment, if the merged data is unreadable or does not correspond to the requested information, the received sliced ​​data and merged data are deleted; a security warning is generated and uploaded to the blockchain, indicating a security issue with the data requesting device or cloud storage device. Since data transmission and final security verification are performed by an intermediary server, if a security issue arises, the intermediary server can simply send a security warning, sever access, or even physically shut down the device. Since the cloud storage devices and data requesting devices do not intersect and do not know each other's addresses, if a security issue occurs on any one device, disconnecting the intermediary server prevents the other devices from being affected. Furthermore, the intermediary server can store the received sliced ​​data and the merged data in volatile memory. This data disappears when the intermediary server is physically offline, further enhancing the security of the method.

[0074] In summary, the blockchain-based data storage method in the above embodiment of the present invention receives unencrypted data and encrypted data for device transmission, so that the intermediate server transmits the data to cloud storage devices of different corresponding levels according to the confidentiality level of each data, and uploads the third data to the blockchain, so that other users can determine the currently existing data based on the third data, so as to request access according to needs, and by setting up multiple cloud storage devices at the same level, and all receiving complete data of the corresponding level, decentralization is achieved, so that after any cloud storage device is damaged, the complete data can be obtained through other cloud storage devices. Then, the data is sliced ​​using the same method through the cloud storage device to obtain slice data of the same number and content, and the slice data of different cloud storage devices are reordered so that the slice data with the same serial number in different cloud storage devices are different, so that when subsequent data is acquired, the slice data with the same serial number in different cloud storage devices can be integrated into complete data in a specific order. Only when all cloud storage devices and data request devices are normal can the intermediate server obtain the correct slice data 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. Then, it can be judged whether the merged data is normal through the non-encrypted data and the request information. If normal, it can be determined that the cloud storage device and the data request device are operating normally, so that the merged data can be sent to the data request device, so that the data request device can decrypt the encrypted data according to its own key to obtain the confidential data. This method realizes zero-knowledge proof between each cloud storage device and the data request device, and if there is a problem with any device, the correct merged data cannot be obtained. Each data request is equivalent to a security verification of each device, which greatly improves the security of data transmission and reduces the risk of data leakage. The intermediate server, cloud storage device and data request device cannot independently obtain the decrypted confidential data, further reducing the risk of data leakage. In addition, each cloud storage device determines the slice data with the corresponding serial number and the data request device determines the correct merge order, all based on the verification information transmitted to the blockchain by the intermediate server, thereby ensuring the non-tamperability, transparency and traceability of data access information. Therefore, the present invention solves the problem in the prior art that the method of using cloud devices for data storage based on blockchain has a high risk of data leakage.

[0075] Example 2

[0076] See also Figure 2, which is a block diagram of a data storage system based on blockchain proposed in the second embodiment of the present invention. The data storage system based on blockchain 200 includes: a receiving module 210, a storage module 220, a verification module 230, a judgment module 240 and a transmission module 250, wherein:

[0077] A receiving module 210 is configured to receive a first data set to be stored by a user device, and determine a second data set based on the confidentiality level of data in the first data set, wherein the first data set includes at least unencrypted data and encrypted data determined by the user device based on the original data, and the second data set includes at least primary data and secondary data, wherein the primary data includes the unencrypted data, and the secondary data includes the unencrypted data and the encrypted data;

[0078] The storage module 220 is configured 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 devices determine 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 devices;

[0079] Verification module 230, configured to receive request information and permission identification from a data requesting device, determine verification information, and upload the verification information to the blockchain, so that the cloud storage device can determine the serial number of the accessible slice data according to the verification information;

[0080] A determination module 240 is configured to access the corresponding cloud storage device to obtain the slice data, receive the data merging order determined by the data requesting device according to the verification information to determine the merged data, and determine whether the merged data corresponds to the request information;

[0081] The transmission module 250 is configured to send the combined data to the data requesting device when the combined data is readable data and corresponds to the request information.

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

[0083] Example 3

[0084] Another aspect of the present invention provides an electronic device, see Figure 3 , shown is a schematic diagram of an electronic device according to a third embodiment of the present invention, comprising a memory 20, a processor 10, and a computer program 30 stored in the memory and executable on the processor. When the processor 10 executes the computer program 30, the blockchain-based data storage method described above is implemented.

[0085] In some embodiments, the processor 10 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip, used to run program codes or process data stored in the memory 20, such as executing access restriction programs.

[0086] The memory 20 includes at least one type of readable storage medium, including flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 20 may be an internal storage module of the electronic device, such as the hard disk of the electronic device. In other embodiments, the memory 20 may also be an external storage device of the electronic device, 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. Furthermore, the memory 20 may include both an internal storage module of the electronic device and an external storage 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 is about to be output.

[0087] It should be pointed out that Figure 3 The structure shown does not constitute a limitation to the electronic device. In other embodiments, the electronic device may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0088] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the blockchain-based data storage method as described above.

[0089] Those skilled in the art will appreciate that the logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device), or in conjunction with such instruction execution system, apparatus, or device. For purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by an instruction execution system, apparatus, or device, or in conjunction with such instruction execution system, apparatus, or device.

[0090] More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic devices), a portable computer disk cartridge (magnetic devices), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disc read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting, or processing it in another suitable manner as necessary, and then storing it in a computer memory.

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

[0092] Throughout this specification, references to terms such as "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" indicate that the specific features, structures, materials, or characteristics described in conjunction with that embodiment or example are included in at least one embodiment or example of the present invention. Throughout this specification, schematic representations of these terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

[0093] The above embodiments merely illustrate several implementations of the present invention, and while their descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art would be able to make numerous modifications and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.

Claims

1. A data storage method based on blockchain, characterized in that: The method comprises, receiving a first data set to be stored by a user device, and determining a second data set based on a confidentiality level of data in the first data set, wherein the first data set includes at least unencrypted data and encrypted data determined by the user device based on original data, and the second data set includes at least primary data and secondary data, wherein the primary data includes the unencrypted data, and the secondary data includes the unencrypted data and the encrypted data; Uploading the data of different levels in the second data set to multiple cloud storage devices of corresponding levels, so that the cloud storage devices determine slice data of different sequence numbers, and uploading the third data describing the original data to the blockchain constructed by the multiple user devices and cloud storage devices; 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 so, sending the combined data to the data requesting device; The cloud storage device slices and sequences the data using a preset method to determine 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; Numbering the cloud storage devices at the same level, and determining, based on the numbers of the cloud storage devices, that the sequence number of the slice data corresponding to the number is the first digit, and the sequence number of the slice data preceding the first digit is the last digit; The step of determining verification information includes: Determining the request time and level 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; Combining the permission identifier, the level information, and the verification hash value as verification information and uploading them to the blockchain; The step of determining, by the cloud storage device, the serial number of the accessible slice data according to the verification information includes: Determine whether the device itself is an access target based on the level information and determine whether the data requesting device has the authority based on the authority information; If the device itself is the access object and the data requesting device has the authority, determining the random number according to the verification hash value and the hash mapping table; Determine, according to the random number, the slice data with the same serial number as the random number that can be accessed, and the serial numbers of the slice data accessible to the cloud storage devices of the same level are consistent; The step of the data requesting device determining the data merging order according to the verification information includes: 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 that is consistent with the sort value is selected as the first one, and each number is selected in sequence along the data chain according to the pointer to determine the data merging order; The preset formula is: in, X is the random number, is the total number of numbers in the data chain, is the sort value.

2. The data storage method based on blockchain according to claim 1, characterized in that: All the slice data are set in a non-volatile memory, and after the step of determining the serial number of the accessible slice data according to the random number, the following steps are included: 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.

3. The data storage method based on blockchain according to claim 1, characterized in that: After the step of determining whether the merged data corresponds to the request information, the following steps are included: 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.

4. 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 3, 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 based on a confidentiality level of data in the first data set, wherein the first data set includes at least unencrypted data and encrypted data determined by the user device based on original data, and the second data set includes at least primary data and secondary data, wherein the primary data includes the unencrypted data, and the secondary data includes the unencrypted data and the encrypted data; a storage module, configured 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 devices determine 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 cloud storage devices; A verification module is configured to receive request information and an authority identifier from a data requesting device, determine verification information, and upload the verification information 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 requesting 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 configured to send the combined data to the data requesting device when the combined data is readable data and corresponds to the request information.

5. 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 according to any one of claims 1 to 3 are implemented.

6. An electronic device, characterized in that: The method comprises 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 method for data storage based on blockchain as described in any one of claims 1 to 3 is implemented.

Citation Information

Patent Citations

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

    CN111198862A

  • Data storage management method on blockchain

    CN111427897A