Block chain-based distributed storage data lightweight management method and system

By using permission management smart contracts and digital asset smart contracts on the blockchain, the problem of diversified permission management of distributed storage data is solved, and flexible and efficient data management is realized, including data creation, deletion, retrieval, sharing, and transfer The operation of the distributed storage layer reduces the amount of operation and improves management efficiency.

CN118965451APending Publication Date: 2024-11-15NAT COMP NETWORK & INFORMATION SECURITY MANAGEMENT CENT
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410973742.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-19
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

The prior art has failed to effectively realize the diversified multi-level permission management of distributed storage data, including data creation, deletion, retrieval, sharing, transfer and other operations.

Method used

By calling permission management smart contracts on the blockchain, generating transactions to manage account permissions and distributed storage files, including data creation, deletion, retrieval, sharing, transfer and other operations, using blockchain digital assets and permission management intelligence Contracts realize lightweight data management.

Benefits of technology

It realizes diversified management permissions for distributed storage data, improves flexible and efficient management of data, reduces a large number of operations on large-scale hypertext files in the distributed storage layer, and improves management efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118965451A_ABST
    Figure CN118965451A_ABST
Patent Text Reader

Abstract

The invention discloses a distributed storage data lightweight management method and system based on a block chain, and belongs to the technical field of block chains. The method comprises the steps that a transaction is generated by calling an authority management smart contract to achieve authority management of an account and data management of a distributed storage file, and input parameters of the authority management smart contract comprise an operation type, an account id, an authority id and a data id. According to the method, diversified management authorities, including data creation, deletion, retrieval, sharing, transfer and the like, of distributed storage data can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of blockchain, and in particular to a distributed storage data lightweight management method and system based on blockchain. Background Art

[0002] Since blockchain can build an unforgeable, tamper-proof and traceable block chain data structure in a peer-to-peer network environment through transparent and trusted rules, and realize and manage transaction processing models, blockchain technology has attracted more and more attention. Blockchain can be divided into public chain, private chain and alliance chain, and the alliance chain is only used by a group of specific blockchain service customers with relevant interests, and only authorized nodes can access the blockchain. The access nodes can participate in consensus and read and write data according to the rules.

[0003] Distributed storage is a content-addressed peer-to-peer hypermedia distribution protocol, a typical example of which is IPFS. Using content-based addresses instead of domain-based addresses, users are looking for content stored somewhere, not a certain address.

[0004] Therefore, more and more scientific researchers are focusing on the field of blockchain technology.

[0005] Chinese patent application CN202410324613.4 discloses a data distributed storage verification method, medium and device based on blockchain. The data holder sends the verification initiation information and verification hash used to verify the data slice to the main blockchain. After querying the verification information related to itself, each storage node performs the corresponding verification response processing and sends the sub-verification hash to the main blockchain. The main blockchain then compares the sub-verification hash and the verification hash through the smart contract to generate the corresponding verification result. At the same time, the zero-knowledge proof method is adopted, which can verify whether the data slice has been tampered with without providing any information related to the content of the data slice to the storage node. Although the application uses blockchain and smart contracts to assist in the verification of distributed storage data, it does not provide diversified multi-level permission management functions for accounts and data, and does not involve operations such as deletion, retrieval, sharing, and transfer of data.

[0006] Chinese patent application CN202410279276.1 discloses a method and system for realizing the secure transmission of mine data based on blockchain, constructing a mine blockchain network; distributing and storing encrypted mine data in the corresponding block nodes of the mine blockchain network to obtain a unit blockchain; extracting the data transmission record of the data storage process in the unit blockchain, constructing a transmission transaction tree of the data transmission record, verifying the transmission transaction tree, and obtaining verification data; generating a permission smart contract and a secure transmission protocol for the verification data, and executing the data secure transmission of the verification data through the permission smart contract and the secure transmission protocol. It is used to improve the security of mine data transmission. Although the application executes the data secure transmission of the verification data through the permission smart contract and the secure transmission protocol, it ensures the access rights of the data to avoid data loss caused by leapfrog operations, thereby improving the security of the data. However, the permission management is limited to data transmission, and does not provide diversified multi-level permission management functions such as account and data creation permissions, deletion permissions, retrieval permissions, sharing permissions, and transfer permissions, and does not involve operations such as data deletion, retrieval, sharing, and transfer.

[0007] Chinese patent application CN202311853360.1 proposes a real estate information security protection method and system based on a security audit mechanism, which obtains relevant information about real estate; encrypts the obtained real estate information and obtains a summary signature; transmits the encrypted data and summary signature to the blockchain for storage; performs a security audit on the stored summary signature; uses cloud backup and distributed storage to back up and restore data; and enters the householder information to query real estate information. Although the application uploads the encrypted data and summary signature of real estate data to the blockchain, uses cloud backup and distributed storage to back up and save the original data of real estate, and realizes the tamper-proof audit effect of data through the blockchain, users query and access data through smart contracts, and only authorized users can access and modify data. However, it only involves the user's query authority, not other data management authorities, and does not involve the user's deletion, sharing, transfer and other operations of data.

[0008] Chinese patent application CN202311865423.5 provides a blockchain-based instant messaging data storage management method and device, which performs distributed storage of instant messaging technology based on a blockchain network, and can improve security, transparency, and anti-censorship through decentralization, while also improving scalability. By setting a check on the number of evidence that a user can store, the amount of instant messaging data that a user can store on the chain is limited to limit the use of storage space and avoid wasting storage resources. However, it only verifies the chat permissions of the initiator of the chat message through public and private key encryption and decryption, and does not involve smart contract management permissions, and does not involve diversified multi-level permission management functions such as account and data creation permissions, deletion permissions, retrieval permissions, sharing permissions, and transfer permissions, and does not involve operations such as data deletion, retrieval, sharing, and transfer.

[0009] Chinese patent application CN202311825106.0 provides a homomorphic encryption method based on distributed storage of blockchain, which generates interactive users and interactive content based on storage nodes through authorized users; locates interactive nodes according to interactive users in blockchain nodes, and sends interactive content to interactive nodes for permission verification, obtains permission identity verification results, and uses interactive content as the basis for data call in interactive nodes to obtain feedback interactive content and send it to storage nodes for information homomorphic decryption processing. However, it does not provide diversified multi-level permission management functions for accounts and data, and does not involve operations such as data deletion, retrieval, sharing, and transfer.

[0010] Chinese patent application CN202311767771.9 designs a secure remote sensing image data sharing system and method based on blockchain and IPFS, using blockchain and IPFS as the underlying network and storage system respectively, designs a secure remote sensing image data sharing protocol, introduces an authorization verification strategy based on discrete logarithmic knowledge signature and a dynamic data access permission management strategy based on smart contracts, and uses smart contracts to implement user access control and data access verification functions, providing permission authentication capabilities for all parties involved, performing data access control with low overhead, and limiting the malicious users' ability to do evil. However, its main function is data sharing, and does not involve other data management operations. In addition, the distributed storage of data does not involve the creation of digital assets for chain storage, and lightweight data management cannot be achieved through digital assets, including retrieval, transfer, sharing, deletion, etc.

[0011] Chinese patent application CN202311644746.1 discloses a secure data exchange method based on blockchain. In the process of data exchange, the total amount of user attribute sensitivity values ​​is calculated and compared with the attribute sensitivity value limit level of the data object to further screen out users who meet the attribute sensitivity value requirements. At the same time, by using blockchain to evaluate attribute values ​​and sensitivity levels, a more fine-grained and secure data hierarchical access control strategy is implemented. However, it does not provide diversified multi-level permission management functions for accounts and data, and does not involve operations such as data deletion, retrieval, sharing, and transfer.

[0012] In summary, how to lightweight implement the diverse and multi-level management authority requirements involved in distributed storage files is a technical problem that needs to be urgently solved by technical personnel in this field. Summary of the invention

[0013] In response to the above technical problems, the present invention discloses a lightweight management method and system for distributed storage data based on blockchain, which realizes diversified management rights for distributed storage data, including data creation, deletion, retrieval, sharing, transfer, etc.

[0014] To achieve the above-mentioned object of the invention, the technical solution of the present invention includes the following contents.

[0015] A lightweight management method for distributed storage data based on blockchain realizes account authority management and distributed storage file data management by calling authority management smart contracts to generate transactions. The input parameters of the authority management smart contract include: operation type, account ID, authority ID and data ID.

[0016] Furthermore, the permission management of the account includes: adding permissions to a specific account;

[0017] The above method generates a transaction by calling the permission management smart contract to add permissions to a specific account, including:

[0018] The specific account calls the permission management smart contract to generate a transaction, and sends the transaction to the permission management node after digitally signing it; wherein the operation type in the permission management smart contract is new addition, the account id is the account id of the specific account, the permission id includes data creation permission, data deletion permission, data retrieval permission, data sharing permission and data transfer permission, and the data id is the file root hash or digital asset hash of the storage file;

[0019] If the permission management account agrees to the change request of the newly added permission, it will digitally sign the transaction again and send it to the blockchain network;

[0020] After receiving the request signed by the permission management account, each node in the blockchain network verifies the legitimacy of the transaction format and the digital signatures of the specific account and the permission management account. If the verification is passed and the account ID in the input parameter of the permission management smart contract is consistent with the account ID of the specific account, the corresponding permissions of the specific account to the storage file are added.

[0021] Further, the account rights management includes: deleting rights for a specific account;

[0022] The above method generates a transaction by calling the permission management smart contract to delete permissions for a specific account, including:

[0023] A specific account or a rights management account calls the rights management smart contract to generate a transaction, and digitally signs the transaction and sends it to the rights management contract account; wherein the operation type in the rights management smart contract is deletion, the account id is the account id of the specific account, the rights id includes data creation rights, data deletion rights, data retrieval rights, data sharing rights and data transfer rights, and the data id is the file root hash or digital asset hash of the storage file;

[0024] If the permission management contract account agrees to the change request of the deletion permission, it will digitally sign the transaction again and send it to the blockchain network;

[0025] After receiving the request signed by the permission management contract account, each node in the blockchain network verifies the legitimacy of the transaction format and the digital signatures of the specific account and the permission management contract account, and deletes the corresponding permissions of the specific account on the storage file if the verification is passed and the account ID in the input parameter of the permission management smart contract is consistent with the account ID of the specific account.

[0026] Further, the account authority management includes: changing the authority for a specific account;

[0027] The above method generates a transaction by calling the permission management smart contract to change the permissions for a specific account, including:

[0028] The specific account calls the permission management smart contract to generate a transaction, and sends the transaction to the permission management node after digitally signing it; wherein the operation type in the permission management smart contract is new addition, the account id is the account id of the specific account, the permission id includes data creation permission, data deletion permission, data retrieval permission, data sharing permission and data transfer permission, and the data id is the file root hash or digital asset hash of the storage file;

[0029] If the permission management account agrees to the change request of the newly added permission, it will digitally sign the transaction again and send it to the blockchain network;

[0030] After receiving the request signed by the rights management account, each node in the blockchain network verifies the legitimacy of the transaction format and the digital signatures of the specific account and the rights management account. If the verification is successful and the account ID in the input parameter of the rights management smart contract is consistent with the account ID of the specific account, the corresponding permissions of the specific account to the storage file are added;

[0031] A specific account or a rights management account calls the rights management smart contract to generate a transaction, and digitally signs the transaction and sends it to the rights management contract account; wherein the operation type in the rights management smart contract is deletion, the account id is the account id of the specific account, the rights id includes data creation rights, data deletion rights, data retrieval rights, data sharing rights and data transfer rights, and the data id is the file root hash or digital asset hash of the storage file;

[0032] If the permission management contract account agrees to the change request of the deletion permission, it will digitally sign the transaction again and send it to the blockchain network;

[0033] After receiving the request signed by the permission management contract account, each node in the blockchain network verifies the legitimacy of the transaction format and the digital signatures of the specific account and the permission management contract account, and deletes the corresponding permissions of the specific account to the storage file if the verification is passed and the account ID in the input parameter of the permission management smart contract is consistent with the account ID of the specific account;

[0034] or,

[0035] A specific account or a rights management account calls the rights management smart contract to generate a transaction, and digitally signs the transaction and sends it to the rights management contract account; wherein the operation type in the rights management smart contract is deletion, the account id is the account id of the specific account, the rights id includes data creation rights, data deletion rights, data retrieval rights, data sharing rights and data transfer rights, and the data id is the file root hash or digital asset hash of the storage file;

[0036] If the permission management contract account agrees to the change request of the deletion permission, it will digitally sign the transaction again and send it to the blockchain network;

[0037] After receiving the request signed by the permission management contract account, each node in the blockchain network verifies the legitimacy of the transaction format and the digital signatures of the specific account and the permission management contract account, and deletes the corresponding permissions of the specific account to the storage file if the verification is passed and the account ID in the input parameter of the permission management smart contract is consistent with the account ID of the specific account;

[0038] The specific account calls the permission management smart contract to generate a transaction, and sends the transaction to the permission management node after digitally signing it; wherein the operation type in the permission management smart contract is new addition, the account id is the account id of the specific account, the permission id includes data creation permission, data deletion permission, data retrieval permission, data sharing permission and data transfer permission, and the data id is the file root hash or digital asset hash of the storage file;

[0039] If the permission management account agrees to the change request of the newly added permission, it will digitally sign the transaction again and send it to the blockchain network;

[0040] After receiving the request signed by the permission management account, each node in the blockchain network verifies the legitimacy of the transaction format and the digital signatures of the specific account and the permission management account. If the verification is passed and the account ID in the input parameter of the permission management smart contract is consistent with the account ID of the specific account, the corresponding permissions of the specific account to the storage file are added.

[0041] Further, the data management of the distributed storage file includes: data creation of the distributed storage file;

[0042] The data creation of distributed storage files is achieved by calling the rights management smart contract to generate transactions, including:

[0043] The user accesses the service node of the blockchain layer, initiates a storage request for a hypertext file, and sends the file to be stored, the file name, the file feature description, and the initial management authority of the file to the blockchain service node; wherein the initial management authority is used to clarify the user who has the operation authority of the file and / or the authority level corresponding to the file;

[0044] The blockchain service node receives the user's storage request, divides the file to be stored into shards, sends it to the distributed storage system for storage, and generates the root hash of the sharded file and returns it to the user;

[0045] The blockchain service node creates corresponding blockchain digital assets for distributed storage files through digital asset management smart contracts, and returns the hash of the blockchain digital assets to the user; the information recorded in the blockchain digital assets includes: file name, feature description, file size, root hash and asset ownership;

[0046] The blockchain service node calls the permission management smart contract based on the initial management authority, and records the permission records and permission status of the distributed storage files in the blockchain.

[0047] Further, the data management of the distributed storage files includes: data deletion of the distributed storage files;

[0048] The data deletion of distributed storage files is achieved by calling the rights management smart contract to generate a transaction, including:

[0049] The user initiates a request to delete specific file data to the blockchain service node, where the request parameters of the request to delete specific file data include: account ID, operation ID, and file root hash or digital asset hash of the specific file;

[0050] The blockchain service node receives the request to delete the specific file data, and verifies whether the account ID has the deletion permission for the specific file by calling the permission management smart contract; wherein, when calling the permission management smart contract to verify whether the account ID has the deletion permission for the specific file, the operation type in the permission management smart contract is query, the account ID is the account ID of the user; the permission ID is deletion, and the data ID is the file root hash or digital asset hash of the specific file;

[0051] In the case that the account ID has the permission to delete the specific file, the blockchain service node destroys the digital asset according to the file root hash of the specific file, and confirms the deletion of multiple copies by monitoring the data storage validity proof in the distributed storage network, and the distributed storage system deletes the data shard corresponding to the specific file according to the file root hash of the specific file.

[0052] Furthermore, the data management of the distributed storage files includes: data editing of the distributed storage files;

[0053] The data editing of distributed storage files is realized by calling the rights management smart contract to generate transactions, including:

[0054] The user initiates a request to delete specific file data to the blockchain service node, where the request parameters of the request to delete specific file data include: account ID, operation ID, and file root hash or digital asset hash of the specific file;

[0055] The blockchain service node receives the request to delete the specific file data, and verifies whether the account ID has the deletion permission for the specific file by calling the permission management smart contract; wherein, when calling the permission management smart contract to verify whether the account ID has the deletion permission for the specific file, the operation type in the permission management smart contract is query, the account ID is the account ID of the user; the permission ID is deletion, and the data ID is the file root hash or digital asset hash of the specific file;

[0056] In the case that the account ID has the permission to delete the specific file, the blockchain service node destroys the digital asset according to the file root hash of the specific file, and confirms the deletion of multiple copies by monitoring the data storage validity proof in the distributed storage network, and the distributed storage system deletes the data shard corresponding to the specific file according to the file root hash of the specific file;

[0057] The user accesses the service node of the blockchain layer, initiates a storage request for a hypertext file, and sends the file to be stored, the file name, the file feature description, and the initial management authority of the file to the blockchain service node; wherein the initial management authority is used to clarify the user who has the operation authority of the file and / or the authority level corresponding to the file;

[0058] The blockchain service node receives the user's storage request, divides the file to be stored into shards, sends it to the distributed storage system for storage, and generates the root hash of the sharded file and returns it to the user;

[0059] The blockchain service node creates corresponding blockchain digital assets for distributed storage files through digital asset management smart contracts, and returns the hash of the blockchain digital assets to the user; the information recorded in the blockchain digital assets includes: file name, feature description, file size, root hash and asset ownership;

[0060] The blockchain service node calls the permission management smart contract based on the initial management authority, and records the permission records and permission status of the distributed storage files in the blockchain.

[0061] Furthermore, the data management of the distributed storage files includes: data sharing of the distributed storage files;

[0062] The data sharing of distributed storage files is realized by calling the rights management smart contract to generate transactions, including:

[0063] The user initiates a file sharing request to the blockchain service node, wherein the request parameters of the file sharing request include: the sharing user ID, the root hash of the shared file, and the receiving user ID;

[0064] After receiving the request, the blockchain service node verifies whether the user has sharing authority through the authority management smart contract; wherein, when verifying whether the user has sharing authority through the authority management smart contract, the operation type of the authority management smart contract is query, the account id is the sharing user id, and the data id is the root hash or digital asset hash of the shared file;

[0065] When the user has sharing permissions, the blockchain service node calls the permission management smart contract to set retrieval permissions for the receiving user; wherein, when the blockchain service node calls the permission management smart contract to set retrieval permissions for the receiving user, the operation type of the permission management smart contract is new addition, the account id is the receiving user id, and the data id is the root hash or digital asset hash of the shared file.

[0066] Further, the data management of the distributed storage file includes: data transfer of the distributed storage file;

[0067] The data transfer of distributed storage files is achieved by calling the rights management smart contract to generate transactions, including:

[0068] The user initiates a digital asset transfer transaction by calling a digital asset smart contract, and digitally signs the digital asset transfer transaction and sends it to the blockchain network; the source account address of the transaction is the user's account, the destination account address is the receiving user's account, and the transaction content is that the user transfers the digital assets corresponding to the file to be transferred to the receiving user;

[0069] The blockchain service node verifies the legitimacy of the digital asset transfer transaction and the correctness of the digital signature, and executes the digital asset transfer transaction after the verification is passed to complete the digital asset transfer of the metadata of the file to be transferred;

[0070] The blockchain service node calls the permission management smart contract to add file deletion permissions, retrieval permissions, sharing permissions, and transfer permissions for the receiving account.

[0071] A distributed storage data lightweight management system based on blockchain, the system comprising: users, blockchain service nodes and distributed storage systems; wherein, the user node and / or the blockchain service node calls a permission management smart contract to generate a transaction to implement account permission management and distributed storage file data management, and the input parameters of the permission management smart contract include: operation type, account ID, permission ID and data ID.

[0072] Compared with the prior art, the present invention stores hypertext file fragments in a distributed storage layer, and converts the metadata of hypertext files into blockchain digital assets. Through permission management smart contracts, digital asset smart contracts, etc., it firstly realizes diversified management permissions for distributed storage data, including data creation, deletion, retrieval, sharing, and transfer; secondly, it realizes flexible, efficient, and lightweight management of data. The retrieval, transfer, sharing, and deletion of data are lightweight based on metadata digital assets, which reduces a large number of operations on large-scale hypertext files in the distributed storage layer and improves management efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] Figure 1 Block diagram of a lightweight management system for distributed storage data based on blockchain. DETAILED DESCRIPTION

[0074] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present invention is described and illustrated below in conjunction with the accompanying drawings.

[0075] The present invention proposes a distributed storage data management method based on blockchain digital assets and rights management smart contracts, which realizes data management of distributed storage in a lightweight manner, including management operations such as data creation, deletion, editing, sharing, and transfer.

[0076] Figure 1 This is a block diagram of a distributed storage data lightweight management system based on blockchain, which can achieve the following functions.

[0077] 1. Data management permissions

[0078] Set up a special permission management smart contract in the blockchain and set up a permission management account to manage the permissions of distributed storage data. When creating data, initialize management permissions for the data, and store and manage the permissions of the account through smart contracts.

[0079] (1) Rights Management Smart Contract

[0080] The permission management smart contract stores the permissions of all accounts in the system and provides permission change and permission query functions. The input parameters for calling the smart contract include <operation type, account id, permission id, data id>. The operation types include add, delete, and query, which correspond to adding specific permissions for specific accounts or data, deleting permissions for specific accounts or specific data, and querying the current permissions of specific accounts; specify the account that needs to perform permission management operations through the account id; specify the permissions that need to be set through the permission id, including data creation, deletion, retrieval, sharing, and transfer; set the distributed storage file corresponding to the permission through the data id.

[0081] (2) Account authority management

[0082] Permissions include data creation permission, deletion permission, retrieval permission, sharing permission, and transfer permission. Permissions support two methods: one is for a specific distributed storage file; the other is to configure a class of distributed storage files in a hierarchical permission management method. According to the regulatory business scenario, a total of 3 layers of permissions are set. The first layer of permissions has specific permissions for all distributed storage data, including deletion permission, retrieval permission, sharing permission, and creation permission, and can store files in the distributed storage system; the second layer of permissions has specific permissions for a certain range of data, including deletion permission, retrieval permission, sharing permission, and creation permission, and can store files in the distributed storage system. The scope can be divided according to regional attributes, and the regional identification is set in the data permissions for permission management; the third layer of permissions only has specific permissions for specific data, including data creation permission, deletion permission, retrieval permission, sharing permission, and transfer permission.

[0083] 1) Add new permissions

[0084] When creating an account, you can configure initial permissions for the account; for an already created account, you can add permissions. When you need to add permissions to a specific account, the corresponding account initiates a request to add permissions, forming a permission management transaction. The transaction is in the form of calling the permission management smart contract. The initiating account is the current account, and the receiving account is the permission management contract account. The input parameters of the contract call are <operation type, account id, permission id, data id>, the operation type is "add", and the account id is the account that initiates the request. The transaction is digitally signed and sent to the permission management node. If the permission management account agrees to the change request, it is digitally signed again and sent to the blockchain network. After receiving the request, each node in the blockchain network verifies the legitimacy of the transaction format, as well as the digital signatures of the request initiating account and the permission management account. If the verification is successful, and the "account id" in the input parameter of the smart contract is consistent with the account id that initiated the transaction, the smart contract is executed according to the consensus protocol to add permissions to the account.

[0085] 2) Delete permissions

[0086] There are two ways to delete permissions.

[0087] First, the account initiates a request to delete permissions, forming a permission management transaction. The transaction form is to call the permission management smart contract. The initiating account is the current account, and the receiving account is the permission management contract account. The input parameters of the contract call are <operation type, account id, permission id, data id>, the operation type is "delete", and the account id is the account that initiates the request. The transaction is digitally signed and sent to the permission management node. If the permission management account agrees to the deletion request, it is digitally signed again and sent to the blockchain network. After receiving the request, each node in the blockchain network verifies the legitimacy of the transaction format, as well as the digital signatures of the request initiating account and the permission management account. If the verification is successful, and the "account id" in the input parameter of the smart contract is consistent with the account id that initiated the transaction, the smart contract is executed according to the consensus protocol to delete the corresponding permissions of the account.

[0088] Second, the permission management account deletes the permission of a specific account, initiates a permission deletion request, and forms a permission management transaction. The transaction form is to call the permission management smart contract. The initiating account is the current account, and the receiving account is the permission management contract account. The input parameters of the contract call are <operation type, account id, permission id, data id>, the operation type is "delete", and the account id is the account whose permission needs to be deleted. The transaction is digitally signed and sent to the blockchain network. After receiving the request, each node in the blockchain network verifies the legitimacy of the transaction format and the digital signature of the permission management account. If the verification is successful, the smart contract is executed according to the consensus protocol to delete the corresponding permission of the account.

[0089] 3) Change permissions

[0090] Permission changes are completed by deleting the original permissions and adding new permissions.

[0091] 2. Data management process

[0092] (1) Data creation

[0093] 1) The user accesses the service node of the blockchain layer, initiates a storage request for a hypertext file, and sends the file to be stored, the file name, feature description, and initial management authority to the blockchain service node. The initial management authority stipulates the permissions for deleting, retrieving, sharing, and transferring data, and clarifies the specific permissions of the data in two ways. First, by clarifying the account, the deletion permission clarifies the account that can delete the file, the retrieval permission clarifies the account that can retrieve and view the file, the sharing permission clarifies the account that can share the file, and the transfer permission clarifies the account that can transfer the file. Second, according to the principle of hierarchy, the permission level of the data is clarified. By identifying the permission level, the deletion, retrieval, sharing, and transfer permissions of the data are clarified as one of the three layers of permissions. For data that is clearly N-level permissions, accounts with N-level permissions can perform corresponding operations on the data.

[0094] 2) The blockchain service node receives the user's storage request, divides the file to be stored into shards, sends it to the distributed storage system for storage, and generates the root hash merkle (S) of the sharded file and returns it to the user.

[0095] 3) The blockchain service node creates corresponding blockchain digital assets for distributed storage files through digital asset management smart contracts. It can be created using protocols such as ERC721 and returns the created digital asset hash to the user.

[0096] The information recorded in the digital asset includes file name, feature description, file size, root hash merkle (S), and the asset belongs to the account of the creator of the file.

[0097] 4) The blockchain service node calls the permission management smart contract based on the initial management authority. The operation type is "add". The "add" operation will record the permission record and permission status of the distributed storage file in the blockchain.

[0098] (2) Data deletion

[0099] In a blockchain-based distributed storage system, data is stored in two locations. One is stored on the blockchain in the form of digital assets, and the other is stored in multiple copies in the distributed storage system. Therefore, data deletion involves the destruction of blockchain digital assets and the deletion of multiple copies of the original file. The specific steps are as follows:

[0100] 1) The user initiates a request to the blockchain node to delete specific file data. The request parameters include <account id, file root hash merkle (S) or digital asset hash, operation id>.

[0101] 2) The blockchain node receives the request initiated by the user and queries the permission management smart contract. The calling parameters are <operation type, account id, permission id, data id>, where the operation type is "query", the account id is the user's account id, the permission id is "delete", and the data id is the file root hash merkle (S) or digital asset hash. Verify whether the account id has the permission to delete the data. If it has permission, execute steps 3)-5); otherwise, reject the user's request.

[0102] 3) Blockchain digital assets destruction

[0103] According to the file root hash merkle (S), the digital assets corresponding to the file are queried, and the digital asset smart contract is called to destroy the corresponding digital assets. The specific destruction method can be to transfer the assets to the "black hole" address, or to set the asset status to "destroyed" through the smart contract.

[0104] 4) Distributed storage file deletion

[0105] The distributed storage system queries the blockchain ledger data, reads the root hash merkle (S) of the deleted file from the destroyed digital assets, checks whether the local node stores the shard of the data, and deletes the corresponding data shard for the node that stores the data shard.

[0106] 5) Multiple copy deletion confirmation

[0107] The blockchain node listens to the data storage validity proof in the distributed storage network. If the validity proof of the file no longer exists, it means that the deletion is complete and the user is notified of the successful operation. Otherwise, the deletion is requested again.

[0108] (3) Data editing

[0109] Data editing is done by deleting the original data and creating new data.

[0110] (4) Data Sharing

[0111] The user chooses to share a specific file with other users for other users to retrieve, download and view. A request to share the file is initiated to the blockchain node, and the request parameters include <sharing user id, root hash merkle (S), receiving user id>. After receiving the request, the blockchain node verifies whether the sharing user ID has sharing permissions through the permission management smart contract. The transmission parameters are <operation type, account id, permission id, data id>, where the operation type is "query", the account id is the sharing user id, and the data id is the root hash merkle (S) or digital asset hash. For those who have sharing permissions, the permission management smart contract is called again to set retrieval permissions for the receiving user. The calling parameters are <operation type, account id, permission id, data id>, where the operation type is "add", the account id is the receiving user id, the permission id is "retrieve", and the data id is the file root hash merkle (S) or digital asset hash.

[0112] (5) Data Transfer

[0113] In this system, users can transfer files to other users through the transfer of digital assets without actually moving the distributed stored data. The specific process is as follows.

[0114] (1) A user initiates a digital asset transfer operation by calling the transfer function of the digital asset smart contract to initiate a transaction. The transaction source account address is the initiating user account, and the destination account address is the receiving user account. The digital asset corresponding to the file to be transferred is transferred to the receiving user, and the transaction is digitally signed and sent to the blockchain network.

[0115] (2) The blockchain node verifies the legitimacy of the transaction and whether the digital signature is correct. If the verification is successful, the transaction is executed and the transfer of metadata digital assets is completed.

[0116] (3) Add file management permissions to the receiving account. Call the permission management smart contract to add file deletion, retrieval, sharing, and transfer permissions to the receiving account.

[0117] In summary, the present invention creates a permission management smart contract and a digital asset uniquely corresponding to a distributed file at the blockchain layer according to the actual business requirements for diversified management permissions for distributed storage files. Combined with the flexible management of digital asset contracts and permission contracts, the present invention implements diversified management permissions for distributed storage data in a lightweight manner, including data creation, deletion, retrieval, sharing, and transfer, without the need for complex transfer and storage operations on distributed storage files.

[0118] The present invention stores hypertext file fragments in a distributed storage layer, and converts the hypertext file into digital assets on the blockchain. By combining the rights management smart contract and the digital asset smart contract, flexible and efficient data management, including retrieval, transfer, sharing, deletion, etc., is achieved. It is based on the lightweight implementation of blockchain digital assets and reduces the large number of operations on large-scale hypertext files in the distributed storage layer.

[0119] Text, pictures, videos and other files are reliably stored in the distributed storage system. In actual business, the distributed storage files involve diversified and multi-level management authority requirements, which requires flexible and diverse authority management. Based on the diversified management authority requirements of distributed storage files in actual business, a permission management method based on smart contracts is proposed at the blockchain layer based on the two-layer architecture of blockchain + distributed storage to achieve diversified management authority for distributed storage data, including data creation, deletion, retrieval, sharing, and transfer.

[0120] During use, distributed storage data involves a series of operations, including creation, deletion, retrieval, sharing, transfer, etc. Directly performing a large number of operations on hypertext files in the distributed storage layer is inefficient and costly, and a lightweight operation solution is required. To address this problem, hypertext files are stored in the distributed storage layer in pieces, and the hypertext files are converted into one-to-one blockchain digital assets. Digital assets and permissions are managed through permission management smart contracts and digital asset smart contracts, achieving flexible and efficient data management, including retrieval, transfer, sharing, deletion, etc. Based on the lightweight implementation of blockchain digital assets, a large number of operations on large-scale hypertext files in the distributed storage layer are reduced.

[0121] The above description is only an explanation of a specific example of the present invention and does not impose any limitation on the present invention. Obviously, for those with professional knowledge in this field, once the content and principle of the present invention are understood, it is possible to make various modifications and changes in form and details without violating the original principle and structure of the present invention. However, these amendments and changes based on the idea of ​​the present invention are still considered to be within the scope of protection of the claims of the present invention.

Claims

1. A lightweight management method for distributed storage data based on blockchain, characterized in that: By calling the rights management smart contract to generate transactions, the rights management of the account and the data management of the distributed storage files are realized. The input parameters of the rights management smart contract include: operation type, account ID, rights ID and data ID.

2. The method according to claim 1, characterized in that: The permission management of the account includes: adding permissions to a specific account; The above method generates a transaction by calling the permission management smart contract to add permissions to a specific account, including: The specific account calls the permission management smart contract to generate a transaction, and sends the transaction to the permission management node after digitally signing it; wherein the operation type in the permission management smart contract is new addition, the account id is the account id of the specific account, the permission id includes data creation permission, data deletion permission, data retrieval permission, data sharing permission and data transfer permission, and the data id is the file root hash or digital asset hash of the storage file; If the permission management account agrees to the change request of the newly added permission, it will digitally sign the transaction again and send it to the blockchain network; After receiving the request signed by the permission management account, each node in the blockchain network verifies the legitimacy of the transaction format and the digital signatures of the specific account and the permission management account. If the verification is passed and the account ID in the input parameter of the permission management smart contract is consistent with the account ID of the specific account, the corresponding permissions of the specific account to the storage file are added.

3. The method according to claim 1, characterized in that The account rights management includes: deleting rights for a specific account; The above method generates a transaction by calling the permission management smart contract to delete permissions for a specific account, including: A specific account or a rights management account calls the rights management smart contract to generate a transaction, and digitally signs the transaction and sends it to the rights management contract account; wherein the operation type in the rights management smart contract is deletion, the account id is the account id of the specific account, the rights id includes data creation rights, data deletion rights, data retrieval rights, data sharing rights and data transfer rights, and the data id is the file root hash or digital asset hash of the storage file; If the permission management contract account agrees to the change request of the deletion permission, it will digitally sign the transaction again and send it to the blockchain network; After receiving the request signed by the permission management contract account, each node in the blockchain network verifies the legitimacy of the transaction format and the digital signatures of the specific account and the permission management contract account, and deletes the corresponding permissions of the specific account on the storage file if the verification is passed and the account ID in the input parameter of the permission management smart contract is consistent with the account ID of the specific account.

4. The method according to claim 1, characterized in that: The permission management of the account includes: changing permissions for a specific account; The above method generates a transaction by calling the permission management smart contract to change the permissions for a specific account, including: The specific account calls the permission management smart contract to generate a transaction, and sends the transaction to the permission management node after digitally signing it; wherein the operation type in the permission management smart contract is new addition, the account id is the account id of the specific account, the permission id includes data creation permission, data deletion permission, data retrieval permission, data sharing permission and data transfer permission, and the data id is the file root hash or digital asset hash of the storage file; If the permission management account agrees to the change request of the newly added permission, it will digitally sign the transaction again and send it to the blockchain network; After receiving the request signed by the rights management account, each node in the blockchain network verifies the legitimacy of the transaction format and the digital signatures of the specific account and the rights management account. If the verification is successful and the account ID in the input parameter of the rights management smart contract is consistent with the account ID of the specific account, the corresponding permissions of the specific account to the storage file are added; A specific account or a rights management account calls the rights management smart contract to generate a transaction, and digitally signs the transaction and sends it to the rights management contract account; wherein the operation type in the rights management smart contract is deletion, the account id is the account id of the specific account, the rights id includes data creation rights, data deletion rights, data retrieval rights, data sharing rights and data transfer rights, and the data id is the file root hash or digital asset hash of the storage file; If the permission management contract account agrees to the change request of the deletion permission, it will digitally sign the transaction again and send it to the blockchain network; After receiving the request signed by the permission management contract account, each node in the blockchain network verifies the legitimacy of the transaction format and the digital signatures of the specific account and the permission management contract account, and deletes the corresponding permissions of the specific account to the storage file if the verification is passed and the account ID in the input parameter of the permission management smart contract is consistent with the account ID of the specific account; or, A specific account or a rights management account calls the rights management smart contract to generate a transaction, and digitally signs the transaction and sends it to the rights management contract account; wherein the operation type in the rights management smart contract is deletion, the account id is the account id of the specific account, the rights id includes data creation rights, data deletion rights, data retrieval rights, data sharing rights and data transfer rights, and the data id is the file root hash or digital asset hash of the storage file; If the permission management contract account agrees to the change request of the deletion permission, it will digitally sign the transaction again and send it to the blockchain network; After receiving the request signed by the permission management contract account, each node in the blockchain network verifies the legitimacy of the transaction format and the digital signatures of the specific account and the permission management contract account, and deletes the corresponding permissions of the specific account to the storage file if the verification is passed and the account ID in the input parameter of the permission management smart contract is consistent with the account ID of the specific account; The specific account calls the permission management smart contract to generate a transaction, and sends the transaction to the permission management node after digitally signing it; wherein the operation type in the permission management smart contract is new addition, the account id is the account id of the specific account, the permission id includes data creation permission, data deletion permission, data retrieval permission, data sharing permission and data transfer permission, and the data id is the file root hash or digital asset hash of the storage file; If the permission management account agrees to the change request of the newly added permission, it will digitally sign the transaction again and send it to the blockchain network; After receiving the request signed by the permission management account, each node in the blockchain network verifies the legitimacy of the transaction format and the digital signatures of the specific account and the permission management account. If the verification is passed and the account ID in the input parameter of the permission management smart contract is consistent with the account ID of the specific account, the corresponding permissions of the specific account to the storage file are added.

5. The method according to claim 1, characterized in that The data management of the distributed storage file includes: data creation of the distributed storage file; The data creation of distributed storage files is achieved by calling the rights management smart contract to generate transactions, including: The user accesses the service node of the blockchain layer, initiates a storage request for a hypertext file, and sends the file to be stored, the file name, the file feature description, and the initial management authority of the file to the blockchain service node; wherein the initial management authority is used to clarify the user who has the operation authority of the file and / or the authority level corresponding to the file; The blockchain service node receives the user's storage request, divides the file to be stored into shards, sends it to the distributed storage system for storage, and generates the root hash of the sharded file and returns it to the user; The blockchain service node creates corresponding blockchain digital assets for distributed storage files through digital asset management smart contracts, and returns the hash of the blockchain digital assets to the user; the information recorded in the blockchain digital assets includes: file name, feature description, file size, root hash and asset ownership; The blockchain service node calls the permission management smart contract based on the initial management authority, and records the permission records and permission status of the distributed storage files in the blockchain.

6. The method according to claim 1, characterized in that The data management of the distributed storage files includes: data deletion of the distributed storage files; The data deletion of distributed storage files is achieved by calling the rights management smart contract to generate a transaction, including: The user initiates a request to delete specific file data to the blockchain service node, wherein the request parameters of the request to delete specific file data include: account ID, operation ID, and file root hash or digital asset hash of the specific file; The blockchain service node receives the request to delete the specific file data, and verifies whether the account ID has the deletion permission for the specific file by calling the permission management smart contract; wherein, when calling the permission management smart contract to verify whether the account ID has the deletion permission for the specific file, the operation type in the permission management smart contract is query, the account ID is the account ID of the user; the permission ID is deletion, and the data ID is the file root hash or digital asset hash of the specific file; In the case that the account ID has the permission to delete the specific file, the blockchain service node destroys the digital asset according to the file root hash of the specific file, and confirms the deletion of multiple copies by monitoring the data storage validity proof in the distributed storage network, and the distributed storage system deletes the data shard corresponding to the specific file according to the file root hash of the specific file.

7. The method according to claim 1, characterized in that The data management of the distributed storage files includes: data editing of the distributed storage files; The data editing of distributed storage files is realized by calling the rights management smart contract to generate transactions, including: The user initiates a request to delete specific file data to the blockchain service node, wherein the request parameters of the request to delete specific file data include: account ID, operation ID, and file root hash or digital asset hash of the specific file; The blockchain service node receives the request to delete the specific file data, and verifies whether the account ID has the deletion permission for the specific file by calling the permission management smart contract; wherein, when calling the permission management smart contract to verify whether the account ID has the deletion permission for the specific file, the operation type in the permission management smart contract is query, the account ID is the account ID of the user; the permission ID is deletion, and the data ID is the file root hash or digital asset hash of the specific file; In the case that the account ID has the permission to delete the specific file, the blockchain service node destroys the digital asset according to the file root hash of the specific file, and confirms the deletion of multiple copies by monitoring the data storage validity proof in the distributed storage network, and the distributed storage system deletes the data shard corresponding to the specific file according to the file root hash of the specific file; The user accesses the service node of the blockchain layer, initiates a storage request for a hypertext file, and sends the file to be stored, the file name, the file feature description, and the initial management authority of the file to the blockchain service node; wherein the initial management authority is used to clarify the user who has the operation authority of the file and / or the authority level corresponding to the file; The blockchain service node receives the user's storage request, divides the file to be stored into shards, sends it to the distributed storage system for storage, and generates the root hash of the sharded file and returns it to the user; The blockchain service node creates corresponding blockchain digital assets for distributed storage files through digital asset management smart contracts, and returns the hash of the blockchain digital assets to the user; the information recorded in the blockchain digital assets includes: file name, feature description, file size, root hash and asset ownership; The blockchain service node calls the permission management smart contract based on the initial management authority, and records the permission records and permission status of the distributed storage files in the blockchain.

8. The method according to claim 1, characterized in that The data management of the distributed storage files includes: data sharing of distributed storage files; The data sharing of distributed storage files is realized by calling the rights management smart contract to generate transactions, including: The user initiates a file sharing request to the blockchain service node, wherein the request parameters of the file sharing request include: the sharing user ID, the root hash of the shared file, and the receiving user ID; After receiving the request, the blockchain service node verifies whether the user has sharing authority through the authority management smart contract; wherein, when verifying whether the user has sharing authority through the authority management smart contract, the operation type of the authority management smart contract is query, the account id is the sharing user id, and the data id is the root hash or digital asset hash of the shared file; When the user has sharing permissions, the blockchain service node calls the permission management smart contract to set retrieval permissions for the receiving user; wherein, when the blockchain service node calls the permission management smart contract to set retrieval permissions for the receiving user, the operation type of the permission management smart contract is new addition, the account id is the receiving user id, and the data id is the root hash or digital asset hash of the shared file.

9. The method according to claim 1, characterized in that: The data management of the distributed storage files includes: data transfer of distributed storage files; The data transfer of distributed storage files is achieved by calling the rights management smart contract to generate transactions, including: The user initiates a digital asset transfer transaction by calling a digital asset smart contract, and digitally signs the digital asset transfer transaction and sends it to the blockchain network; the source account address of the transaction is the user's account, the destination account address is the receiving user's account, and the transaction content is that the user transfers the digital assets corresponding to the file to be transferred to the receiving user; The blockchain service node verifies the legitimacy of the digital asset transfer transaction and the correctness of the digital signature, and executes the digital asset transfer transaction after the verification is passed to complete the digital asset transfer of the metadata of the file to be transferred; The blockchain service node calls the permission management smart contract to add file deletion permissions, retrieval permissions, sharing permissions, and transfer permissions for the receiving account.

10. A distributed storage data lightweight management system based on blockchain, characterized in that: The system includes: a user, a blockchain service node and a distributed storage system; wherein, the user and / or the blockchain service node calls a permission management smart contract to generate a transaction to implement account permission management and distributed storage file data management, and the input parameters of the permission management smart contract include: operation type, account ID, permission ID and data ID.