CN109522270A - File storing and reading method, electronic device and readable storage medium storing program for executing based on block chain - Google Patents

File storing and reading method, electronic device and readable storage medium storing program for executing based on block chain Download PDF

Info

Publication number
CN109522270A
CN109522270A CN201811221035.2A CN201811221035A CN109522270A CN 109522270 A CN109522270 A CN 109522270A CN 201811221035 A CN201811221035 A CN 201811221035A CN 109522270 A CN109522270 A CN 109522270A
Authority
CN
China
Prior art keywords
file
fragment
block chain
information
index information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811221035.2A
Other languages
Chinese (zh)
Inventor
金龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201811221035.2A priority Critical patent/CN109522270A/en
Publication of CN109522270A publication Critical patent/CN109522270A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services

Abstract

The invention discloses a kind of file storing and reading method, electronic device and readable storage medium storing program for executing based on block chain, wherein this method comprises: receiving the file upload request of user, wherein carry file to be uploaded in the file upload request;Calculate the document information of the file to be uploaded;Slicing treatment is carried out to the file to be uploaded, obtains multiple fragments;The multiple fragment is uploaded to memory node different in block chain respectively, and records the index information of each fragment;After uploading completion, the index information of each fragment is encrypted, encrypted index information and the document information are committed to the account book node of the block chain.It solves the lower technical problem of existing Information Security during existing data access through the above scheme, has reached effective technical effect for promoting Information Security and confidentiality.

Description

File storing and reading method, electronic device and readable storage medium storing program for executing based on block chain
Technical field
The present invention relates to block chain technical fields, and in particular to a kind of file storing and reading method based on block chain, electronics dress It sets and readable storage medium storing program for executing.
Background technique
With the continuous development of Internet technology, the demand to file storage etc. is also just increasing.It is existing to provide greatly The method of service of scale document storage system can provide storage medium generally for service provider, while can be on user The file of biography provides the file access service of network access mode.For file size and storage mode, can be used file fragmentation, The means such as Directory hash, the preservation of more copies are to guarantee access efficiency and memory reliability.
However, this results in the burst information of user file since file is stored directly in storage service provider side And bibliography information be to storage service provider it is transparent, storage service provider has the ability to directly acquire original file Content, it is totally unfavorable to the safety of file and confidentiality in this way.
The file present in the existing document storage system service is perfectly safe and aiming at the problem that secrecy, at present still It does not put forward effective solutions.
Summary of the invention
The purpose of the present invention is to provide a kind of file storing and reading method, electronic device and readable storage mediums based on block chain Matter, and then solve the technical issues of safety of file and confidentiality cannot be guaranteed in existing file storing process.
The present invention is to solve above-mentioned technical problem by following technical proposals:
According to an aspect of the invention, there is provided a kind of file storing and reading method based on block chain, includes the following steps:
Receive the file upload request of user, wherein carry file to be uploaded in the file upload request;
Calculate the document information of the file to be uploaded;
Slicing treatment is carried out to the file to be uploaded, obtains multiple fragments;
The multiple fragment is uploaded to memory node different in block chain respectively, and records the index letter of each fragment Breath;
After uploading and completing, the index information of each fragment is encrypted, by encrypted index information and described Document information is committed to the account book node of the block chain.
In one embodiment, encrypted index information and the document information are being committed to the block After the account book node of chain, the method also includes:
Obtain the file read request of user's input, wherein document information is carried in the file read request;
According to the document information, retrieval whether there is the document in the account book node of the block chain The corresponding file of information;
In the presence of determination, it is corresponding encrypted that the document information is read in the account book node Index information;
The encrypted index information is decrypted, complete index information is obtained;
According to the complete index information, different memory nodes obtains slicing files from the block chain, and presses It is assembled that file is completed according to fragment sequence;
The file that splicing is obtained, the read requests as user request the file read.
In one embodiment, after completing file assembly according to fragment sequence, the method also includes:
Obtain the document information carried in the file read request;
Integrity checking is carried out to the file that splicing obtains by the document information;
In the case where integrity checking passes through, determine that obtaining the file read request requests the file read.
In one embodiment, before the file upload request for receiving user, the method also includes:
Receive the cipher key pair information that user is locally generated;
The index information of each fragment is encrypted, comprising:
By the cipher key pair information, the index information of each fragment is encrypted.
In one embodiment, each fragment in the multiple fragment is uploaded to storage section different in block chain Point, and record the index information of each fragment, comprising:
After each fragment uploads completion, the serial number mark and uploading position of the fragment are recorded;
After all fragments upload completion, the serial number mark and uploading position of all fragments are collected;
The serial number mark and uploading position of obtained all fragments will be collected, the index as the file to be uploaded is believed Breath.
According to another aspect of the present invention, a kind of electronic device, including memory and processor, the storage are provided Device deposits read apparatus for storing the file based on block chain that can be executed by the processor, and the file based on block chain is deposited Read apparatus includes:
Receiving module, for receiving the file upload request of user, wherein carry in the file upload request to upper Transmitting file;
Computing module, for calculating the document information of the file to be uploaded;
It is sliced module, for carrying out slicing treatment to the file to be uploaded, obtains multiple fragments;
Logging modle for the multiple fragment to be uploaded to memory node different in block chain respectively, and records each The index information of a fragment;
Module is submitted, for encrypting to the index information of each fragment, by encrypted rope after uploading completion Fuse breath and the document information are committed to the account book node of the block chain.
In one embodiment, above-mentioned electronic device further include:
First obtains module, for encrypted index information and the document information to be committed to the block After the account book node of chain, the file read request of user's input is obtained, wherein carry file in the file read request Summary info;
Retrieval module, for retrieving and whether depositing in the account book node of the block chain according to the document information In the corresponding file of the document information;
Read module, for reading the document information in the account book node in the presence of determination Corresponding encrypted index information;
Deciphering module obtains complete index information for the encrypted index information to be decrypted;
Splicing module, for according to the complete index information, different memory nodes to be obtained from the block chain Slicing files, and file assembly is completed according to fragment sequence;
Generation module, for that will splice obtained file, the read requests as user request the file read.
In one embodiment, above-mentioned electronic device further include:
Second obtains module, for obtaining the file read request after completing file assembly according to fragment sequence The document information of middle carrying;
Module is checked, for carrying out integrity checking to the file that splicing obtains by the document information;
Determining module, in the case where integrity checking passes through, determining that obtaining the file read request is requested The file of reading.
According to a further aspect of the invention, a kind of computer equipment is provided, comprising: memory and processor, wherein The processor is for the step of executing the above method.
According to a further aspect of the invention, a kind of non-volatile computer readable storage medium storing program for executing is provided, is stored thereon There is computer instruction, described instruction is performed the step of realizing the above method.
The positive effect of the present invention is that: the document information of file to be uploaded is calculated, then to text to be uploaded Part carries out slicing treatment, obtains multiple fragments, each fragment in the multiple fragment is uploaded to different in block chain deposit Node is stored up, and records the index information of each fragment, and after uploading completion, the index information of each fragment is added It is close, encrypted index information and the document information are committed to the account book node of the block chain.That is, to file into Row slice finds suitable storage point in block chain network node to slice of data, and is indexed update, because of index information It is encryption, data access private key must be taken in this way and be just able to achieve access to data, the data for realizing decentralization are deposited It takes, solves the lower technical problem of existing Information Security during existing data access through the above scheme, reach Effective technical effect for promoting Information Security and confidentiality is arrived.
Detailed description of the invention
Fig. 1 is the method flow diagram of the file storing and reading method according to an embodiment of the present invention based on block chain;
Fig. 2 is the structural block diagram that the file according to an embodiment of the present invention based on block chain deposits read apparatus;
Fig. 3 is another structural block diagram that the file according to an embodiment of the present invention based on block chain deposits read apparatus;
Fig. 4 is a kind of optional hardware structure schematic diagram of electronic device according to an embodiment of the present invention.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right The present invention is further elaborated.It should be appreciated that described herein, specific examples are only used to explain the present invention, not For limiting the present invention.Based on the embodiments of the present invention, those of ordinary skill in the art are not before making creative work Every other embodiment obtained is put, shall fall within the protection scope of the present invention.
In view of existing document storage mode is that file is stored directly in storage service provider side, this results in using The burst information and bibliography information of family file be to storage service provider it is transparent, storage service provider has the ability straight It obtains and takes original file content, it is totally unfavorable to the safety of file and confidentiality in this way.If block chain skill can be passed through File is stored in multiple nodes, and encrypted to index information by art, and index is stored in account book node, then can be with Promote the privacy of data storage.
For this purpose, providing a kind of file storing and reading method, electronic device and readable storage medium based on block chain in this example Matter is below specifically described this method and electronic equipment as follows:
Embodiment one
The file storing and reading method provided by the invention based on block chain is illustrated with reference to the accompanying drawing.
Fig. 1 be the present invention is based on a kind of optional flow diagrams of the file storing and reading method of block chain, as shown in Figure 1, This method may comprise steps of:
Step 101: receiving the file upload request of user, wherein carry text to be uploaded in the file upload request Part;
Step 102: calculating the document information of the file to be uploaded;
Wherein, this document summary info can include but is not limited to following information: file fingerprint abstract, size, MIME Type。
Step 103: slicing treatment being carried out to the file to be uploaded, obtains multiple fragments;
Wherein, rule is sliced in Slicing procedure can be and be sliced according to file size, for example, by file to be uploaded Cutting is that 2M fragment, each fragment are exactly the content of 2M one by one, is also possible to be sliced according to the content of file, for example, File to be uploaded is classified, a class file is as a fragment.It should be noted, however, that above-mentioned cited slice Rule is only a kind of exemplary description, when actually realizing, can not be limited with others slice rule, the application this It is fixed, it can select according to actual needs.As long as the rule that can be divided into multiple fragments to file to be uploaded all can serve as to be sliced Rule.
Step 104: the multiple fragment being uploaded to memory node different in block chain respectively, and records each fragment Index information;
When actually realizing, each fragment in the multiple fragment is uploaded to storage section different in block chain Point, and the index information of each fragment is recorded, it may include: to record the sequence of the fragment after each fragment uploads completion Number mark and uploading position;After all fragments upload completion, the serial number mark and uploading position of all fragments are collected;It will receive Collect the serial number mark and uploading position of obtained all fragments, the index information as the file to be uploaded.
Step 105: after uploading completion, the index information of each fragment being encrypted, encrypted index is believed Breath and the document information are committed to the account book node of the block chain.
Specifically, system can provide client utility, client utility can pass through the fragment index information of file After user key encryption, as the identification informations such as ciphertext attribute and document information, it is packaged as this document in storage system In complete index, be committed to block chain account book node, form permanent record.
Based on above-mentioned file memory method, it can be carried out as follows file reading, may include steps of:
S1: the file read request of user's input is obtained, wherein document letter is carried in the file read request Breath;
S2: according to the document information, retrieval whether there is the file in the account book node of the block chain The corresponding file of summary info;
S3: in the presence of determination, the corresponding encryption of the document information is read in the account book node Index information afterwards;
S4: the encrypted index information is decrypted, complete index information is obtained;
S5: according to the complete index information, different memory nodes obtains slicing files from the block chain, and It is assembled that file is completed according to fragment sequence;
S6: the file that splicing is obtained, the read requests as user request the file read.
It, can be after completing file assembly according to fragment sequence, to file in order to realize the accuracy detection to file Integrity detection is carried out, it is whether complete to detect obtained file.Specifically, the text carried in available file read request Part summary info;Integrity checking is carried out to the file that splicing obtains by the document information;Pass through in inspection In the case of, determine that the read requests for obtaining user request the file read.
When actually realizing, before starting file upload request by block chain network, local generate belongs to user The cipher key pair information of oneself, the encryption authority of fragment index information when being uploaded as file;.Specifically, the transmitting file on user When, it can receive the cipher key pair information that user is locally generated;Correspondingly, adding to the index information of each fragment It is close, it may include: to be encrypted by the cipher key pair information to the index information of each fragment.
The above method is illustrated below with reference to a specific embodiment, it is important to note, however, that the specific implementation Example does not constitute an undue limitation on the present application merely to better illustrate the application.
In this example, by the way that the secret protection of block chain and characteristic can not be distorted, in conjunction with existing big file storage technology, A kind of large-scale distributed storage system scheme of update is provided.Specifically, by the burst information and storage catalogue of user file Hash is in the storage resource of random distribution.Wherein, detailed information is grasped by user, and the basic resources such as storage medium are mentioned by servicing For quotient provide, thus by large-scale distributed storage service file access control strategy and storage resource ability provide effectively Separation, basic resource provider collect resource accounting, the fragment and catalogue of file according only to the common store ability of offer Hash rule is by user's control, and really to realize, user is to the entirely autonomous controllable of file when using third party's storage service.
Specifically, the system is made of storage medium and block chain network, storage medium is provided by different storage service quotient, Block chain network is responsible for recording the hash storage letter of the file upload record of user and corresponding document burst information and different fragments Breath.Specifically, may include steps of:
S1: user is local to generate one's own key pair letter before starting file upload request by block chain network Breath, the encryption authority of fragment index information when being uploaded as file;
S2: the system provides the client utility that file uploads, and in the preparation stage of file upload movement, calculates to be uploaded The content Hash of file is made a summary as file fingerprint, and records file size, and the file identification informations such as MIMEType are treated later Upper transmitting file carries out fragment processing operation;
S3: after fragment completion, the selection of all fragments is uploaded to different memory nodes by client utility, and each A fragment is completed after uploading, and serial number mark and its position uploaded of the fragment are recorded;
S4: after all fragments upload completion, client utility collects the fragments such as all segmental identifications, uploading position letter Breath, the fragment index information as entire file;
S5: after client utility encrypts the fragment index information of file by user key, as ciphertext attribute and S2 The identification informations such as middle acquisition file fingerprint abstract, size, MIME Type are packaged as this document within the storage system complete Index is committed to block chain account book node, forms permanent record.
S6: in file acquisition scene, user can be made a summary by file fingerprint and retrieve whether this document is deposited in block chain network , and obtain the complete index of file within the storage system;
S7: if this document is all for user, user can decrypt the complete fragment index information in ciphertext attribute, visitor Family ending tool obtains slicing files from different memory nodes according to the complete fragment index information, and completes according to fragment sequence File is assembled;
S8: after the completion of file assembly, it can be made a summary by file fingerprint and carry out File Integrity Checking again.
Wherein, more copies of file save, and can be the service side by offer memory node by storing High Availabitity mode It realizes, to effectively separate the service ability of the access visit strategy of original document and storage resource, more different to be deposited Storage node provider convenient can access, and provide storage service ability by unified standard.User is to the access of file using unified visitor Family ending tool is completed, it is not necessary to the provider of relationship bottom storage service, with stylish storage service side's access system, can to Unaware is accomplished in family side, gets through different service provider storage resource abilities, and realizing can divide across the extensive of manufacturer's smooth expansion Cloth storage system.
In upper example, a kind of large-scale distributed storage system based on block chain is provided, for data according to size It is sliced, finds suitable storage point in block chain network node to slice of data, and be indexed update.Data slicer And more copies save, and carry out data retrieval by data fingerprint, only taking data access private key just can be completed data simultaneously Verifying improves the safety of data storage, reduces storage risk.Further, it because of data slicer and the whole network dispersion, improves Storage system robustness, and store cheaper, slack resources are stored using node, compare centralization storage cluster, cost has Very big advantage.
In the above-described embodiments, the document information for calculating file to be uploaded, is then sliced file to be uploaded Processing, obtains multiple fragments, each fragment in the multiple fragment is uploaded to memory node different in block chain, and remember The index information of each fragment is recorded, and after uploading completion, the index information of each fragment is encrypted, after encryption Index information and the document information be committed to the account book node of the block chain.That is, be sliced to file, to cutting Sheet data finds suitable storage point in block chain network node, and is indexed update, because index information is encryption, this Sample must take data access private key and just be able to achieve access to data, the data access of decentralization be realized, by above-mentioned Scheme solves the lower technical problem of existing Information Security during existing data access, has reached effective promotion The technical effect of Information Security and confidentiality.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.
Embodiment two
The file storing and reading method based on block chain provided in one based on the above embodiment provides a kind of base in the present embodiment Read apparatus is deposited in the file of block chain, specifically, Fig. 2 and Fig. 3 show the files based on block chain to deposit the optional of read apparatus Structural block diagram, should file based on block chain deposit read apparatus and be divided into one or more program modules, one or more Program module is stored in storage medium, and as performed by one or more processors, to complete the present invention.Alleged by the present invention Program module be refer to complete specific function series of computation machine program instruction section, than program itself be more suitable for describe base Implementation procedure of the read apparatus in storage medium is deposited in the file of block chain, each program of the present embodiment will specifically be introduced by being described below The function of module:
As shown in Fig. 2, the file based on block chain deposits read apparatus 20 includes:
Receiving module 201, for receiving the file upload request of user, wherein carried in the file upload request File to be uploaded;
Computing module 202, for calculating the document information of the file to be uploaded;
Fragment module 203 obtains multiple fragments for carrying out slicing treatment to the file to be uploaded;
Uploading module 204 for the multiple fragment to be uploaded to memory node different in block chain respectively, and records The index information of each fragment;
Module 205 is submitted, for encrypting to the index information of each fragment, after encryption after uploading completion Index information and the document information be committed to the account book node of the block chain.
In one embodiment, as shown in figure 3, it may include: to obtain that the above-mentioned file based on block chain, which deposits read apparatus, Module 301, for obtaining the file read request of user's input, wherein carry document in the file read request Information;
Retrieval module 302, for according to the document information, retrieved in the account book node of the block chain whether There are the corresponding files of the document information;
Read module 303, in the presence of determination, reading the document letter in the account book node Cease corresponding encrypted index information;
Deciphering module 304 obtains complete index information for the encrypted index information to be decrypted;
Splicing module 305, for according to the complete index information, different memory nodes to be obtained from the block chain Slicing files are taken, and complete file assembly according to fragment sequence;
Generation module 306, for that will splice obtained file, the read requests as user request the file read.
In one embodiment, splicing module 305 can specifically obtain after completing file assembly according to fragment sequence Take the document information carried in the file read request;By the document information, to the file that splicing obtains, Carry out integrity checking;In the case where integrity checking passes through, determine that obtaining the file read request requests reading File.
In one embodiment, receiving module 201 can specifically receive before the file upload request for receiving user The cipher key pair information that user is locally generated;Submit module 205 can be by the cipher key pair information, to the index of each fragment Information is encrypted.
In one embodiment, each fragment in the multiple fragment is uploaded to storage section different in block chain Point, and the index information of each fragment is recorded, it may include: to record the sequence of the fragment after each fragment uploads completion Number mark and uploading position;After all fragments upload completion, the serial number mark and uploading position of all fragments are collected;It will receive Collect the serial number mark and uploading position of obtained all fragments, the index information as the file to be uploaded.
About the device in above-described embodiment, wherein each unit, module execute the concrete mode of operation related It is described in detail in the embodiment of this method, no detailed explanation will be given here.
In each embodiment of the present embodiment, the document information of file to be uploaded is calculated, then to be uploaded File carries out slicing treatment, obtains multiple fragments, each fragment in the multiple fragment is uploaded to different in block chain Memory node, and the index information of each fragment is recorded, and after uploading completion, carry out to the index information of each fragment Encrypted index information and the document information, are committed to the account book node of the block chain by encryption.That is, to file It is sliced, suitable storage point is found in block chain network node to slice of data, and be indexed update, because index is believed Breath is encryption, must take data access private key in this way and just be able to achieve access to data, realize the data of decentralization Access solves the lower technical problem of existing Information Security during existing data access through the above scheme, Effective technical effect for promoting Information Security and confidentiality is reached.
Embodiment three
A kind of electronic device is provided in the preferred embodiment of the invention three.Fig. 4 is that electronic device one is real according to the present invention Apply the hardware structure schematic diagram of example.In the present embodiment, electronic device 2 is that one kind can be according to the finger for being previously set or storing It enables, the automatic equipment for carrying out numerical value calculating and/or information processing.For example, it may be smart phone, tablet computer, notebook are electric Brain, desktop computer, rack-mount server, blade server, tower server or Cabinet-type server (including independent clothes Server cluster composed by business device or multiple servers) etc..As shown, electronic device 2 includes, but is not limited to: Connection memory 21, processor 22, network interface 23 and the file based on block chain can be in communication with each other by system bus to deposit Read apparatus 20.Wherein:
Memory 21 includes at least a type of computer readable storage medium, and readable storage medium storing program for executing includes flash memory, hard Disk, multimedia card, card-type memory (for example, SD or DX memory etc.), random access storage device (RAM), static random-access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), may be programmed read-only storage at read-only memory (ROM) Device (PROM), magnetic storage, disk, CD etc..In some embodiments, memory 21 can be the inside of electronic device 2 Memory module, such as the hard disk or memory of the electronic device 2.In further embodiments, memory 21 is also possible to electronics dress Set the plug-in type hard disk being equipped on 2 External memory equipment, such as the electronic device 2, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash Card) etc..Certainly, memory 21 is gone back Can both including electronic device 2 storage inside module and also including its External memory equipment.In the present embodiment, memory 21 is usual For storing the operating system and types of applications software that are installed on electronic device 2, such as the file based on block chain deposits read apparatus 20 program code etc..In addition, memory 21 can be also used for temporarily storing all kinds of numbers that has exported or will export According to.
Processor 22 can be in some embodiments central processing unit (Central Processing Unit, CPU), Controller, microcontroller, microprocessor or other data processing chips.The processor 22 is commonly used in control electronic device 2 Overall operation, such as execute control relevant to the progress data interaction of electronic device 2 or communication and processing etc..The present embodiment In, program code or processing data of the processor 22 for storing in run memory 21, such as operation based on block chain File deposit read apparatus 20 etc..
Network interface 23 may include radio network interface or wired network interface, which is commonly used in electronics Communication connection is established between device 2 and other electronic devices.For example, network interface 23 be used for by network by electronic device 2 with Exterior terminal is connected, and establishes data transmission channel and communication connection etc. between electronic device 2 and exterior terminal.Network can be with It is intranet (Intranet), internet (Internet), global system for mobile communications (Global System of Mobile communication, GSM), wideband code division multiple access (Wideband Code Division Multiple Access, WCDMA), 4G network, 5G network, bluetooth (Bluetooth), the wirelessly or non-wirelessly network such as Wi-Fi.
It should be pointed out that Fig. 4 illustrates only the electronic device with component 21-23, it should be understood that simultaneously should not Realistic to apply all components shown, the implementation that can be substituted is more or less component.
In the present embodiment, the file based on block chain being stored in memory 21 is deposited read apparatus 20 and can also be divided For one or more program module, one or more program module is stored in memory 21, and by one or more Processor (the present embodiment is processor 22) is performed, to complete the present invention.
Example IV
The present embodiment also provides a kind of computer readable storage medium, is stored in computer readable storage medium based on area The file of block chain deposits read apparatus, and the file based on block chain deposits read apparatus can be performed by least one processor, so that at least The step of one processor executes the file storing and reading method based on block chain such as embodiment one.
In the present embodiment, computer readable storage medium include flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory etc.), random access storage device (RAM), static random-access memory (SRAM), read-only memory (ROM), Electrically erasable programmable read-only memory (EEPROM), programmable read only memory (PROM), magnetic storage, disk, CD Deng.In some embodiments, computer readable storage medium can be the internal storage unit of computer equipment, such as the calculating The hard disk or memory of machine equipment.In further embodiments, computer readable storage medium is also possible to the outer of computer equipment The plug-in type hard disk being equipped in portion's storage equipment, such as the computer equipment, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) blocks, flash card (Flash Card) etc..Certainly, computer-readable storage medium Matter can also both including computer equipment internal storage unit and also including its External memory equipment.In the present embodiment, computer Readable storage medium storing program for executing is installed on the operating system and types of applications software of computer equipment, such as embodiment two commonly used in storage Client ensure analysis system program code etc..In addition, computer readable storage medium can be also used for temporarily storing Various types of data through exporting or will export.
Obviously, those skilled in the art should be understood that each module of the above-mentioned embodiment of the present invention or each step can be with It is realized with general computing device, they can be concentrated on a single computing device, or be distributed in multiple computing devices On composed network, optionally, they can be realized with the program code that computing device can perform, it is thus possible to by it Store and be performed by computing device in the storage device, and in some cases, can be held with the sequence for being different from herein The shown or described step of row, perhaps they are fabricated to each integrated circuit modules or will be multiple in them Module or step are fabricated to single integrated circuit module to realize.In this way, the embodiment of the present invention be not limited to it is any specific hard Part and software combine.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills Art field, is included within the scope of the present invention.

Claims (10)

1. a kind of file storing and reading method based on block chain, which comprises the steps of:
Receive the file upload request of user, wherein carry file to be uploaded in the file upload request;
Calculate the document information of the file to be uploaded;
Slicing treatment is carried out to the file to be uploaded, obtains multiple fragments;
The multiple fragment is uploaded to memory node different in block chain respectively, and records the index information of each fragment;
After uploading completion, the index information of each fragment is encrypted, by encrypted index information and the file Summary info is committed to the account book node of the block chain.
2. the method according to claim 1, wherein believing by encrypted index information and the document Breath is committed to after the account book node of the block chain, the method also includes:
Obtain the file read request of user's input, wherein document information is carried in the file read request;
According to the document information, retrieval whether there is the document information in the account book node of the block chain Corresponding file;
In the presence of determination, the corresponding encrypted index of the document information is read in the account book node Information;
The encrypted index information is decrypted, complete index information is obtained;
According to the complete index information, different memory nodes obtains slicing files from the block chain, and according to point It is assembled that piece sequence completes file;
The file that splicing is obtained, the read requests as user request the file read.
3. according to the method described in claim 2, it is characterized in that, completed according to fragment sequence file it is assembled after, it is described Method further include:
Obtain the document information carried in the file read request;
Integrity checking is carried out to the file that splicing obtains by the document information;
In the case where integrity checking passes through, determine that obtaining the file read request requests the file read.
4. the method according to claim 1, wherein receive user file upload request before, the side Method further include:
Receive the cipher key pair information that user is locally generated;
The index information of each fragment is encrypted, comprising:
By the cipher key pair information, the index information of each fragment is encrypted.
5. the method according to claim 1, wherein each fragment in the multiple fragment is uploaded to block Different memory node in chain, and record the index information of each fragment, comprising:
After each fragment uploads completion, the serial number mark and uploading position of the fragment are recorded;
After all fragments upload completion, the serial number mark and uploading position of all fragments are collected;
The serial number mark and uploading position of obtained all fragments will be collected, the index information as the file to be uploaded.
6. a kind of electronic device, including memory and processor, which is characterized in that the memory can be by the place for storing The file based on block chain that reason device executes deposits read apparatus, and the file based on block chain deposits read apparatus and includes:
Receiving module, for receiving the file upload request of user, wherein carry text to be uploaded in the file upload request Part;
Computing module, for calculating the document information of the file to be uploaded;
It is sliced module, for carrying out slicing treatment to the file to be uploaded, obtains multiple fragments;
Logging modle for the multiple fragment to be uploaded to memory node different in block chain respectively, and records each point The index information of piece;
Module is submitted, for being encrypted to the index information of each fragment after uploading completion, encrypted index is believed Breath and the document information are committed to the account book node of the block chain.
7. electronic device according to claim 6, which is characterized in that further include:
First obtains module, for encrypted index information and the document information to be committed to the block chain After account book node, the file read request of user's input is obtained, wherein carry document in the file read request Information;
Retrieval module, for according to the document information, retrieval to whether there is institute in the account book node of the block chain State the corresponding file of document information;
Read module, it is corresponding in the presence of determination, reading the document information in the account book node Encrypted index information;
Deciphering module obtains complete index information for the encrypted index information to be decrypted;
Splicing module, for according to the complete index information, different memory nodes to obtain fragment from the block chain File, and file assembly is completed according to fragment sequence;
Generation module, for that will splice obtained file, the read requests as user request the file read.
8. electronic device according to claim 7, which is characterized in that further include:
Second obtains module, for obtaining and taking in the file read request after completing file assembly according to fragment sequence The document information of band;
Module is checked, for carrying out integrity checking to the file that splicing obtains by the document information;
Determining module, in the case where integrity checking passes through, determining that obtaining the file read request requests to read File.
9. a kind of computer equipment, comprising: memory and processor, wherein the processor requires 1 to 5 for perform claim Any one of the method the step of.
10. a kind of non-volatile computer readable storage medium storing program for executing, is stored thereon with computer instruction, which is characterized in that the finger Order is performed the step of realizing any one of claims 1 to 5 the method.
CN201811221035.2A 2018-10-19 2018-10-19 File storing and reading method, electronic device and readable storage medium storing program for executing based on block chain Pending CN109522270A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811221035.2A CN109522270A (en) 2018-10-19 2018-10-19 File storing and reading method, electronic device and readable storage medium storing program for executing based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811221035.2A CN109522270A (en) 2018-10-19 2018-10-19 File storing and reading method, electronic device and readable storage medium storing program for executing based on block chain

Publications (1)

Publication Number Publication Date
CN109522270A true CN109522270A (en) 2019-03-26

Family

ID=65770575

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811221035.2A Pending CN109522270A (en) 2018-10-19 2018-10-19 File storing and reading method, electronic device and readable storage medium storing program for executing based on block chain

Country Status (1)

Country Link
CN (1) CN109522270A (en)

Cited By (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110062034A (en) * 2019-04-01 2019-07-26 中科天御(苏州)科技有限公司 A kind of big file safety storage method of block chain and system
CN110099114A (en) * 2019-04-30 2019-08-06 普华云创科技(北京)有限公司 Block chain and the file memory method of IPFS agreement, system, terminal and storage medium
CN110149373A (en) * 2019-04-28 2019-08-20 平安科技(深圳)有限公司 Date storage method, device, medium and server based on point to point network
CN110166220A (en) * 2019-05-06 2019-08-23 山东公链信息科技有限公司 A kind of sharding method carrying out cutting according to the hashed value of subregion key
CN110209727A (en) * 2019-04-04 2019-09-06 特斯联(北京)科技有限公司 A kind of date storage method, terminal device and medium
CN110334054A (en) * 2019-05-17 2019-10-15 杭州亦笔科技有限公司 A kind of block chained file fragment storage method
CN110399338A (en) * 2019-04-13 2019-11-01 西安电子科技大学 Distributed document directory system and method, cloud storage service device based on block chain
CN110460886A (en) * 2019-08-21 2019-11-15 重庆华医康道科技有限公司 A kind of method and system of the real-time cochain of video data
CN110704858A (en) * 2019-10-16 2020-01-17 长春银彩通信息科技有限公司 Data security storage method and system under distributed environment
CN111259432A (en) * 2020-02-18 2020-06-09 福州瑞芯微电子股份有限公司 Model data protection method and readable computer storage medium
CN111291414A (en) * 2020-03-11 2020-06-16 深圳市网心科技有限公司 Data storage method and device, computer device and storage medium
CN111414334A (en) * 2020-02-21 2020-07-14 平安科技(深圳)有限公司 File fragment uploading method, device, equipment and storage medium based on cloud technology
WO2020011287A3 (en) * 2019-10-15 2020-08-20 Alipay (Hangzhou) Information Technology Co., Ltd. Indexing and recovering encoded blockchain data
CN111723071A (en) * 2020-06-18 2020-09-29 江苏优网智能科技有限公司 Distributed dynamic point cloud storage technology
CN111880826A (en) * 2020-07-28 2020-11-03 平安科技(深圳)有限公司 Cloud service application upgrading method and device, electronic equipment and storage medium
CN112015710A (en) * 2020-08-27 2020-12-01 北京达佳互联信息技术有限公司 Method and device for determining directory fragmentation relationship
CN112307504A (en) * 2020-11-18 2021-02-02 成都佳华物链云科技有限公司 Secure multi-party computing method and device, electronic equipment and storage medium
CN112394876A (en) * 2019-08-14 2021-02-23 深圳市特思威尔科技有限公司 Large file storage/reading method, storage/reading device and computer equipment
CN112435026A (en) * 2020-11-27 2021-03-02 从法信息科技有限公司 Method and device for protecting file transaction information by using zero-knowledge proof and electronic equipment
CN112632008A (en) * 2020-12-29 2021-04-09 华录光存储研究院(大连)有限公司 Data fragment transmission method and device and computer equipment
WO2021098277A1 (en) * 2019-11-21 2021-05-27 深圳壹账通智能科技有限公司 Blockchain file access method and apparatus, computer device and storage medium
CN112988764A (en) * 2021-05-14 2021-06-18 北京百度网讯科技有限公司 Data storage method, device, equipment and storage medium
CN113535669A (en) * 2021-07-23 2021-10-22 广东工业大学 File uploading method, downloading method and system
CN114389878A (en) * 2022-01-13 2022-04-22 中国人民解放军国防科技大学 Block chain fragmentation method and block chain network system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108052649A (en) * 2017-12-26 2018-05-18 广州泼墨神网络科技有限公司 The data managing method and its system of a kind of distributed file system
CN108062202A (en) * 2017-12-15 2018-05-22 中链科技有限公司 A kind of file block storage method and system
CN108076148A (en) * 2017-12-15 2018-05-25 成都链网络科技有限公司 Storage system based on block chain
CN108108127A (en) * 2017-12-15 2018-06-01 中链科技有限公司 A kind of file reading and system
CN108446407A (en) * 2018-04-12 2018-08-24 北京百度网讯科技有限公司 Database audit method based on block chain and device
CN108462568A (en) * 2018-02-11 2018-08-28 西安电子科技大学 A kind of secure file storage and sharing method based on block chain
CN108566375A (en) * 2018-03-12 2018-09-21 深圳壹账通智能科技有限公司 The method, terminal and storage medium of message communicating between multiterminal based on block chain

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108062202A (en) * 2017-12-15 2018-05-22 中链科技有限公司 A kind of file block storage method and system
CN108076148A (en) * 2017-12-15 2018-05-25 成都链网络科技有限公司 Storage system based on block chain
CN108108127A (en) * 2017-12-15 2018-06-01 中链科技有限公司 A kind of file reading and system
CN108052649A (en) * 2017-12-26 2018-05-18 广州泼墨神网络科技有限公司 The data managing method and its system of a kind of distributed file system
CN108462568A (en) * 2018-02-11 2018-08-28 西安电子科技大学 A kind of secure file storage and sharing method based on block chain
CN108566375A (en) * 2018-03-12 2018-09-21 深圳壹账通智能科技有限公司 The method, terminal and storage medium of message communicating between multiterminal based on block chain
CN108446407A (en) * 2018-04-12 2018-08-24 北京百度网讯科技有限公司 Database audit method based on block chain and device

Cited By (37)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110062034A (en) * 2019-04-01 2019-07-26 中科天御(苏州)科技有限公司 A kind of big file safety storage method of block chain and system
CN110209727A (en) * 2019-04-04 2019-09-06 特斯联(北京)科技有限公司 A kind of date storage method, terminal device and medium
CN110399338A (en) * 2019-04-13 2019-11-01 西安电子科技大学 Distributed document directory system and method, cloud storage service device based on block chain
CN110399338B (en) * 2019-04-13 2022-03-08 西安电子科技大学 Distributed file index system and method based on block chain and cloud storage server
CN110149373A (en) * 2019-04-28 2019-08-20 平安科技(深圳)有限公司 Date storage method, device, medium and server based on point to point network
CN110099114A (en) * 2019-04-30 2019-08-06 普华云创科技(北京)有限公司 Block chain and the file memory method of IPFS agreement, system, terminal and storage medium
CN110166220A (en) * 2019-05-06 2019-08-23 山东公链信息科技有限公司 A kind of sharding method carrying out cutting according to the hashed value of subregion key
CN110166220B (en) * 2019-05-06 2022-05-06 山东公链信息科技有限公司 Slicing method for slicing according to hash value of partition key
CN110334054A (en) * 2019-05-17 2019-10-15 杭州亦笔科技有限公司 A kind of block chained file fragment storage method
CN112394876A (en) * 2019-08-14 2021-02-23 深圳市特思威尔科技有限公司 Large file storage/reading method, storage/reading device and computer equipment
CN112394876B (en) * 2019-08-14 2024-02-23 深圳市特思威尔科技有限公司 Large file storage/reading method, storage/reading device and computer equipment
CN110460886A (en) * 2019-08-21 2019-11-15 重庆华医康道科技有限公司 A kind of method and system of the real-time cochain of video data
KR20210045353A (en) * 2019-10-15 2021-04-26 알리페이 (항저우) 인포메이션 테크놀로지 씨오., 엘티디. Indexing and recovery of encoded blockchain data
US10977114B2 (en) 2019-10-15 2021-04-13 Alipay (Hangzhou) Information Technology Co., Ltd. Indexing and recovering encoded blockchain data
KR102412024B1 (en) 2019-10-15 2022-06-22 알리페이 (항저우) 인포메이션 테크놀로지 씨오., 엘티디. Indexing and recovery of encoded blockchain data
US11307927B2 (en) 2019-10-15 2022-04-19 Alipay (Hangzhou) Information Technology Co., Ltd. Indexing and recovering encoded blockchain data
WO2020011287A3 (en) * 2019-10-15 2020-08-20 Alipay (Hangzhou) Information Technology Co., Ltd. Indexing and recovering encoded blockchain data
CN110704858A (en) * 2019-10-16 2020-01-17 长春银彩通信息科技有限公司 Data security storage method and system under distributed environment
WO2021098277A1 (en) * 2019-11-21 2021-05-27 深圳壹账通智能科技有限公司 Blockchain file access method and apparatus, computer device and storage medium
CN111259432B (en) * 2020-02-18 2023-09-12 瑞芯微电子股份有限公司 Model data protection method and readable computer storage medium
CN111259432A (en) * 2020-02-18 2020-06-09 福州瑞芯微电子股份有限公司 Model data protection method and readable computer storage medium
CN111414334B (en) * 2020-02-21 2024-04-05 平安科技(深圳)有限公司 File fragment uploading method, device, equipment and storage medium based on cloud technology
CN111414334A (en) * 2020-02-21 2020-07-14 平安科技(深圳)有限公司 File fragment uploading method, device, equipment and storage medium based on cloud technology
CN111291414A (en) * 2020-03-11 2020-06-16 深圳市网心科技有限公司 Data storage method and device, computer device and storage medium
CN111723071A (en) * 2020-06-18 2020-09-29 江苏优网智能科技有限公司 Distributed dynamic point cloud storage technology
CN111880826A (en) * 2020-07-28 2020-11-03 平安科技(深圳)有限公司 Cloud service application upgrading method and device, electronic equipment and storage medium
CN112015710B (en) * 2020-08-27 2023-11-21 北京达佳互联信息技术有限公司 Method and device for determining directory slicing relationship
CN112015710A (en) * 2020-08-27 2020-12-01 北京达佳互联信息技术有限公司 Method and device for determining directory fragmentation relationship
CN112307504B (en) * 2020-11-18 2024-02-09 成都佳华物链云科技有限公司 Secure multiparty computing method, device, electronic equipment and storage medium
CN112307504A (en) * 2020-11-18 2021-02-02 成都佳华物链云科技有限公司 Secure multi-party computing method and device, electronic equipment and storage medium
CN112435026A (en) * 2020-11-27 2021-03-02 从法信息科技有限公司 Method and device for protecting file transaction information by using zero-knowledge proof and electronic equipment
CN112435026B (en) * 2020-11-27 2023-03-28 从法信息科技有限公司 Method and device for protecting file transaction information by using zero-knowledge proof and electronic equipment
CN112632008A (en) * 2020-12-29 2021-04-09 华录光存储研究院(大连)有限公司 Data fragment transmission method and device and computer equipment
CN112988764A (en) * 2021-05-14 2021-06-18 北京百度网讯科技有限公司 Data storage method, device, equipment and storage medium
CN113535669A (en) * 2021-07-23 2021-10-22 广东工业大学 File uploading method, downloading method and system
CN114389878A (en) * 2022-01-13 2022-04-22 中国人民解放军国防科技大学 Block chain fragmentation method and block chain network system
CN114389878B (en) * 2022-01-13 2024-03-19 中国人民解放军国防科技大学 Block chain slicing method and block chain network system

Similar Documents

Publication Publication Date Title
CN109522270A (en) File storing and reading method, electronic device and readable storage medium storing program for executing based on block chain
EP3255832B1 (en) Dynamic encryption method, terminal and server
CN108734028B (en) Data management method based on block chain, block chain link point and storage medium
CN103229479B (en) A kind of website identification method, device and network system
CN104506487B (en) The credible execution method of privacy policy under cloud environment
CN106878265A (en) A kind of data processing method and device
CN102624699A (en) Method and system for protecting data
EP3694175A1 (en) System and method for delegating authority through coupled devices
CN111915019A (en) Federal learning method, system, computer device, and storage medium
CN109948347A (en) A kind of date storage method and device, server and readable storage medium storing program for executing
CN110138754B (en) Multi-cloud-end information processing system and resource sharing method thereof
CN113259382B (en) Data transmission method, device, equipment and storage medium
CN111669408A (en) Identity registration and authentication method and device
EP3804218B1 (en) Blockchain based access control using time-dependent obfuscation of access tokens
CN103457954A (en) Method and device for user password management
CN109379360A (en) Auditing method, electronic device and computer readable storage medium
CN114041134A (en) System and method for block chain based secure storage
CN113468599A (en) File storage certificate method, device, system, equipment and storage medium
CN111880919A (en) Data scheduling method, system and computer equipment
CN115130075A (en) Digital signature method and device, electronic equipment and storage medium
CN111339558A (en) Data encryption method, data decryption method, computer device and medium
CN105184559B (en) A kind of payment system and method
CN113129008A (en) Data processing method and device, computer readable medium and electronic equipment
CN108900510A (en) Off-line data storage method, device, computer equipment and storage medium
CN112100689A (en) Trusted data processing method, device and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination