Blockchain file-based processing method and apparatus, processor, and electronic device

By using blockchain nodes to process and sign target files in a distributed storage system, generating and storing target data blocks, the problem of difficulty in tracking and tracing file information in distributed file storage technology is solved, thereby improving data security and file integrity.

CN114676460BActive Publication Date: 2025-12-12INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210412029.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-19
Publication Date
2025-12-12
Estimated Expiration
2042-04-19

AI Technical Summary

Technical Problem

Existing distributed file storage technologies make it difficult to track and trace file information, resulting in low data security.

Method used

By obtaining the transaction request for the target file, the blockchain node processes and signs the target file, generating a target data block, which is then stored in a decentralized storage node. The target data block contains the digital identity IDs of the participants, the digital identity ID of the uploader of the target file, the target signature, and the storage address information. A preset algorithm is used for signature processing to ensure the security and traceability of the file.

Benefits of technology

It enables the tracking and tracing of target files, improves data security, and ensures file integrity and access control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114676460B_ABST
    Figure CN114676460B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on blockchain file processing method and device, processor and electronic equipment, it is related to blockchain technical field, the method comprises the following steps: obtaining the transaction request one of target file upload;Transaction request one is handled by distributed storage node one, obtain target transaction message one, and target transaction message one is uploaded to blockchain node;According to the digital identity ID of participant, target file is signed by preset algorithm one and is handled, and target signature is obtained;Target file is handled, and target data block is obtained;Target data block is transmitted to at least one distributed storage node two, to realize the storage of target data block.By the application, the problem that the data security is relatively low is solved in the related art that file information is stored using distributed file storage technology, it is difficult to track and trace the content of file information, leading to.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of blockchains, in particular, to a blockchain file processing method and device, a processor and an electronic device. BACKGROUND

[0002] The blockchain technology has the characteristics of tamper resistance and decentralization, and therefore, the blockchain technology has been widely applied in finance, banking, supply chain and other fields. Compared with the traditional centralized solution, the blockchain can effectively guarantee the data security and the decentralization of the system architecture, and solve the trust and efficiency problems of inter-institution cooperation. In a distributed storage system, the introduction of the blockchain technology can improve the security and scalability of the storage system, save device resources, and improve the long-distance transmission efficiency. However, the application of the blockchain to the storage system also brings new challenges. The decentralized file storage technology divides the files into mutually unrelated file fragments, and then transmits the file fragments in a concurrent manner. This manner has certain difficulties in file tracking and tracing, which also leads to certain risks in data security.

[0003] At present, there is no effective solution to the problem that the related technology uses the decentralized file storage technology to store file information, which is difficult to track and trace the content of the file information, resulting in relatively low data security. SUMMARY

[0004] The main purpose of the present application is to provide a blockchain file processing method and device, a processor and an electronic device to solve the problem that the related technology uses the decentralized file storage technology to store file information, which is difficult to track and trace the content of the file information, resulting in relatively low data security.

[0005] In order to achieve the above object, according to one aspect of the present application, a blockchain file-based processing method is provided. The method comprises: obtaining a transaction request one of a target file upload, wherein the transaction request one at least includes the target file and the ID of a target smart contract; processing the transaction request one through a distributed storage node one to obtain a target transaction message one, and uploading the target transaction message one to a blockchain node, wherein the target transaction message one is processed through the blockchain node, and the digital identity ID of a participant having the access right of the target file is returned to the distributed storage node one; performing signature processing on the target file through a preset algorithm one according to the digital identity ID of the participant to obtain a target signature; processing the target file to obtain a target data block, wherein the target data block at least includes the digital identity ID of the participant, the digital identity ID of the uploader of the target file, the target signature and the storage address information of the target file; and transmitting the target data block to at least one distributed storage node two to realize the storage of the target data block, wherein the distributed storage node two is another distributed storage node in the distributed storage nodes except the distributed storage node one.

[0006] Further, the preset algorithm one is in the form of: e = Did A1 Did A2 ... Did Ak t f(t,M) (modn), wherein S e is the target signature, M is the hash value of the target file, t = r e (modn), r is a randomly selected integer, Did Ai (1≤i≤k) is the digital identity ID of k participants having the access right, n = pq, p and q are randomly selected 256-bit prime numbers, f is a threshold function, e is a randomly selected 256-bit prime number, and the order of e and n are prime to each other.

[0007] Further, the target signature is in the form of: e = g e r ef(t,C) (modn), wherein g e ≡ Did A1 Did A2 ... Did Ak (modn), and C is the data information of the target file.

[0008] Further, the target file is processed to obtain the target data block, including: performing block processing on the target file by using a preset algorithm two to obtain a plurality of initial data blocks; and processing the initial data blocks by using a preset algorithm three to obtain the target data block.

[0009] Further, the target data block is in the form of Block m =(m,Cid,Did A1 ,...,Did Ak ,m,Cid,Did R ,s e ,...,chksum), wherein Block m is the target data block, m is the initial data block, Did R is a digital identity ID of an uploader of the target file, Cid is storage address information of the target file, and chksum is a security parameter.

[0010] Further, the storage address information of the target file is in the form of: wherein h is a hash function, and Cid Children is a hash value of the initial data block.

[0011] Further, before initiating the transaction request for uploading the target file, the method further includes: obtaining a transaction request two deployed by the target smart contract, wherein the target smart contract is used to process the target transaction message one; generating an ID of the transaction request two and an ID of the target smart contract by using a transaction processing module of the blockchain node, and assembling the ID of the transaction request two, the ID of the target smart contract, and a code of the target smart contract into a target transaction message two; broadcasting the target transaction message two to other blockchain nodes in a blockchain system by using a communication module of the blockchain node, wherein the blockchain node analyzes the target transaction message two to deploy the target smart contract; and feeding back a signal one indicating that the target smart contract has been deployed to a target object.

[0012] Further, after the target data block is transmitted to at least one target distributed storage node to realize storage of the target data block, the method further includes: verifying and reaching a consensus on storage behavior information of the target data block by using the blockchain node; and feeding back a signal two indicating that the target data block has been stored to a target object if the verification and the consensus on the storage behavior information of the target data block are passed.

[0013] Further, after the target data block is transmitted to at least one target distributed storage node to realize storage of the target data block, the method further comprises: obtaining a transaction request three of the target file query, wherein the transaction request three at least comprises: a digital identity ID of an initiator of the transaction request three, and storage address information of the target file; verifying the transaction request three by the blockchain node to determine whether the initiator has access authority of the target file; if the initiator has the access authority of the target file, obtaining the target file according to the storage address information of the target file; checking the target file to determine whether the target file is complete; and if the target file passes the check, feeding back the target file to the initiator.

[0014] To achieve the above-mentioned purpose, according to another aspect of the present application, a kind of processing device based on blockchain file is provided.The device comprises: first acquisition unit, for obtaining the transaction request one of target file upload, wherein the transaction request one at least includes: the ID of target file and target smart contract;First processing unit, for processing the transaction request one by distributed storage node one, obtain target transaction message one, and the target transaction message one is uploaded to blockchain node, wherein by the blockchain node is handled, and the digital identity ID of the participant with the target file access authority is returned to the distributed storage node one;Second processing unit, for signing the target file according to the digital identity ID of the participant by preset algorithm one, and obtain target signature;Third processing unit, for processing the target file, obtain target data block, wherein the target data block at least includes: the digital identity ID of the participant, the digital identity ID of the target file uploader, the target signature and the storage address information of the target file;Sending unit, for transmitting the target data block to at least one distributed storage node two, to realize the storage of the target data block, wherein the distributed storage node two is other distributed storage node except the distributed storage node one in the distributed storage node.

[0015] Further, the form of the preset algorithm one is: e = Did A1 Did A2 ... Did Ak t f(t,M) (modn), wherein S e is the target signature, M is the hash value of the target file, t=r e (modn), r is randomly selected integer, Did Ai(1≤i≤k) are digital identities of k participants with access rights, n=pq, p, q are randomly selected 256-bit prime numbers, f is a threshold function, e is a randomly selected 256-bit prime number, and e and the order of n are prime to each other.

[0016] Further, the form of the target signature is: s e = g e r ef(t,C) (mod n), wherein g e ≡ Did A1 Did A2 ... Did Ak (mod n), and C is data information of the target file.

[0017] Further, the third processing unit comprises: a first processing module configured to perform block processing on the target file by using a preset algorithm two to obtain a plurality of initial data blocks; a second processing module configured to perform processing on the initial data blocks by using a preset algorithm three to obtain the target data block; and a sending unit configured to transmit the target data block to at least one dispersed storage node two to realize storage of the target data block, wherein the dispersed storage node two is other dispersed storage node than the dispersed storage node one in the dispersed storage nodes.

[0018] Further, the form of the target data block is: Block m =(Did A1 ,...,Did Ak ,m,Cid,Did R ,s e ,...,chksum), wherein Block m is the target data block, m is the initial data block, Did R is a digital identity ID of an uploader of the target file, Cid is storage address information of the target file, and chksum is a security parameter.

[0019] Further, the form of the storage address information of the target file is: wherein h is a hash function, and Cid Children is a hash value of the initial data block.

[0020] Further, the apparatus further comprises: a second acquisition unit, configured to acquire a transaction request two of the target smart contract deployment before initiating the transaction request of the target file upload, wherein the target smart contract is used for processing the target transaction message one; an assembly unit, configured to generate an ID of the transaction request two and an ID of the target smart contract through a transaction processing module of the blockchain node, and assemble the ID of the transaction request two, the ID of the target smart contract and a code of the target smart contract into a target transaction message two; a broadcast unit, configured to broadcast the target transaction message two to other blockchain nodes in a blockchain system through a communication module of the blockchain node, wherein the blockchain node analyzes the target transaction message two to deploy the target smart contract; and a first feedback unit, configured to feed back a signal one that the target smart contract has been deployed to a target object.

[0021] Further, the apparatus further comprises: a first verification unit, configured to verify and reach a consensus on storage behavior information of the target data block through the blockchain node after the target data block is transmitted to at least one target distributed storage node to implement storage of the target data block; and a second feedback unit, configured to feed back a signal two that the target data block has been stored to a target object if the verification and the consensus on the storage behavior information of the target data block pass.

[0022] Further, the apparatus further comprises: a third acquisition unit, configured to acquire a transaction request three of the target file query after the target data block is transmitted to at least one target distributed storage node to implement storage of the target data block, wherein the transaction request three at least comprises a digital identity ID of an initiator of the transaction request three and storage address information of the target file; a verification unit, configured to verify the transaction request three through the blockchain node to determine whether the initiator of the transaction request three has access authority of the target file; a fourth acquisition unit, configured to acquire the target file according to the storage address information of the target file if the initiator has the access authority of the target file; a second verification unit, configured to verify the target file to determine whether the target file is complete; and a third feedback unit, configured to feed back the target file to the initiator if the verification of the target file passes.

[0023] In order to achieve the above-mentioned purpose, according to an aspect of the present application, a processor is provided, which is used for running a program, wherein the program performs any one of the above-mentioned processing methods based on a blockchain file when running.

[0024] In order to achieve the above object, according to an aspect of the present application, an electronic device is provided, which comprises one or more processors and a memory for storing the one or more processors to implement any one of the above-mentioned blockchain file-based processing methods.

[0025] According to the present application, the following steps are adopted: obtaining a transaction request one for uploading a target file, wherein the transaction request one at least comprises the target file and the ID of a target smart contract; processing the transaction request one through a distributed storage node one to obtain a target transaction message one, and uploading the target transaction message one to a blockchain node, wherein the target transaction message one is processed through the blockchain node, and the digital identity ID of a participant having the target file access permission is returned to the distributed storage node one; performing signature processing on the target file through a preset algorithm one according to the digital identity ID of the participant to obtain a target signature; processing the target file to obtain a target data block, wherein the target data block at least comprises the digital identity ID of the participant, the digital identity ID of the uploader of the target file, the target signature, and the storage address information of the target file; and transmitting the target data block to at least one distributed storage node two to implement storage of the target data block, wherein the distributed storage node two is another distributed storage node in addition to the distributed storage node one among the distributed storage nodes, thereby solving the problem in the related art that the file information is difficult to be tracked and traced in content when the file information is stored by using the distributed file storage technology, and leading to relatively low data security. Through the preset algorithm one, the target signature is obtained by performing signature processing on the target file according to the digital identity ID of the participant having the target file access permission, and then the target signature is added to the target data block, and the target data block is transmitted to the distributed storage node two, so that the target file can be tracked and traced, and thus the effect of improving the data security is achieved. BRIEF DESCRIPTION OF DRAWINGS

[0026] The accompanying drawings, which form a part of the present application, are intended to provide further understanding of the present application, and the illustrative embodiments of the present application and their description serve the purpose of explaining the present application. The accompanying drawings should not be construed as an inappropriate limitation on the present application.

[0027] Figure 1 is a flowchart of the blockchain file-based processing method according to an embodiment of the present application;

[0028] Figure 2 is an optional target data block format diagram according to an embodiment of the present application;

[0029] Figure 3 is an optional flowchart of the blockchain file-based processing method according to an embodiment of the present application;

[0030] Figure 4is a schematic diagram of a processing device based on a blockchain file according to an embodiment of the present application;

[0031] Figure 5 is a schematic diagram of an optional processing system based on a blockchain file according to an embodiment of the present application;

[0032] Figure 6 is a schematic diagram of an optional distributed storage node according to an embodiment of the present application;

[0033] Figure 7 is a schematic diagram of an optional blockchain node according to an embodiment of the present application;

[0034] Figure 8 is a schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0035] It should be noted that the embodiments and features of the embodiments in the present application can be combined with each other without conflict. The present application will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.

[0036] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should fall within the scope of protection of the present application.

[0037] It should be noted that the terms "first", "second" and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily limit to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0038] The present application will be described below in conjunction with preferred implementation steps, Figure 1 is a flowchart of a processing method based on a blockchain file according to an embodiment of the present application, as shown in Figure 1 The method comprises the following steps:

[0039] Step S101, a transaction request one of a target file upload is obtained, wherein the transaction request one at least includes: the target file and the ID of the target smart contract.

[0040] Specifically, the user can initiate an upload request of the target file (i.e. the above transaction request one) according to actual needs, which needs to include the target file uploaded this time, the ID of the target smart contract and related configuration parameters, etc. The transaction request one is sent to the distributed storage node one.

[0041] Step S102, the transaction request one is processed by the distributed storage node one to obtain a target transaction message one, and the target transaction message one is uploaded to the block chain node, wherein the block chain node is processed and returns the digital identity ID of the participant with the target file access permission to the distributed storage node one.

[0042] Specifically, the distributed storage node one receives the transaction request one, processes the transaction request one to obtain the target transaction message one, sends the target transaction message one to the block chain node, the block chain node receives the target transaction message one, analyzes the target transaction message one, obtains the ID of the target smart contract, then calls the corresponding target smart contract, the target smart contract processes to obtain the digital identity ID of the participant with the target file access permission and returns the digital identity ID of the participant with the target file access permission to the distributed storage node one. At the same time, the distributed storage node one will backup and store the target file to the local. The distributed storage node is a node for storing the target file.

[0043] Step S103, according to the digital identity ID of the participant, the target file is processed by a preset algorithm one to obtain a target signature.

[0044] Specifically, according to the digital identity ID of the participant, the target file is processed by a preset algorithm one to obtain a target signature. The form of the preset algorithm one used is S e =Did A1 Did A2 ...Did Ak t f(t,M) (modn), S e is the target signature, M is the hash value of the target file, t=r e (modn), r is a randomly selected integer, Did Ai (1≤i≤k) is the digital identity ID of the k participants with access permission, n=pq, p, q are randomly selected 256-bit prime numbers, f is a threshold function, e is a randomly selected 256-bit prime number, and e and the order of n are prime to each other. The form of the obtained target signature is s e =ge .r ef(t,C) (modn), g e ≡Did A1 Did A2 ...Did An (modn).

[0045] In step S104, the target file is processed to obtain a target data block, wherein the target data block at least includes the digital identity ID of the participant, the digital identity ID of the uploader of the target file, the target signature, and the storage address information of the target file.

[0046] Specifically, after obtaining the target signature, the target file is processed to obtain the target data block. The target data block has the form of: Block m =(Did A1 ,...,Did Ak ,m,Cid,Did R ,s e ,...,chksum), wherein Block m is the target data block, m is the initial data block, Did R is the digital identity ID of the uploader of the target file, Cid is the storage address information of the target file, and chksum is a security parameter.

[0047] In step S105, the target data block is transmitted to at least one decentralized storage node two to store the target data block, wherein the decentralized storage node two is other decentralized storage node in the decentralized storage nodes except the decentralized storage node one.

[0048] Specifically, the target data block is stored in the corresponding decentralized storage node two.

[0049] As shown above, by using the preset algorithm one to sign the target file according to the digital identity ID of the participant having the access right of the target file to obtain the target signature, and then adding the target signature to the target data block and transmitting the target data block to the decentralized storage node two, the target file can be tracked and traced, and the data security is improved.

[0050] Optionally, in the method for processing the blockchain file provided in the embodiments of the present application, the preset algorithm one has the form of: S e =(Did A1 Did A2 ...Did Ak t f(t,M) (modn), wherein S e is the target signature, M is the hash value of the target file, and t=re (modn), r is an integer randomly selected, Did Ai (1≤i≤k) is the digital identity ID of the k participants with access rights, n=pq, p and q are 256-bit prime numbers randomly selected, f is a threshold function, e is a 256-bit prime number randomly selected, and e and the order of n are prime to each other.

[0051] Specifically, the preset algorithm one is an algorithm based on the RSA algorithm, the target file is processed by signing by using the preset algorithm one, the target signature obtained will not be easily tampered with, the security of the target file is ensured, and the target file can be accurately tracked and traced according to the target signature.

[0052] Optionally, in the method for processing a blockchain file provided in the embodiment of the application, the form of the target signature is s e ≡g e r ef(t,C) (modn), wherein g e ≡Did A1 Did A2 ...Did Ak (modn), and C is the data information of the target file.

[0053] Specifically, the form of the target signature is s e ≡g e r ef(t,C) (modn), and the target signature can be further simplified to S≡g.r f(t,C) (modn) according to the current form. The form of the target signature described above will not be easily tampered with, and the security of the data is ensured.

[0054]

[0055] Optionally, in the method for processing a blockchain file provided in the embodiment of the application, the target file is processed to obtain the target data block, including: the target file is processed by block processing through a preset algorithm two to obtain a plurality of initial data blocks; and the initial data blocks are processed by a preset algorithm three to obtain the target data block.

[0056] Specifically, the target file is processed by block processing according to a block strategy of the target file. The target file can be processed by block processing by using a Rabin block algorithm (i.e., the preset algorithm two described above), and the Rabin block algorithm is: M(Parent)=M(child1)||M(child2)||...||M(childn)||Did A1 ||Did A2 ||....||Did Ak ​Here, M(Parent) represents the Rabin fingerprint information of the file fragment, and M(childi) represents the Rabin fingerprint information of the child node file fragment. Then, the hash aggregation algorithm (i.e., the preset algorithm two mentioned above) is called to aggregate the hash of each child node file fragment, the target signature, and other information to obtain the target data block. The above two algorithms can flexibly divide the target file into blocks to obtain the target data block.

[0057] Optionally, in the blockchain-based file processing method provided in this application embodiment, the target data block is in the form of: Block m =(Did A1 ,...,Did Ak ,m,Cid,Did R ,s e ,...,chksum), where Block m The target data block is m, the initial data block is m, and Did is 0. R Cid is the digital identity ID of the uploader of the target file, Cid is the storage address information of the target file, and chksum is a security parameter.

[0058] Specifically, the target data block obtained through the above two algorithms takes the form of: Block m =(Did A1 ,...,Did Ak ,m,Cid,Did R ,s e ,...,chksum), for example, such as Figure 2 The data format diagram of the target data block is shown.

[0059] Optionally, in the blockchain-based file processing method provided in this application embodiment, the storage address information of the target file is in the form of: Where h is the hash function, Cid Children The hash value of the initial data block.

[0060] Specifically, the storage address information of the target file in the target data block is in the following form: The aforementioned storage address information enables the target data blocks to be accurately stored in the corresponding distributed storage node 2. When the target file needs to be read later, the target data blocks can be read and combined according to the storage address information to obtain the target file.

[0061] Optionally, in the method for processing a file based on a blockchain provided in the embodiments of the present application, before initiating the transaction request for uploading the target file, the method further comprises: obtaining a transaction request two for deploying a target smart contract, wherein the target smart contract is used for processing a target transaction message one; generating an ID of the transaction request two and an ID of the target smart contract by a transaction processing module of the blockchain node, and assembling the ID of the transaction request two, the ID of the target smart contract, and a code of the target smart contract into a target transaction message two; broadcasting the target transaction message two to other blockchain nodes in the blockchain system by a communication module of the blockchain node, wherein the blockchain nodes analyze the target transaction message two to deploy the target smart contract; and feeding back a signal one indicating that the target smart contract has been deployed to the target object.

[0062] Specifically, before uploading the target file, the target smart contract needs to be deployed in advance. A user initiates a transaction request two for deploying the target smart contract according to needs, and uploads the transaction request two to the blockchain node. The transaction processing module of the blockchain node generates an ID of the transaction request two and an ID of the target smart contract, and assembles the ID of the transaction request two, the ID of the target smart contract, and a code of the target smart contract into a target transaction message two. The target transaction message two is broadcasted to other blockchain nodes in the blockchain system by the communication module of the blockchain node. Each blockchain node receives the target transaction message two, analyzes the target transaction message two, and if the target transaction message two involves the node, the node starts to compile the code of the target smart contract in the node, starts an execution environment of the target smart contract, and finally feeds back a signal one indicating that the target smart contract has been deployed to the target object. Through the above steps, the deployment of the target smart contract is realized, and the storage of the target file is ensured.

[0063] Optionally, in the method for processing a file based on a blockchain provided in the embodiments of the present application, after the target data block is transmitted to at least one target distributed storage node to realize the storage of the target data block, the method further comprises: checking and consensus of the storage behavior information of the target data block by the blockchain node; and feeding back a signal two indicating that the target data block has been stored to the target object if the checking and consensus of the storage behavior information of the target data block are passed.

[0064] Specifically, the blockchain node checks and consenses the storage behavior information of the target data block. When the checking and consensus of the storage behavior information of the target data block are passed, it indicates that the storage of the target file is legal, and also means that the storage of the target file has been completed. Through the above steps, the legality of the storage of the target file is ensured.

[0065] Optionally, in the method for processing a blockchain file provided in the embodiments of the present application, after the target data block is transmitted to at least one target distributed storage node to store the target data block, the method further comprises: obtaining a transaction request three for querying the target file, wherein the transaction request three at least comprises: a digital identity ID of an initiator of the transaction request three, and storage address information of the target file; verifying the transaction request three by a blockchain node to determine whether the initiator of the transaction request three has access authority of the target file; if the initiator has the access authority of the target file, obtaining the target file according to the storage address information of the target file; checking the target file to determine whether the target file is complete; and if the target file passes the check, feeding back the target file to the initiator.

[0066] Specifically, the user can read the target file according to the demand, the user initiates a transaction request three for querying the target file, the blockchain node verifies the transaction request three, and determines whether the initiator of the transaction request three has access authority of the target file. If the initiator has the access authority of the target file, the target data block is read according to the storage address information of the target file and assembled into the target file, the target file is obtained, the target file is checked to determine whether the target file is complete, and if the target file passes the check, the target file is fed back to the initiator.

[0067] The method for processing a file based on a block chain provided in the embodiments of the present application comprises the following steps: obtaining a transaction request one uploaded by a target file, wherein the transaction request one at least comprises an ID of the target file and an ID of a target smart contract; processing the transaction request one by a distributed storage node one to obtain a target transaction message one, and uploading the target transaction message one to a block chain node, wherein the target transaction message one is processed by the block chain node, and the block chain node returns a digital identity ID of a participant having a target file access right to the distributed storage node one; performing signature processing on the target file by a preset algorithm one according to the digital identity ID of the participant to obtain a target signature; processing the target file to obtain a target data block, wherein the target data block at least comprises the digital identity ID of the participant, a digital identity ID of an uploader of the target file, the target signature and storage address information of the target file; and transmitting the target data block to at least one distributed storage node two to store the target data block, wherein the distributed storage node two is another distributed storage node in the distributed storage nodes except the distributed storage node one, thereby solving the problem that in the related art, it is difficult to track and trace the content of the file information when the file information is stored by using the distributed file storage technology, and the data security is relatively low. The target file is processed by the preset algorithm one according to the digital identity ID of the participant having the target file access right to obtain the target signature, and then the target signature is added to the target data block, and the target data block is transmitted to the distributed storage node two, so that the target file can be tracked and traced, and the effect of improving the data security is achieved.

[0068] As shown in Figure 3 The optional method for processing a file based on a block chain provided in the embodiments of the present application is shown in a flowchart. In stage one, a target smart contract is deployed: in step S301, any user initiates a target smart contract deployment request of distributed storage, and a transaction processing module of a block chain node receives the deployment request; in step S302, after receiving the smart contract deployment request, the transaction processing module generates an ID of a deployment contract transaction and an ID of the target smart contract, and then assembles the ID of the transaction, the ID of the target smart contract, a target smart contract code and related parameters into a message; in step S303, the transaction processing module of the block chain node calls a communication module to broadcast the message assembled in step S302 to other block chain nodes in the block chain system; in step S304, each node receives the contract deployment request message and starts to parse the request message, and if the request message involves the node, the node starts to compile the smart contract code and starts a smart contract execution environment; in step S305, the block chain node returns a deployment success state to the user.

[0069] The distributed storage transaction of the phase two target file: step S306: after the nodes involved in the transaction deploy the target smart contract, a transaction request one for uploading the target file is initiated; step S307: the distributed storage node one receives the transaction request one and processes the transaction request one to obtain a target transaction message; step S308: the target transaction message is uploaded to the blockchain node; step S309: the blockchain node receives the distributed storage transaction request, analyzes the target transaction message, obtains the ID of the target smart contract, and the target smart contract obtains the digital identity ID of the participant with the target file access authority required for this distributed storage transaction from the database of the blockchain node, and then gives the digital identity ID of the participant to the distributed storage node; step S310: the digital identity ID of the participant is received, the target file is signed through a preset algorithm one according to the digital identity ID of the participant, and a target signature is obtained; step S311: the target file is processed through a preset algorithm two and a preset algorithm three to obtain a target data block; step S312: the target data block is stored in the distributed storage node two; step S313: the blockchain node checks and consensus the distributed storage behavior information of the target file; step S314: after the check and consensus pass, a signal of the storage completion is returned to the user.

[0070] Phase three query target file: step S315: the user initiates a target file query request; step S316: the target data block is obtained and assembled to obtain the target file; step S317: the target file is verified, and if the verification passes, the target file is fed back to the user.

[0071] It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a group of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that here.

[0072] The embodiment of the present application also provides a processing device based on a blockchain file. It should be noted that the processing device based on the blockchain file of the embodiment of the present application can be used to execute the processing method based on the blockchain file provided by the embodiment of the present application. The processing device based on the blockchain file provided by the embodiment of the present application is introduced as follows.

[0073] Figure 4 is a schematic diagram of the processing device based on the blockchain file according to the embodiment of the present application. As shown in Figure 4 , the device includes a first acquisition unit 401, a first processing unit 402, a second processing unit 403, a third processing unit 404, and a sending unit 405.

[0074] The first obtaining unit 401 is configured to obtain a transaction request one uploaded by a target file, wherein the transaction request one at least includes the target file and an ID of a target smart contract;

[0075] The first processing unit 402 is configured to process the transaction request one through a first distributed storage node to obtain a target transaction message one, and upload the target transaction message one to a block chain node, wherein the target transaction message one is processed through the block chain node, and the block chain node returns a digital identity ID of a participant having a target file access permission to the first distributed storage node;

[0076] The second processing unit 403 is configured to sign the target file through a preset algorithm one according to the digital identity ID of the participant to obtain a target signature;

[0077] The third processing unit 404 is configured to process the target file to obtain a target data block, wherein the target data block at least includes the digital identity ID of the participant, a digital identity ID of an uploader of the target file, the target signature and storage address information of the target file;

[0078] The sending unit 405 is configured to transmit the target data block to at least one second distributed storage node to realize storage of the target data block, wherein the second distributed storage node is another distributed storage node in the distributed storage nodes except the first distributed storage node.

[0079] The processing device based on a blockchain file provided in the embodiment of the present application comprises: a first obtaining unit 401 configured to obtain a transaction request one uploaded by a target file, wherein the transaction request one at least comprises an ID of the target file and an ID of a target smart contract; a first processing unit 402 configured to process the transaction request one through a first distributed storage node to obtain a target transaction message one and upload the target transaction message one to a blockchain node, wherein the target transaction message one is processed through the blockchain node, and a digital identity ID of a participant having a target file access right is returned to the first distributed storage node; a second processing unit 403 configured to sign the target file through a preset algorithm one according to the digital identity ID of the participant to obtain a target signature; a third processing unit 404 configured to process the target file to obtain a target data block, wherein the target data block at least comprises the digital identity ID of the participant, a digital identity ID of an uploader of the target file, the target signature and storage address information of the target file; and a sending unit 405 configured to transmit the target data block to at least one second distributed storage node to store the target data block, wherein the second distributed storage node is another distributed storage node in the distributed storage nodes except the first distributed storage node, thereby solving the problem that in the related art, the file information is difficult to be tracked and traced in content when the file information is stored by using the distributed file storage technology, and the data security is relatively low. The target file is signed through the preset algorithm one according to the digital identity ID of the participant having the target file access right to obtain the target signature, the target signature is then added to the target data block, and the target data block is transmitted to the second distributed storage node, so that the target file can be tracked and traced, and the effect of improving the data security is achieved.

[0080] Optionally, in the processing device based on a blockchain file provided in the embodiment of the present application, the preset algorithm one is in the form of: e = Did A1 Did A2 ... Did Ak t f(t,M) (modn), wherein S e is the target signature, M is a hash value of the target file, t = r e (modn), r is a randomly selected integer, Did Ai (1≤i≤k) is a digital identity ID of k participants having an access right, n = pq, p and q are randomly selected 256-bit prime numbers, f is a threshold function, and e is a randomly selected 256-bit prime number, and the order of e and n is a prime number.

[0081] Optionally, in the processing device based on a blockchain file provided in the embodiment of the present application, the target signature is in the form of: e = g e ref(t,C) (modn), where g e ≡ Did A1 Did A2 ...Did Ak (modn), C is data information of the target file.

[0082] Optionally, in the processing apparatus for the blockchain file provided in the embodiments of the present application, the third processing unit 404 comprises: a first processing module, configured to perform block processing on the target file through a preset algorithm two to obtain a plurality of initial data blocks; a second processing module, configured to perform processing on the initial data blocks through a preset algorithm three to obtain a target data block; and a sending unit, configured to transmit the target data block to at least one dispersed storage node two to realize storage of the target data block, wherein the dispersed storage node two is another dispersed storage node in the dispersed storage nodes except for the dispersed storage node one.

[0083] Optionally, in the processing apparatus for the blockchain file provided in the embodiments of the present application, the target data block is in the form of: Block m =(Did A1 ,...,Did Ak ,m,Cid,Did R ,s e ,...,chksum), where Block m is the target data block, m is the initial data block, Did R is a digital identity ID of an uploader of the target file, Cid is storage address information of the target file, and chksum is a security parameter.

[0084] Optionally, in the processing apparatus for the blockchain file provided in the embodiments of the present application, the storage address information of the target file is in the form of: where h is a hash function, and Cid Children is a hash value of the initial data block.

[0085] Optionally, in the processing apparatus based on the blockchain file provided in the embodiments of the present application, the apparatus further comprises: a second acquisition unit, configured to acquire a transaction request two for deploying a target smart contract before initiating a transaction request for uploading a target file, wherein the target smart contract is used for processing a target transaction message one; an assembling unit, configured to generate an ID of the transaction request two and an ID of the target smart contract through a transaction processing module of a blockchain node, and assemble the ID of the transaction request two, the ID of the target smart contract, and a code of the target smart contract into a target transaction message two; a broadcasting unit, configured to broadcast the target transaction message two to other blockchain nodes in a blockchain system through a communication module of the blockchain node, wherein the blockchain nodes analyze the target transaction message two to deploy the target smart contract; and a first feedback unit, configured to feed back a signal one indicating that the target smart contract has been deployed to a target object.

[0086] Optionally, in the processing apparatus based on the blockchain file provided in the embodiments of the present application, the apparatus further comprises: a first verification unit, configured to verify and reach a consensus on storage behavior information of a target data block through a blockchain node after the target data block is transmitted to at least one target distributed storage node to realize storage of the target data block; and a second feedback unit, configured to feed back a signal two indicating that the target data block has been stored to a target object if the verification and the consensus on the storage behavior information of the target data block are passed.

[0087] Optionally, in the processing apparatus based on the blockchain file provided in the embodiments of the present application, the apparatus further comprises: a third acquisition unit, configured to acquire a transaction request three for querying a target file after the target data block is transmitted to at least one target distributed storage node to realize storage of the target data block, wherein the transaction request three at least includes a digital identity ID of an initiator of the transaction request three and storage address information of the target file; a verification unit, configured to verify the transaction request three through a blockchain node to determine whether the initiator of the transaction request three has access authority of the target file; a fourth acquisition unit, configured to acquire the target file according to the storage address information of the target file if the initiator has the access authority of the target file; a second verification unit, configured to verify the target file to determine whether the target file is complete; and a third feedback unit, configured to feed back the target file to the initiator if the verification of the target file is passed.

[0088] The processing apparatus based on the blockchain file comprises a processor and a memory, the first acquisition unit 401, the first processing unit 402, the second processing unit 403, the third processing unit 404 and the sending unit 405 are all stored in the memory as program units, and the corresponding functions are realized by the processor executing the program units stored in the memory.

[0089] The processor includes a core, and the core retrieves corresponding program units in the memory. The core can be set to one or more, and the storage work of the file is realized by adjusting the core parameters.

[0090] The memory can include non-permanent memory in a computer readable medium, random access memory (RAM) and / or non-volatile memory such as read-only memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.

[0091] As shown in Figure 5 The optional structure diagram of the file processing system based on the blockchain provided by the embodiment of the present application is shown in the figure. The processing system includes a client 1, a distributed storage node 2 and a blockchain node 3. The client 1 is mainly responsible for initiating a smart contract deployment request, a file distributed storage transaction request, a file query request and the like. The distributed storage node 2 is a decentralized storage node, which is responsible for receiving the file upload and query request of the client 1, performing the distributed file read-write work and storing the transaction information into the blockchain node 3. The blockchain node 3 is a node that completes the functions of transaction broadcasting, transaction execution, transaction verification, consensus and storage, and has the general characteristics of the blockchain.

[0092] As shown in Figure 6 The optional schematic diagram of the distributed storage node provided by the embodiment of the present application is shown in the figure. The distributed storage node includes a communication module 21, a ciphertext processing module 22, a DAG module 23 and a Chunk module 24. The communication module 21 is responsible for establishing a secure channel for the distributed storage node 2, and realizes the transmission and reception of the distributed storage message. The ciphertext processing module 22 is responsible for the encryption and decryption processing of the distributed storage message, and is the main module for performing the signature processing of the file. The DAG module 23 performs the block processing of the file to obtain the initial data block. The Chunk module 24 processes the initial data to obtain the target data block.

[0093] As shown in Figure 7As shown in the diagram, according to the optional blockchain node structure provided in this application embodiment, blockchain node 3 includes: a communication module 31, a transaction processing module 32, a smart contract module 33, and a consensus verification module 34. The communication module 31 is responsible for communication and interaction between nodes, completing general blockchain node communication information, including transaction information broadcasting, consensus-related information, block synchronization information, network status information, etc. The transaction processing module 32 is responsible for receiving transaction requests, generating a unique transaction identifier, assembling the unique transaction identifier, contract identifier, and call parameters into a transaction message, and broadcasting the transaction message to other nodes in the blockchain. The smart contract module 33 is responsible for receiving transaction requests from the communication module 22 and processing the transaction requests according to preset business logic. The consensus verification module 34 is responsible for consensus processing of received transaction requests. When consensus is reached, it calls the smart contract module 23 to execute the smart contract and ultimately forms a record for future auditing, tracing, or verification.

[0094] This invention provides a processor for running a program, wherein the program executes a blockchain file-based processing method during runtime.

[0095] like Figure 8 As shown, this embodiment of the invention provides an electronic device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs the following steps: obtaining a transaction request 1 for uploading a target file, wherein the transaction request 1 includes at least: the ID of the target file and the ID of the target smart contract; processing the transaction request 1 through a distributed storage node 1 to obtain a target transaction message 1, and uploading the target transaction message 1 to a blockchain node, wherein the blockchain node processes the transaction and returns the digital identity ID of the participant with access rights to the target file to the distributed storage node 1; based on the digital identity ID of the participant, signing the target file using a preset algorithm 1 to obtain a target signature; processing the target file to obtain a target data block, wherein the target data block includes at least: the digital identity ID of the participant, the digital identity ID of the uploader of the target file, the target signature, and the storage address information of the target file; transmitting the target data block to at least one distributed storage node 2 to store the target data block, wherein the distributed storage node 2 is another distributed storage node besides the distributed storage node 1.

[0096] Optionally, the form of the preset algorithm one is: S e =Did A1 Did A2 ...Did Ak t f(t,M) (mod n), where S es is a target signature, M is a hash value of a target file, t=r e (mod n), r is an integer randomly selected, Did Ai (1≤i≤k) is a digital identity ID of k participants with access rights, n=pq, p and q are prime numbers of 256 bits randomly selected, f is a threshold function, e is a prime number of 256 bits randomly selected, and e and the order of n are prime to each other.

[0097] Optionally, the target signature is in the form of: s e = g e r ef(t,C) (mod n), wherein g e ≡ Did A1 Did A2 ... Did Ak (mod n), and C is data information of the target file.

[0098] Optionally, the target file is processed to obtain the target data block, including: the target file is processed by a preset algorithm two to obtain a plurality of initial data blocks; and the initial data blocks are processed by a preset algorithm three to obtain the target data block.

[0099] Optionally, the target data block is in the form of: Block m =(Did A1 ,..., Did Ak , m, Cid, Did R , s e ,..., chksum), wherein Block m is the target data block, m is an initial data block, Did R is a digital identity ID of an uploader of the target file, Cid is storage address information of the target file, and chksum is a security parameter.

[0100] Optionally, the storage address information of the target file is in the form of: wherein h is a hash function, and Cid Children is a hash value of the initial data block.

[0101] Optionally, before initiating the transaction request of the target file uploading, the method further comprises: obtaining a transaction request two of a target smart contract deployment, wherein the target smart contract is used for processing the target transaction message one; generating an ID of the transaction request two and an ID of the target smart contract through a transaction processing module of the blockchain node, and assembling the ID of the transaction request two, the ID of the target smart contract and a code of the target smart contract into a target transaction message two; broadcasting the target transaction message two to other blockchain nodes in the blockchain system through a communication module of the blockchain node, wherein the blockchain node analyzes the target transaction message two to deploy the target smart contract; and feeding back a signal one of the target smart contract having been deployed to the target object.

[0102] Optionally, after the target data block is transmitted to the at least one target distributed storage node to realize the storage of the target data block, the method further comprises: checking and consensus of the storage behavior information of the target data block through the blockchain node; if the checking and consensus of the storage behavior information of the target data block pass, feeding back a signal two of the target data block having been stored to the target object.

[0103] Optionally, after the target data block is transmitted to the at least one target distributed storage node to realize the storage of the target data block, the method further comprises: obtaining a transaction request three of a target file query, wherein the transaction request three at least comprises: a digital identity ID of an initiator of the transaction request three, and storage address information of the target file; verifying the transaction request three through the blockchain node to determine whether the initiator of the transaction request three has the access right of the target file; if the initiator has the access right of the target file, obtaining the target file according to the storage address information of the target file; checking the target file to determine whether the target file is complete; if the target file passes the checking, feeding back the target file to the initiator. The device in the present application can be a server, a PC, a PAD, a mobile phone, etc.

[0104] The application further provides a computer program product suitable for executing a program for initializing the following method steps when executed on a data processing device: obtaining a transaction request one uploaded by a target file, wherein the transaction request one at least includes: the target file and the ID of a target smart contract; processing the transaction request one through a distributed storage node one to obtain a target transaction message one, and uploading the target transaction message one to a blockchain node, wherein the target transaction message one is processed through the blockchain node, and the digital identity ID of a participant having the target file access permission is returned to the distributed storage node one; performing signature processing on the target file through a preset algorithm one according to the digital identity ID of the participant to obtain a target signature; processing the target file to obtain a target data block, wherein the target data block at least includes: the digital identity ID of the participant, the digital identity ID of the uploader of the target file, the target signature and the storage address information of the target file; and transmitting the target data block to at least one distributed storage node two to realize storage of the target data block, wherein the distributed storage node two is another distributed storage node in the distributed storage nodes except the distributed storage node one.

[0105] Optionally, the preset algorithm one is in the form of: S e = Did A1 Did A2 ... Did Ak t f(t,M) (modn), wherein S e is the target signature, M is the hash value of the target file, t = r e (modn), r is an integer randomly selected, Did Ai (1≤i≤k) is the digital identity ID of the k participants having the access permission, n = pq, p and q are prime numbers of 256 bits randomly selected, f is a threshold function, e is a prime number of 256 bits randomly selected, and the order of e and n are prime to each other.

[0106] Optionally, the target signature is in the form of: s e = g e r ef(t,C) (modn), wherein g e ≡ Did A1 Did A2 ... Did Ak (modn), and C is the data information of the target file.

[0107] Optionally, processing the target file to obtain the target data block includes: performing block processing on the target file through a preset algorithm two to obtain a plurality of initial data blocks; and processing the initial data blocks through a preset algorithm three to obtain the target data block.

[0108] Optionally, the target data block is in the form of: Block m =(m, Cid, Did A1 ,..., Did Ak ,m,Cid,Did R ,s e ,...,chksum), where Block m is the target data block, m is the initial data block, Did R is the digital identity ID of the uploader of the target file, Cid is the storage address information of the target file, and chksum is a security parameter.

[0109] Optionally, the storage address information of the target file is in the form of: where h is a hash function, and Cid Children is the hash value of the initial data block.

[0110] Optionally, before initiating the transaction request for uploading the target file, the method further comprises: obtaining a transaction request two deployed by a target smart contract, wherein the target smart contract is used to process a target transaction message one; generating an ID of the transaction request two and an ID of the target smart contract through a transaction processing module of a blockchain node, and assembling the ID of the transaction request two, the ID of the target smart contract, and a code of the target smart contract into a target transaction message two; broadcasting the target transaction message two to other blockchain nodes in the blockchain system through a communication module of the blockchain node, wherein the blockchain node analyzes the target transaction message two to deploy the target smart contract; and feeding back a signal one indicating that the target smart contract has been deployed to the target object.

[0111] Optionally, after transmitting the target data block to at least one target distributed storage node to store the target data block, the method further comprises: verifying and consensus-checking the storage behavior information of the target data block by the blockchain node; and feeding back a signal two indicating that the target data block has been stored to the target object if the verification and consensus-checking of the storage behavior information of the target data block pass.

[0112] Optionally, after transmitting the target data block to at least one target distributed storage node to store the target data block, the method further comprises: obtaining a transaction request three for querying the target file, wherein the transaction request three at least includes a digital identity ID of an initiator of the transaction request three and storage address information of the target file; verifying the transaction request three by the blockchain node to determine whether the initiator has access rights to the target file; obtaining the target file according to the storage address information of the target file if the initiator has the access rights to the target file; verifying the target file to determine whether the target file is complete; and feeding back the target file to the initiator if the verification of the target file passes.

[0113] Those skilled in the art will appreciate that embodiments of the application can be readily used as a method, apparatus, or computer program product. Accordingly, the application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the application can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, magnetic disks, CD-ROMs, optical storage media such as DVD s, etc.) embodying computer program instructions.

[0114] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.

[0115] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.

[0116] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.

[0117] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0118] Memory can include non-persistent memory, Random Access Memory (RAM), and / or non-volatile memory such as read-only memory (ROM) or flash memory, etc. in a computer readable medium. Memory is an example of computer readable media.

[0119] Computer readable media includes permanent and non-permanent, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD), or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer readable media does not include transitory media such as modulated data signals and carrier waves.

[0120] It should also be noted that the terms "comprising", "comprises", "including", "includes" or any other variation thereof are intended to cover a non-exclusive inclusion, such that a process, method, article or apparatus that comprises a list of elements does not include only those elements recited, but can also include other elements not expressly listed or inherent to such process, method, article or apparatus. Without limitation, an element preceded by "comprises a" does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article or apparatus that comprises the element.

[0121] Those skilled in the art will understand that embodiments of the present application can be provided as a method, a system or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application can take the form of a computer program product implemented on one or more computer available storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage etc.) containing computer usable program code.

[0122] The above merely provides an example of the present application and is not intended to limit the present application. The present application can have various modifications and changes for those skilled in the art. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in the scope of claims of the present application.

Claims

1. A method for processing a blockchain-based file, characterized in that, The method comprises the following steps: obtaining a transaction request one for uploading a target file, wherein the transaction request one at least comprises the target file and the ID of a target smart contract; processing the transaction request one through a distributed storage node one to obtain a target transaction message one, and uploading the target transaction message one to a blockchain node, wherein the target transaction message one is processed through the blockchain node, and the digital identity ID of a participant with the target file access permission is returned to the distributed storage node one; signing the target file through a preset algorithm one according to the digital identity ID of the participant to obtain a target signature; processing the target file to obtain a target data block, wherein the target data block at least comprises the digital identity ID of the participant, the digital identity ID of the uploader of the target file, the target signature and the storage address information of the target file; transmitting the target data block to at least one distributed storage node two to realize the storage of the target data block, wherein the distributed storage node two is another distributed storage node except the distributed storage node one in the distributed storage nodes.

2. The method of claim 1, wherein, The form of the preset algorithm one is: S e = Did A1 Did A2 ...Did Ak t f(t,M) (modn), wherein S e is the target signature, M is the hash value of the target file, t=r e (modn), r is an integer randomly selected, Did Ai (1≤i≤k) is the digital identity ID of the k participants with access rights, n=pq, p and q are prime numbers with 256 bits randomly selected, f is a threshold function, e is a prime number with 256 bits randomly selected, and the order of e and n is a prime number.

3. The method of claim 2, wherein, The target signature is in the form of: s e = g e r ef(t,C) (mod n), where g e ≡ Did A1 Did A2 ... Did Ak (mod n), and C is the data information of the target file.

4. The method of claim 1, wherein, The processing of the target file to obtain the target data block comprises the following steps: processing the target file through a preset algorithm two to obtain a plurality of initial data blocks; processing the initial data blocks through a preset algorithm three to obtain the target data block.

5. The method of claim 4, wherein, The target data block is in the form of: Block m =(Did A1 ,...,Did Ak ,m,Cid,Did R ,s e ,...,chksum), where Block m The target data block is m, the initial data block is m, and Did is m. R The target file is the digital identity ID of the uploader, Cid is the storage address information of the target file, and chksum is a security parameter.

6. The method of claim 5, wherein, The storage address information of the target file is in the form of: Wherein, h is a hash function, Cid Children is the hash value of the initial data block.

7. The method of claim 1, wherein, Before initiating the transaction request for uploading the target file, the method further comprises the following steps: obtaining a transaction request two for deploying the target smart contract, wherein the target smart contract is used for processing the target transaction message one; generating the ID of the transaction request two and the ID of the target smart contract through a transaction processing module of the blockchain node, and assembling the ID of the transaction request two, the ID of the target smart contract and the code of the target smart contract into a target transaction message two; broadcasting the target transaction message two to other blockchain nodes in a blockchain system through a communication module of the blockchain node, wherein the target transaction message two is analyzed by the blockchain node to deploy the target smart contract; feeding a signal one indicating that the deployment of the target smart contract is completed to a target object.

8. The method of claim 1, wherein, After transmitting the target data block to at least one target distributed storage node to realize the storage of the target data block, the method further comprises the following steps: verifying and reaching a consensus on the storage behavior information of the target data block through the blockchain node; if the verification and consensus on the storage behavior information of the target data block are passed, feeding a signal two indicating that the storage of the target data block is completed to a target object.

9. The method of claim 1, wherein, After transmitting the target data block to at least one target distributed storage node to realize the storage of the target data block, the method further comprises the following steps: obtaining a transaction request three for querying the target file, wherein the transaction request three at least comprises the digital identity ID of the initiator of the transaction request three and the storage address information of the target file; verifying the transaction request three by the blockchain node, to determine whether an initiator of the transaction request three has access authority of the target file; if the initiator has the access authority of the target file, obtaining the target file according to storage address information of the target file; checking the target file, to determine whether the target file is complete; if the target file passes the check, feeding back the target file to the initiator. 10.A processing apparatus based on a blockchain file, characterized in that, Comprising: a first obtaining unit, configured to obtain a transaction request one of a target file upload, wherein the transaction request one at least includes the target file and an ID of a target smart contract; a first processing unit, configured to process the transaction request one by a distributed storage node one, to obtain a target transaction message one, and upload the target transaction message one to a blockchain node, wherein the target transaction message one is processed by the blockchain node, and a digital identity ID of a participant having the access authority of the target file is returned to the distributed storage node one; a second processing unit, configured to perform signature processing on the target file by a preset algorithm one according to the digital identity ID of the participant, to obtain a target signature; a third processing unit, configured to process the target file, to obtain a target data block, wherein the target data block at least includes the digital identity ID of the participant, a digital identity ID of an uploader of the target file, the target signature and storage address information of the target file; a sending unit, configured to transmit the target data block to at least one distributed storage node two, to implement storage of the target data block, wherein the distributed storage node two is another distributed storage node in the distributed storage nodes except the distributed storage node one.

11. A processor, comprising: The processor is configured to run a program, wherein the program performs the processing method based on the blockchain file in any one of claims 1 to 9 when the program is run.

12. An electronic device, comprising: Comprising one or more processors and a memory, the memory is configured to store one or more programs, wherein the one or more programs make the one or more processors implement the processing method based on the blockchain file in any one of claims 1 to 9 when the one or more programs are executed by the one or more processors.

Citation Information

Patent Citations

  • Blockchain-based cross-chain interconnection method, device and system

    CN110266655A

  • Block chain network transaction method and device and storage medium

    CN111210344A