Data storage method and system based on block chain, storage medium and computer
By adopting blockchain-based data storage methods in heretic storage, the problems of storage security and data processing speed are solved, data block integrity verification and user privacy protection are realized, and the security and efficiency of data storage are improved.
Patent Information
- Application Number
- CN202510218382.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-26
- Publication Date
- 2025-06-27
AI Technical Summary
The existing heretic storage methods have storage security problems, and when the data volume increases, the data processing speed of user terminals slows down, the cloud server runs slowly, and the user experience declines.
Using a blockchain-based data storage method, by creating a blockchain contract, obtaining the service tasks of the user terminal in real time, performing task analysis and data file segmentation, generating verification parameters and data hash trees, creating storage contracts, and verifying validity through the terminal signature of the user terminal, and finally storing the data blocks on the server.
Through blockchain technology, data block integrity verification is achieved, data security is improved, user privacy is protected by anonymity, and data storage security and efficiency are improved.
Smart Images

Figure CN120217425A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of blockchain, and particularly to a data storage method, system, storage medium and computer based on blockchain. Background Art
[0002] With the continuous development of information network technology and the rapid improvement of people's living standards, off-site storage of big data such as cloud and private cloud has become one of the main storage methods for users' local data.
[0003] Currently, for the off-site storage method, centralized storage is usually adopted, and the local data generated by the same software used by different user terminals is centrally stored in the cloud server of the software. Along with the increase in the number of users, the data also shows explosive growth. The centralized storage method has storage security problems, and at the same time, when the data volume increases, it will cause the inability to process more quickly when sending data at the user terminal, resulting in slow operation of the cloud server and a decline in the user experience. Summary of the Invention
[0004] Based on this, the purpose of the present invention is to provide a data storage method, system, storage medium and computer based on blockchain to at least solve the above-mentioned technical deficiencies.
[0005] The present invention provides a data storage method based on blockchain, including: Create a blockchain contract for providing services and broadcast the blockchain contract to all nodes in the server; Real-time obtain the service tasks sent by the user terminal, and perform task analysis on the service tasks based on the blockchain contract to establish a connection between the server and the user terminal; Split the data file of the service task to obtain a number of data blocks of the same size, and generate corresponding verification parameters and a data hash tree based on the hash values of each data block; Create a corresponding storage contract according to the verification parameters and the data hash tree, obtain the terminal signature of the user terminal, and perform validity verification on the user terminal based on the terminal signature; If the validity verification passes, create storage identifiers for each data block based on the storage contract, and store each data block in the server according to the mapping of the corresponding storage identifiers.
[0006] Further, the step of real-time obtaining the service tasks sent by the user terminal and performing task analysis on the service tasks based on the blockchain contract includes: Create an instance analysis file based on the terminal information of the user terminal, and generate a random encryption key for the data file in the instance analysis file; Construct an encrypted random number, and encrypt the data file according to the encrypted random number and the random encryption key to obtain a corresponding encrypted file.
[0007] Further, the steps of splitting the data file of the service task to obtain a number of data blocks of the same size and generating corresponding verification parameters and a data hash tree based on the hash values of each data block include: Split the data file based on the file size of the data file to obtain a number of data blocks of the same size, and copy and matrix-transform each data block to obtain a corresponding data block matrix; Use a preset hash function to perform hash calculation on the data block matrix to obtain a corresponding set of hash values, and generate corresponding verification parameters and a data hash tree using the set of hash values.
[0008] Further, the steps of creating a corresponding storage contract according to the verification parameters and the data hash tree include: Obtain the feedback parameters fed back by the server based on the verification parameters and the data hash tree, and forward the feedback parameters to the user terminal for parameter verification; When the verification passed message fed back by the user terminal is obtained, create a corresponding storage contract based on the hash values of each data block.
[0009] Further, the steps of creating a storage identifier for each data block based on the storage contract and storing each data block in the server according to the mapping of the corresponding storage identifier include: Define a set of storage nodes of the storage network in the server, and construct corresponding distribution information according to the data structure information of each data block; Use the distribution information to create a storage identifier for its corresponding data block, and chain up its corresponding data block according to each storage identifier to store each data block in the server.
[0010] The present invention also proposes a blockchain-based data storage system, including: A contract creation module, configured to create a blockchain contract for providing services and broadcast the blockchain contract to all nodes in the server; A task analysis module, configured to obtain in real time a service task sent by a user terminal, and perform task analysis on the service task based on the blockchain contract to establish a connection between the server and the user terminal; A file splitting module, which is used to split the data file of the service task to obtain a number of data blocks of the same size, and generate corresponding verification parameters and a data hash tree based on the hash values of the data blocks; A validity verification module, which is used to create a corresponding storage contract according to the verification parameters and the data hash tree, obtain the terminal signature of the user terminal, and perform validity verification on the user terminal based on the terminal signature; A data storage module, which is used to, if the validity verification is passed, create storage identifiers for the data blocks based on the storage contract, and store the data blocks in the server according to the mapping of the corresponding storage identifiers.
[0011] Furthermore, the task analysis module includes: A file creation unit, which is used to create an instance analysis file based on the terminal information of the user terminal, and generate a random encryption key for the data file in the instance analysis file; A file encryption unit, which is used to construct an encrypted random number, and encrypt the data file according to the encrypted random number and the random encryption key to obtain a corresponding encrypted file.
[0012] Furthermore, the file splitting module includes: A file splitting unit, which is used to split the data file based on the file size of the data file to obtain a number of data blocks of the same size, and copy and perform matrix transformation on the data blocks to obtain corresponding data block matrices; A hash calculation unit, which is used to perform hash calculation on the data block matrix by using a preset hash function to obtain a corresponding set of hash values, and generate corresponding verification parameters and a data hash tree by using the set of hash values.
[0013] Furthermore, the validity verification module includes: A parameter verification unit, which is used to obtain the feedback parameters fed back by the server based on the verification parameters and the data hash tree, and forward the feedback parameters to the user terminal for parameter verification; A contract creation unit, which is used to create a corresponding storage contract based on the hash values of the data blocks when receiving the verification passed message fed back by the user terminal.
[0014] Furthermore, the data storage module includes: A node definition unit, which is used to define the set of storage nodes of the storage network in the server, and construct corresponding distribution information according to the data structure information of the data blocks; A data storage unit is configured to create a storage identifier for its corresponding data block by using the distribution information, and chain up its corresponding data block according to each storage identifier, so as to store each data block in the server.
[0015] The present invention also provides a storage medium, on which a computer program is stored. When the program is executed by a processor, the above-mentioned blockchain-based data storage method is implemented.
[0016] The present invention also provides a computer, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the above-mentioned blockchain-based data storage method is implemented.
[0017] In the blockchain-based data storage method, system, storage medium and computer of the present invention, by creating a blockchain contract for providing services, and using the blockchain contract to perform task analysis on the service tasks of the user terminal, a connection between the server and the user terminal is constructed, the data file of the service task is file-split, the hash value of the data block obtained after splitting is used to generate corresponding verification parameters and a data hash tree, and the corresponding storage contract is created by using the verification parameters and the data hash tree, so as to support data integrity and verifiability functions. The integrity verification of any data block is realized through blockchain technology, thereby improving data security. The user terminal is verified for validity by using the terminal signature of the user terminal, and the anonymity of the blockchain is used to protect user privacy, thereby improving the security of data storage. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a flowchart of the blockchain-based data storage method in the first embodiment of the present invention; Figure 2 is Figure 1 a detailed flowchart of step S102 in Figure 3 is Figure 1 a detailed flowchart of step S103 in Figure 4 is Figure 1 a detailed flowchart of step S104 in Figure 5 is Figure 1 a detailed flowchart of step S105 in Figure 6 It is a structural block diagram of the blockchain-based data storage system in the second embodiment of the present invention; Figure 7 It is a structural block diagram of the computer in the third embodiment of the present invention.
[0019] The following specific embodiments will further illustrate the present invention in conjunction with the above-mentioned drawings. Detailed implementation manners
[0020] 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 given 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.
[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill 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.
[0022] Embodiment 1 Please refer to Figure 1 , which shows the blockchain-based data storage method in the first embodiment of the present invention. The method specifically includes steps S101 to S104: S101, create a blockchain contract for providing services and broadcast the blockchain contract to all nodes in the server; In this embodiment, the user terminal is a terminal device with communication function used by the user to upload data files. The device terminal includes but is not limited to computers, mobile phones, personal servers, etc. The user sends an application signal to the server through the user terminal. There is a blockchain entity in the server, which is used to record the information of data connection and provide a running environment for the blockchain contract. There are multiple storage nodes in the server that are used to store the above data files and are independent of each other; In specific implementation, parameters such as a time stamp, a type identifier of the blockchain contract, storage service information of the blockchain contract, and storage data information of the blockchain contract are created by using the blockchain entity, and the above parameters are used to create a blockchain contract, and the created blockchain contract is broadcast to all nodes in the server so that each node can implement the data storage function through the blockchain contract.
[0023] S102, obtain the service tasks sent by the user terminal in real time and perform task analysis on the service tasks based on the blockchain contract to establish a connection between the server and the user terminal; Further, please refer to Figure 2 , the step S102 specifically includes steps S1021 to S1022: S1021, create an instance analysis file based on the terminal information of the user terminal, and generate a random encryption key for the data file in the instance analysis file; S1022, construct an encrypted random number, and encrypt the data file according to the encrypted random number and the random encryption key to obtain a corresponding encrypted file.
[0024] In specific implementation, obtain the service task sent by the user terminal, which is used to request data storage from the server, create an instance analysis file based on the terminal information of the user terminal, where the terminal information includes the terminal type and its corresponding data interface protocol, etc. Generate a random encryption key for the data file in the above service task in the instance analysis file. The user terminal constructs an encrypted random number according to the random encryption key, and uses the symmetric encryption algorithm, the encrypted random number, and the random encryption key to encrypt the data file to obtain a corresponding encrypted file.
[0025] Further, find a compliant contract in the corresponding blockchain contract based on the terminal information of the user terminal, and establish a connection with the server according to the connection method in the compliant contract.
[0026] S103, split the data file of the service task to obtain a number of data blocks of the same size, and generate corresponding verification parameters and a data hash tree based on the hash values of each data block; Further, please refer to Figure 3 , the step S103 specifically includes steps S1031~S1032: S1031, split the data file based on the file size of the data file to obtain a number of data blocks of the same size, and copy and perform matrix transformation on each data block to obtain a corresponding data block matrix; S1032, perform hash calculation on the data block matrix using a preset hash function to obtain a corresponding set of hash values, and generate corresponding verification parameters and a data hash tree using the set of hash values.
[0027] In specific implementation, obtain the file size of the above-obtained encrypted file, and evenly split it according to the file size to obtain a number of data blocks of the same size. The number of data blocks is an integer. Copy the obtained data block set x times, and represent the data block set in matrix form: ; ; In the formula, represents the number of data blocks, represents the number of copies, It is the serial number of the data block.
[0028] Furthermore, use a preset hash function to perform hash calculation on the data block matrix to obtain a corresponding set of hash values, construct a corresponding data hash tree using the set of hash values, and transmit the set of hash values to the user terminal so that the user terminal generates corresponding verification parameters according to the set of hash values.
[0029] S104. Create a corresponding storage contract according to the verification parameters and the data hash tree, and obtain the terminal signature of the user terminal, and perform validity verification on the user terminal based on the terminal signature; Furthermore, please refer to Figure 4 , the step S104 specifically includes steps S1041 to S1042: S1041. Obtain the feedback parameters fed back by the server based on the verification parameters and the data hash tree, and forward the feedback parameters to the user terminal for parameter verification; S1042. When receiving the verification passed message fed back by the user terminal, create a corresponding storage contract based on the hash values of each data block.
[0030] In specific implementation, send the obtained verification parameters and data hash tree to the server so that the server feeds back corresponding feedback parameters according to the verification parameters and the data hash tree. Forward the feedback parameters to the user terminal for parameter verification. The user terminal receives the feedback parameters using the communication protocol and verifies the feedback parameters using the random number algorithm, recalculates the hash value for verification. If the hash value verification meets the expectation, feedback the corresponding verification passed message; Furthermore, create storage contracts corresponding to each data block based on the fed-back verification passed message. In the server, for the storage contract, there are storage nodes with the same number as the data blocks. Obtain the terminal signature of the user terminal and perform validity verification on the user terminal using the terminal signature. Among them, the terminal signature refers to generating a unique digital signature for each user terminal to identify and verify the legality of the terminal. The signature is usually generated based on the hardware information, software information or user identity information of the terminal and is protected by encryption algorithms (such as RSA, ECDSA). The server can judge whether the terminal is legal and whether it has been tampered with by verifying the validity of the terminal signature.
[0031] Specifically, a pair of asymmetric encryption keys (public key and private key) is generated based on the user terminal. The private key is stored in the terminal, and the public key is uploaded to the server. The private key is used to sign the terminal information to generate a terminal signature. When validating the effectiveness of the user terminal, the private key is used to sign the request data (such as timestamp, request parameters), and the signature and the terminal identifier (such as device ID) are attached to the request and sent to the server. The server looks up the corresponding public key from the database according to the terminal identifier (such as device ID), and uses the public key to verify the signature in the request to confirm whether the signature is generated by the private key of the corresponding user terminal. If it is confirmed that the signature is generated by the private key of the corresponding user terminal, the effectiveness verification of the user terminal is marked as passed.
[0032] S105. If the effectiveness verification passes, storage identifiers are created for each of the data blocks based on the storage contract, and each of the data blocks is stored in the server according to the mapping of the corresponding storage identifiers.
[0033] Further, please refer to Figure 5 , and the step S105 specifically includes steps S1051 to S1052: S1051. Define the set of storage nodes of the storage network in the server, and construct the corresponding distribution information according to the data structure information of each of the data blocks. S1052. Create the storage identifier of the corresponding data block by using the distribution information, and chain each of the data blocks according to the corresponding storage identifier to store each of the data blocks in the server.
[0034] In specific implementation, define the set of storage nodes of the storage network in the server , where represents the number of storage nodes, and one node needs to be selected from nodes to store each data block. Construct the corresponding distribution information according to the data structure information of each data block: ; In the formula, represents each data block, the data block number is , represents the data file, represents the identifying data structure information in the data block; Further, after obtaining the distribution information, define the storage identifier of the corresponding data block according to the distribution information. Among them, the storage identifier includes a timestamp, a random number, a contract signature, and the corresponding storage node information. Use the storage identifier to chain the corresponding data block on the corresponding storage node, and judge whether the data of the data block is complete during the chaining process. If the data is complete, store the data block in the server.
[0035] In summary, in the above embodiments of the present invention, the blockchain-based data storage method creates a blockchain contract for providing services, analyzes the service tasks of the user terminal using the blockchain contract to establish a connection between the server and the user terminal, splits the data file of the service task, generates corresponding verification parameters and a data hash tree using the hash values of the obtained data blocks after splitting, creates a corresponding storage contract using the verification parameters and the data hash tree, thereby supporting data integrity and verifiability functions, realizing the integrity verification of any data block through blockchain technology, improving data security, verifying the validity of the user terminal using the terminal signature of the user terminal, and protecting user privacy using the anonymity of the blockchain, thereby improving the security of data storage.
[0036] Embodiment 2 On the other hand, the present invention also proposes a blockchain-based data storage system. Please refer to Figure 6 , which shows the blockchain-based data storage system in the second embodiment of the present invention. The system includes: A contract creation module 11 for creating a blockchain contract for providing services and broadcasting the blockchain contract to all nodes in the server; A task analysis module 12 for real-time obtaining the service tasks sent by the user terminal and analyzing the service tasks based on the blockchain contract to establish a connection between the server and the user terminal; Furthermore, the task analysis module 12 includes: A file creation unit for creating an instance analysis file based on the terminal information of the user terminal and generating a random encryption key for the data file in the instance analysis file; A file encryption unit for constructing an encryption random number and encrypting the data file according to the encryption random number and the random encryption key to obtain a corresponding encrypted file.
[0037] A file splitting module 13 for splitting the data file of the service task to obtain a number of data blocks of the same size and generating corresponding verification parameters and a data hash tree based on the hash values of the data blocks; Furthermore, the file splitting module 13 includes: A file splitting unit for splitting the data file based on the file size of the data file to obtain a number of data blocks of the same size, copying and matrix-transforming each data block to obtain a corresponding data block matrix; A hash calculation unit, configured to perform hash calculation on the data block matrix by using a preset hash function to obtain a corresponding set of hash values, and generate corresponding verification parameters and a data hash tree by using the set of hash values.
[0038] A validity verification module 14, configured to create a corresponding storage contract according to the verification parameters and the data hash tree, obtain a terminal signature of the user terminal, and perform validity verification on the user terminal based on the terminal signature; Further, the validity verification module 14 includes: A parameter verification unit, configured to obtain feedback parameters fed back by the server based on the verification parameters and the data hash tree, and forward the feedback parameters to the user terminal for parameter verification; A contract creation unit, configured to create a corresponding storage contract based on the hash values of the data blocks when a verification passed message fed back by the user terminal is obtained.
[0039] A data storage module 15, configured to, if the validity verification passes, create storage identifiers for the data blocks based on the storage contract, and store the data blocks in the server according to the mapping of the corresponding storage identifiers.
[0040] Further, the data storage module 15 includes: A node definition unit, configured to define a set of storage nodes of a storage network in the server, and construct corresponding distribution information according to the data structure information of the data blocks; A data storage unit, configured to create storage identifiers for the corresponding data blocks by using the distribution information, and chain the corresponding data blocks according to the storage identifiers to store the data blocks in the server.
[0041] The functions or operation steps implemented when the above modules and units are executed are substantially the same as those in the foregoing method embodiments, and will not be elaborated herein.
[0042] The data storage system based on blockchain provided in the embodiments of the present invention has the same implementation principle and technical effects as those in the foregoing method embodiments. For a brief description, for parts not mentioned in the system embodiments, reference may be made to the corresponding content in the foregoing method embodiments.
[0043] Embodiment III The present invention also provides a computer. Please refer to Figure 7 , which shows the computer in the third embodiment of the present invention, including a memory 10, a processor 20, and a computer program 30 stored on the memory 10 and executable on the processor 20. When the processor 20 executes the computer program 30, the above-mentioned data storage method based on blockchain is implemented.
[0044] Among them, the memory 10 includes at least one type of storage medium, and the storage medium includes flash memory, hard disk, multimedia card, card-type memory (such as SD or DX memory, etc.), magnetic memory, magnetic disk, optical disc, etc. The memory 10 can be an internal storage unit of a computer in some embodiments, such as the hard disk of the computer. The memory 10 can also be an external storage device in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Further, the memory 10 can also include both an internal storage unit of a computer and an external storage device. The memory 10 can be used not only to store application software installed in the computer and various types of data, but also to temporarily store data that has been output or will be output.
[0045] Among them, the processor 20 can be an Electronic Control Unit (ECU, also known as the vehicle computer), a Central Processing Unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments, and is used to run the program code stored in the memory 10 or process data, such as executing an access restriction program, etc.
[0046] It should be noted that Figure 7 The structure shown does not constitute a limitation on the computer. In other embodiments, the computer may include fewer or more components than shown in the figure, or combine certain components, or have a different component arrangement.
[0047] An embodiment of the present invention also provides a storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the blockchain-based data storage method as described above.
[0048] 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 logical functions, 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 instructions from the instruction execution system, apparatus, or device and execute the instructions), or used 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 transmit a program for use by or in combination with an instruction execution system, apparatus, or device.
[0049] More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection (electronic device) having one or more wirings, a portable computer diskette (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a 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.
[0050] 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-described 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 (PGAs), field-programmable gate arrays (FPGAs), etc.
[0051] The technical features of the above-described embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as falling within the scope described in this specification.
[0052] The above-described embodiments merely represent several implementation manners of the present application. Their descriptions are relatively specific and detailed, but should not be construed as limiting the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the appended claims.
Claims
1. A data storage method based on blockchain, characterized in that: include: Creating a blockchain contract for providing services, and broadcasting the blockchain contract to all nodes in the server; Acquire the service task sent by the user terminal in real time, and perform task analysis on the service task based on the blockchain contract to establish a connection between the server and the user terminal; The data file of the service task is segmented to obtain a number of data blocks of the same size, and corresponding verification parameters and data hash trees are generated based on the hash values of the data blocks; Creating a corresponding storage contract according to the verification parameter and the data hash tree, obtaining a terminal signature of the user terminal, and verifying the validity of the user terminal based on the terminal signature; If the validity verification is passed, a storage identifier is created for each data block based on the storage contract, and each data block is stored in the server according to the mapping of the corresponding storage identifier.
2. The data storage method based on blockchain according to claim 1 is characterized in that: The steps of acquiring the service task sent by the user terminal in real time and performing task analysis on the service task based on the blockchain contract include: Creating an instance analysis file based on the terminal information of the user terminal, and generating a random encryption key for the data file in the service task in the instance analysis file; An encrypted random number is constructed, and the data file is encrypted according to the encrypted random number and the random encryption key to obtain a corresponding encrypted file.
3. The data storage method based on blockchain according to claim 1 is characterized in that: The steps of dividing the data file of the service task into a plurality of data blocks of the same size, and generating corresponding verification parameters and a data hash tree based on the hash value of each data block include: Based on the file size of the data file, the data file is segmented to obtain a number of data blocks of the same size, and each of the data blocks is copied and matrix-converted to obtain a corresponding data block matrix; A preset hash function is used to perform hash calculation on the data block matrix to obtain a corresponding hash value set, and the hash value set is used to generate corresponding verification parameters and a data hash tree.
4. The data storage method based on blockchain according to claim 1 is characterized in that: The step of creating a corresponding storage contract according to the verification parameters and the data hash tree includes: Acquire feedback parameters fed back by the server based on the verification parameters and the data hash tree, and forward the feedback parameters to the user terminal for parameter verification; When the verification pass message fed back by the user terminal is obtained, a corresponding storage contract is created based on the hash value of each data block.
5. The data storage method based on blockchain according to claim 1 is characterized in that: The steps of creating a storage identifier for each data block based on the storage contract and storing each data block in the server according to the mapping of the corresponding storage identifier include: Defining a storage node set of a storage network in the server, and constructing corresponding distribution information according to the data structure information of each data block; The distribution information is used to create a storage identifier of the corresponding data block, and the corresponding data block is chained according to each storage identifier to store each data block in the server.
6. A data storage system based on blockchain, characterized in that: include: A contract creation module, used to create a blockchain contract for providing services and broadcast the blockchain contract to all nodes in the server; A task analysis module, used to obtain the service tasks sent by the user terminal in real time, and perform task analysis on the service tasks based on the blockchain contract to establish a connection between the server and the user terminal; A file segmentation module, used for segmenting the data file of the service task to obtain a number of data blocks of the same size, and generating corresponding verification parameters and data hash trees based on the hash values of the data blocks; A validity verification module, used to create a corresponding storage contract according to the verification parameters and the data hash tree, obtain a terminal signature of the user terminal, and verify the validity of the user terminal based on the terminal signature; The data storage module is used to create a storage identifier for each data block based on the storage contract if the validity verification is passed, and store each data block in the server according to the mapping of the corresponding storage identifier.
7. The data storage system based on blockchain according to claim 6 is characterized in that: The task analysis module includes: A file creation unit, configured to create an instance analysis file based on the terminal information of the user terminal, and generate a random encryption key for the data file in the service task in the instance analysis file; The file encryption unit is used to construct an encrypted random number, and encrypt the data file according to the encrypted random number and the random encryption key to obtain a corresponding encrypted file.
8. The data storage system based on blockchain according to claim 6, characterized in that: The file segmentation module includes: A file segmentation unit, configured to segment the data file based on the file size of the data file to obtain a number of data blocks of the same size, and to copy and matrix-convert each of the data blocks to obtain a corresponding data block matrix; The hash calculation unit is used to perform hash calculation on the data block matrix using a preset hash function to obtain a corresponding hash value set, and use the hash value set to generate corresponding verification parameters and a data hash tree.
9. A storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the blockchain-based data storage method as described in any one of claims 1 to 5 is implemented.
10. A computer comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the blockchain-based data storage method as described in any one of claims 1 to 5 is implemented.