WO2021088278A1 - 一种文件存储方法、终端及存储介质 - Google Patents
一种文件存储方法、终端及存储介质 Download PDFInfo
- Publication number
- WO2021088278A1 WO2021088278A1 PCT/CN2020/077840 CN2020077840W WO2021088278A1 WO 2021088278 A1 WO2021088278 A1 WO 2021088278A1 CN 2020077840 W CN2020077840 W CN 2020077840W WO 2021088278 A1 WO2021088278 A1 WO 2021088278A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- file
- address set
- stored
- ciphertext
- blockchain network
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/18—File system types
- G06F16/182—Distributed file systems
- G06F16/184—Distributed file systems implemented as replicated file system
- G06F16/1844—Management specifically adapted to replicated file systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/50—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/13—File access structures, e.g. distributed indices
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/14—Details of searching files based on file metadata
- G06F16/148—File search processing
- G06F16/152—File search processing using file content signatures, e.g. hash values
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/18—File system types
- G06F16/182—Distributed file systems
- G06F16/1824—Distributed file systems implemented using Network-attached Storage [NAS] architecture
- G06F16/183—Provision of network file services by network file servers, e.g. by using NFS, CIFS
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/18—File system types
- G06F16/182—Distributed file systems
- G06F16/1834—Distributed file systems implemented based on peer-to-peer networks, e.g. gnutella
- G06F16/1837—Management specially adapted to peer-to-peer storage networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/602—Providing cryptographic facilities or services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/62—Protecting access to data via a platform, e.g. using keys or access control rules
- G06F21/6218—Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/04—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
- H04L63/0428—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
- H04L63/0442—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply asymmetric encryption, i.e. different keys for encryption and decryption
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/06—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
- H04L9/0618—Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/08—Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
- H04L9/0816—Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
- H04L9/0819—Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s)
- H04L9/0825—Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s) using asymmetric-key encryption or public key infrastructure [PKI], e.g. key signature or public key certificates
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/12—Applying verification of the received information
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Definitions
- the present invention relates to the field of terminal technology, in particular to a file storage method, terminal and storage medium.
- the existing blockchain storage and retrieval method usually sends the file to the server, divides the file into multiple sub-files on the server, and further encrypts the multiple sub-files, and then The encrypted sub-files are stored.
- the user downloads the file all the sub-files are obtained and decrypted by the server, and then all the sub-files are merged into a file with a large amount of data and then returned to the terminal.
- the existing blockchain storage methods not only have low encryption efficiency and poor security, but also cause excessive pressure on the server side, which cannot meet the storage requirements of files with a large amount of data.
- the embodiments of the present application provide a file storage method, terminal and storage medium, which not only overcomes the defect of excessive pressure on the server caused by the existing file storage method to a large extent, but also has a small amount of stored data and is encrypted High efficiency and high file storage security, which greatly meets the storage requirements of files with large data volumes.
- the embodiment of the present application provides a file storage method, and the method includes:
- N is an integer greater than or equal to 1;
- M is an integer greater than or equal to 1 and less than or equal to N;
- the ciphertext of the address set is sent to the blockchain network, and the target index value returned by the blockchain network is received; wherein the target index value is used to identify the ciphertext of the address set.
- the embodiment of the present application provides a terminal, the terminal includes: an acquisition part, a processing part, a sending part, a receiving part, a generating part, and an encryption part,
- the obtaining part is configured to obtain the file to be stored
- the processing part is configured to perform division processing on the file to be stored to obtain N sub-files corresponding to the file to be stored; where N is an integer greater than or equal to 1;
- the sending part is configured to send the N sub-files to IPFS;
- the receiving part is configured to receive M address information corresponding to the N subfiles returned by the IPFS; where M is an integer greater than or equal to 1 and less than or equal to N;
- the generating part is configured to generate an address set corresponding to the file to be stored according to the M address information
- the encryption part is configured to encrypt the address set to obtain the ciphertext of the address set
- the sending part is further configured to send the ciphertext of the address set to a blockchain network
- the receiving part is further configured to receive a target index value returned by the blockchain network; wherein the target index value is used to identify the ciphertext of the address set.
- An embodiment of the present application provides a terminal.
- the terminal includes a processor and a memory storing executable instructions of the processor. When the instructions are executed by the processor, the above-mentioned file storage method is implemented.
- the embodiment of the present application provides a computer-readable storage medium with a program stored thereon and applied to a terminal.
- the program is executed by a processor, the file storage method as described above is implemented.
- the embodiments of the application provide a file storage method, terminal, and storage medium.
- the terminal obtains the file to be stored, and divides the file to be stored to obtain N sub-files corresponding to the file to be stored; where N is greater than or equal to 1 Integer; send N subfiles to IPFS, and receive M address information corresponding to N subfiles returned by IPFS; where M is an integer greater than or equal to 1 and less than or equal to N; generate to be stored according to M address information
- the address set corresponding to the file, and the address set is encrypted to obtain the address set ciphertext; the address set ciphertext is stored in the blockchain network, and the target index value returned by the blockchain network is received; among them, the target index value is used for Identify the ciphertext of the address set.
- the terminal fragments the file to be stored and uploads it to IPFS, generates an address set according to the addresses corresponding to the multiple sub-files returned by the received IPFS, and then encrypts the address set, and Further store the ciphertext of the address set to the blockchain network. It not only overcomes the shortcomings of excessive server pressure caused by the existing file storage methods to a large extent, but at the same time, the storage data is small, the encryption is efficient, and the file storage security is high, which greatly satisfies the large amount of data files. Storage requirements.
- FIG. 1 is a schematic diagram of the functional architecture of a blockchain network service platform provided by an embodiment of the present application
- FIG. 2 is a schematic structural diagram of the resource layer provided by an embodiment of the present application constructed as a container cluster 200 by deploying a containerized management system;
- FIG. 3 is a schematic diagram of a developer accessing the blockchain network service platform 100 through a terminal 300 according to an embodiment of the present application;
- FIGS. 4A to 4Q are schematic diagrams showing various function management pages of the blockchain network service platform provided by an embodiment of the present application.
- FIG. 5 is a schematic structural diagram of an exemplary blockchain network deployed using a blockchain network service platform provided by an embodiment of the application;
- Fig. 6 is an exemplary flow chart of using a blockchain network service platform to conduct transactions provided by an embodiment of the application
- FIG. 7 is the first implementation schematic diagram of the file storage method provided by the embodiment of this application.
- FIG. 8 is a schematic diagram 1 of the implementation process of the file storage method provided by an embodiment of the application.
- FIG. 9 is a schematic diagram of an exemplary process for implementing file storage according to an embodiment of the application.
- FIG. 10 is a second schematic diagram of the implementation of the file storage method provided by the embodiment of this application.
- FIG. 11 is a second schematic diagram of the implementation process of the file storage method provided by the embodiment of the application.
- FIG. 12 is a schematic diagram of an exemplary file query process provided by an embodiment of the application.
- FIG. 13 is a schematic diagram 1 of the composition structure of a terminal provided by an embodiment of the application.
- FIG. 14 is a second schematic diagram of the composition structure of a terminal provided by an embodiment of the application.
- IPFS InterPlanetary File System
- IPFS is a network transmission protocol designed to create persistent and distributed storage and sharing of files. IPFS is universal and has few storage restrictions. The files it serves can be large or small, and can automatically cut large files into small pieces, so that nodes can not only download files from a server like HyperText Transfer Protocol (HTTP), but also Simultaneous downloading on hundreds of servers. IPFS can slice large files in a fixed size and store them in the system in plaintext.
- HTTP HyperText Transfer Protocol
- Blockchain a decentralized distributed database system involving nodes, is a chained data structure composed of blocks connected in sequence, and the previous one is referenced in each block The hash value of the block or its subset, so as to ensure that the recorded transaction cannot be tampered with or forged in a cryptographic manner. It is a distributed storage data structure that is open to all blockchain nodes connected to the server and contains several blocks.
- a user terminal that includes a client can be registered as a blockchain node.
- Each blockchain node device acts as a blockchain node and forms a peer-to-peer lending (P2P) with other blockchain nodes connected to the blockchain server.
- P2P peer-to-peer lending
- blockchain data can be stored in the P2P network, any one or more blockchain nodes in the P2P network are paralyzed, and will not cause the loss of the blockchain data, so the blockchain data has strong security. Ensure the permanent preservation of data and cannot be tampered with.
- all the blockchain nodes connected to the server can add the block; the blocks are added to the blockchain data one by one in the order of persistence time, except Every block outside the first block in the blockchain data must be linked to its previous block, so that the blockchain data forms a block linking this block, just like a chain, when After a block is persisted to the blockchain data, the block cannot be modified.
- Block which records the data structure of the ledger data updated by the exchange over a period of time, is marked with a timestamp and the unique mark of the previous block (such as a digital fingerprint), and the block passes through the nodes in the blockchain network After the consensus is verified, it will be appended to the end of the blockchain to become a new block.
- Transaction which is equivalent to the computer term "thing" includes three different simulated transaction operations: Deploy, Invoke and Query.
- the deployment transaction is used to install the specified chain code to the node of the blockchain network
- the call and query type transaction is used to call the chain code of the deployment number to realize the operation of the relevant data of the target account in the ledger, including adding and deleting
- the operations of, checking, and modifying modify the data in the form of key-value pairs in the account, or add a new account in the ledger. It does not only refer to transactions in the business context.
- transaction is used, and the embodiments of the present invention follow this habit.
- Ledger the sum of data recorded in the blockchain network with the account as the dimension, including elements such as ledger data, ledger status, ledger status proof, and block index.
- Ledger data the actual block data storage, that is, the record of a series of orderly and immutable transactions recorded in the blockchain, which can be expressed in the form of files in the file system.
- the state of the ledger also called state data, that is, the state of the ledger data, can be expressed in the form of key-value pairs in the database.
- the real-time ledger state is used to represent the latest record of the key-value pairs updated by the consensus exchange.
- the historical ledger status is used to represent the historical records of key-value pairs.
- Consensus is a process in the blockchain network that is used to reach agreement on transaction results among multiple nodes involved.
- the mechanisms for achieving consensus include (Proof Of Work, POW), Proof of Stake (POS), Proof of Stake (Delegate d Proof-Of-Stake, DPOS), Proof of Elapsed Time (POE T), etc.
- Smart Contracts also known as Chaincodes
- Chaincodes are deployed in the blockchain network and the program chain codes that trigger execution based on conditions run in a secure container to initialize and manage the data and Ledger status.
- FIG. 1 is a schematic diagram of the functional architecture of a blockchain network service platform provided by an embodiment of the application, including an application layer 101, a consensus layer 102, and a network layer. 103, the data layer 104 and the resource layer 105 are described separately below.
- the resource layer 105 encapsulates various available computing resources and storage resources, such as computing resources and storage resources in computers, servers/clusters, and clouds, abstracts and provides a unified interface to the data layer 104 to shield the underlying hardware that implements the resource layer 105 The difference.
- Computing resources include various forms of processors, such as Central Processing Unit (CPU), Application Specific Integrated Circuit (ASIC), Application Specific Integrated Circuit, and Field-Programmable Gate Array (Field-Programmable Gate Array). , FPGA) of various forms of processors.
- CPU Central Processing Unit
- ASIC Application Specific Integrated Circuit
- FPGA Field-Programmable Gate Array
- Storage resources include various types of storage media such as volatile memories and non-volatile memories.
- the non-volatile memory may be a read only memory (Read Only Memory, ROM) or a programmable read only memory (Programmable Read-Only Memory, PROM).
- the volatile memory may be random access memory (Random Access Memory, RAM), which is used as an external cache.
- the computing resources and storage resources of the resource layer 105 can be mapped to various types of nodes in the blockchain network, and the storage medium that implements the embodiment of the present invention stores the data used to implement the blockchain network deployment method of the embodiment of the present invention.
- Execution instructions once the executable instructions deployed to the node are executed, the underlying resources (such as various types of processors) that implement the node will implement the deployment of various types of nodes in the blockchain network and execute various types of nodes In order to realize the ledger for transactions in the business process and various applications based on the ledger.
- executable instructions can take the form of software (including system programs and application programs), software modules, scripts, plug-ins, etc., in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages). It is written and can be deployed in any form, including being deployed as an independent program or as a module, component or other unit suitable for use in a computing environment.
- the data layer 104 encapsulates various data structures that implement the ledger, including ledger data implemented in a file system, and ledger status and existence proof implemented in the form of a database.
- the network layer 103 encapsulates the P2P network protocol, data transmission mechanism and data verification mechanism, access and authentication mechanism, and business subject identity.
- the P2P network protocol realizes the communication between nodes in the blockchain network.
- the data dissemination mechanism ensures the dissemination of transactions/transaction results in the blockchain network.
- the data verification mechanism is used based on cryptographic methods (such as digital certificates, digital signatures, The public/private key pair) realizes the reliability of data transmission between nodes; the access and authentication mechanism is used to manage the access and authentication of the terminal based on the identity of the business subject.
- the consensus layer 102 encapsulates the mechanism for achieving consistency of transaction results propagated in the blockchain, including POS, POW, and DPOS, and supports the pluggability of the consensus mechanism.
- the application layer 101 encapsulates various services that can be implemented by the blockchain network, including transaction settlement, traceability, and deposit certificates.
- FIG. 2 is a schematic diagram of the structure of the resource layer provided by an embodiment of the application being constructed as a container cluster 200 by deploying a containerized management system, and the machine that provides resources to the resource layer forms a management node by deploying corresponding components of the containerized management system
- the management node is used to manage the scheduling and operation of containers in the service node.
- the service node is mainly used to run various containers and provide various types in the blockchain network.
- the isolated operating environment of the application for example, the chain code container used to run the chain code, the node container used to run the code of the node (that is, the code of various types of nodes in the blockchain network), etc., respectively, are described below.
- the management node (Master Server) 200 is responsible for managing the cluster, and provides external access to the resource data of the cluster in the form of a service.
- the management node includes several exemplary components.
- the state component (etcd) is used to save the state of the entire cluster.
- API Server component is used to provide the only entry for resource operations and provide mechanisms for authentication, authorization, access control, API registration, and discovery.
- the Scheduler component is used to schedule the resources and schedule the container to run on appropriate nodes according to a predetermined scheduling strategy.
- the container group (Plain old data structure, Pod) of the same set of resources in the shared machine (that is, the machine on which the service node component is deployed) in the container running by the service node is the smallest unit of invocation.
- the resources shared by the containers in the container group include: application namespace, network namespace, host name, and storage volume (Volume).
- NFS Network File System
- GlusterFS cluster file system
- Cephfs ceph file system
- the Controller Manager component is responsible for monitoring/maintaining the status of the cluster. Through the interface provided by the application program interface service component, it can monitor the current status of each resource object in the entire cluster in real time. When various faults occur, the system When the state changes, it will be restored to the desired state.
- the Replication Controller (RC) component controls the running of a certain number of Pod replicas within a certain period of time; for example, the running Pod replica exceeds the set value, then some Pod replicas will be closed; if the Pod replica is less than the set value Set the value to create a new copy of the Pod.
- RC Replication Controller
- Deployment Controller used to manage and maintain the resource object-Deployment object found in the container cluster, associate the deployment object with the replica controller, and provide declarations for the container group and replica controller in the deployment object Mode update is used to declare the target state of the container group and the replica controller, so that when the deployment object is updated, the update of the replica controller and the container group is controlled.
- the service node 300 includes the following exemplary components.
- the container engine (denoted as Docker) is used to be responsible for all specific image downloads and container operations.
- the daemon component (denoted as Kubelet) is responsible for maintaining the life cycle of the container (creation, starting and stopping), and is also responsible for the management of storage volumes and the container network interface (Container Network Interface, CNI).
- CNI Container Network Interface
- the daemon process component uses the shared file system components deployed in the nodes, such as the Network File System (NFS), the cluster file system (GlusterFS), and the ceph file system (Cephfs).
- NFS Network File System
- GlusterFS cluster file system
- Cephfs ceph file system
- Each container in the container group is mounted on the same storage volume, so that each container uses the same storage volume to store data produced during operation.
- the data in the storage volume can be accessed by any container in the same container group.
- the load balancing component (denoted as Proxy) is responsible for providing service discovery and load balancing within the cluster for the Service.
- the image of the application deploying a blockchain network is packaged into a container group (referred to as the target Pod in the following example) and running on the node (referred to as the target Node in the following example)
- a container group referred to as the target Pod in the following example
- the target Node running on the node
- the management tool (Kubectl) of the container cluster 200 submits a request to create a replica controller RC, which includes the definition of the target Pod; the number of replicas that the target Pod needs to run; the target Pod label (Lable) to be monitored and other information.
- the Controller Manager listens to the RC event through the API Server's interface for monitoring resource changes, and finds that there is no Pod instance corresponding to it in the current cluster, so according to The Pod template definition in RC generates a Pod object, which is written into etcd through the API Server.
- the RC event was discovered by the Scheduler, and it immediately executed a scheduling process: select a node for this new Pod, and then write the result to etcd through the API Server, and then the Kubelet process running on the target Node
- This new Pod is monitored through the API Server, and according to its definition, the new Pod is started until the life of the Pod ends.
- Kubectl submits a new service creation request that is mapped to the target Pod.
- the Controller Manager will query the associated Pod instance through the Label, and then generate Service Endpoints information (including address and port), and pass the API Server Write to etcd; Proxy processes running on all Nodes in the container cluster query and listen to the Service object and its corresponding Endpoints information through API Server, and establish a software load balancer to realize the traffic forwarding of Service access to the back-end Pod Features.
- the blockchain network service platform implementing the embodiment of the present invention is realized by deploying a container cluster at the resource layer and running the container encapsulating the blockchain network application, thereby realizing the block of the embodiment of the present invention.
- the chain network can be provided in the form of a memory and a processor, and executable instructions are stored in the memory. When the executable instructions are executed by the processor, a container cluster is established on multiple nodes running the processor and the memory. Run the encapsulated application in the embodiment of the present invention to implement the chain code installation method in the blockchain service network platform of the embodiment of the present invention.
- the blockchain network platform that implements the embodiments of the present invention is connected with developers in various ways, and provides various graphical ways to deploy and manage the blockchain network, which will be described below.
- Fig. 3 is a schematic diagram of a developer accessing the blockchain network service platform 100 through a terminal 300 according to an embodiment of the application.
- the software development kit (SDK/World Wide Web, Web of the developer terminal 300) )
- the 320 interface is connected to the corresponding SDE/Web interface of the data layer 104 in the blockchain network service platform 100, and supports the remote deployment of the blockchain network supporting specific services in the terminal 300 of the developer.
- the interface 310 displays the management page of various functions of the blockchain network service platform 100, including the creation of container clusters and the access of new container clusters, the management of storage resources, the one-click deployment of the blockchain network, and chain code management ( Operation status view), application store management, etc.
- FIGS. 4A to 4Q are schematic diagrams showing the various function management pages of the blockchain network service platform provided by an embodiment of the application.
- the graphical interface 310 of the developer terminal 300 in FIG. 3 will be exemplified in conjunction with FIG. 4A to FIG. 4Q.
- FIG. 4A shows the status view page of the blockchain network service platform 100.
- the operating status of the blockchain network such as CPU usage, memory usage, and resource (node) usage, is shown.
- Figure 4B shows the one-click deployment console page of the blockchain network service platform 100, which supports developers to set basic information (including block domain name, version number) and organization (including organization name, number of nodes) of the blockchain network , Number of users, etc.), using default values to set advanced options, including sorting node type, channel name, chain code name, etc.
- Figure 4C shows the resource management console page of the resource layer 105 of the blockchain network service platform 100, which shows the relevant information of the clusters that can be deployed by the developer through the blockchain network service platform 100, including whether it is connected Status, CPU/memory usage, etc.
- Figure 4D it is supported to add a container cluster to support the blockchain network, and enter the cluster name; after the cluster creation function option is triggered, the creation page will be entered.
- Figure 4E shows the console page of the query cluster of the blockchain network service platform 100.
- the query cluster function button When the query cluster function button is triggered, it will enter the cluster list page, which supports adding clusters, querying clusters, deleting clusters, and editing. Operation of the cluster.
- Figure 4F shows the storage management console page of the blockchain network service platform 100.
- the storage management function button When the storage management function button is triggered, it will enter the storage management list page, displaying the storage items that have been created in the cluster, including Storage query and delete function.
- FIG. 4G shows the storage details console page of the blockchain network service platform 100
- FIG. 4H shows the storage details, and supports dynamic storage space expansion of the storage.
- Figure 4I shows the add storage console page of the blockchain network service platform 100, which supports the setting of the added storage name and node, adds the node to the container cluster according to the setting, and shows the addition in Figure 4J
- the stored detailed information includes a list of nodes in the container cluster.
- 4K shows the console page of the Hyperledger of the blockchain network service platform 100, which displays the name, network version, status, and creation time of the Hyperledger used to deploy the blockchain network.
- Figure 4L shows the one-click deployment console page of the Hyperledger of the blockchain network service platform 100, which provides configuration items for the basic information of Hyperledger deployment, and advanced configuration items with default values, such as sorting. Node type, channel, default chain code, initialization parameters, etc.
- Fig. 4M/N the console page for uploading/installing the chain code of the blockchain network service platform 100 is shown, and the setting items of the chain code name and version number are provided in the uploaded console page; in the installation control The configuration items of the chain code version, initialization parameters, organization and nodes are provided on the platform page.
- console page of the network details of the blockchain network service platform 100 is shown. It supports viewing the organization members, block height, number of transactions, and number of contracts of different channels, and can also display the organization of the viewed channel Name, node name in the channel, chain code name in the channel and other information.
- Figure 4P shows the console page of the chain code query of the blockchain network service platform 100, which supports the use of network name, chain code name, chain code parameters, ledger name and chain code function to query the chain code, query
- the dimensions include status, message, and data.
- Figure 4Q shows the console page of the application store of the blockchain network service platform 100, which supports developers to select the applications that need to be deployed. Once an application is determined to be deployed to the blockchain network, the mirroring of the application will be reused The way to complete the rapid deployment of the container cluster to the resource layer 105.
- FIG. 5 is a schematic structural diagram of an exemplary blockchain network deployed using a blockchain network service platform provided by an embodiment of the application.
- the application program obtains a legal identity certificate from the CA to join the application channel in the network.
- the transaction request (carrying the endorsement of the endorsement node) is sent to the ordering node (Orderer) in the ordering service for ordering, so as to encapsulate the transaction to form a block.
- the ordering node Orderer
- FIG. 6 is an exemplary flow chart of using a blockchain network service platform to conduct transactions provided by an embodiment of the application, where the functions of the client and each node in the transaction process are as follows:
- Client Use the SDK to interact with the blockchain network.
- the client obtains a legal identity certificate from a certificate authority (Certificate Authority, CA) to join the application channel in the network.
- CA Certificate Authority
- the client can also monitor messages in the network through the event mechanism to learn whether the transaction has been successfully received.
- Endorser It mainly provides methods for the client to call to complete the endorsement (signature) processing of the transaction proposal. After receiving the transaction proposal from the client, first check the legality and access control lists (ACL) permissions. If the check is passed, the transaction will be simulated (the chain code name and parameters that need to be executed will be executed in the transaction, and the transaction will be executed. The essence is to execute the chain code specified in the transaction), to endorse the state change (recorded in the form of read-write set, including the key and version of the read state, and the key value of the written state) caused by the transaction (that is, perform digital signatures) ) And return the result of whether the client supports it.
- ACL legality and access control lists
- Ordering node Receives transactions containing endorsement signatures, sorts unpackaged transactions to generate blocks, and broadcasts them to Peer nodes.
- Committer Maintain the structure of the blockchain and ledger (including state decibels (decibel, DB), history DB, index DB, etc.). The node will periodically obtain the sorted batch transaction block structure from the sorting node, and check these transactions (including transaction message structure, signature integrity, whether it is duplicated, whether the read-write set version matches, etc.). After the check is passed, a legal transaction is executed, the result is written into the ledger, and a new block is constructed at the same time.
- Peer nodes are bookkeeping nodes, responsible for verifying transactions from the ordering node block, and maintaining status data and copies of the ledger. Some Peer nodes will execute the transaction and sign the endorsement of the result, acting as an endorsing node.
- the endorsement node has a dynamic role and is bound to a specific chain code. Each chaincode in the chaincode container will set an endorsement strategy when it is instantiated, specifying which nodes are effective after endorsing the transaction. It is also an endorsing node only when the application initiates a transaction endorsement request to it, and other times it is an ordinary accounting node, which is only responsible for verifying transactions and accounting.
- the existing blockchain storage and retrieval method usually sends the file to the server, divides the file into multiple sub-files on the server, and further encrypts the multiple sub-files, and then The encrypted sub-files are stored.
- the user downloads the file all the sub-files are obtained and decrypted by the server, and then all the sub-files are merged into a file with a large amount of data and then returned to the user.
- the existing blockchain storage methods not only have low encryption efficiency and poor security, but also cause excessive pressure on the server side, which cannot meet the storage requirements of files with a large amount of data.
- an embodiment of the present application provides a file storage method, in which the terminal fragments the file to be stored and uploads it to IPFS, and corresponds to the multiple sub-files returned by the received IPFS An address set is generated from the address, and then the address set is encrypted, and the ciphertext of the address set is further stored in the blockchain network. It not only overcomes the shortcomings of excessive server pressure caused by the existing file storage methods to a large extent, but at the same time, the storage data is small, the encryption is efficient, and the file storage security is high, which greatly satisfies the large amount of data files. Storage requirements.
- FIG. 7 is a first schematic diagram of the implementation of the file storage method provided by the embodiment of the present application.
- the file address set generated by the file address is encrypted to generate the ciphertext of the file address set, and the hash value corresponding to the ciphertext of the file address set is further generated, and then the file address set ciphertext and the hash value are stored in the area.
- Block chain and receive the transaction identification (Identity document, ID), transaction time, block information, etc. returned by the block chain, and save the transaction ID after self-association processing.
- FIG. 8 is a schematic diagram 1 of the implementation process of the file storage method provided by the embodiment of the application. As shown in FIG. 8, in the embodiment of the present application, the method for the terminal to perform file storage may include the following steps:
- Step S101 Obtain a file to be stored, and perform division processing on the file to be stored to obtain N sub-files corresponding to the file to be stored; where N is an integer greater than or equal to 1.
- the terminal when a user needs to store a file, the terminal can obtain the file to be stored, and can divide the file to be stored, and further obtain N sub-files corresponding to the file to be stored; where N is greater than Or an integer equal to 1.
- the terminal may be any device with communication and storage functions.
- the terminal may be any device with communication and storage functions.
- tablet computers mobile phones, e-readers, personal computers (PC), notebook computers, in-vehicle devices, Internet TVs and other devices.
- PC personal computers
- notebook computers in-vehicle devices, Internet TVs and other devices.
- the file to be stored may be a video file, audio file, compressed file or other types of files, that is, the file type of the file to be stored may include document (Word) format, Portable document format (Portable Document Format, PDF), image format (Joint Photographic Experts Group, JPG), portable network graphics (Portable Network Graphics, PNG), video, and voice are not limited by this application.
- the terminal after the terminal obtains the file to be stored, in the process of fragmenting the file to be stored to obtain N sub-files, the size of each sub-file can be adjusted adaptively.
- the terminal may perform division processing on the file to be stored by determining the bytes or instruction parameters corresponding to the file to be stored, so as to obtain N sub-files corresponding to the file to be stored.
- the terminal can first obtain the number of bytes corresponding to the file to be stored, and further divide the file to be stored into N sub-files of the same byte size according to the number of bytes.
- the terminal can obtain the instruction parameter corresponding to the file to be stored, where the instruction parameter may be the number of lines corresponding to the file to be stored; since the files to be stored are all Composed of corresponding program code, the code contains multiple line break identifiers.
- the terminal can further determine the number of lines corresponding to the file to be stored by identifying the line break identifier, and then divide the file to be stored according to the line number division processing method, and further divide the line to be stored.
- the storage file is equally divided into N sub-files of the same size.
- the terminal presets the number of lines corresponding to each sub-file to 1500, when the terminal determines that the number of lines corresponding to the file to be stored is 30000 by identifying the line break corresponding to the file to be stored, the terminal can further divide the file to be stored Into 20 sub-files.
- the terminal may send the N sub-files to IPFS, so as to further obtain the addresses corresponding to the N sub-files.
- Step S102 Send N sub-files to IPFS, and receive M address information corresponding to the N sub-files returned by IPFS; where M is an integer greater than or equal to 1 and less than or equal to N.
- the terminal after dividing the acquired file to be stored, the terminal obtains the N sub-files corresponding to the file to be stored, sends the N sub-files to IPFS, and receives the N sub-files returned by IPFS Corresponding M pieces of address information; where M is an integer greater than or equal to 1 and less than or equal to N.
- the N sub-files corresponding to the file to be stored are sent to IPFS, and the IPFS storage chain recognizes the N sub-files.
- N sub-files are allocated to M storage nodes such as storage node A, storage node B, and storage node C. Since one storage node in IPFS can store at least one sub-file correspondingly, and one storage node returns one address information, the storage node The number of nodes is less than or equal to the number of subfiles corresponding to the file to be stored.
- the terminal sends the N subfiles to IPFS and stores them on M storage nodes corresponding to IPFS.
- the terminal After the storage is completed, the terminal will receive M address information corresponding to the M storage nodes returned by IPFS. Further, when sending the N sub-files corresponding to the file to be stored to IPFS, a fixed sub-file can be sent to a storage node, and the sub-files can be sent in a single sequential sending manner of the corresponding address information. Or it can be sent in a specific broadcast mode.
- the terminal after the terminal divides the file to be stored with a size of 300M into 20 sub-files with a size of 15M, the sub-files with a size of 15M are sent to IPFS in turn, each time a sub-file is sent To IPFS, it will receive an address information returned by IPFS, and the terminal will receive 20 address information returned by IPFS in turn, that is to say, subfile A corresponds to storage node A, which corresponds to address information A; subfile B corresponds to storage node B , That is, the corresponding address information B, etc.; or after the terminal divides the 300M file to be stored into 20 15M sub-files, at this time, the terminal can first obtain the number of storage nodes corresponding to IPFS, according to the number of storage nodes corresponding to IPFS Determine the sending method of N sub-files.
- the terminal will set the file size of a single sending to IPFS to 30M, that is, each time the terminal can send to IPFS 2 sub-files, that is, IPFS can store sub-file A and sub-file B to a storage node A.
- IPFS stores the 2 sub-files to a storage node
- the terminal receives the IPFS and can receive the address information returned by IPFS A.
- the terminal receives a total of 10 address information corresponding to the file to be stored returned by IPFS.
- the terminal may further generate an address set corresponding to the file to be stored and perform an encryption operation on the generated address set.
- Step S103 Generate an address set corresponding to the file to be stored according to the M pieces of address information, and encrypt the address set to obtain a ciphertext of the address set.
- the terminal after the terminal sends N sub-files to IPFS and receives M address information returned by IPFS, it generates an address set corresponding to the file to be stored according to the obtained M addresses, and the terminal pair generates The address set is encrypted, and the ciphertext of the address set is further obtained.
- the terminal uses the public key to encrypt the address set corresponding to the file to be stored. Specifically, the terminal randomly generates an asymmetric key pair, and then uses the public key in the asymmetric key pair to encrypt the address set corresponding to the file to be stored and containing M address information, thereby obtaining the address set ciphertext.
- the asymmetric secret key pair randomly generated by the terminal includes two things, one is a public key and the other is a private key.
- the public key and the private key are a pair.
- the public key encrypts the data, and only the corresponding private key can be used to decrypt it; if the private key is used to encrypt the data, then only the corresponding public key can be used to decrypt the data.
- the private key can only be safely kept by one party and cannot be leaked, while the public key can be sent to anyone who requests it.
- the terminal can use the RSA algorithm for asymmetric encryption.
- the public key and private key in the asymmetric key pair are generated at the same time.
- the terminal uses the public key to encrypt the address set and stores the obtained private key, so that after the storage of the file to be stored is completed, the waiting The address set can be decrypted when the storage file is downloaded.
- the terminal generates the address set corresponding to the file to be stored according to the M address information, and further encrypts the address set to obtain the address set ciphertext, and may further encrypt the address set Documents are stored in the blockchain network.
- the terminal can also generate the hash operation corresponding to the address set ciphertext through hash operation. Hence, the ciphertext and hash value of the address set are further stored in the blockchain network.
- Step S104 Send the ciphertext of the address set to the blockchain network, and receive the target index value returned by the blockchain network; wherein the target index value is used to identify the ciphertext of the address set.
- the terminal after the terminal encrypts the address set corresponding to the file to be stored and obtains the ciphertext of the address set, it can send the ciphertext of the address set to the blockchain network and receive the return from the blockchain network
- the terminal after the terminal sends the ciphertext of the address set corresponding to the file to be stored to the blockchain network, it is further stored in a block in the blockchain network, and the terminal can receive the zone The transaction ID, transaction time, and block information returned by the blockchain network.
- the blockchain network after receiving the ciphertext of the address set sent by the terminal, the blockchain network will store the ciphertext of the address set and store it in the block containing the file information, and the blockchain network will store the event As a transaction, since multiple different files to be stored correspond to different address set ciphertexts, that is, to different transactions, each block in the blockchain network can contain multiple transactions.
- the terminal will receive the transaction information corresponding to the ciphertext of the address set returned by the blockchain network, including: transaction ID, transaction time, block information, etc.
- the transaction ID is the target index value, and the corresponding address set ciphertext can be found according to the target index value;
- the transaction time corresponds to the address set ciphertext sending and uploading time, the address set ciphertext uploading time is the terminal set the address set ciphertext The starting time of sending to the blockchain network; block information, that is, some information contained in the block storing the ciphertext of the address set, which can be block height, block hash value, etc.
- the terminal may also send the address set ciphertext and the hash value corresponding to the address set ciphertext to the blockchain network, and receive the information returned by the blockchain network.
- the target index value corresponding to the hash value may also be sent to the blockchain network, and receive the information returned by the blockchain network.
- the terminal stores the ciphertext and hash value of the address set corresponding to the file to be stored in the blockchain, and after obtaining the target index value returned by the blockchain, the obtained target index The value is stored, so that when a download request to download the file to be stored is received, the file to be stored can be obtained through the target index value.
- FIG. 9 is an exemplary flow diagram for implementing file storage provided by an embodiment of the application.
- the file storage system obtains the file to be stored uploaded by the user, and divides the file to be stored into sub-file A, sub-file B, and sub-file through the file fragmentation component. C, and send the divided sub-files to IPFS.
- IPFS stores the three sub-files in the corresponding storage node A, storage node B, and storage node C through the storage component, and assigns the file address A corresponding to the three sub-files , File address B and file address C are returned to the file storage system.
- the file storage system After the file storage system receives the file address corresponding to the subfile returned by IPFS, it generates a file address set based on file address A, file address B, and file address C, and then uses the public The key performs an encryption operation on the file address set, and then obtains the address set ciphertext, and further sends the address set ciphertext to the blockchain network.
- the terminal fragments the file to be stored and uploads it to IPFS, generates an address set according to the addresses corresponding to the multiple sub-files returned by the received IPFS, and then encrypts the address set, and Further store the ciphertext of the address set to the blockchain network. It not only overcomes the shortcomings of excessive server pressure caused by the existing file storage methods to a large extent, but at the same time, the storage data is small, the encryption is efficient, and the file storage security is high, which greatly satisfies the large amount of data files. Storage requirements.
- FIG. 10 is a second schematic diagram of the implementation of the file storage method provided by the embodiment of the present application.
- the file storage system receives the request information for downloading the file, that is, the download request, sends the transaction ID carried in the download request to the blockchain, and receives the ciphertext of the address set returned by the blockchain.
- the ciphertext is decrypted to obtain a file address set containing multiple sub-file addresses, and then the file addresses corresponding to the multiple sub-files are sent to IPFS, the sub-files corresponding to different file addresses returned by IPFS are received, and the multiple sub-files are further processed combination.
- FIG. 11 is a schematic diagram of the second implementation process of the file storage method provided by the embodiment of the application. As shown in FIG. 11, after the terminal stores the ciphertext of the address set in the blockchain network and receives the target index value returned by the blockchain network, That is, after step S104, the method for the terminal to store files may further include the following steps:
- Step S105 Receive a download request; where the download request carries a target index value.
- the terminal after the terminal sends the address set ciphertext to the blockchain network and receives the target index value returned by the blockchain network, and further stores the target index value, the terminal receives the download request, the The information corresponding to the download request carries the target index value.
- the terminal receives a download request for downloading the file to be stored, and the information carried in the download request may include the target index value corresponding to the address set ciphertext, or may include the address set ciphertext corresponding to the Hash value, if the information carried in the download request includes the target index value, the terminal can directly extract the ciphertext of the address set corresponding to the file to be stored from the blockchain through the target index value; if the information carried in the download request includes the address set
- the target index value corresponding to the hash value is generated, Therefore, when the terminal receives a download request and needs to extract the ciphertext of the address set corresponding to the file to be stored from the blockchain network, it can first determine the target index value through the hash value corresponding to the ciphertext
- the terminal may send the target index value to the blockchain network, so as to obtain the ciphertext of the address set corresponding to the file to be stored.
- Step S106 Send the target index value to the blockchain network, and receive the ciphertext of the address set returned by the blockchain network.
- the terminal after the terminal receives the download request sent by the user and obtains the target index value carried in the download request, it can send the target index value to the blockchain network, and further receive the blockchain return The ciphertext of the address set corresponding to the file to be stored.
- the terminal will receive the index value returned by the blockchain network for obtaining the ciphertext of the address set, therefore, When downloading the file to be stored, the terminal can send the target index value corresponding to the ciphertext of the address set carried in the download request to the blockchain network, and further according to the index value, store the block of file information from the blockchain network Extract the ciphertext of the address set corresponding to the file to be stored in the file.
- the block link After the block link receives the target index value sent by the terminal, it performs a matching search according to the target index value, and the retrieved address set corresponding to the target index value The ciphertext is sent to the terminal, and the terminal obtains the ciphertext of the address set corresponding to the file to be stored.
- the terminal receives the ciphertext of the address set corresponding to the file to be stored returned by the blockchain, the ciphertext of the address set may be further decrypted.
- Step S107 Decrypt the ciphertext of the address set to obtain an address set corresponding to the file to be stored; where the address set includes M pieces of address information.
- the terminal after receiving the address set ciphertext corresponding to the file to be stored returned by the blockchain network, the terminal can decrypt the received address set ciphertext to further obtain the address corresponding to the file to be stored Set; Among them, the address set includes M address information.
- the terminal uses the private key to decrypt the ciphertext of the address set corresponding to the file to be stored, so as to obtain the address set corresponding to the file to be stored and containing M address information systems. Since the public key in the asymmetric key pair is used to encrypt the address set when storing the file to be stored, the public key and the private key are a pair. If the data is encrypted with the public key, only the corresponding private key can be used. Decrypted. Therefore, the terminal can decrypt the ciphertext of the address set only by using the private key, and further obtain the address set corresponding to the file to be stored.
- the terminal may send the M address information to IPFS, and further obtain the N sub-files corresponding to the file to be stored .
- Step S108 Send the M address information to the IPFS, and receive the N sub-files corresponding to the file to be stored returned by the IPFS.
- the terminal decrypts the address set ciphertext and obtains the address set corresponding to the file to be stored containing M address information, it sends the M address information to IPFS, and further receives the IPFS return N sub-files corresponding to the files to be stored.
- the terminal after the terminal obtains the address set corresponding to the file to be stored, it will send the M address information contained in the address set to IPFS, and further receive the return from the M storage nodes in IPFS Of N sub-files. Specifically, the terminal may send an address information A and then receive a subfile A returned by IPFS, or the terminal may send an address information A and receive subfile A and subfile B returned by IPFS.
- the terminal may further merge the N sub-files to obtain the file to be stored.
- Step S109 Perform a merge operation on the N sub-files to obtain the file to be stored.
- the terminal after the terminal sends M address information to IPFS and receives the N subfiles corresponding to the file to be stored returned by IPFS, it further merges the N subfiles to obtain the file to be stored.
- Figure 12 is a schematic diagram of an exemplary file query process provided by an embodiment of the application.
- the file storage system receives a download request for downloading a file to be stored.
- the download request carries a transaction ID, and the file storage system sends the transaction ID to the district.
- Blockchain network the blockchain network performs matching search based on the transaction ID, and sends the retrieved ciphertext of the address set corresponding to the transaction ID to the file storage system, and the file storage system uses the private key to decrypt the ciphertext of the address set , Get a file address set containing file address A, file address B, and file address C, and then send file address A, file address B, and file address C to IPFS in a multi-threaded concurrent request mode, and IPFS will send the file address from storage according to the received file address Node A, storage node B, and storage node C extract the corresponding subfile A, subfile B, and subfile C, and return the subfile to the file storage system.
- the file storage system responds to the received subfile A, subfile B, and The sub-file C is combined to obtain the file to be stored.
- the embodiments of the application provide a file storage method, terminal, and storage medium.
- the terminal obtains the file to be stored, and divides the file to be stored to obtain N sub-files corresponding to the file to be stored; where N is greater than or equal to 1 Integer; send N subfiles to IPFS, and receive M address information corresponding to N subfiles returned by IPFS; where M is an integer greater than or equal to 1 and less than or equal to N; generate to be stored according to M address information
- the address set corresponding to the file, and the address set is encrypted to obtain the address set ciphertext; the address set ciphertext is stored in the blockchain network, and the target index value returned by the blockchain network is received; among them, the target index value is used for Identify the ciphertext of the address set.
- the terminal fragments the file to be stored and uploads it to IPFS, generates an address set according to the addresses corresponding to the multiple sub-files returned by the received IPFS, and then encrypts the address set, and Further store the ciphertext of the address set to the blockchain network. It not only overcomes the shortcomings of excessive server pressure caused by the existing file storage methods to a large extent, but at the same time, the storage data is small, the encryption is efficient, and the file storage security is high, which greatly satisfies the large amount of data files. Storage requirements.
- FIG. 13 is a schematic diagram 1 of the composition structure of the terminal provided by the embodiment of the present application.
- the terminal 500 proposed in the embodiment of the present application may include an obtaining part 501, The processing part 502, the sending part 503, the receiving part 504, the generating part 505, the encrypting part 506, the storing part 507, the decrypting part 508, the merging part 509, and the determining part 510.
- the obtaining part 501 is configured to obtain a file to be stored
- the processing part 502 is configured to divide the file to be stored to obtain N sub-files corresponding to the file to be stored; where N is an integer greater than or equal to 1;
- the sending part 503 is configured to send the N sub-files to IPFS;
- the receiving part 504 is configured to receive M address information corresponding to the N subfiles returned by the IPFS; where M is an integer greater than or equal to 1 and less than or equal to N;
- the generating part 505 is configured to generate an address set corresponding to the file to be stored according to the M address information
- the encryption part 506 is configured to encrypt the address set to obtain the ciphertext of the address set;
- the sending part 503 is further configured to send the ciphertext of the address set to the blockchain network;
- the receiving part 504 is further configured to receive a target index value returned by the blockchain network; wherein the target index value is used to identify the address set ciphertext.
- the processing part 502 is specifically configured to determine the number of bytes corresponding to the file to be stored; and divide the file to be stored into the N according to the number of bytes. Sub-files.
- the processing part 502 is further specifically configured to determine the instruction parameter corresponding to the file to be stored; and divide the file to be stored into the N sub-files according to the instruction parameter. file.
- the encryption part 506 is specifically configured to randomly generate an asymmetric key pair; wherein, the asymmetric key pair includes a public key and a private key; and the public key is used
- the address set corresponding to the file to be stored is encrypted to obtain the address set ciphertext.
- the sending part 503 is specifically configured to generate a hash value corresponding to the ciphertext of the address set; and send the ciphertext of the address set and the hash value to Blockchain network.
- the receiving part 504 is specifically configured to receive the target index value corresponding to the hash value returned by the blockchain network.
- the storage part 507 is configured to send the ciphertext of the address set and the hash value to the blockchain network, and receive the AND returned by the blockchain network. After the target index value corresponding to the hash value, the target index value and the hash value are stored.
- the receiving part 504 is further configured to store the ciphertext of the address set in the blockchain network, and after receiving the target index value returned by the blockchain network, receive Download request; wherein, the download request carries the target index value.
- the sending part 503 is further configured to send the target index value to the blockchain network.
- the receiving part 504 is further configured to receive the ciphertext of the address set returned by the blockchain network.
- the decryption part 508 is configured to decrypt the ciphertext of the address set to obtain the address set corresponding to the file to be stored; wherein, the address set includes The M pieces of address information.
- the sending part 503 is further configured to send the M address information to the IPFS.
- the receiving part 504 is further configured to receive the N sub-files corresponding to the file to be stored returned by the IPFS.
- the merging part 509 is configured to perform a merging operation on the N sub-files to obtain the file to be stored.
- the decryption part 508 is specifically configured to use the private key to decrypt the ciphertext of the address set to obtain the address set corresponding to the file to be stored.
- the download request carries the hash value
- the determining part 510 is configured to decrypt the ciphertext of the address set to obtain the file corresponding to the file to be stored Before the address set, the target index value corresponding to the hash value is determined.
- the sending part 503 is further configured to send the target index value to the blockchain network.
- the receiving part 504 is further configured to receive the ciphertext of the address set returned by the blockchain network.
- FIG. 14 is a second schematic diagram of the structure of the terminal provided by the embodiment of the present application.
- the terminal 500 proposed in the embodiment of the present application may further include a processor 511, which stores processing The memory 512 for the processor 511 to execute instructions.
- the terminal 500 may further include a communication interface 513 and a bus 514 for connecting the processor 511, the memory 512, and the communication interface 513.
- the aforementioned processor 511 may be an application specific integrated circuit (ASIC), a digital signal processor (Digital Signal Processor, DSP), a digital signal processing device (Digital Signal Processing Device, DS PD), at least one of programmable logic device (ProgRAMmable Logic Device, PLD), field programmable gate array FPGA, central processing unit CPU, controller, microcontroller, and microprocessor. It can be understood that, for different devices, the electronic devices used to implement the above-mentioned processor functions may also be other, which is not specifically limited in the embodiment of the present application.
- ASIC application specific integrated circuit
- DSP Digital Signal Processor
- DS PD digital signal processing device
- PLD programmable logic device
- FPGA field programmable gate array FPGA
- CPU central processing unit
- controller microcontroller
- microprocessor microprocessor
- the terminal 500 may further include a memory 512, which may be connected to the processor 511, where the memory 512 is used to store executable program code, the program code includes computer operation instructions, the memory 512 may include a high-speed RAM memory, or may also include Non-volatile memory, for example, at least two disk memories.
- the bus 514 is used to connect the communication interface 513, the processor 511, and the memory 512, and to communicate with each other among these devices.
- the memory 512 is used to store instructions and data.
- the above-mentioned processor 511 is configured to obtain a file to be stored, divide the file to be stored, and obtain N sub-files corresponding to the file to be stored; where N is An integer greater than or equal to 1; send the N subfiles to IPFS, and receive M address information corresponding to the N subfiles returned by the IPFS; where M is greater than or equal to 1, and less than or equal to N According to the M address information, generate the address set corresponding to the file to be stored, and encrypt the address set to obtain the ciphertext of the address set; send the ciphertext of the address set to the blockchain network, And receiving the target index value returned by the blockchain network; wherein the target index value is used to identify the address set ciphertext.
- the above-mentioned memory 512 may be a volatile memory (volatile memory), such as a random access memory (Random-Access Memory, RAM); or a non-volatile memory (non-volatile memory), such as a read-only memory (Read-Only Memory, ROM), flash memory (flash memory), hard disk (Hard Disk Drive, HDD) or solid-state drive (Solid-State Drive, SSD); or a combination of the above types of memory, and send it to the processor 511 Provide instructions and data.
- volatile memory such as a random access memory (Random-Access Memory, RAM)
- non-volatile memory such as a read-only memory (Read-Only Memory, ROM), flash memory (flash memory), hard disk (Hard Disk Drive, HDD) or solid-state drive (Solid-State Drive, SSD); or a combination of the above types of memory, and send it to the processor 511 Provide instructions and data.
- the functional modules in this embodiment may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
- the above-mentioned integrated unit can be realized in the form of hardware or software function module.
- the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer readable storage medium.
- the technical solution of this embodiment is essentially or correct
- the part that the prior art contributes or all or part of the technical solution can be embodied in the form of a software product.
- the computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer).
- the aforementioned storage media include: U disk, mobile hard disk, read only memory (Read Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes.
- An embodiment of the present application provides a terminal, which obtains a file to be stored, and divides the file to be stored to obtain N sub-files corresponding to the file to be stored; where N is an integer greater than or equal to 1; Send to IPFS and receive M address information corresponding to N subfiles returned by IPFS; where M is an integer greater than or equal to 1 and less than or equal to N; generate the address set corresponding to the file to be stored according to the M address information, The address set is encrypted to obtain the address set ciphertext; the address set ciphertext is stored in the blockchain network, and the target index value returned by the blockchain network is received; among them, the target index value is used to perform the address set ciphertext Logo.
- the terminal fragments the file to be stored and uploads it to IPFS, generates an address set according to the addresses corresponding to the multiple sub-files returned by the received IPFS, and then encrypts the address set, and Further store the ciphertext of the address set to the blockchain network. It not only overcomes the shortcomings of excessive server pressure caused by the existing file storage methods to a large extent, but at the same time, the storage data is small, the encryption is efficient, and the file storage security is high, which greatly satisfies the large amount of data files. Storage requirements.
- the embodiment of the present application provides a computer-readable storage medium on which a program is stored, and when the program is executed by a processor, the file storage method described above is implemented.
- the program instructions corresponding to a file storage method in this embodiment can be stored on storage media such as optical disks, hard disks, USB flash drives, etc.
- storage media such as optical disks, hard disks, USB flash drives, etc.
- N is an integer greater than or equal to 1;
- M is an integer greater than or equal to 1 and less than or equal to N;
- the ciphertext of the address set is sent to the blockchain network, and the target index value returned by the blockchain network is received; wherein the target index value is used to identify the ciphertext of the address set.
- this application can be provided as methods, systems, or computer program products. Therefore, this application may adopt the form of hardware embodiment, software embodiment, or a combination of software and hardware embodiments. Moreover, this application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, optical storage, etc.) containing computer-usable program codes.
- These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
- the device realizes the functions specified in one or more processes in the schematic diagram and/or one block or more in the block diagram.
- These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
- the instructions provide steps for implementing functions specified in one or more processes in the schematic diagram and/or one block or more in the block diagram.
- the embodiment of the application discloses a file storage method, a terminal and a storage medium.
- the file storage method includes: obtaining a file to be stored, and dividing the file to be stored to obtain N sub-files corresponding to the file to be stored; where N Is an integer greater than or equal to 1; send N subfiles to IPFS, and receive M address information corresponding to the N subfiles returned by IPFS; where M is an integer greater than or equal to 1 and less than or equal to N; according to M
- Each address information generates the address set corresponding to the file to be stored, and encrypts the address set to obtain the ciphertext of the address set; sends the ciphertext of the address set to the blockchain network, and receives the target index value returned by the blockchain network; ,
- the target index value is used to identify the ciphertext of the address set.
- the terminal fragments the file to be stored and uploads it to IPFS, generates an address set according to the addresses corresponding to the multiple sub-files returned by the received IPFS, and then encrypts the address set, and Further store the ciphertext of the address set to the blockchain network. It not only overcomes the shortcomings of excessive server pressure caused by the existing file storage methods to a large extent, but at the same time, the storage data is small, the encryption is efficient, and the file storage security is high, which greatly satisfies the large amount of data files. Storage requirements.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Data Mining & Analysis (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Computer Hardware Design (AREA)
- Health & Medical Sciences (AREA)
- Bioethics (AREA)
- General Health & Medical Sciences (AREA)
- Software Systems (AREA)
- Computing Systems (AREA)
- Library & Information Science (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本申请实施例公开了一种文件存储方法、终端及存储介质,所述文件存储方法包括:获取待存储文件,并对待存储文件进行划分处理,获得待存储文件对应的N个子文件;其中,N为大于或者等于1的整数;将N个子文件发送至IPFS,并接收IPFS返回的N个子文件对应的M个地址信息;其中,M为大于或者等于1,且小于或者等于N的整数;根据M个地址信息生成待存储文件对应的地址集,并对地址集进行加密,得到地址集密文;将地址集密文发送至区块链网络,并接收区块链网络返回的目标索引值;其中,目标索引值用于对地址集密文进行标识。
Description
本申请基于申请号为201911067461.X、申请日为2019年11月04日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。
本发明涉及终端技术领域,尤其涉及一种文件存储方法、终端及存储介质。
随着计算机技术的不断发展,用户使用的电子产品越来越多样化,进而通过使用多样化的电子产品产生了各种各样的数据,使得用户对个人数据的存储和保护要求也越来越高。目前,普遍使用区块链体系对这些海量数据进行管理、存储以及检索。
针对数据量较大的文件,现有的区块链存储及检索方式通常是将文件发送至服务端,在服务端将文件分割成多个子文件,并进一步对多个子文件分别进行加密,然后将加密后的子文件进行存储,当用户下载文件时通过服务端获取并解密获得所有子文件,然后将所有子文件合并成数据量较大的文件后再返回给终端。由此可见,现有的区块链存储方式不仅加密效率低、安全性差,同时也造成了服务端压力过大的问题,无法满足数据量较大的文件的存储需求。
发明内容
本申请实施例提供了一种文件存储方法、终端及存储介质,不仅在很大程度上克服了现有的文件存储方式所造成的服务端压力过大的缺陷,同时,存储数据量小,加密高效,文件存储安全性高,极大地满足了数据量较大文件的存储需求。
本申请实施例的技术方案是这样实现的:
本申请实施例提供了一种文件存储方法,所述方法包括:
获取待存储文件,并对所述待存储文件进行划分处理,获得所述待存储文件对应的N个子文件;其中,N为大于或者等于1的整数;
将所述N个子文件发送至IPFS,并接收所述IPFS返回的所述N个子文件对应的M个地址信息;其中,M为大于或者等于1,且小于或者等于N的整数;
根据所述M个地址信息生成所述待存储文件对应的地址集,并对所述地址集进行加密,得到地址集密文;
将所述地址集密文发送至区块链网络,并接收所述区块链网络返回的目标索引值;其中,所述目标索引值用于对所述地址集密文进行标识。
本申请实施例提供了一种终端,所述终端包括:获取部分,处理部分,发送部分,接收部分,生成部分以及加密部分,
所述获取部分,配置为获取待存储文件;
所述处理部分,配置为对所述待存储文件进行划分处理,获得所述待存储文件对应的N个子文件;其中,N为大于或者等于1的整数;
所述发送部分,配置为将所述N个子文件发送至IPFS;
所述接收部分,配置为接收所述IPFS返回的所述N个子文件对应的M个地址信息;其中,M为大于或者等于1,且小于或者等于N的整数;
所述生成部分,配置为根据所述M个地址信息生成所述待存储文件对应的地址集;
所述加密部分,配置为对所述地址集进行加密,得到地址集密文;
所述发送部分,还配置为将所述地址集密文发送至区块链网络;
所述接收部分,还配置为接收所述区块链网络返回的目标索引值;其中,所述目标索引值用于对所述地址集密文进行标识。
本申请实施例提供了一种终端,所述终端包括处理器、存储有所述处理器可执行指令的存储器,当所述指令被所述处理器执行时,实现如上所述的文件存储方法。
本申请实施例提供了一种计算机可读存储介质,其上存储有程序,应用于终端中,所述程序被处理器执行时,实现如上所述的文件存储方法。
本申请实施例提供了一种文件存储方法、终端及存储介质,终端获取待存储文件,并对待存储文件进行划分处理,获得待存储文件对应的N个子文件;其中,N为大于或者等于1的整数;将N个子文件发送至IPFS,并接收IPFS返回的N个子文件对应的M个地址信息;其中,M为大于或者等于1,且小于或者等于N的整数;根据M个地址信息生成待存储文件对应的地址集,并对地址集进行加密,得到地址集密文;将地址集密文存储至区块链网络,并接收区块链网络返回的目标索引值;其中,目标索引值用于对地址集密文进行标识。也就是说,在本申请的实施例中,终端将待存储文件碎片化并上传至IPFS,根据接收到的IPFS返回的多个子文件对应的地址生成地址集,进而对该地址集进行加密,并进一步将地址集密文存储至区块链网络。不仅在很大程度上克服了现有的文件存储方式所造成的服务端压力过大的缺陷,同时,存储数据量小,加密高效,文件存储安全性高,极大地满足了数据量较大文件的存储需求。
图1是本申请实施例提供的区块链网络服务平台的功能架构示意图;
图2是本申请实施例提供的资源层通过部署有容器化管理系统而被构建为容器集群200的结构示意图;
图3是本申请实施例提供的开发者通过终端300接入区块链网络服务平台100的示意图;
图4A至图4Q是本申请实施例提供的区块链网络服务平台的各种功能管理页面的显示示意图;
图5为本申请实施例提供的示例性的使用区块链网络服务平台部署的区块链网络的结构示意图;
图6为本申请实施例提供的示例性的使用区块链网络服务平台进行交易的流程图;
图7为本申请实施例提供的文件存储方法的实现示意图一;
图8为本申请实施例提供的文件存储方法的实现流程示意图一;
图9为本申请实施例提供的示例性的实现文件存储的流程示意图;
图10为本申请实施例提供的文件存储方法的实现示意图二;
图11为本申请实施例提供的文件存储方法的实现流程示意图二;
图12为本申请实施例提供的示例性的实现文件查询的流程示意图;
图13为本申请实施例提供的终端的组成结构示意图一;
图14为本申请实施例提供的终端的组成结构示意图二。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。可以理解的是,此处所描述的具体实施例仅用于解释相关申请,而非对该申请的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关申请相关的部分。
除非另有定义,本文所使用的所有的技术和科学术语与属于本发明的技术领域的技术人员通常理解的含义相同。本文中所使用的术语只是为了描述本发明实施例的目的,不是旨在限制本发明。
对本发明实施例进行进一步详细说明之前,对本发明实施例中涉及的名词和术语进行说明,本发明实施例中涉及的名词和术语适用于如下的解释。
1)星际文件系统(Inter Planetary File System,IPFS)是一个旨在创建持久且分布式存储和共享文件的网络传输协议。IPFS是通用的,并且存储限制很少。其服务的文件可大可小,并可以自动将大的文件切割成小块,使节 点不仅可以像超文本传输协议(Hyper Text Transfer Protocol,HTTP)一样从一台服务器上下载文件,还可以从数百台服务器上进行同步下载。IPFS可以将大文件按固定大小切片并明文存储到系统中。
2)区块链网络,通过共识的方式将新区块纳入区块链的一系列的、无中心的节点的集合。
3)区块链(Blockchain),由节点参与的去中心化的分布式数据库系统,是由区块以顺序相连的方式组合成的一种链式数据结构,在每个区块中引用前一个区块或者其子集的哈希值,从而以密码学的方式保证所记录交易的不可篡改和不可伪造。是对接入服务器的所有区块链节点公开的分布式存储的数据结构,包含着若干的区块(Block)。包含客户端的用户终端可以注册成为一个区块链节点,每一个区块链节点设备作为一个区块链节点,与接入区块链服务器的其他区块链节点组成点对点(peer to peer lending,P2P)网络,区块链数据可以存放在P2P网络,P2P网络任何一个或多个区块链节点瘫痪,都不会导致区块链数据的丢失,这样区块链数据就具有很强的安全性,确保数据的永久保存和不可篡改。当一个区块持久化到区块链数据中时,接入服务器的区块链节点都可以添加该区块;区块是按照持久化时间顺序一个一个地添加到区块链数据中的,除了区块链数据中第一个区块外的每一个区块都要链接到其前一个区块,这样区块链数据就形成一个区块链接这一个区块了,就像一个链条一样,当一个区块被持久化到区块链数据后,该区块就无法被修改了。
4)区块(Block),记录一段时间内交易所更新的账本数据的数据结构,被标记上时间戳和之前一个区块的独特标记(例如数字指纹),区块经过区块链网络中节点的共识验证后,会被追加到区块链的末尾成为新的区块。
5)交易(Transaction),等同于计算机术语“事物”,包括三种不同的模拟交易操作:部署(Deploy),调用(Invoke)和查询(Query)。部署交易用于向区块链网络的节点安装指定的链码,调用和查询类型的交易用于调用部署号的链码,以实现对账本中的目标账户的相关数据的操作,包括增、删、查、改的操作修改账户中的键值(Key-Value)对形式的数据,或者在账本中增加新的账户,并非单指商业语境中的交易,鉴于在区块链技术中约定俗成地使用了“交易”这一术语,本发明实施例遵循了这一习惯。
6)账本(Ledger),区块链网络中以账户为维度所记录的数据的总和,包括账本数据、账本状态、账本状态证明和区块索引等元素。
7)账本数据,实际区块数据存储,即区块链中记录的一系列有序的、不可篡改的交易的记录,可以表现为文件系统的文件的形式,交易中调用的智能合约被执行时,实现对账户/账户中数据的更新。
8)账本状态,也称为状态数据,即账本数据的状态,可以表现为数据库终中的键值对的形式,其中实时账本状态用于表示共识的交易所更新的键值 对的最新记录,历史账本状态用于表示键值对的历史记录。
9)共识(Consensus),是区块链网络中的一个过程,用于在涉及的多个节点之间对交易结果达成一致,实现共识的机制包括工作量证明((Proof Of Work,POW)、权益证明(Proof Of Stake,POS)、股份授权证明(Delegate d Proof-Of-Stake,DPOS)、消逝时间量证明(Proof Of Elapsed Time,POE T)等。
10)智能合约(Smart Contracts),也称为链码(Chaincode),部署在区块链网络中的根据条件而触发执行的程序链码运行在一个安全的容器中,来初始化和管理账本数据和账本状态。
11)容器编排,容器的调度和集群的技术,提供用于基于容器应用可扩展性的基本机制,使用容器提供服务并编排决定容器之间如何进行交互。下面说明实现本发明实施例的区块链网络的示例性的功能架构,图1为本申请实施例提供的区块链网络服务平台的功能架构示意图,包括应用层101、共识层102、网络层103、数据层104和资源层105,下面分别进行说明。
资源层105封装各种可用的计算资源和存储资源,例如计算机、服务器/集群和云中的计算资源和存储资源,进行抽象并向数据层104提供统一的接口以屏蔽实现资源层105的底层硬件的差异性。
计算资源包括各种形式的处理器,例如中央处理器(Central Processing Unit,CPU)、应用专用集成电路(Application Specific Integrated Circuit,ASIC)、专用集成电路和现场可编程门阵列(Field-Programmable Gate Array,FPGA)的各种形式的处理器。
存储资源包括各种易失性存储器和非易失性存储器等各种类型的存储介质。其中,非易失性存储器可以是只读存储器(Read Only Memory,ROM)、可编程只读存储器(Programmable Read-Only Memory,PROM)。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。
资源层105的计算资源和存储资源可以被映射为区块链网络中各种类型的节点,实现本发明实施例的存储介质存储了用于实现本发明实施例的区块链网络部署方法的可执行指令,一旦被部署到节点的可执行指令被执行,实现节点的底层资源(例如各种类型的处理器)将实现区块链网络中各种类型的节点的部署、以及执行各种类型节点的功能,从而实现针对业务过程中的交易的账本、以及基于账本的各种应用。
作为示例,可执行指令可以采用软件(包括系统程序和应用程序)、软件模块、脚本、插件等的形式,按任意形式的编程语言(包括编译或解释语言,或者声明性或过程性语言)来编写,并且其可按任意形式部署,包括被部署为独立的程序或者被部署为模块、组件或者适合在计算环境中使用的其它单元。
数据层104封装了实现账本的各种数据结构,包括以文件系统实现的账本数据,以数据库形式实现的账本状态和存在性证明。
网络层103封装了P2P网络协议、数据传播机制和数据验证机制、接入和认证机制和业务主体身份。P2P网络协议实现区块链网络中节点之间的通信,数据传播机制保证了交易/交易结果在区块链网络中的传播,数据验证机制用于基于加密学方法(例如数字证书、数字签名、公/私钥对)实现节点之间传输数据的可靠性;接入和认证机制用于基于业务主体身份对终端的接入和认证进行管理。
共识层102封装了区块链中传播的交易结果达成一致性的机制,包括POS、POW和DPOS等,支持共识机制的可插拔。
应用层101封装了区块链网络能够实现的各种业务,包括交易结算、溯源和存证等。
图2为本申请实施例提供的资源层通过部署有容器化管理系统而被构建为容器集群200的结构示意图,向资源层提供资源的机器中通过部署容器化管理系统的相应组件而形成管理节点(Master Server)200和服务节点300(Node)两类节点,管理节点用于管理容器在服务节点中的调度和运行,服务节点主要用于运行各种容器,提供区块链网络中的各种应用的隔离运行环境,例如,用于运行链码的链码容器,用于运行节点(即区块链网络中各种类型的节点的代码)代码的节点容器等,下面分别进行说明。
管理节点(Master Server)200负责管理集群,以服务(Service)的形式对外提供集群的资源数据访问入口,管理节点包括几个示例性的组件。
1)状态组件(etcd),用于保存整个集群的状态。
2)应用程序接口服务(Application Programming Interface,API)Server组件,用于提供了资源操作的唯一入口,并提供认证、授权、访问控制、API注册和发现等机制。
3)调度(Scheduler)组件,用于负责资源的调度,按照预定的调度策略将容器调度到合适的节点上运行。服务节点所运行的容器中共享机器(也就是部署服务节点组件的机器)中同一组资源的容器组(Plain old data structur e,Pod)为调用的最小单位,对于区块链网络的应用来说,可以通过一个或多个的容器组来实现,容器组中的容器共享的资源包括:应用程序命名空间、网络命名空间、主机名和存储卷(Volume)。
以共享存储卷为例,当节点上部署共享文件系统组件时,例如网络文件系统(Network File System,NFS)、集群文件系统(GlusterFS)、ceph文件系统(Cephfs),调度组件就能够存储卷上所挂载的容器组轻易地调度(挂载)到其他机器(节点)的存储卷中。
4)控制管理(Controller Manager)组件,用于负责监控/维护集群的状态,通过应用程序接口服务组件提供的接口,实时监控整个集群的每个资源 对象的当前状态,当发生各种故障导致系统状态发生变化时,会修复到期望状态。
5)副本控制器(Replication Controller,RC)组件,控制一定时间内总有一定数量的Pod副本的运行;例如正在运行的Pod副本超出设定值,则关闭部分Pod副本;如果Pod副本少于设定值则创建新的Pod副本。
6)部署控制器(Deployment Controller)组件,用于管理维护容器集群找中的资源对象-部署(Deployment)对象,关联部署对象和副本控制器,在部署对象中为容器组和副本控制器提供声明式更新,用于声明容器组和副本控制器的目标状态,从而当部署对象更新时,控制实现副本控制器和容器组的更新。
服务节点300包括以下示例性的组件。
1)容器引擎(记为Docker),用于来负责所有具体的镜像下载和容器运行。
2)守护进程组件(记为Kubelet),用于负责维护容器的生命周期(创建、启动和停止),同时也负责存储卷和容器网络接口(Container Network Interf ace,CNI)的管理。
以存储卷的管理为例,守护进程组件通过节点中部署的共享文件系统的组件,例如网络文件系统(Network File System,NFS)、集群文件系统(GlusterFS)、ceph文件系统(Cephfs),将一个容器组中的各个容器挂载到相同的存储卷上,使各个容器使用相同的存储卷存储在运行过程中所生产的数据,存储卷中的数据可以被同一个容器组的任一容器访问。
3)负载均衡组件(记为Proxy),负责为Service提供cluster内部的服务发现和负载均衡。
基于图2示出的集群,部署一个区块链网络的应用的镜像被封装到容器组(在下面的示例中称为目标Pod)并运行在节点(在下面的示例中称为目标Node)的示例性过程如下所述。
首先,容器集群200的管理工具(Kubectl)提交一个创建副本控制器RC的请求,其中包括目标Pod的定义;目标Pod需要运行的副本数量;要监控的目标Pod标签(Lable)等信息。
接下来,请求通过应用程序接口API Server被写入etcd中,此时Controller Manager通过API Server的监听资源变化的接口监听到这个RC事件,发现当前集群中还没有它所对应的Pod实例,于是根据RC里的Pod模板定义生成一个Pod对象,通过API Server写入etcd。
紧接着,RC事件被Scheduler发现,它立即执行一个调度流程:为这个新Pod选定一个落户的节点,然后通过API Server将这一结果写入到etcd中,随后,目标Node上运行的Kubelet进程通过API Server监测到这个新Pod, 并按照它的定义,启动新Pod,直到Pod的生命结束。
随后,Kubectl提交一个新的映射到目标Pod的Service的创建请求,Controller Manager会通过Label查询到相关联的Pod实例,然后生成Service的端点(Endpoints)信息(包括地址和端口),并通过API Server写入到etcd中;容器集群中所有Node上运行的Proxy进程通过API Server查询、并监听Service对象与其对应的Endpoints信息,建立一个软件方式的负载均衡器来实现Service访问到后端Pod的流量转发功能。
结合上文可知,实现本发明实施例的区块链网络服务平台通过在资源层部署容器集群、并运行封装有区块链网络应用的容器而实现,由此,实现本发明实施例的区块链网络可以提供为存储器和处理器的形式,在存储器中存储有可执行指令,当可执行指令被处理器执行时,在运行处理器和存储器的多个节点上建立了容器集群,通过在容器中运行封装的应用,来实现本发明实施例的区块链服务网络平台中的链码安装方法。
实现本发明实施例的区块链网络平台通过各种方式与开发者连接,并提供各种图形化的方式以进行区块链网络的部署和管理,下面进行说明。
图3为本申请实施例提供的开发者通过终端300接入区块链网络服务平台100的示意图,开发者终端300的软件开发工具包(Software Development Kit,SDK/全球广域网(World Wide Web,Web)320接口连接区块链网络服务平台100中的数据层104相应的SDE/Web接口,支持在开发者的终端300本地以远程的方式部署支撑特定业务的区块链网络,在终端300的图形界面310中显示区块链网络服务平台100的各种功能的管理页面,包括容器集群的创建和新的容器集群的接入、存储资源的管理、一键部署区块链网络、链码管理(运行状态查看)、应用商店管理等。
图4A至图4Q为本申请实施例提供的区块链网络服务平台的各种功能管理页面的显示示意图,将结合图4A至图4Q示例性说明如图3中开发者终端300的图形界面310中显示的功能管理页面。
图4A示出了区块链网络服务平台100的状态查看页面,在状态查看页面中区块链网络的运行状态,例如CPU使用、内存使用、资源(节点)使用的情况。
图4B示出了区块链网络服务平台100的一键部署的控制台页面,支持开发者设置区块链网络的基本信息(包括区块域名、版本号)和组织(包括组织名、节点数量、用户数量等),采用默认值来设置高级选项,包括排序节点类型、通道名称和链码名称等。
图4C示出了的区块链网络服务平台100的资源层105的资源管理的控制台页面,其中显示了开发者通过区块链网络服务平台100可部署的集群的相关信息,包括是否连接的状态,CPU/内存使用情况等。
在图4D中支持添加用于支撑去区块链网络的容器集群,录入集群名称; 在创建集群的功能选项被触发后将进入创建页面。
在图4E中示出了区块链网络服务平台100的查询集群的控制台页面,当查询集群的功能按钮被触发后,将进入集群列表页面,支持进行添加集群、查询集群、删除集群、编辑集群的操作。
在图4F中示出了区块链网络服务平台100的存储管理的控制台页面,当存储管理的功能按钮被触发时,将进入存储管理列表页,显示集群中已创建的存储项目,其中包含存储查询及删除功能。
在图4G中示出了区块链网络服务平台100的存储详情的控制台页面,在图4H中显示存储的详情,并支持对存储进行动态存储空间扩容。
在图4I中示出了区块链网络服务平台100的添加存储的控制台页面,支持对添加的存储名称和节点进行设置,根据设置将节点添加到容器集群中,并在图4J中显示添加存储后的详情信息,包括容器集群的节点的列表。
在图4K中示出了区块链网络服务平台100的超级账本的控制台页面,显示了部署区块链网络所使用的超级账本的名称、网络版本、状态和创建时间的信息。
在图4L中示出了区块链网络服务平台100的超级账本的一键部署的控制台页面,提供了针对超级账本部署的基本信息的配置项目,以及采用默认值的高级配置项,例如排序节点类型、通道、默认链码和初始化参数等。
在图4M/N中示出了区块链网络服务平台100的链码的上传/安装的控制台页面,在上传的控制台页面中提供了链码名和版本号的设置项目;在安装的控制台页面中提供了链码版本、初始化参数、组织和节点的配置项目。
在图4O中示出了区块链网络服务平台100的网络详情的控制台页面,支持查看不同通道的组织成员、区块高度、交易数量和合约数量等信息,还可以显示所查看通道的组织名称、通道内节点名称、通道内链码名称等信息。
在图4P中示出了区块链网络服务平台100的链码查询的控制台页面,支持使用网络名称、链码名称、链码参数、账本名称和链码函数等方式配合查询链码,查询的维度包括状态、消息和数据。
在图4Q中示出了区块链网络服务平台100的应用商店的控制台页面,支持开发者选择需要部署的应用,一旦有应用被确定部署到区块链网络,将通过复用应用的镜像的方式完成到资源层105的容器集群的快速部署。
图5为本申请实施例提供的示例性的使用区块链网络服务平台部署的区块链网络的结构示意图,应用程序从CA获取合法的身份证书来加入到网络内的应用通道。发起正式交易前,需要先构造交易提案(Proposal)提交给组织1和组织2中的背书节点进行背书;客户端收集到足够(数量根据背书策略决定)的背书支持后,可以利用背书构造一个合法的交易请求(携带背书节点的背书),发给排序服务中的排序节点(Orderer)进行排序,以是将交易封装 形成区块。
图6为本申请实施例提供的示例性的使用区块链网络服务平台进行交易的流程图,其中,交易流程中客户端和各个节点的功能如下:
客户端(应用程序):使用SDK来跟区块链网络进行交互。首先,客户端从证书颁发机构(Certificate Authority,CA)获取合法的身份证书来加入到网络内的应用通道。发起正式交易前,需要先构造交易提案(Proposal)提交给背书节点进行背书;客户端收集到足够(数量根据背书策略决定)的背书支持后,可以利用背书构造一个合法的交易请求(携带背书节点的背书),发给排序节点(Orderer)进行排序,以是将交易封装形成区块。客户端还可以通过事件机制来监听网络中消息,来获知交易是否被成功接收。
背书节点(Endorser):主要提供方法供客户端调用,完成对交易提案的背书(签名)处理。收到来自客户端的交易提案后,首先进行合法性和访问控制列表(Access Control Lists,ACL)权限检查,检查通过则模拟运行交易(交易中会执行需要执行的链码名称和参数,执行交易,实质就是执行交易中所指定的链码),对交易导致的状态变化(以读写集形式记录,包括所读状态的键和版本,所写状态的键值)进行背书(也就是进行数字签名)并返回客户端是否予以支持的结果。
排序节点(Orderer):接收包含背书签名的交易,对未打包的交易进行排序生成区块,广播给Peer节点。
主节点(Leader Peer):和排序节点通信的节点,负责从排序节点处获取最新的区块并在区块链网络的内部同步。
记账节点(Committer):维护区块链和账本的结构(包括状态分贝(decibel,DB)、历史DB、索引DB等)。该节点会定期地从排序节点获取排序后的批量交易区块结构,对这些交易检查(包括交易消息结构、签名完整性、是否重复、读写集合版本是否匹配等)。检查通过后执行合法的交易,将结果写入账本,同时构造新的区块。
需要说明的是,所有的Peer节点都是记账节点,负责验证从排序节点区块里的交易,维护状态数据和账本的副本。部分Peer节点会执行交易并对结果进行签名背书,充当背书节点的角色。背书节点是动态的角色,是与具体链码绑定的。在链码容器中的每个链码在实例化的时候都会设置背书策略,指定哪些节点对交易背书后才是有效的。也只有在应用程序向它发起交易背书请求的时候才是背书节点,其他时候就是普通的记账节点,只负责验证交易并记账。
随着计算机技术的不断发展,用户使用的电子产品越来越多样化,进而通过使用多样化的电子产品产生了各种各样的数据,使得用户对个人数据的存储和保护要求也越来越高。目前,普遍使用区块链体系对这些海量数据进行管理、存储以及检索。
针对数据量较大的文件,现有的区块链存储及检索方式通常是将文件发送至服务端,在服务端将文件分割成多个子文件,并进一步对多个子文件分别进行加密,然后将加密后的子文件进行存储,当用户下载文件时通过服务端获取并解密获得所有子文件,然后将所有子文件合并成数据量较大的文件后再返回给用户。由此可见,现有的区块链存储方式不仅加密效率低、安全性差,同时也造成了服务端压力过大的问题,无法满足数据量较大的文件的存储需求。
为了解决现有的文件存储机制所存在的问题,本申请实施例提供了一种文件存储方法,其中,终端将待存储文件碎片化并上传至IPFS,根据接收到的IPFS返回的多个子文件对应的地址生成地址集,进而对该地址集进行加密,并进一步将地址集密文存储至区块链网络。不仅在很大程度上克服了现有的文件存储方式所造成的服务端压力过大的缺陷,同时,存储数据量小,加密高效,文件存储安全性高,极大地满足了数据量较大文件的存储需求。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。
本申请一实施例提供了一种文件存储方法,该文件存储方法应用于文件存储系统,该文件存储系统集成于终端中,图7为本申请实施例提供的文件存储方法的实现示意图一。文件存储系统获取到用户上传的文件后,对该文件进行分割得到多个子文件,并将分割后得到的子文件循环存储至IPFS,进而接收到IPFS返回的多个子文件对应的文件地址,对多个文件地址生成的文件地址集,进行加密操作生成文件地址集密文,并进一步生成该文件地址集密文对应的哈希值,然后将文件地址集密文和哈希值一并存储至区块链,并接收区块链返回的交易标识(Identity document,ID)、交易时间、区块信息等,经自关联处理后,保存交易ID。
图8为本申请实施例提供的文件存储方法的实现流程示意图一,如图8所示,在本申请的实施例中,终端进行文件存储的方法可以包括以下步骤:
步骤S101、获取待存储文件,并对待存储文件进行划分处理,获得待存储文件对应的N个子文件;其中,N为大于或者等于1的整数。
在本申请的实施例中,当用户需要进行文件存储时,终端可以获取待存储文件,并且可以对待存储文件进行划分处理,进一步可以得到该待存储文件对应的N个子文件;其中,N为大于或者等于1的整数。
需要说明的是,在本申请的实施例中,终端可以为任何具备通信和存储功能的设备。例如:平板电脑、手机、电子阅读器、个人计算机(Personal Computer,PC)、笔记本电脑、车载设备、网络电视等设备。
需要说明的是,在本申请的实施例中,待存储文件可以是视频文件、音频文件、压缩文件或者其他类型的文件,也就是说,待存储文件的文件类型可以包括文档(Word)格式、便携式文档格式(Portable Document Format, PDF)、图像格式(Joint Photographic Experts Group,JPG)、便携式网络图形(Portable Network Graphics,PNG)、视频以及语音,本申请不做限定。
需要说明的是,在本申请的实施例中,终端获取待存储文件后,在对待存储文件进行分片以得到N个子文件的过程中,各个子文件的大小可以进行适应性的调整。具体地,终端可以通过确定待存储文件对应的字节或者指令参数对该待存储文件进行划分处理,以便获得待存储文件对应的N个子文件。
相应地,若终端采用字节划分处理方式对待存储文件进行分割,则终端可以先获取待存储文件对应的字节数,进一步按照字节数将待存储文件平均分割成相同字节大小的N个子文件;其中,每个子文件对应的字节数可以是终端预先设置的。例如,如果终端预先设置每个子文件对应的字节数为1.536×10
7,当获取到的待存储文件大小为300M时,终端按设置好的字节划分处理方式可以将待存储文件划分成20个子文件。
相应地,若终端采用指令参数划分处理方式对待存储文件进行分割,则终端可以获取待存储文件对应的指令参数,其中,该指令参数可以为待存储文件对应的行数;由于待存储文件都是由相应的程序代码组成,该代码包含有多个换行符标识,终端可以通过识别换行符标识进一步确定待存储文件对应的行数,然后按照行数划分处理方式对待存储文件进行分割,进一步将待存储文件平均分割成相同大小的N个子文件。例如,如果终端预先设置每个子文件对应的行数为1500,当终端通过识别待存储文件对应的换行标识,而确定出待存储文件对应的行数为30000,那么终端可以进一步将待存储文件分割成20个子文件。
进一步地,在本申请的实施例中,终端在将待存储文件划分成N个子文件后,可以将N个子文件发送至IPFS,以便进一步得到N个子文件对应的地址。
步骤S102、将N个子文件发送至IPFS,并接收IPFS返回的N个子文件对应的M个地址信息;其中,M为大于或者等于1,且小于或者等于N的整数。
在本申请的实施例中,终端在将获取到的待存储文件经划分处理,得到该待存储文件对应的N个子文件后,将N个子文件发送至IPFS,并接收到了IPFS返回的N个子文件对应的M个地址信息;其中,M为大于或者等于1,且小于或者等于N的整数。
需要说明的是,在本申请的实施例中,对待存储文件进行划分处理得到N个子文件后,将待存储文件对应的N个子文件发送至IPFS,IPFS的存储链对N个子文件进行识别处理,分别将N个子文件分配至存储节点A、存储节点B、存储节点C等M个存储节点,由于IPFS中一个存储节点可对应存储至少一个子文件,且一个存储节点返回一个地址信息,因此,存储节点个数小于或者等于待存储文件对应的子文件的个数。相应地,终端将N个子文件发送 至IPFS,存储在IPFS对应的M个存储节点上,在存储完成后,终端会接收到IPFS返回的M个存储节点对应的M个地址信息。进一步地,将待存储文件对应的N个子文件发送至至IPFS时,可以以固定的一个子文件发送至一个存储节点,并返回一个对应的地址信息的单个依次发送的方式进行子文件的发送,或者可以采用特定的广播的方式进行发送。
示例性地,在本申请的实施例中,当终端将300M大小的待存储文件划分成20个大小为15M的子文件后,依次将大小为15M的子文件发送至IPFS,每发送一个子文件至IPFS,将会接收到IPFS返回的一个地址信息,终端依次接收到IPFS返回的20个地址信息,也就是说子文件A对应存储节点A,即对应址信息A;子文件B对应存储节点B,即对应地址信息B等;或者终端在将300M的待存储文件划分成20个大小为15M的子文件后,此时,终端可以先获取IPFS对应的存储节点数,根据IPFS对应的存储节点数确定N个子文件的发送至方式,如果终端获取到的IPFS对应的存储节点数为10个,那么终端将单次向IPFS发送文件大小设定为30M,也就是说,每一次终端可以向IPFS发送2个子文件,也就是说,IPFS可以将子文件A、子文件B存储至一个存储节点A,当IPFS将2个子文件存储至一个存储节点后,终端接收到IPFS可以接收到IPFS返回的地址信息A,终端总共接收到IPFS返回的待存储文件对应的10个地址信息。
进一步地,终端在接收到IPFS返回的N个子文件对应的M个地址信息后,可以进一步生成待存储文件对应的地址集以及对生成的地址集进行加密操作。
步骤S103、根据M个地址信息生成待存储文件对应的地址集,并对地址集进行加密,得到地址集密文。
在本申请的实施例中,终端在将N个子文件发送至IPFS,并接收到IPFS返回的M个地址信息后,根据得到的M个地址生成了待存储文件对应的地址集,终端对生成的地址集进行加密,进一步得到了地址集密文。
需要说明的是,在本申请的实施例中,终端使用公钥对待存储文件对应的地址集进行加密。具体地,终端随机生成非对称秘钥对,然后使用非对称秘钥对里的公钥,对待存储文件对应的且包含M个地址信息的地址集进行加密,进而得到地址集密文。
需要说明的的,在本申请的实施例中,终端随机生成的非对称秘钥对包括两个东西,一个是公钥,一个是私钥,公开密钥与私有密钥是一对,如果用公开密钥对数据进行加密,只有用对应的私有密钥才能解密;如果用私有密钥对数据进行加密,那么只有用对应的公开密钥才能解密。具体地,私钥只能由一方安全保管,不能外泄,而公钥则可以发给任何请求它的人。相应地,终端可以使用RSA算法进行非对称加密。非对称秘钥对里的公钥和私钥是同时生成的,终端采用公钥对地址集进行加密的同时会将得到的私钥进行 存储,以便在完成待存储文件的存储后,在进行待存储文件的下载时可以实现地址集的解密。
进一步地,在本申请的实施例中,终端在根据M个地址信息生成待存储文件对应的地址集,并进一步对该地址集进行加密,得到地址集密文之后,可以进一步将该地址集密文存储至区块链网络。
进一步地,在本申请的实施例中,在通过公钥对待存储文件对应的地址集进行加密,并得到地址集密文之后,终端还可以通过哈希运算,生成该地址集密文对应的哈希值,进一步将地址集密文和哈希值存储至区块链网络。
步骤S104、将地址集密文发送至区块链网络,并接收区块链网络返回的目标索引值;其中,目标索引值用于对地址集密文进行标识。
在本申请的实施例中,终端在对待存储文件对应的地址集进行加密,并得到地址集密文之后,可以将该地址集密文发送至区块链网络,并接收到区块链网络返回的目标索引值,其中,目标索引值用于对地址集密文进行标识。
需要说明的是,在本申请的实施例中,终端将待存储文件对应的地址集密文发送至区块链网络后,进一步存储在区块链网络中的区块中,终端可以接收到区块链网络返回的交易ID、交易时间以及区块信息等。具体地,在接收到终端发送至的地址集密文之后,区块链网络会对该地址集密文进行存储,存储至包含文件信息的区块中,并且区块链网络会将该存储事件当成一场交易,由于多个不同的待存储文件对应着不同的地址集密文,也就是对应不同的交易,区块链网络中每个区块可以包含多个交易。因此,为了对不同的交易,也就是不同地址集密文进行区分,在对地址集密文进行存储之后,终端会接收到区块链网络返回的地址集密文对应的交易信息,包括:交易ID,交易时间以及区块信息等等。交易ID也就是目标索引值,可以根据该目标索引值找到对应的地址集密文;交易时间对应的是地址集密文发送上传时间,该地址集密文上传时间也就是终端将地址集密文发送至区块链网络的起始时刻;区块信息,即存储该地址集密文的区块包含的一些信息,可以是区块高度、区块哈希值等。
需要说明的是,在本申请的实施例中,终端也可以将地址集密文和地址集密文对应的哈希值发送至区块链网络,并接收所述区块链网络返回的与所述哈希值对应的所述目标索引值。
进一步地,在本申请的实施例中,终端将待存储文件对应的地址集密文和哈希值存储至区块链,得到区块链返回的目标索引值之后,可以进一步将得到的目标索引值进行存储,以便接收到下载待存储文件的下载请求时,可以通过该目标索引值获取待存储文件。
图9为本申请实施例提供的示例性的实现文件存储的流程示意图,文件存储系统获取用户上传的待存储文件,通过文件分片组件将待存储文件分割成子文件A、子文件B、子文件C,并将分割后的子文件发送至IPFS,IPFS 通过存储组件将这三个子文件相应的存储在对应的存储节点A、存储节点B以及存储节点C,并将三个子文件对应的文件地址A、文件地址B以及文件地址C返回给文件存储系统,文件存储系统接收到IPFS返回的子文件对应的文件地址后,根据文件地址A、文件地址B、文件地址C生成文件地址集,然后使用公钥对文件地址集进行加密操作,进而得到地址集密文,并进一步将地址集密文发送至区块链网络。
本申请实施例提供了一种文件存储方法、终端及存储介质,终端获取待存储文件,并对待存储文件进行划分处理,获得待存储文件对应的N个子文件;其中,N为大于或者等于1的整数;将N个子文件发送至IPFS,并接收IPFS返回的N个子文件对应的M个地址信息;其中,M为大于或者等于1,且小于或者等于N的整数;根据M个地址信息生成待存储文件对应的地址集,并对地址集进行加密,得到地址集密文;将地址集密文存储至区块链网络,并接收区块链网络返回的目标索引值;其中,目标索引值用于对地址集密文进行标识。也就是说,在本申请的实施例中,终端将待存储文件碎片化并上传至IPFS,根据接收到的IPFS返回的多个子文件对应的地址生成地址集,进而对该地址集进行加密,并进一步将地址集密文存储至区块链网络。不仅在很大程度上克服了现有的文件存储方式所造成的服务端压力过大的缺陷,同时,存储数据量小,加密高效,文件存储安全性高,极大地满足了数据量较大文件的存储需求。
基于上述实施例,在本申请的另一实施例中,图10为本申请实施例提供的文件存储方法的实现示意图二。文件存储系统接收到下载文件的请求信息,即下载请求,将下载请求中携带的交易ID发送至区块链中,并接收到区块链返回的地址集密文,通过对获取到的地址集密文进行解密操作,进而得到包含多个子文件地址的文件地址集,然后将多个子文件对应的文件地址发送至IPFS,接收IPFS返回的不同文件地址对应的子文件,并进一步将多个子文件进行组合。
图11为本申请实施例提供的文件存储方法的实现流程示意图二,如图11所示,终端将地址集密文存储至区块链网络,并接收区块链网络返回的目标索引值之后,即步骤S104之后,终端进行文件存储的方法还可以包括以下步骤:
步骤S105、接收下载请求;其中,下载请求携带有目标索引值。
本申请的实施例中,终端在将地址集密文发送至区块链网络,并接收区块链网络返回的目标索引值,以及进一步将该目标索引值存储之后,终端接收到下载请求,该下载请求对应的信息中携带有目标索引值。
需要说明的是,在本申请的实施例中,终端接收到下载待存储文件的下载请求,下载请求携带的信息可以包括地址集密文对应的目标索引值,也可以包括地址集密文对应的哈希值,若下载请求携带的信息包括目标索引值时, 终端可以直接通过该目标索引值从区块链中提取待存储文件对应的地址集密文;若下载请求中携带的信息包括地址集密文对应的哈希值时,由于将待存储文件对应的地址集密文以及地址集密文对应的哈希值存储至区块链网络时,生成了与哈希值对应的目标索引值,因此,当终端接收到下载请求,需要从区块链网络中提取待存储文件对应的地址集密文时,可以先通过下载请求里携带的地址集密文对应的哈希值先确定目标索引值,进一步通过该目标索引值从区块链网络中提取待存储文件对应的地址集密文。
进一步地,终端在接收到携带有目标索引值的下载请求之后,可以将该目标索引值发送至区块链网络,以便得到待存储文件对应的地址集密文。
步骤S106、将目标索引值发送至区块链网络,并接收区块链网络返回的地址集密文。
在本申请的实施例中,终端在接收到的用户发送的下载请求,获取到下载请求携带的目标索引值之后,可以将目标索引值发送至区块链网络,并进一步接收到区块链返回的待存储文件对应的地址集密文。
需要说明的是,在本申请的实施例中,由于将待存储文件存储至区块链网络后,终端会接收到区块链网络返回的用于获取地址集密文的索引值,因此,在进行待存储文件的下载时,终端可以将下载请求中携带的地址集密文对应的目标索引值发送至区块链网络,进一步根据该索引值,从区块链网络中存储文件信息的区块中提取待存储文件对应的地址集密文,具体地,区块链接收到终端发送的目标索引值后,根据该目标索引值进行匹配检索,将检索到的与该目标索引值对应的地址集密文发送给终端,进而终端得到了待存储文件对应的地址集密文。
进一步地,在终端接收到区块链返回的待存储文件对应的地址集密文之后,可以进一步对地址集密文进行解密操作。
步骤S107、对地址集密文进行解密,得到与待存储文件对应的地址集;其中,地址集包括M个地址信息。
本申请的实施例中,终端在接收到区块链网络返回的待存储文件对应的地址集密文之后,可以对接收到的地址集密文进行解密,进一步得到了与待存储文件对应的地址集;其中,地址集包括M个地址信息。
需要说明的是,在本申请的实施例中,终端使用私钥对待存储文件对应的地址集密文进行解密操作,进而得到待存储文件对应的,且包含M个地址信息系的地址集。由于在进行待存储文件的存储时采用非对称秘钥对里的公钥进行地址集的加密,公钥与私钥是一对,如果用公钥对数据进行加密,只有用对应的私钥才能解密。因此,终端只有采用私钥才能实现地址集密文的解密,进一步得到待存储文件对应的地址集。
进一步地,在本申请的实施例中,终端在得到包含有M个地址信息的待存储文件对应的地址集之后,可以将M个地址信息发送至IPFS,进一步获取 待存储文件对应的N个子文件。
步骤S108、将M个地址信息发送至IPFS,并接收IPFS返回的待存储文件对应的N个子文件。
在本申请的实施例中,终端在对地址集密文进行解密,并得到包含M个地址信息的待存储文件对应的地址集之后,将M个地址信息发送到了IPFS,并进一步接收到了IPFS返回的待存储文件对应的N个子文件。
需要说明的是,在本申请的实施例中,终端获取到待存储文件对应的地址集之后,会将该地址集包含的M个地址信息发送至IPFS,进一步接收从IPFS中M个存储节点返回的N个子文件。具体地,终端可以发送一个地址信息A,进而接收IPFS返回的一个子文件A,或者可以是终端发送一个地址信息A,接收到IPFS返回的子文件A和子文件B。
进一步地,在本申请的实施例中,终端在接收到IPFS返回的待存储文件对应的N个子文件后,可以进一步合并N个子文件,以便得到待存储文件。
步骤S109、对N个子文件进行合并操作,得到待存储文件。
本申请的实施例中,终端在将M个地址信息发送至IPFS,并接收到IPFS返回的待存储文件对应的N个子文件之后,进一步对N个子文件进行合并操作,进而得到了待存储文件。
图12为本申请实施例提供的示例性的实现文件查询的流程示意图,文件存储系统接收到下载待存储文件的下载请求,该下载请求中携带有交易ID,文件存储系统将交易ID发送至区块链网络,区块链网络根据交易ID进行匹配检索,将检索到的与该交易ID对应的地址集密文发送给文件存储系统,文件存储系统使用私钥对该地址集密文进行解密操作,得到包含文件地址A、文件地址B、文件地址C的文件地址集,然后以多线程并发请求方式将文件地址A、文件地址B以及文件地址C发送至IPFS,IPFS根据接收到文件地址从存储节点A、存储节点B以及存储节点C提取对应的子文件A、子文件B以及子文件C,并将子文件返回至文件存储系统,文件存储系统对接收到的子文件A、子文件B以及子文件C进行组合,进而得到待存储文件。
本申请实施例提供了一种文件存储方法、终端及存储介质,终端获取待存储文件,并对待存储文件进行划分处理,获得待存储文件对应的N个子文件;其中,N为大于或者等于1的整数;将N个子文件发送至IPFS,并接收IPFS返回的N个子文件对应的M个地址信息;其中,M为大于或者等于1,且小于或者等于N的整数;根据M个地址信息生成待存储文件对应的地址集,并对地址集进行加密,得到地址集密文;将地址集密文存储至区块链网络,并接收区块链网络返回的目标索引值;其中,目标索引值用于对地址集密文进行标识。也就是说,在本申请的实施例中,终端将待存储文件碎片化并上传至IPFS,根据接收到的IPFS返回的多个子文件对应的地址生成地址集,进而对该地址集进行加密,并进一步将地址集密文存储至区块链网络。不仅在 很大程度上克服了现有的文件存储方式所造成的服务端压力过大的缺陷,同时,存储数据量小,加密高效,文件存储安全性高,极大地满足了数据量较大文件的存储需求。
基于上述实施例,在本申请的另一实施例中,图13为本申请实施例提供的终端的组成结构示意图一,如图13示,本申请实施例提出的终端500可以包括获取部分501,处理部分502,发送部分503,接收部分504,生成部分505、加密部分506,存储部分507、解密部分508、合并部分509以及确定部分510。
所述获取部分501,配置为获取待存储文件;
所述处理部分502,配置为对所述待存储文件进行划分处理,获得所述待存储文件对应的N个子文件;其中,N为大于或者等于1的整数;
所述发送部分503,配置为将所述N个子文件发送至IPFS;
所述接收部分504,配置为接收所述IPFS返回的所述N个子文件对应的M个地址信息;其中,M为大于或者等于1,且小于或者等于N的整数;
所述生成部分505,配置为根据所述M个地址信息生成所述待存储文件对应的地址集;
所述加密部分506,配置为对所述地址集进行加密,得到地址集密文;
所述发送部分503,还配置为将所述地址集密文发送至区块链网络;
所述接收部分504,还配置为接收所述区块链网络返回的目标索引值;其中,所述目标索引值用于对所述地址集密文进行标识。
进一步地,在本申请的实施例中,所述处理部分502,具体配置为确定所述待存储文件对应的字节数;以及按所述字节数将所述待存储文件分割成所述N个子文件。
进一步地,在本申请的实施例中,所述处理部分502,还具体配置为确定所述待存储文件对应的指令参数;以及按所述指令参数将所述待存储文件分割成所述N个子文件。
进一步地,在本申请的实施例中,所述加密部分506,具体配置为随机生成非对称密钥对;其中,所述非对称密钥对包括公钥和私钥;以及使用所述公钥对所述待存储文件对应的所述地址集进行加密,得到所述地址集密文。
进一步地,在本申请的实施例中,所述发送部分503,具体配置为生成与所述地址集密文对应的哈希值;以及将所述地址集密文和所述哈希值发送至区块链网络。
进一步地,在本申请的实施例中,所述接收部分504,具体配置为接收所述区块链网络返回的与所述哈希值对应的所述目标索引值。
进一步地,在本申请的实施例中,所述存储部分507,配置为将所述地址 集密文和所述哈希值发送至区块链网络,并接收所述区块链网络返回的与所述哈希值对应的所述目标索引值之后,存储所述目标索引值和所述哈希值。
进一步地,在本申请的实施例中,所述接收部分504,还配置为将所述地址集密文存储至区块链网络,并接收所述区块链网络返回的目标索引值之后,接收下载请求;其中,所述下载请求携带有所述目标索引值。
进一步地,在本申请的实施例中,所述发送部分503,还配置为将所述目标索引值发送至所述区块链网络。
进一步地,在本申请的实施例中,所述接收部分504,还配置为接收所述区块链网络返回的所述地址集密文。
进一步地,在本申请的实施例中,所述解密部分508,配置为对所述地址集密文进行解密,得到与所述待存储文件对应的所述地址集;其中,所述地址集包括所述M个地址信息。
进一步地,在本申请的实施例中,所述发送部分503,还配置为将所述M个地址信息发送至所述IPFS。
进一步地,在本申请的实施例中,所述接收部分504,还配置为接收所述IPFS返回的所述待存储文件对应的所述N个子文件。
进一步地,在本申请的实施例中,所述合并部分509,配置为对所述N个子文件进行合并操作,得到所述待存储文件。
进一步地,在本申请的实施例中,所述解密部分508,具体配置为使用所述私钥对所述地址集密文进行解密,得到与所述待存储文件对应的所述地址集。
进一步地,在本申请的实施例中,所述下载请求携带有所述哈希值,所述确定部分510,配置为对所述地址集密文进行解密,得到与所述待存储文件对应的所述地址集之前,确定所述哈希值对应的所述目标索引值。
进一步地,在本申请的实施例中,所述发送部分503,还配置为将所述目标索引值发送至所述区块链网络。
进一步地,在本申请的实施例中,所述接收部分504,还配置为接收所述区块链网络返回的所述地址集密文。
在本申请的实施例中,进一步地,图14为本申请实施例提供的终端的组成结构示意图二,如图14示,本申请实施例提出的终端500还可以包括处理器511、存储有处理器511可执行指令的存储器512,进一步地,终端500还可以包括通信接口513,和用于连接处理器511、存储器512以及通信接口513的总线514。
在本申请的实施例中,上述处理器511可以为特定用途集成电路(Application Specific Integrated Circuit,ASIC)、数字信号处理器(Digital Signal Processor,DSP)、数字信号处理装置(Digital Signal Processing Device,DS PD)、可编程逻辑装置(ProgRAMmable Logic Device,PLD)、现场可编程门阵列FPGA、中央处理器CPU、控制器、微控制器、微处理器中的至少一种。可以理解地,对于不同的设备,用于实现上述处理器功能的电子器件还可以为其它,本申请实施例不作具体限定。终端500还可以包括存储器512,该存储器512可以与处理器511连接,其中,存储器512用于存储可执行程序代码,该程序代码包括计算机操作指令,存储器512可能包含高速RAM存储器,也可能还包括非易失性存储器,例如,至少两个磁盘存储器。
在本申请的实施例中,总线514用于连接通信接口513、处理器511以及存储器512以及这些器件之间的相互通信。
在本申请的实施例中,存储器512,用于存储指令和数据。
进一步地,在本申请的实施例中,上述处理器511,用于获取待存储文件,并对所述待存储文件进行划分处理,获得所述待存储文件对应的N个子文件;其中,N为大于或者等于1的整数;将所述N个子文件发送至IPFS,并接收所述IPFS返回的所述N个子文件对应的M个地址信息;其中,M为大于或者等于1,且小于或者等于N的整数;根据所述M个地址信息生成所述待存储文件对应的地址集,并对所述地址集进行加密,得到地址集密文;将所述地址集密文发送至区块链网络,并接收所述区块链网络返回的目标索引值;其中,所述目标索引值用于对所述地址集密文进行标识。
在实际应用中,上述存储器512可以是易失性存储器(volatile memory),例如随机存取存储器(Random-Access Memory,RAM);或者非易失性存储器(non-volatile memory),例如只读存储器(Read-Only Memory,ROM),快闪存储器(flash memory),硬盘(Hard Disk Drive,HDD)或固态硬盘(Solid-State Drive,SSD);或者上述种类的存储器的组合,并向处理器511提供指令和数据。
另外,在本实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或processor(处理器)执行本实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
本申请实施例提供的一种终端,该终端获取待存储文件,并对待存储文件进行划分处理,获得待存储文件对应的N个子文件;其中,N为大于或者等于1的整数;将N个子文件发送至IPFS,并接收IPFS返回的N个子文件对应的M个地址信息;其中,M为大于或者等于1,且小于或者等于N的整数;根据M个地址信息生成待存储文件对应的地址集,并对地址集进行加密,得到地址集密文;将地址集密文存储至区块链网络,并接收区块链网络返回的目标索引值;其中,目标索引值用于对地址集密文进行标识。也就是说,在本申请的实施例中,终端将待存储文件碎片化并上传至IPFS,根据接收到的IPFS返回的多个子文件对应的地址生成地址集,进而对该地址集进行加密,并进一步将地址集密文存储至区块链网络。不仅在很大程度上克服了现有的文件存储方式所造成的服务端压力过大的缺陷,同时,存储数据量小,加密高效,文件存储安全性高,极大地满足了数据量较大文件的存储需求。
本申请实施例提供一种计算机可读存储介质,其上存储有程序,该程序被处理器执行时实现如上所述的文件存储方法。
具体来讲,本实施例中的一种文件存储方法对应的程序指令可以被存储在光盘,硬盘,U盘等存储介质上,当存储介质中的与一种文件存储方法对应的程序指令被一电子设备读取或被执行时,包括如下步骤:
获取待存储文件,并对所述待存储文件进行划分处理,获得所述待存储文件对应的N个子文件;其中,N为大于或者等于1的整数;
将所述N个子文件发送至IPFS,并接收所述IPFS返回的所述N个子文件对应的M个地址信息;其中,M为大于或者等于1,且小于或者等于N的整数;
根据所述M个地址信息生成所述待存储文件对应的地址集,并对所述地址集进行加密,得到地址集密文;
将所述地址集密文发送至区块链网络,并接收所述区块链网络返回的目标索引值;其中,所述目标索引值用于对所述地址集密文进行标识。
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的实现流程示意图和/或方框图来描述的。应理解可由计算机程序指令实现流程示意图和/或方框图中的每一流程和/或方框、以及实现流程示意图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生 用于实现在实现流程示意图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在实现流程示意图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在实现流程示意图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
以上所述,仅为本申请的较佳实施例而已,并非用于限定本申请的保护范围。
本申请实施例公开了一种文件存储方法、终端及存储介质,所述文件存储方法包括:获取待存储文件,并对待存储文件进行划分处理,获得待存储文件对应的N个子文件;其中,N为大于或者等于1的整数;将N个子文件发送至IPFS,并接收IPFS返回的N个子文件对应的M个地址信息;其中,M为大于或者等于1,且小于或者等于N的整数;根据M个地址信息生成待存储文件对应的地址集,并对地址集进行加密,得到地址集密文;将地址集密文发送至区块链网络,并接收区块链网络返回的目标索引值;其中,目标索引值用于对地址集密文进行标识。也就是说,在本申请的实施例中,终端将待存储文件碎片化并上传至IPFS,根据接收到的IPFS返回的多个子文件对应的地址生成地址集,进而对该地址集进行加密,并进一步将地址集密文存储至区块链网络。不仅在很大程度上克服了现有的文件存储方式所造成的服务端压力过大的缺陷,同时,存储数据量小,加密高效,文件存储安全性高,极大地满足了数据量较大文件的存储需求。
Claims (20)
- 一种文件存储方法,所述方法包括:获取待存储文件,并对所述待存储文件进行划分处理,获得所述待存储文件对应的N个子文件;其中,N为大于或者等于1的整数;将所述N个子文件发送至星际文件系统IPFS,并接收所述IPFS返回的所述N个子文件对应的M个地址信息;其中,M为大于或者等于1,且小于或者等于N的整数;根据所述M个地址信息生成所述待存储文件对应的地址集,并对所述地址集进行加密,得到地址集密文;将所述地址集密文发送至区块链网络,并接收所述区块链网络返回的目标索引值;其中,所述目标索引值用于对所述地址集密文进行标识。
- 根据权利要求1所述的方法,其中,所述对所述待存储文件进行划分处理,获得所述待存储文件对应的N个子文件,包括:确定所述待存储文件对应的字节数;按所述字节数将所述待存储文件分割成所述N个子文件。
- 根据权利要求1所述的方法,其中,所述对所述待存储文件进行划分处理,获得所述待存储文件对应的N个子文件,包括:确定所述待存储文件对应的指令参数;按所述指令参数将所述待存储文件分割成所述N个子文件。
- 根据权利要求1所述的方法,其中,所述对所述地址集进行加密,得到地址集密文,包括:随机生成非对称密钥对;其中,所述非对称密钥对包括公钥和私钥;使用所述公钥对所述待存储文件对应的所述地址集进行加密,得到所述地址集密文。
- 根据权利要求1所述的方法,其中,所述将所述地址集密文发送至区块链网络,并接收所述区块链网络返回的目标索引值,包括:生成与所述地址集密文对应的哈希值;将所述地址集密文和所述哈希值发送至区块链网络,并接收所述区块链网络返回的与所述哈希值对应的所述目标索引值。
- 根据权利要求5所述的方法,其中,所述将所述地址集密文和所述哈希值发送至区块链网络,并接收所述区块链网络返回的与所述哈希值对应的所述目标索引值之后,所述方法还包括:存储所述目标索引值和所述哈希值。
- 根据权利要求4所述的方法,其中,所述将所述地址集密文发送至区块链网络,并接收所述区块链网络返回的目标索引值之后,所述方法还包括:接收下载请求;其中,所述下载请求携带有所述目标索引值;将所述目标索引值发送至所述区块链网络,并接收所述区块链网络返回 的所述地址集密文;对所述地址集密文进行解密,得到与所述待存储文件对应的所述地址集;其中,所述地址集包括所述M个地址信息;将所述M个地址信息发送至所述IPFS,并接收所述IPFS返回的所述待存储文件对应的所述N个子文件;对所述N个子文件进行合并操作,得到所述待存储文件。
- 根据权利要求7所述的方法,其中,所述对所述地址集密文进行解密,得到与所述待存储文件对应的所述地址集,包括:使用所述私钥对所述地址集密文进行解密,得到与所述待存储文件对应的所述地址集。
- 根据权利要求7所述的方法,其中,所述下载请求携带有所述哈希值,所述对所述地址集密文进行解密,得到与所述待存储文件对应的所述地址集之前,所述方法还包括:确定所述哈希值对应的所述目标索引值;将所述目标索引值发送至所述区块链网络,并接收所述区块链网络返回的所述地址集密文。
- 一种终端,所述终端包括:获取部分,处理部分,发送部分,接收部分,生成部分以及加密部分,所述获取部分,配置为获取待存储文件;所述处理部分,配置为对所述待存储文件进行划分处理,获得所述待存储文件对应的N个子文件;其中,N为大于或者等于1的整数;所述发送部分,配置为将所述N个子文件发送至IPFS;所述接收部分,配置为接收所述IPFS返回的所述N个子文件对应的M个地址信息;其中,M为大于或者等于1,且小于或者等于N的整数;所述生成部分,配置为根据所述M个地址信息生成所述待存储文件对应的地址集;所述加密部分,配置为对所述地址集进行加密,得到地址集密文;所述发送部分,还配置为将所述地址集密文发送至区块链网络;所述接收部分,还配置为接收所述区块链网络返回的目标索引值;其中,所述目标索引值用于对所述地址集密文进行标识。
- 根据权利要求10所述的终端,其中,所述处理部分,具体配置为确定所述待存储文件对应的字节数;以及按所述字节数将所述待存储文件分割成所述N个子文件。
- 根据权利要求10所述的终端,其中,所述处理部分,还具体配置为确定所述待存储文件对应的指令参数;以及按所述指令参数将所述待存储文件分割成所述N个子文件。
- 根据权利要求10所述的终端,其中,所述加密部分,具体配置为随机生成非对称密钥对;其中,所述非对称密钥对包括公钥和私钥;以及使用所述公钥对所述待存储文件对应的所述地 址集进行加密,得到所述地址集密文。
- 根据权利要求10所述的终端,其中,所述发送部分,具体配置为生成与所述地址集密文对应的哈希值;以及将所述地址集密文和所述哈希值发送至区块链网络;所述接收部分,具体配置为接收所述区块链网络返回的与所述哈希值对应的所述目标索引值。
- 根据权利要求14所述的终端,其中,所述终端还包括:存储部分,所述存储部分,配置为将所述地址集密文和所述哈希值发送至区块链网络,并接收所述区块链网络返回的与所述哈希值对应的所述目标索引值之后,存储所述目标索引值和所述哈希值。
- 根据权利要求13所述的终端,其中,所述终端还包括:解密部分和合并部分,所述接收部分,还配置为将所述地址集密文存储至区块链网络,并接收所述区块链网络返回的目标索引值之后,接收下载请求;其中,所述下载请求携带有所述目标索引值;所述发送部分,还配置为将所述目标索引值发送至所述区块链网络;所述接收部分,还配置为接收所述区块链网络返回的所述地址集密文;所述解密部分,配置为对所述地址集密文进行解密,得到与所述待存储文件对应的所述地址集;其中,所述地址集包括所述M个地址信息;所述发送部分,还配置为将所述M个地址信息发送至所述IPFS;所述接收部分,还配置为接收所述IPFS返回的所述待存储文件对应的所述N个子文件;所述合并部分,配置为对所述N个子文件进行合并操作,得到所述待存储文件。
- 根据权利要求16所述的终端,其中,所述解密部分,具体配置为使用所述私钥对所述地址集密文进行解密,得到与所述待存储文件对应的所述地址集。
- 根据权利要求16所述的终端,其中,所述下载请求携带有所述哈希值,所述终端还包括:确定部分,所述确定部分,配置为对所述地址集密文进行解密,得到与所述待存储文件对应的所述地址集之前,确定所述哈希值对应的所述目标索引值;所述发送部分,还配置为将所述目标索引值发送至所述区块链网络;所述接收部分,还配置为接收所述区块链网络返回的所述地址集密文。
- 一种终端,所述终端包括处理器、存储有所述处理器可执行指令的存储器,当所述指令被所述处理器执行时,实现如权利要求1-9任一项所述的方法。
- 一种计算机可读存储介质,其上存储有程序,应用于终端中,所述程序被处理器执行时,实现如权利要求1-9任一项所述的方法。
Priority Applications (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2022525637A JP7335440B2 (ja) | 2019-11-04 | 2020-03-04 | ファイル記憶方法、端末及び記憶媒体 |
EP20885212.9A EP4047487B1 (en) | 2019-11-04 | 2020-03-04 | File storage method, terminal, and storage medium |
US17/772,206 US20220407725A1 (en) | 2019-11-04 | 2020-03-04 | File storage method, terminal, and storage medium |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911067461.X | 2019-11-04 | ||
CN201911067461.XA CN111104386B (zh) | 2019-11-04 | 2019-11-04 | 一种文件存储方法、终端及存储介质 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021088278A1 true WO2021088278A1 (zh) | 2021-05-14 |
Family
ID=70420436
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2020/077840 WO2021088278A1 (zh) | 2019-11-04 | 2020-03-04 | 一种文件存储方法、终端及存储介质 |
Country Status (5)
Country | Link |
---|---|
US (1) | US20220407725A1 (zh) |
EP (1) | EP4047487B1 (zh) |
JP (1) | JP7335440B2 (zh) |
CN (1) | CN111104386B (zh) |
WO (1) | WO2021088278A1 (zh) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112764677A (zh) * | 2021-01-14 | 2021-05-07 | 杭州电子科技大学 | 一种在云存储中增强数据迁移安全性的方法 |
CN113535648A (zh) * | 2021-07-27 | 2021-10-22 | 浪潮卓数大数据产业发展有限公司 | 一种基于ipfs的分布式云存储方法、设备及存储介质 |
CN114338646A (zh) * | 2021-11-29 | 2022-04-12 | 王建冬 | 文件交互传输方法、装置、设备及存储介质 |
CN114443608A (zh) * | 2022-04-07 | 2022-05-06 | 深圳市星卡科技有限公司 | 分布式文件存储及下载方法、装置、设备及介质 |
CN115174553A (zh) * | 2022-06-06 | 2022-10-11 | 蚂蚁区块链科技(上海)有限公司 | 一种文件传输的方法及装置 |
CN115269511A (zh) * | 2022-07-25 | 2022-11-01 | 北京航星永志科技有限公司 | 一种泛电子文件封装方法及装置 |
CN115438383A (zh) * | 2022-11-09 | 2022-12-06 | 南京邮电大学 | 基于区块链通道技术的临床试验数据上传及共享方法 |
Families Citing this family (35)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111209346B (zh) * | 2020-04-24 | 2020-07-28 | 腾讯科技(深圳)有限公司 | 一种区块链数据归档方法、装置和计算机可读存储介质 |
CN111523152B (zh) * | 2020-05-11 | 2021-08-03 | 毕红伟 | 基于区块链的电子证件管理方法、管理网络及电子设备 |
CN111339106B (zh) * | 2020-05-18 | 2020-08-28 | 杭州趣链科技有限公司 | 一种区块链数据索引的方法 |
CN111414434B (zh) * | 2020-05-20 | 2021-09-03 | 华北电力大学 | 基于区块链的数据交易管理网络、交易设备和存储介质 |
CN111782722B (zh) * | 2020-06-02 | 2021-05-18 | 北京海泰方圆科技股份有限公司 | 一种数据管理方法、装置、电子设备及存储介质 |
CN111651408B (zh) * | 2020-06-08 | 2024-05-03 | Oppo广东移动通信有限公司 | 获取数据的方法、装置、终端及存储介质 |
CN111752946B (zh) * | 2020-06-22 | 2021-04-30 | 上海众言网络科技有限公司 | 一种基于分片方式对调研数据进行预处理的方法及装置 |
CN111797417A (zh) * | 2020-07-06 | 2020-10-20 | 上海明略人工智能(集团)有限公司 | 文件的上传方法和装置、存储介质及电子装置 |
CN114244856B (zh) * | 2020-09-09 | 2024-05-10 | 中国联合网络通信集团有限公司 | 基于区块链的网络存储方法、装置、系统及运营商平台 |
CN112084522B (zh) * | 2020-09-28 | 2021-09-21 | 深圳市腾盟技术有限公司 | 数据存储方法、装置、设备及存储介质 |
CN112133386A (zh) * | 2020-09-29 | 2020-12-25 | 深圳壹账通智能科技有限公司 | 一种基于区块链的信息处理方法、装置、设备及介质 |
CN112202779B (zh) * | 2020-09-29 | 2022-08-30 | 深圳壹账通智能科技有限公司 | 基于区块链的信息加密方法、装置、设备及介质 |
CN112434105A (zh) * | 2020-10-16 | 2021-03-02 | 苏州浪潮智能科技有限公司 | 区块链存储的数据持续保存的方法、系统、设备及介质 |
CN112417502B (zh) * | 2020-11-18 | 2022-03-18 | 中国电子科技集团公司第三十研究所 | 基于区块链、去中心化部署的分布式即时通讯系统及方法 |
CN112492580B (zh) * | 2020-11-25 | 2023-08-18 | 北京小米移动软件有限公司 | 信息处理方法及装置、通信设备及存储介质 |
CN112445770A (zh) * | 2020-11-30 | 2021-03-05 | 清远职业技术学院 | 多维乱序存储的超大规模高性能数据库引擎及云服务平台 |
CN112688996A (zh) * | 2020-12-16 | 2021-04-20 | 宁波云麟信息科技有限公司 | 基于区块链的电子存证数据存储方法和电子设备 |
CN112965980A (zh) * | 2021-03-12 | 2021-06-15 | 平安国际智慧城市科技股份有限公司 | 信息存储方法及装置 |
CN113064876B (zh) * | 2021-03-25 | 2024-06-04 | 北京知料科技有限公司 | 一种ipfs文件处理方法 |
CN113157648A (zh) * | 2021-04-28 | 2021-07-23 | 中国工商银行股份有限公司 | 基于区块链的分布式数据存储方法、装置、节点及系统 |
CN114968964B (zh) * | 2021-05-24 | 2024-03-19 | 中移互联网有限公司 | 一种文件处理方法、装置及电子设备 |
CN113342763B (zh) * | 2021-06-03 | 2022-07-15 | 上海和数软件有限公司 | 基于ipfs的分布式数据同步方法、设备及介质 |
CN113726873B (zh) * | 2021-08-27 | 2022-11-01 | 平安科技(深圳)有限公司 | 基于区块链的文件处理方法、系统、设备和存储介质 |
CN113806300B (zh) * | 2021-09-23 | 2023-08-01 | 北京百度网讯科技有限公司 | 数据存储方法、系统、装置、设备及存储介质 |
CN113821478A (zh) * | 2021-11-24 | 2021-12-21 | 南京金宁汇科技有限公司 | 一种基于区块链的大文件存储方法及系统 |
CN113938324A (zh) * | 2021-12-16 | 2022-01-14 | 成都车晓科技有限公司 | 一种基于区块链的车贷信息的安全存储方法 |
CN114398449B (zh) * | 2021-12-29 | 2023-01-06 | 深圳市海清视讯科技有限公司 | 数据处理方法、装置、视频监控系统、存储介质 |
CN114911869A (zh) * | 2022-05-13 | 2022-08-16 | 北京航星永志科技有限公司 | 一种数据及文件存储系统、方法、装置及电子设备 |
US12081684B2 (en) * | 2022-05-18 | 2024-09-03 | Jpmorgan Chase Bank, N.A. | System and method for fact verification using blockchain and machine learning technologies |
US20230409604A1 (en) * | 2022-06-20 | 2023-12-21 | Emtruth, Inc. | Natural language processing for blockchain-based management of multi-source, multi-format binary objects |
WO2024001304A1 (zh) * | 2022-06-30 | 2024-01-04 | 华为云计算技术有限公司 | 一种数据处理方法及相关设备 |
CN115118734A (zh) * | 2022-07-11 | 2022-09-27 | 京东科技信息技术有限公司 | 文件共享方法、装置及设备 |
US12015744B1 (en) * | 2023-06-20 | 2024-06-18 | Open Text Sa Ulc | Systems and methods for large document transfer and decentralized storage |
CN116527691B (zh) * | 2023-06-27 | 2023-11-03 | 天津中远海运散运数字科技有限公司 | 一种船岸数据的同步方法、装置、设备和介质 |
CN116915510B (zh) * | 2023-09-13 | 2023-12-01 | 北京数盾信息科技有限公司 | 一种基于高速加密算法的分布式存储系统 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170287090A1 (en) * | 2016-03-31 | 2017-10-05 | Clause, Inc. | System and method for creating and executing data-driven legal contracts |
CN108876383A (zh) * | 2018-08-27 | 2018-11-23 | 广东工业大学 | 一种基于区块链的数据交易方法、装置及设备 |
CN109493055A (zh) * | 2018-11-28 | 2019-03-19 | 深圳力维智联技术有限公司 | 基于区块链的入网区块链设备、数据处理方法及装置 |
CN110062034A (zh) * | 2019-04-01 | 2019-07-26 | 中科天御(苏州)科技有限公司 | 一种区块链大文件安全存储方法及系统 |
Family Cites Families (28)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CA2975843C (en) * | 2016-08-10 | 2023-06-13 | Peer Ledger Inc. | Apparatus, system, and methods for a blockchain identity translator |
JP6533771B2 (ja) | 2016-11-15 | 2019-06-19 | 富士通株式会社 | 通信方法、装置、及びプログラム |
US10491378B2 (en) * | 2016-11-16 | 2019-11-26 | StreamSpace, LLC | Decentralized nodal network for providing security of files in distributed filesystems |
CN106686008B (zh) * | 2017-03-03 | 2019-01-11 | 腾讯科技(深圳)有限公司 | 信息存储方法及装置 |
WO2019124610A1 (ko) * | 2017-12-21 | 2019-06-27 | 문인식 | 블록체인을 이용한 개인정보 분리 후 분산 저장 및 조합을 통한 인증 방법 |
KR101936756B1 (ko) | 2018-03-05 | 2019-01-11 | 주식회사 미탭스플러스 | 블록체인을 이용한 공유경제 관리 장치 |
EP3785420A4 (en) * | 2018-04-27 | 2022-01-19 | Omnibek Ip Holding Llc | MULTI-DECENTRALIZED PRIVATE BLOCKCHAIN NETWORK |
US10885021B1 (en) * | 2018-05-02 | 2021-01-05 | Palantir Technologies Inc. | Interactive interpreter and graphical user interface |
CN109243583B (zh) * | 2018-07-09 | 2020-05-12 | 研境信息科技(上海)有限公司 | 基于区块链的医疗影像数据去中心化管理的方法及设备 |
CN109151031B (zh) * | 2018-08-28 | 2022-08-26 | 北京奇虎科技有限公司 | 基于区块链的合约处理方法及装置 |
US11606291B2 (en) * | 2018-10-16 | 2023-03-14 | Eluvio, Inc. | Access control and ownership transfer of digital content using a decentralized content fabric and ledger |
US20230117725A1 (en) * | 2018-11-02 | 2023-04-20 | Verona Holdings Sezc | Performance analytics for cryptographic tokens that link to real world objects |
JP7190336B2 (ja) | 2018-11-15 | 2022-12-15 | 富士通株式会社 | 通信装置、通信方法、および通信プログラム |
US10949388B2 (en) * | 2018-11-16 | 2021-03-16 | Advanced Messaging Technologies, Inc. | Systems and methods for distributed data storage and delivery using blockchain |
US11249953B2 (en) * | 2019-01-30 | 2022-02-15 | Penta Security Systems Inc. | Method and apparatus for sharing big data using block chain |
US11212347B2 (en) * | 2019-02-05 | 2021-12-28 | S&P Global Inc. | Private content storage with public blockchain metadata |
JP7311745B2 (ja) * | 2019-03-06 | 2023-07-20 | 日本電信電話株式会社 | 管理者端末、参加者端末、権利者端末、利用者端末、コンテンツ利用システム、管理者プログラム、参加者プログラム、権利者プログラムおよび利用者プログラム |
CN109886692B (zh) * | 2019-03-08 | 2021-05-07 | 泰康保险集团股份有限公司 | 基于区块链的数据传输方法、装置、介质及电子设备 |
CN109831527B (zh) * | 2019-03-13 | 2021-12-28 | 试金石信用服务有限公司 | 文件处理方法、用户端、服务器及可读存储介质 |
CN110032545A (zh) * | 2019-03-27 | 2019-07-19 | 远光软件股份有限公司 | 基于区块链的文件存储方法、系统及电子设备 |
RU2706183C1 (ru) * | 2019-04-11 | 2019-11-14 | Алексей Владиславович Потанин | Способ фиксации данных, связанных с производством и реализацией продукции, и соответствующая система |
US12010236B2 (en) * | 2019-04-24 | 2024-06-11 | Sony Group Corporation | Blockchain-based crowdsourcing |
CN110083606B (zh) * | 2019-04-25 | 2021-06-08 | 深圳市豪斯莱科技有限公司 | 跨链存储方法、终端及存储介质 |
CN110099114A (zh) * | 2019-04-30 | 2019-08-06 | 普华云创科技(北京)有限公司 | 区块链和ipfs协议的文件存储方法、系统、终端及存储介质 |
JP7333554B2 (ja) * | 2019-05-29 | 2023-08-25 | 日本電信電話株式会社 | 更新装置、更新方法、更新プログラム、及びデータ構造 |
JP7174300B2 (ja) * | 2019-06-17 | 2022-11-17 | 日本電信電話株式会社 | コンテンツ利用システム、許諾端末、閲覧端末、配信端末、および、コンテンツ利用プログラム |
US20200412525A1 (en) * | 2019-06-26 | 2020-12-31 | Grid7 Llc D/B/A Taekion | Blockchain filesystem |
US20210336796A1 (en) * | 2019-09-03 | 2021-10-28 | Christopher A. Wiklof | System and computer method including a blockchain-mediated agreement engine |
-
2019
- 2019-11-04 CN CN201911067461.XA patent/CN111104386B/zh active Active
-
2020
- 2020-03-04 JP JP2022525637A patent/JP7335440B2/ja active Active
- 2020-03-04 US US17/772,206 patent/US20220407725A1/en active Pending
- 2020-03-04 EP EP20885212.9A patent/EP4047487B1/en active Active
- 2020-03-04 WO PCT/CN2020/077840 patent/WO2021088278A1/zh unknown
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170287090A1 (en) * | 2016-03-31 | 2017-10-05 | Clause, Inc. | System and method for creating and executing data-driven legal contracts |
CN108876383A (zh) * | 2018-08-27 | 2018-11-23 | 广东工业大学 | 一种基于区块链的数据交易方法、装置及设备 |
CN109493055A (zh) * | 2018-11-28 | 2019-03-19 | 深圳力维智联技术有限公司 | 基于区块链的入网区块链设备、数据处理方法及装置 |
CN110062034A (zh) * | 2019-04-01 | 2019-07-26 | 中科天御(苏州)科技有限公司 | 一种区块链大文件安全存储方法及系统 |
Non-Patent Citations (1)
Title |
---|
DUAN XINAN, YAN ZHIWEI; GENG GUANGGANG; YAN BAOPING: "Research and Trend Analysis on Blockchain Consensus Algorithm", E-SCIENCE TECHNOLOGY & APPLICATION, vol. 8, no. 6, 1 January 2017 (2017-01-01), pages 43 - 51, XP055810254, ISSN: 1674-9480, DOI: 10.11871/j.issn.1674-9480.2017.06.006 * |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112764677A (zh) * | 2021-01-14 | 2021-05-07 | 杭州电子科技大学 | 一种在云存储中增强数据迁移安全性的方法 |
CN113535648A (zh) * | 2021-07-27 | 2021-10-22 | 浪潮卓数大数据产业发展有限公司 | 一种基于ipfs的分布式云存储方法、设备及存储介质 |
CN114338646A (zh) * | 2021-11-29 | 2022-04-12 | 王建冬 | 文件交互传输方法、装置、设备及存储介质 |
CN114443608A (zh) * | 2022-04-07 | 2022-05-06 | 深圳市星卡科技有限公司 | 分布式文件存储及下载方法、装置、设备及介质 |
CN114443608B (zh) * | 2022-04-07 | 2022-07-29 | 深圳市星卡科技股份有限公司 | 分布式文件存储及下载方法、装置、设备及介质 |
CN115174553A (zh) * | 2022-06-06 | 2022-10-11 | 蚂蚁区块链科技(上海)有限公司 | 一种文件传输的方法及装置 |
CN115269511A (zh) * | 2022-07-25 | 2022-11-01 | 北京航星永志科技有限公司 | 一种泛电子文件封装方法及装置 |
CN115438383A (zh) * | 2022-11-09 | 2022-12-06 | 南京邮电大学 | 基于区块链通道技术的临床试验数据上传及共享方法 |
CN115438383B (zh) * | 2022-11-09 | 2023-02-14 | 南京邮电大学 | 基于区块链通道技术的临床试验数据上传及共享方法 |
Also Published As
Publication number | Publication date |
---|---|
JP7335440B2 (ja) | 2023-08-29 |
CN111104386A (zh) | 2020-05-05 |
US20220407725A1 (en) | 2022-12-22 |
EP4047487C0 (en) | 2024-05-08 |
CN111104386B (zh) | 2023-09-01 |
JP2023500316A (ja) | 2023-01-05 |
EP4047487B1 (en) | 2024-05-08 |
EP4047487A1 (en) | 2022-08-24 |
EP4047487A4 (en) | 2023-05-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021088278A1 (zh) | 一种文件存储方法、终端及存储介质 | |
EP3669280B1 (en) | Shared blockchain data storage | |
US11270308B2 (en) | Shared blockchain data storage | |
US10917234B2 (en) | Blockchain for on-chain management of off-chain storage | |
CN108683747B (zh) | 资源获取、分发、下载方法、装置、设备及存储介质 | |
EP3769490B1 (en) | Implementing a blockchain-based web service | |
US10445517B1 (en) | Protecting data in insecure cloud storage | |
EP3317998B1 (en) | Resilient secret sharing cloud based architecture for data vault | |
US20210014066A1 (en) | Shared blockchain data storage | |
CN102170440B (zh) | 适用于存储云间数据安全迁移的方法 | |
TW202103033A (zh) | 用以實現用於去中心化標識的解析器服務的系統和方法 | |
US20200266971A1 (en) | Re-encrypting data on a hash chain | |
JP2023524659A (ja) | 低信頼の特権アクセス管理 | |
JP2023542317A (ja) | ブロックチェーン・ネットワークのための合意サービス | |
CN108694331B (zh) | 一种数据存储方法、装置、系统及计算机可读存储介质 | |
JP2023542681A (ja) | ブロックチェーンの許可フレームワークへのデバイスアイデンティティの統合 | |
AU2015281798B2 (en) | System of shared secure data storage and management | |
CN112041834B (zh) | 使用分布式账本进行数据交换的系统和方法 | |
AU2015101745A4 (en) | System of shared secure data storage and management | |
Gawande et al. | A Survey of Various Security Management Models for Cloud Computing Storage Systems |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 20885212 Country of ref document: EP Kind code of ref document: A1 |
|
ENP | Entry into the national phase |
Ref document number: 2022525637 Country of ref document: JP Kind code of ref document: A |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
ENP | Entry into the national phase |
Ref document number: 2020885212 Country of ref document: EP Effective date: 20220607 |