CN114880300A - Processing method and device based on block chain file, processor and electronic equipment - Google Patents

Processing method and device based on block chain file, processor and electronic equipment Download PDF

Info

Publication number
CN114880300A
CN114880300A CN202210297182.8A CN202210297182A CN114880300A CN 114880300 A CN114880300 A CN 114880300A CN 202210297182 A CN202210297182 A CN 202210297182A CN 114880300 A CN114880300 A CN 114880300A
Authority
CN
China
Prior art keywords
target
storage node
storage
file
target file
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
CN202210297182.8A
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202210297182.8A priority Critical patent/CN114880300A/en
Publication of CN114880300A publication Critical patent/CN114880300A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • 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
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2107File encryption
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2113Multi-level security, e.g. mandatory access control

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Bioethics (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Storage Device Security (AREA)

Abstract

The application discloses a processing method and device based on a block chain file, a processor and electronic equipment, and relates to the technical field of block chains. The method comprises the following steps: acquiring a transaction request for indicating a storage target file; according to the space size occupied by the target file and the data security level, the target file is subjected to blocking processing through the storage node to obtain an initial data block; calling a multiple hash algorithm through a first storage node to process an initial data block to obtain a target key value pair; determining a target storage strategy of the target file according to the data security level and the access efficiency of the target file; and storing the target key value pair to a target storage node according to the target storage strategy, wherein the target storage node at least comprises a first storage node. According to the method and the device, the problem that the efficiency of acquiring the target file is low due to the fact that the target file is stored under a chain and is acquired through the data hash fingerprint on the chain in the related technology is solved.

Description

Processing method and device based on block chain file, processor and electronic equipment
Technical Field
The present application relates to the field of blockchain technologies, and in particular, to a processing method and apparatus based on a blockchain file, a processor, and an electronic device.
Background
With the wide application of the blockchain technology, the amount of data stored on the chain is larger and larger, and the variety is rich, and the blockchain storage technology also becomes a bottleneck more and more. Currently, the common block chain uplink methods include content uplink, hash uplink, link uplink, and the like. Due to the characteristics of the blockchain, blockchain storage is increased along with the increase of nodes, and storage cost is multiplied. When the storage data under the chain is adopted, the data needs to be acquired through the data hash fingerprint on the chain, and the method has the problem of low data acquisition efficiency, and the processing efficiency of an actual business system is influenced.
Aiming at the problem that the efficiency of acquiring the target file is low due to the fact that the target file is stored under a chain and is acquired through data hash fingerprints on the chain in the related technology, an effective solution is not provided at present.
Disclosure of Invention
The application mainly aims to provide a processing method and device based on a block chain file, a processor and electronic equipment, so as to solve the problem that the efficiency of acquiring a target file is low due to the fact that the target file is acquired by using a data hash fingerprint on a chain and storing the target file under the chain in the related technology.
In order to achieve the above object, according to an aspect of the present application, a processing method based on a blockchain file is provided. The method comprises the following steps: acquiring a transaction request for indicating a storage target file; according to the space size occupied by the target file and the data security level, partitioning the target file through a storage node to obtain an initial data block, wherein the storage node I is a storage node corresponding to an initiator of the transaction request, and the data security level is used for representing the security level of data in the target file; calling a multiple hash algorithm through the first storage node to process the initial data block to obtain a target key value pair; determining a target storage strategy of the target file according to the data security level and the access efficiency of the target file; and storing the target key value pair to a target storage node according to the target storage strategy, wherein the target storage node at least comprises the first storage node.
Further, the step of processing the initial data block by calling a multiple hash algorithm through the first storage node to obtain the target key value pair includes: calling the multiple hash algorithm through the first storage node to perform hash calculation on the initial data block to obtain an initial key value pair; and acquiring a private key of the initiator, and encrypting the initial key value pair according to the private key to obtain the target key value pair.
Further, after the initial data block is processed by the storage node by invoking a multiple hash algorithm to obtain a target key-value pair, the method further includes: and calculating a target hash index of the target file through the multiple hash algorithm, wherein the target hash index is used for identifying the target file.
Further, storing the target key-value pair to a target storage node according to the target storage policy includes: acquiring metadata information of the target file, wherein the metadata information represents the attribute of the target file; and calling an intelligent contract to store the metadata information, the target hash index and the target key value pair to a target storage node according to the target storage strategy.
Further, before obtaining the transaction request for instructing to store the target file, the method further includes: obtaining a user certificate and a secret key, wherein the user certificate and the secret key represent the legal identity of the initiator; according to the user certificate and the secret key, performing authority verification on the block chain to obtain an access certificate, wherein the access certificate is used for storing the target file and accessing the target file; and calling a storage resource interface of the block chain according to the access certificate to obtain IP and address information of all storage nodes in the block chain nodes.
Further, after storing the target key-value pair to a target storage node in accordance with the target storage policy, the method further comprises: carrying out Hash anchoring on the transaction behavior stored in the target file through a consensus node so as to complete consensus work; and returning a signal that the target file is successfully stored to the initiator through the consensus node.
Further, after hash-anchoring the transaction behavior of the target file storage by a consensus node to complete consensus work, the method further comprises: establishing an index key value pair by taking the target hash index as a key and the IP of the target storage node as a value; and storing the index key value pair into a target hash table of the block chain.
In order to achieve the above object, according to another aspect of the present application, there is provided a processing apparatus based on a blockchain file. The device includes: a first acquisition unit configured to acquire a transaction request indicating a storage target file; the first processing unit is used for carrying out blocking processing on the target file through a storage node according to the space size occupied by the target file and the data security level to obtain an initial data block, wherein the first storage node is a storage node corresponding to an initiator of the transaction request, and the data security level is used for representing the security level of data in the target file; the second processing unit is used for processing the initial data block by calling a multiple hash algorithm through the first storage node to obtain a target key value pair; the determining unit is used for determining a target storage strategy of the target file according to the data security level and the access efficiency of the target file; and the first storage unit is used for storing the target key-value pair to a target storage node according to the target storage policy, wherein the target storage node at least comprises the first storage node.
Further, the second processing unit includes: the computing module is used for calling the multiple hash algorithms through the first storage node to perform hash computation on the initial data block to obtain an initial key value pair; and the encryption module is used for acquiring the private key of the initiator and encrypting the initial key value pair according to the private key to obtain the target key value pair.
Further, the apparatus further comprises: and the computing unit is used for processing the initial data block by calling a multiple hash algorithm through the first storage node to obtain a target key value pair, and then computing a target hash index of the target file through the multiple hash algorithm, wherein the target hash index is used for identifying the target file.
Further, the first storage unit includes: the acquisition module is used for acquiring metadata information of the target file, wherein the metadata information represents the attribute of the target file; and the calling module is used for calling an intelligent contract to store the metadata information, the target hash index and the target key value pair into a target storage node according to the target storage strategy.
Further, the apparatus further comprises: a second obtaining unit, configured to obtain a user certificate and a key before obtaining a transaction request indicating a storage target file, where the user certificate and the key represent a legal identity of the initiator; the verification unit is used for performing authority verification on the block chain according to the user certificate and the secret key to obtain an access certificate, wherein the access certificate is used for storing the target file and accessing the target file; and the calling unit is used for calling the storage resource interface of the block chain according to the access certificate to obtain the IP and address information of all the storage nodes in the block chain nodes.
Further, the apparatus further comprises: the third processing unit is used for performing hash anchoring on the transaction behavior stored in the target file through a consensus node after the target key value pair is stored in the target storage node according to the target storage strategy so as to complete consensus work; and the return unit is used for returning the signal that the target file is successfully stored to the initiator through the consensus node.
Further, the apparatus further comprises: the establishing unit is used for performing hash anchoring on the transaction behaviors stored in the target file through the consensus node to complete consensus work, and then establishing an index key value pair by taking the target hash index as a key and the IP of the target storage node as a value; and the second storage unit is used for storing the index key value pair into a target hash table of the block chain.
In order to achieve the above object, according to an aspect of the present application, there is provided a processor configured to execute a program, where the program executes to perform any one of the above processing methods based on a blockchain file.
To achieve the above object, according to one aspect of the present application, there is provided an electronic device including one or more processors and a memory, the memory being configured to store the one or more processors to implement the block chain file-based processing method according to any one of the above.
Through the application, the following steps are adopted: acquiring a transaction request for indicating a storage target file; according to the space size occupied by the target file and the data security level, the target file is subjected to blocking processing through a storage node to obtain an initial data block, wherein the storage node I is a storage node corresponding to an initiator of a transaction request, and the data security level is used for representing the security level of data in the target file; calling a multiple hash algorithm through a first storage node to process an initial data block to obtain a target key value pair; determining a target storage strategy of the target file according to the data security level and the access efficiency of the target file; according to the target storage strategy, the target key value pair is stored to the target storage node, wherein the target storage node at least comprises a first storage node, and the problem that the efficiency of acquiring the target file is low due to the fact that the target file is acquired by using the data hash fingerprint on the link and storing the target file under the link in the related technology is solved. The method comprises the steps of obtaining an initial data block by blocking a target file, converting the initial data block into a target key value pair by utilizing a multiple Hash algorithm, determining a target storage strategy according to a data security level and the access efficiency of the target file, and storing the target key value pair on a target storage node according to the target storage strategy, so that the effect of improving the efficiency of obtaining the target file is achieved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this application, illustrate embodiments of the application and, together with the description, serve to explain the application and are not intended to limit the application. In the drawings:
fig. 1 is a flowchart of a processing method based on a blockchain file according to an embodiment of the present application;
fig. 2 is a flowchart of an alternative blockchain file-based processing method according to an embodiment of the present application;
fig. 3 is a schematic diagram of a processing apparatus based on a blockchain file according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of an alternative blockchain file-based processing system provided in accordance with an embodiment of the present application;
FIG. 5 is a schematic diagram of an alternative storage node provided in accordance with an embodiment of the present application;
FIG. 6 is a schematic diagram of alternative stored data provided in accordance with an embodiment of the present application;
fig. 7 is a schematic diagram of an alternative consensus node provided according to an embodiment of the present application;
fig. 8 is a schematic diagram of an electronic device provided according to an embodiment of the application.
Detailed Description
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be used. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The present invention is described below with reference to preferred implementation steps, and fig. 1 is a flowchart of a processing method based on a blockchain file according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
step S101, a transaction request for instructing storage of a target file is acquired.
Specifically, the initiator initiates a transaction request for storing the target file through the corresponding block link node.
Step S102, according to the space size occupied by the target file and the data security level, the target file is subjected to blocking processing through the storage node to obtain an initial data block, wherein the storage node I is a storage node corresponding to an initiator of the transaction request, and the data security level is used for representing the security level of data in the target file.
Specifically, a first storage node on a link point of the block receives a transaction request, and then blocks the target file according to the space occupied by the target file and the data security level to obtain an initial data block. For example, object file 100M, the object file may be divided into 4 25M initial data chunks. If the data security level is higher, the target file can be divided into more data blocks to ensure security.
Step S103, the initial data block is processed by the first storage node calling the multiple hash algorithm, and a target key value pair is obtained.
Specifically, after the initial data block is obtained, the storage node calls a multiple hash algorithm to process the initial data block, and obtains a target Key Value pair, where usually, the hash Value of the service data is used as a Key (Key), and the service data is a Value.
And step S104, determining a target storage strategy of the target file according to the data security level and the access efficiency of the target file.
Specifically, the storage policy is determined according to the data security level and the access efficiency of the target file. For example, the initiator may choose to store multiple target key-value pairs above the storage node corresponding to the initiator, in order to access the target file as quickly as possible. Or backup storage may be performed by each storage node for data security considerations.
Step S105, storing the target key value pair to a target storage node according to the target storage strategy, wherein the target storage node at least comprises a first storage node.
Specifically, the target key value pair is stored to the corresponding target storage node according to the obtained target storage strategy.
In summary, the target file is partitioned to obtain an initial data block, the initial data block is converted into the target key value pair by using the multiple hash algorithm, the target storage policy is determined according to the data security level and the access efficiency of the target file, and the target key value pair is stored on the target storage node according to the target storage policy, so that the efficiency of obtaining the target file is improved.
Optionally, in the processing method based on a blockchain file provided in the embodiment of the present application, the first step of processing the initial data block by using a multiple hash algorithm invoked by the storage node to obtain the target key value pair includes: calling a multiple hash algorithm through the first storage node to perform hash calculation on the initial data block to obtain an initial key value pair; and acquiring a private key of the initiator, and encrypting the initial key value pair according to the private key to obtain a target key value pair.
Specifically, multiple hash operations are called, block hash security operations are performed according to the data size and the data security level to obtain an initial data key value pair, and then the initial key value pair is encrypted according to a private key of an initiator to obtain a target key value pair. The initial data block is converted into the key value pair, so that the storage space is saved, the key value pair is encrypted, and the data security is ensured.
Optionally, in the processing method based on the blockchain file provided in the embodiment of the present application, after the initial data block is processed by calling a multiple hash algorithm through the storage node to obtain the target key value pair, the method further includes: and calculating a target hash index of the target file through a multiple hash algorithm, wherein the target hash index is used for identifying the target file.
Specifically, besides obtaining the key value pairs by using the multiple hash algorithm, the target hash index of the target file is obtained by calculating through the multiple hash algorithm, and when the target file is subsequently inquired and accessed, the target file can be accurately obtained through the target hash index.
Optionally, in the processing method based on the blockchain file provided in the embodiment of the present application, storing the target key value pair to the target storage node according to the target storage policy includes: acquiring metadata information of a target file, wherein the metadata information represents the attribute of the target file; and calling an intelligent contract to store the metadata information, the target hash index and the target key value pair to a target storage node according to the target storage strategy.
Specifically, metadata information of the target file is obtained, the metadata information is used for expressing attribute information of the target file, and the metadata information, the target hash index and the target key value pair are stored in the target storage node by calling an intelligent contract on the block chain node according to a target storage strategy. Through the steps, each target storage node comprises the target hash index, and when the target file is inquired, the target file can be obtained through the target hash index.
Optionally, in the processing method based on blockchain files provided in the embodiment of the present application, before obtaining the transaction request for indicating to store the target file, the method further includes: acquiring a user certificate and a secret key, wherein the user certificate and the secret key represent the legal identity of an initiator; according to the user certificate and the secret key, performing authority verification on the blockchain to obtain an access certificate, wherein the access certificate is used for storing the target file and accessing the target file; and calling a storage resource interface of the block chain according to the access certificate to obtain IP and address information of all storage nodes in the block chain nodes.
Specifically, the initiator can obtain a user certificate and a key through the blockchain storage management console, call blockchain link points to perform blockchain authority authentication through the user certificate and the key, and return an access certificate; and calling a storage resource interface in the intelligent contract of the block chain through the access certificate to confirm whether a storage node exists in the block chain network, and if so, returning the IP and address information of all the storage nodes. Through the steps, the operation legality of the initiator is guaranteed, and the storage accuracy is guaranteed through the IP and the address information of the storage node.
Optionally, in the processing method based on the blockchain file provided in the embodiment of the present application, after storing the target key-value pair to the target storage node according to the target storage policy, the method further includes: carrying out Hash anchoring on the transaction behavior stored in the target file through the consensus node so as to complete consensus work; and returning a signal that the target file is successfully stored to the initiator through the consensus node.
Specifically, after the target key value pair is stored, hash security anchoring needs to be performed on a transaction behavior stored in the target file through a consensus node of the block chain node, and after the trace is successfully left, a storage success result is returned to the initiator. Through the steps, the validity of the storage transaction is determined.
Optionally, in the processing method based on blockchain files provided in the embodiment of the present application, after performing hash anchoring on a transaction behavior stored in a target file by using a consensus node to complete a consensus work, the method further includes: establishing an index key value pair by taking the target Hash index as a key and the IP of the target storage node as a value; and storing the index key value pair into a target hash table of the block chain.
Specifically, the blockchain whole network maintains a file index hash table, which is composed of key value pairs, where the key is the hash index of the target file under the hash algorithm, and the value is the IP address of the storage file (i.e. the IP of the target storage node). When inquiring, only a key (namely the target hash index) needs to be provided, so that the address of the storage node can be inquired from the table and returned to the inquiring node. Therefore, the target hash index is used as a key, the IP of the target storage node is used as a value, an index key value pair is established, and the index key value pair is stored into the target hash table of the block chain. Through the steps, when the file is inquired, the target file can be quickly obtained only by providing the target hash index, and the efficiency of obtaining the target file is further improved.
According to the processing method based on the blockchain file, the transaction request for indicating the storage target file is obtained; according to the space size occupied by the target file and the data security level, the target file is subjected to blocking processing through a storage node to obtain an initial data block, wherein the storage node I is a storage node corresponding to an initiator of a transaction request, and the data security level is used for representing the security level of data in the target file; calling a multiple hash algorithm through a first storage node to process an initial data block to obtain a target key value pair; determining a target storage strategy of the target file according to the data security level and the access efficiency of the target file; according to the target storage strategy, the target key value pair is stored to the target storage node, wherein the target storage node at least comprises a first storage node, and the problem that the efficiency of acquiring the target file is low due to the fact that the target file is acquired by using the data hash fingerprint on the link and storing the target file under the link in the related technology is solved. The method comprises the steps of obtaining an initial data block by blocking a target file, converting the initial data block into a target key value pair by utilizing a multiple Hash algorithm, determining a target storage strategy according to a data security level and the access efficiency of the target file, and storing the target key value pair on a target storage node according to the target storage strategy, so that the effect of improving the efficiency of obtaining the target file is achieved.
As shown in fig. 2, according to a flowchart of an alternative processing method based on blockchain files provided in an embodiment of the present application, a user obtains a user certificate and a key for accessing and initiating a transaction through a blockchain storage management console; performing block chain authority authentication through the block chain link points, and returning an access certificate; calling a storage resource interface in the intelligent contract of the block chain through the access certificate, confirming whether a storage node exists in the block chain network, and returning IP and address information of all the storage nodes if the storage node exists in the block chain network; a user initiates a data asset storage request to a storage node, data blocking is carried out according to the data size and the data security level, multiple Hash operations are called for carrying out blocking Hash security operations, and an initial key value pair is obtained; and carrying out data encryption on the initial key value pair by using a private key of a user to obtain a target key value pair, calling an intelligent contract to carry out chain storage on the metadata information, the target key value pair and the target hash index, carrying out hash safety anchoring after the storage, and returning a successful storage result to the user after the block chain successfully marks the stored operation.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowcharts, in some cases, the steps illustrated or described may be performed in an order different than presented herein.
The embodiment of the present application further provides a processing apparatus based on a blockchain file, and it should be noted that the processing apparatus based on a blockchain file according to the embodiment of the present application may be used to execute the processing method based on a blockchain file provided in the embodiment of the present application. The following describes a processing apparatus based on a blockchain file according to an embodiment of the present application.
Fig. 3 is a schematic diagram of a processing apparatus based on a blockchain file according to an embodiment of the present application. As shown in fig. 3, the apparatus includes: a first acquisition unit 301, a first processing unit 302, a second processing unit 303, a determination unit 304 and a first storage unit 305.
A first obtaining unit 301, configured to obtain a transaction request indicating a storage target file.
The first processing unit 302 is configured to perform blocking processing on the target file through a storage node according to the size of the space occupied by the target file and a data security level, so as to obtain an initial data block, where the storage node one is a storage node corresponding to an initiator of the transaction request, and the data security level is used to represent a security level of data in the target file.
The second processing unit 303 is configured to invoke a multiple hash algorithm to process the initial data block through the first storage node to obtain the target key value pair.
The determining unit 304 is configured to determine a target storage policy of the target file according to the data security level and the access efficiency of the target file.
The first storage unit 305 is configured to store the target key-value pair to a target storage node according to a target storage policy, where the target storage node includes at least a first storage node.
The processing apparatus based on blockchain files according to the embodiment of the present application obtains a transaction request indicating a storage target file through the first obtaining unit 301. The first processing unit 302 performs block processing on the target file through a storage node according to the size of the space occupied by the target file and the data security level, so as to obtain an initial data block, where the storage node one is a storage node corresponding to an initiator of the transaction request, and the data security level is used for representing the security level of data in the target file. The second processing unit 303 calls a multiple hash algorithm to process the initial data block through the first storage node to obtain the target key value pair. The determining unit 304 determines the target storage policy of the target file according to the data security level and the access efficiency of the target file. The first storage unit 305 stores the target key value pair to a target storage node according to a target storage policy, where the target storage node includes at least a first storage node, which solves the problem in the related art that the efficiency of acquiring the target file is low due to the fact that the target file is acquired by using a data hash fingerprint on a chain by storing the target file under the chain. The method comprises the steps of obtaining an initial data block by blocking a target file, converting the initial data block into a target key value pair by utilizing a multiple Hash algorithm, determining a target storage strategy according to a data security level and the access efficiency of the target file, and storing the target key value pair on a target storage node according to the target storage strategy, so that the effect of improving the efficiency of obtaining the target file is achieved.
Optionally, in the processing apparatus based on the blockchain file provided in the embodiment of the present application, the second processing unit 303 includes: the computing module is used for calling a multiple hash algorithm through the first storage node to perform hash computation on the initial data block to obtain an initial key value pair; and the encryption module is used for acquiring the private key of the initiator and encrypting the initial key value pair according to the private key to obtain the target key value pair.
Optionally, in the processing apparatus based on a blockchain file provided in an embodiment of the present application, the apparatus further includes: and the computing unit is used for processing the initial data block by calling the multiple hash algorithm through the first storage node to obtain a target key value pair, and then computing a target hash index of the target file through the multiple hash algorithm, wherein the target hash index is used for identifying the target file.
Optionally, in the processing apparatus based on a blockchain file provided in an embodiment of the present application, the first storage unit 305 includes: the acquisition module is used for acquiring metadata information of the target file, wherein the metadata information represents the attribute of the target file; and the calling module is used for calling the intelligent contract to store the metadata information, the target hash index and the target key value pair into the target storage node according to the target storage strategy.
Optionally, in the processing apparatus based on a blockchain file provided in an embodiment of the present application, the apparatus further includes: a second obtaining unit, configured to obtain a user certificate and a secret key before obtaining a transaction request indicating a storage target file, where the user certificate and the secret key represent a legal identity of an initiator; the verification unit is used for performing authority verification on the block chain according to the user certificate and the secret key to obtain an access certificate, wherein the access certificate is used for storing the target file and accessing the target file; and the calling unit is used for calling the storage resource interface of the block chain according to the access certificate to obtain the IP and address information of all the storage nodes in the block chain node.
Optionally, in the processing apparatus based on a blockchain file provided in an embodiment of the present application, the apparatus further includes: the third processing unit is used for performing hash anchoring on the transaction behavior stored in the target file through the consensus node after the target key value pair is stored in the target storage node according to the target storage strategy so as to complete consensus work; and the return unit is used for returning the signal that the target file is successfully stored to the initiator through the consensus node.
Optionally, in the processing apparatus based on a blockchain file provided in an embodiment of the present application, the apparatus further includes: the establishing unit is used for performing Hash anchoring on the transaction behavior stored in the target file through the consensus node so as to complete the consensus work, and then establishing an index key value pair by taking the target Hash index as a key and the IP of the target storage node as a value; and the second storage unit is used for storing the index key value pair into a target hash table of the block chain.
The processing apparatus based on the blockchain file comprises a processor and a memory, wherein the first acquiring unit 301, the first processing unit 302, the second processing unit 303, the determining unit 304, the first storing unit 305 and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more, and the storage work of the target file is realized by adjusting the kernel parameters.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
Fig. 4 is a schematic diagram of an alternative blockchain file-based processing system according to an embodiment of the present application. The system comprises a user terminal 1, a management console 2, a storage node 3, a consensus node 4 and a storage contract 5.
The user side 1 comprises various terminals held by a user, including a PC (personal computer) terminal, a mobile terminal, edge equipment, a cloud server and the like, the user can have complete authority and control access authority to other users, the user manages digital assets based on the access authority, makes data asset files and manages or stores keys according to a security scene.
The management console 2 is an interactive management platform supporting management of the blockchain consensus nodes and storage nodes in the blockchain decentralized scenario.
The storage node 3 is a decentralized trusted data storage system based on a block chain. The system is a decentralized peer-to-peer distributed block chain storage system, provides a block storage model with high throughput and addressing according to content, supports flexible capacity expansion of storage, multi-storage protocol adaptation support and point-to-point blocking safety encryption, and can provide a safe, efficient, open and low-cost multi-party shared storage network.
The consensus node 4 is a block chain alliance chain network with the characteristics of multi-party efficient consensus, strong security contract engines, reliable privacy protection, cross-chain interconnection and intercommunication and the like.
The intelligent contract 5 is stored, the core of the blockchain network is realized, so that a decentralized (distributed) blockchain system has programmability, the intelligent contract defines rules among different organizations in an executable code, and is also a computer protocol aiming at propagating verification or executing contracts in an informatization mode.
Fig. 5 is a schematic diagram of an optional storage node provided according to an embodiment of the present application. The storage node comprises a service interface module 21, a core API module 22, an interworking module 23, a data serving subsystem 24, a multiple hash subsystem 25 and a data routing subsystem 26.
The data service subsystem 24 includes a storage access gateway 241, a data operation module 242, a data monitoring module 243 and a data storage module 244. The functions of storage protocol conversion, data synchronization, data performance capacity monitoring, data persistence storage and the like are mainly realized.
The multiple hash subsystem 25 includes a data staging module 251, a multiple hash module 252, a uplink anchor module 253, and a certificate management module 254. Mainly realizes the functions of grading data security registration, realizing multiple Hash algorithms, adapting multi-block chain bottom products to intelligent contract interfaces, generating and managing certificates and the like
The data routing subsystem 26 includes modules such as security check 261, queue management 262, subscription publishing 263 and data block exchanging 264, and implements functions such as hash security detection, hash indexing, data block exchanging, subscription publishing, and the like.
As shown in fig. 6, a schematic diagram of optional stored data is provided according to an embodiment of the present application. Usually, the hash Value of the service data is used as Key, and the service data is Value. Fig. 7 is a schematic diagram of an optional consensus node provided according to an embodiment of the present application. The consensus node 3 stores data including state data 31 and chunk data 32, the state data 31 including index hasha of data assets generated by multiple hashing, hasha 1, a2 of data chunks, and the like.
The embodiment of the invention provides a processor, which is used for running a program, wherein the program runs to execute a processing method based on a block chain file.
As shown in fig. 8, an embodiment of the present invention provides an electronic device, where the device includes a processor, a memory, and a program stored in the memory and executable on the processor, and the processor executes the program to implement the following steps: acquiring a transaction request for indicating a storage target file; according to the space size occupied by the target file and the data security level, the target file is subjected to blocking processing through a storage node to obtain an initial data block, wherein the storage node I is a storage node corresponding to an initiator of a transaction request, and the data security level is used for representing the security level of data in the target file; calling a multiple hash algorithm through a first storage node to process an initial data block to obtain a target key value pair; determining a target storage strategy of the target file according to the data security level and the access efficiency of the target file; and storing the target key value pair to a target storage node according to the target storage strategy, wherein the target storage node at least comprises a first storage node.
Optionally, the first step of calling a multiple hash algorithm by the storage node to process the initial data block, and obtaining the target key value pair includes: calling a multiple hash algorithm through the first storage node to perform hash calculation on the initial data block to obtain an initial key value pair; and acquiring a private key of the initiator, and encrypting the initial key value pair according to the private key to obtain a target key value pair.
Optionally, after the initial data block is processed by the storage node by invoking the multiple hash algorithm to obtain the target key-value pair, the method further includes: and calculating a target hash index of the target file through a multiple hash algorithm, wherein the target hash index is used for identifying the target file.
Optionally, storing the target key-value pair to the target storage node according to the target storage policy includes: acquiring metadata information of a target file, wherein the metadata information represents the attribute of the target file; and calling an intelligent contract to store the metadata information, the target hash index and the target key value pair to a target storage node according to the target storage strategy.
Optionally, before obtaining the transaction request for instructing to store the target file, the method further comprises: acquiring a user certificate and a secret key, wherein the user certificate and the secret key represent the legal identity of an initiator; according to the user certificate and the secret key, performing authority verification on the blockchain to obtain an access certificate, wherein the access certificate is used for storing the target file and accessing the target file; and calling a storage resource interface of the block chain according to the access certificate to obtain IP and address information of all storage nodes in the block chain nodes.
Optionally, after storing the target key-value pair to the target storage node according to the target storage policy, the method further includes: carrying out Hash anchoring on the transaction behavior stored in the target file through the consensus node so as to complete consensus work; and returning a signal that the target file is successfully stored to the initiator through the consensus node.
Optionally, after hash-anchoring the transaction behavior stored in the target file by the consensus node to complete the consensus work, the method further comprises: establishing an index key value pair by taking the target Hash index as a key and the IP of the target storage node as a value; and storing the index key value pair into a target hash table of the block chain. The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application also provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device: acquiring a transaction request for indicating a storage target file; according to the space size occupied by the target file and the data security level, the target file is subjected to blocking processing through a storage node to obtain an initial data block, wherein the storage node I is a storage node corresponding to an initiator of a transaction request, and the data security level is used for representing the security level of data in the target file; calling a multiple hash algorithm through a first storage node to process an initial data block to obtain a target key value pair; determining a target storage strategy of the target file according to the data security level and the access efficiency of the target file; and storing the target key value pair to a target storage node according to the target storage strategy, wherein the target storage node at least comprises a first storage node.
Optionally, the first step of calling a multiple hash algorithm by the storage node to process the initial data block, and obtaining the target key value pair includes: calling a multiple hash algorithm through the first storage node to perform hash calculation on the initial data block to obtain an initial key value pair; and acquiring a private key of the initiator, and encrypting the initial key value pair according to the private key to obtain a target key value pair.
Optionally, after the initial data block is processed by the storage node by invoking the multiple hash algorithm to obtain the target key-value pair, the method further includes: and calculating a target hash index of the target file through a multiple hash algorithm, wherein the target hash index is used for identifying the target file.
Optionally, storing the target key-value pair to the target storage node according to the target storage policy includes: acquiring metadata information of a target file, wherein the metadata information represents the attribute of the target file; and calling an intelligent contract to store the metadata information, the target hash index and the target key value pair to a target storage node according to the target storage strategy.
Optionally, before obtaining the transaction request for instructing to store the target file, the method further comprises: acquiring a user certificate and a secret key, wherein the user certificate and the secret key represent the legal identity of an initiator; according to the user certificate and the secret key, performing authority verification on the blockchain to obtain an access certificate, wherein the access certificate is used for storing the target file and accessing the target file; and calling the storage resource interface of the block chain according to the access certificate to obtain the IP and address information of all storage nodes in the block chain nodes.
Optionally, after storing the target key-value pair to the target storage node according to the target storage policy, the method further includes: carrying out Hash anchoring on the transaction behavior stored in the target file through the consensus node so as to complete consensus work; and returning a signal that the target file is successfully stored to the initiator through the consensus node.
Optionally, after hash-anchoring the transaction behavior stored in the target file by the consensus node to complete the consensus work, the method further comprises: establishing an index key value pair by taking the target Hash index as a key and the IP of the target storage node as a value; and storing the index key value pair into a target hash table of the block chain.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may 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 instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may 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 flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile 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). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, 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 Discs (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 that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," 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 but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A processing method based on a block chain file is characterized by comprising the following steps:
acquiring a transaction request for indicating a storage target file;
according to the space size occupied by the target file and the data security level, partitioning the target file through a storage node to obtain an initial data block, wherein the storage node I is a storage node corresponding to an initiator of the transaction request, and the data security level is used for representing the security level of data in the target file;
calling a multiple hash algorithm through the first storage node to process the initial data block to obtain a target key value pair;
determining a target storage strategy of the target file according to the data security level and the access efficiency of the target file;
and storing the target key value pair to a target storage node according to the target storage strategy, wherein the target storage node at least comprises the first storage node.
2. The method of claim 1, wherein processing the initial data block by the storage node upon invoking a multiple hash algorithm to obtain the target key-value pair comprises:
calling the multiple hash algorithm through the first storage node to perform hash calculation on the initial data block to obtain an initial key value pair;
and acquiring a private key of the initiator, and encrypting the initial key value pair according to the private key to obtain the target key value pair.
3. The method of claim 1, wherein after processing the initial data chunk by the storage node upon invoking a multiple hash algorithm to obtain a target key-value pair, the method further comprises:
and calculating a target hash index of the target file through the multiple hash algorithm, wherein the target hash index is used for identifying the target file.
4. The method of claim 3, wherein storing the target key-value pair to a target storage node in accordance with the target storage policy comprises:
acquiring metadata information of the target file, wherein the metadata information represents the attribute of the target file;
and calling an intelligent contract to store the metadata information, the target hash index and the target key value pair to a target storage node according to the target storage strategy.
5. The method of claim 4, wherein prior to obtaining the transaction request indicating storage of the target file, the method further comprises:
obtaining a user certificate and a secret key, wherein the user certificate and the secret key represent the legal identity of the initiator;
according to the user certificate and the secret key, performing authority verification on the block chain to obtain an access certificate, wherein the access certificate is used for storing the target file and accessing the target file;
and calling a storage resource interface of the block chain according to the access certificate to obtain IP and address information of all storage nodes in the block chain nodes.
6. The method of claim 5, wherein after storing the target key-value pair to a target storage node in accordance with the target storage policy, the method further comprises:
carrying out Hash anchoring on the transaction behavior stored in the target file through a consensus node so as to complete consensus work;
and returning a signal that the target file is successfully stored to the initiator through the consensus node.
7. The method of claim 6, wherein after hash-anchoring the transaction behavior of the target file store by a consensus node to complete consensus work, the method further comprises:
establishing an index key value pair by taking the target hash index as a key and the IP of the target storage node as a value;
and storing the index key value pair into a target hash table of the block chain.
8. A processing apparatus based on a blockchain file, comprising:
a first acquisition unit configured to acquire a transaction request indicating a storage target file;
the first processing unit is used for carrying out blocking processing on the target file through a storage node according to the space size occupied by the target file and the data security level to obtain an initial data block, wherein the first storage node is a storage node corresponding to an initiator of the transaction request, and the data security level is used for representing the security level of data in the target file;
the second processing unit is used for processing the initial data block by calling a multiple hash algorithm through the first storage node to obtain a target key value pair;
the determining unit is used for determining a target storage strategy of the target file according to the data security level and the access efficiency of the target file;
and the first storage unit is used for storing the target key-value pair to a target storage node according to the target storage policy, wherein the target storage node at least comprises the first storage node.
9. A processor, configured to execute a program, wherein the program executes to perform the processing method based on the blockchain file according to any one of claims 1 to 7.
10. An electronic device comprising one or more processors and memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the block chain file-based processing method of any one of claims 1 to 7.
CN202210297182.8A 2022-03-24 2022-03-24 Processing method and device based on block chain file, processor and electronic equipment Pending CN114880300A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210297182.8A CN114880300A (en) 2022-03-24 2022-03-24 Processing method and device based on block chain file, processor and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210297182.8A CN114880300A (en) 2022-03-24 2022-03-24 Processing method and device based on block chain file, processor and electronic equipment

Publications (1)

Publication Number Publication Date
CN114880300A true CN114880300A (en) 2022-08-09

Family

ID=82667640

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210297182.8A Pending CN114880300A (en) 2022-03-24 2022-03-24 Processing method and device based on block chain file, processor and electronic equipment

Country Status (1)

Country Link
CN (1) CN114880300A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115225640A (en) * 2022-09-20 2022-10-21 卓望数码技术(深圳)有限公司 CDN trusted digital content supervision method and system based on block chain

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115225640A (en) * 2022-09-20 2022-10-21 卓望数码技术(深圳)有限公司 CDN trusted digital content supervision method and system based on block chain

Similar Documents

Publication Publication Date Title
CN113157648A (en) Block chain based distributed data storage method, device, node and system
CN102170440A (en) Method suitable for safely migrating data between storage clouds
CN113079200A (en) Data processing method, device and system
CN111931199A (en) Health authentication method, equipment and medium based on block chain and dynamic code
CN106899564B (en) Login method and device
CN110839002B (en) Cloud account opening, authentication and access method and device
CN110992035A (en) Block chain link point management method, device and system
CN114880697A (en) Block chain-based data fingerprint generation method and device and storage medium
CN114528601B (en) Access method and device based on block chain data, processor and electronic equipment
CN114500119B (en) Method and device for calling block chain service
CN111245897A (en) Data processing method, device, system, storage medium and processor
CN114880300A (en) Processing method and device based on block chain file, processor and electronic equipment
Liao et al. Last-hdfs: Location-aware storage technique for hadoop distributed file system
CN115766173A (en) Data processing method, system and device
CN113285952B (en) Network vulnerability plugging method, device, storage medium and processor
CN115048672A (en) Data auditing method and device based on block chain, processor and electronic equipment
CN114968088A (en) File storage method, file reading method and device
CN111988356B (en) File transmission method, equipment and medium
CN115118434A (en) Key management method and device based on block chain
CN114491455A (en) Method and device for directory authorization, processor and electronic equipment
Inamdar et al. Data Security in Hadoop Distributed File System
CN114979996B (en) Business card generation method and device based on SIM card and electronic equipment
KR20190048228A (en) Method for generating non-deterministic data in blockchain-based system
CN115203676B (en) Database connection method, database connection device, proxy server and medium
CN116032469A (en) Key updating method, device and system

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