CN114116710A - Data processing method, device and equipment based on block chain and storage medium - Google Patents

Data processing method, device and equipment based on block chain and storage medium Download PDF

Info

Publication number
CN114116710A
CN114116710A CN202111360986.XA CN202111360986A CN114116710A CN 114116710 A CN114116710 A CN 114116710A CN 202111360986 A CN202111360986 A CN 202111360986A CN 114116710 A CN114116710 A CN 114116710A
Authority
CN
China
Prior art keywords
data
target
storage
target uplink
uplink data
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
CN202111360986.XA
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.)
Eversec Beijing Technology Co Ltd
Original Assignee
Eversec Beijing Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Eversec Beijing Technology Co Ltd filed Critical Eversec Beijing Technology Co Ltd
Priority to CN202111360986.XA priority Critical patent/CN114116710A/en
Publication of CN114116710A publication Critical patent/CN114116710A/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/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a data processing method, a device, equipment and a storage medium based on a block chain. The method comprises the following steps: receiving target uplink data and acquiring the stored data volume of the target uplink data; under the condition that the stored data volume is determined to be larger than the data volume threshold value, storing the target uplink data into a first storage system, and acquiring the stored identification data of the target uplink data according to the storage result of the first storage system on the target uplink data; and storing the storage identification data into each blockchain node of the target blockchain network. The embodiment of the invention can realize safe storage of data occupying a large storage space, greatly save the storage resource of the block chain system and improve the utilization efficiency of the block chain system.

Description

Data processing method, device and equipment based on block chain and storage medium
Technical Field
The embodiment of the invention relates to the technical field of block chains, in particular to a data processing method, a data processing device, data processing equipment and a storage medium based on a block chain.
Background
The blockchain is a distributed database system participated by nodes, and is characterized by being unchangeable and unforgeable. Blocks are composed of a string of cryptographically generated data blocks, each block containing a Hash value of the previous block, connected to the current block starting from the starting block, forming a chain of blocks, each block being guaranteed to be generated after the previous block in chronological order.
In the prior art, data is stored in a blockchain, and for the purpose of ensuring data integrity and preventing tampering, each node needs to store a complete copy of data, and when data of one node is lost or modified, the complete data can be obtained from the other nodes.
However, in the above prior art, since all nodes need to store a complete piece of data, as the data volume continuously increases, the storage space occupied by the nodes also continuously increases, which causes huge storage resource consumption and carrying burden on the computer bearing the nodes.
Disclosure of Invention
Embodiments of the present invention provide a data processing method, an apparatus, a device, and a storage medium based on a blockchain, so as to implement secure storage of data occupying a large storage space, greatly save storage resources of a blockchain system, and improve utilization efficiency of the blockchain system.
In a first aspect, an embodiment of the present invention provides a data processing method based on a block chain, including:
receiving target uplink data and acquiring the stored data volume of the target uplink data;
under the condition that the stored data volume is determined to be larger than a data volume threshold value, storing the target uplink data to a first storage system, and acquiring the stored identification data of the target uplink data according to the storage result of the first storage system on the target uplink data;
and storing the storage identification data into each block chain node of the target block chain network.
In a second aspect, an embodiment of the present invention further provides a data processing apparatus based on a block chain, including:
a data receiving module, configured to receive target uplink data and obtain a data amount stored in the target uplink data;
a data storage module, configured to store the target uplink data in a first storage system and obtain storage identifier data of the target uplink data according to a storage result of the target uplink data by the first storage system, when it is determined that the stored data amount is greater than a data amount threshold;
and the identification uplink module is used for storing the storage identification data into each block chain node of the target block chain network.
In a third aspect, an embodiment of the present invention further provides a computer device, where the computer device includes:
one or more processors;
storage means for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors implement the method for processing data based on a blockchain according to any embodiment of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a computer storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the data processing method based on the blockchain provided in any embodiment of the present invention.
The embodiment of the invention receives the target uplink data which needs to be stored by the target block chain network and acquires the stored data volume of the target uplink data, stores the target uplink data into the first storage system under the condition that the stored data volume is determined to be larger than the data volume threshold, and acquires the stored identification data of the target uplink data according to the storage result of the target uplink data by the first storage system, so that the stored identification data is stored into each block chain node of the target block chain network, the problems of storage resource consumption and node equipment carrying burden caused by the fact that data are stored to each block chain node in a redundant manner in the prior art are solved, the storage resources of the block chain system are greatly saved while the data occupying a large storage space are safely stored, and the utilization efficiency of the block chain system is improved.
Drawings
Fig. 1 is a flowchart of a data processing method based on a block chain according to an embodiment of the present invention.
Fig. 2 is a flowchart of a data processing method based on a block chain according to a second embodiment of the present invention.
Fig. 3 is a flowchart illustrating a data processing method based on a block chain according to a second embodiment of the present invention.
Fig. 4 is a schematic structural diagram of a data processing apparatus based on a block chain according to a third embodiment of the present invention.
Fig. 5 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention.
It should be further noted that, for the convenience of description, only some but not all of the relevant aspects of the present invention are shown in the drawings. Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Example one
Fig. 1 is a flowchart of a data processing method based on a blockchain according to an embodiment of the present invention, where the present embodiment is applicable to a case where data is stored based on a target blockchain network, and the method may be executed by a data processing apparatus based on a blockchain according to an embodiment of the present invention, where the apparatus may be implemented by software and/or hardware, and may be generally integrated in a computer device. Accordingly, as shown in fig. 1, the method comprises the following operations:
s110, receiving the target uplink data and obtaining the stored data volume of the target uplink data.
The target uplink data may be any data that needs to be stored through the blockchain network. The amount of stored data may be the size of the memory space that the target uplink data needs to occupy.
Accordingly, if there is target uplink data that needs to be stored through the blockchain network, for example, the target uplink data can be written into the blockchain network by any user or any program associated with the blockchain network, the target uplink data can be received, so that the stored data amount of the target uplink data can be further obtained. Specifically, the stored data amount of the target uplink data may be obtained in any implementable manner, which is not limited herein. For example, the target uplink data may be various types of data such as transactions, smart contract calls, character strings, files, pictures, and the like, and the data size of the target uplink data may be calculated as the stored data size of the target uplink data.
It should be noted that the block chain-based data processing apparatus for implementing the method provided in the embodiment of the present invention may be deployed relatively independently from any block chain network, and may perform data read-write access to the block chain network, and when any user or any program associated with the block chain network writes target uplink data into the block chain network, the target uplink data is received by the block chain-based data processing apparatus, and the target uplink data cannot be directly received or uplinked by the block chain network.
And S120, storing the target uplink data to a first storage system under the condition that the stored data volume is determined to be larger than a data volume threshold, and acquiring the stored identification data of the target uplink data according to the storage result of the first storage system on the target uplink data.
The threshold of data amount may be a maximum amount of memory that can be consumed by the blockchain network to store a single target uplink data. The first storage system may be a data storage system independent of the blockchain network. The stored result may be data describing a storage situation of the target uplink data in the first storage system, and different target uplink data stored in the first storage system correspond to different stored results. The stored identification data may be data uniquely representing the target uplink data, which is determined according to the storage result of the target uplink data in the first storage system.
Accordingly, the threshold of the data amount may be predetermined according to the total available storage space in the block chain node, the total data amount that needs to be stored in the block chain node, and the performance requirement of the block chain node, which are not limited herein. If the stored data volume of the target uplink data is greater than the data volume threshold, it can be said that the storage space occupied by the target uplink data exceeds the maximum storage space that can be consumed by the block-link point for storing a single target uplink data, and the target uplink data cannot be stored into the block-link point.
Therefore, the target uplink data can be stored to the first storage system. The first storage system may be pre-deployed, has a capability of storing larger data, may be relatively independent from a blockchain network that originally needs to store target uplink data, and the data processing apparatus based on the blockchain may perform data read-write access to the first storage system. After the first storage system stores the target uplink data, a storage result can be obtained according to the storage condition of the target uplink data, so that the storage identification data of the target uplink data can be obtained according to the storage result, the storage identification data can uniquely represent the target uplink data, and further, the storage result of the target uplink data in the first storage system can be determined according to the storage identification data, so that the target uplink data can be obtained in the first storage system according to the storage result.
It should be noted that, after storing any target uplink data, the first storage system can only obtain the target uplink data in the first storage system based on the stored result of the target uplink data, so as to ensure the security of the target uplink data stored in the first storage system.
In an optional embodiment of the present invention, the storing the target uplink data in a first storage system, and obtaining the stored identification data of the target uplink data according to the storage result of the target uplink data in the first storage system may include: carrying out fragmentation processing on the target uplink data according to the stored data volume to obtain target fragmentation data; storing each target fragment data to the first storage system, so that the first storage system performs distributed storage on the target fragment data and generates fragment identification data of each target fragment data respectively; and acquiring all the fragment identification data, and generating the storage identification data of the target uplink data according to all the fragment identification data.
The fragmentation processing may be an operation of dividing the whole data into a plurality of data fragments by using any realizable algorithm. The target fragment data may be all data fragments obtained by fragmentation of the target uplink data. The shard identification data may be data that uniquely represents each target shard data in the first storage system.
Correspondingly, according to the stored data volume of the target uplink data, it may be determined whether the target uplink data needs to be fragmented and then distributed stored in the first storage system, and it may also be determined a specific policy for performing fragmentation on the target uplink data, which may be determined according to the performance and storage requirement of the first storage system, and is not limited herein. After fragmentation processing of the target uplink data is determined according to the amount of the stored data, the target uplink data can be segmented into a plurality of target fragmented data through fragmentation processing, and each target fragmented data is stored in a first storage system in a distributed manner, that is, the first storage system can be a decentralized storage space, and each target fragmented data can be stored in different nodes of the first storage system respectively, so that storage space consumption of a single node is reduced.
Further, after the first storage space stores any target fragment data, fragment identification data of the target fragment data may be generated, and the fragment identification data may be used to uniquely represent the target fragment data in the first storage system. Therefore, all the fragment identification data can be acquired, and the uniquely determined storage identification data is generated according to all the fragment identification data, so that the storage identification data can uniquely correspond to all the fragment identification data, and thus, according to each fragment identification data, each target fragment data can uniquely correspond to each target fragment data in the first storage system, all the target fragment data can form target uplink data, that is, the storage identification data can uniquely represent the target uplink data.
In an alternative embodiment of the invention, the first storage System may be an IPFS (Inter planet File System).
The IPFS adopts a distributed storage protocol, can store a plurality of data in a distributed mode based on the protocol, does not depend on a central node, and has the natural disaster prevention characteristic. The IPFS stores the target uplink data, can calculate the Hash value of the target uplink data, and can automatically identify and store only one copy of the target uplink data when the contents of a plurality of copies of the target uplink data are the same, so that the space is greatly saved.
Correspondingly, if the stored data volume of the target uplink data is large, the IPFS can automatically segment the target uplink data through an algorithm, store the data segments to different nodes respectively, and automatically feed back the Hash value corresponding to the target uplink data according to the storage result of the data segments.
Furthermore, in the multi-node, the retrieval is carried out only by the Hash value of the storage content, so that the data is effectively prevented from being tampered. And aiming at the target uplink data which is stored in the multiple nodes after being segmented in the IPFS, the multiple nodes can be searched in parallel, and all the segments are searched and combined at the same time. The IPFS can resist a large number of data read-write requests, automatically disperse the large number of data read-write requests to multiple nodes, and further improve the data storage efficiency and the retrieval efficiency.
And S130, storing the storage identification data into each block chain node of the target block chain network.
The target blockchain network may be a blockchain network that originally needs to store the target uplink data.
Correspondingly, after the storage identification data of the target uplink data is obtained, the storage identification data can be stored in each block chain node of the target block chain network, and the target block chain network can realize the safe storage of the storage identification data based on each block chain node.
Therefore, since the stored identification data of the target uplink data can be safely stored in each blockchain node of the blockchain network, and the target uplink data can be obtained only by the corresponding stored identification data, although the target uplink data is actually stored in the first storage system, the blockchain network realizes storage of the target uplink data at the same safety degree by safely storing the stored identification data, and simultaneously avoids the target uplink data from occupying too large storage space when being stored in the blockchain node.
The embodiment of the invention provides a data processing method based on a block chain, which comprises the steps of receiving target uplink data needing to be stored by a target block chain network and obtaining the stored data volume of the target uplink data, in the case that the data storage amount is determined to be larger than the data amount threshold value, storing the target uplink data to the first storage system, and obtaining the storage identification data of the target uplink data according to the storage result of the first storage system to the target uplink data, therefore, the storage identification data is stored in each block chain node of the target block chain network, the problems of storage resource consumption and overlarge carrying burden of node equipment caused by the fact that the data are redundantly stored in each block chain node in the prior art are solved, the data occupying a large storage space is safely stored, the storage resource of the block chain system is greatly saved, and the utilization efficiency of the block chain system is improved.
Example two
Fig. 2 is a flowchart of a data processing method based on a block chain according to a second embodiment of the present invention. The embodiment of the present invention is further developed based on the above embodiment, and in the embodiment of the present invention, an alternative implementation manner of retrieving the target retrieval data from the target uplink data stored in the first storage system according to the data retrieval request of the user is provided.
As shown in fig. 2, the method of the embodiment of the present invention specifically includes:
s210, receiving the target uplink data and obtaining the stored data volume of the target uplink data.
S220, judging whether the stored data amount is larger than a data amount threshold value, if so, executing S230-S240, otherwise, executing S250.
S230, storing the target uplink data to a first storage system, and obtaining the storage identification data of the target uplink data according to the storage result of the target uplink data by the first storage system.
In an optional embodiment of the present invention, before the storing the target uplink data in the first storage system, the method may further include: acquiring encryption algorithm parameters corresponding to the target uplink data; and encrypting the target uplink data according to the encryption algorithm parameters.
The encryption algorithm parameter may be a parameter for determining an encryption method for the target uplink data. The encryption process may be an operation of encrypting the target uplink data according to an encryption method determined by the encryption algorithm parameter.
Correspondingly, before the target uplink data is stored in the first storage system, the target uplink data can be encrypted, so that when the storage identification data of the target uplink data is leaked, the encrypted target uplink data can be acquired only in the first storage system by the storage identification data, the specific content of the target uplink data cannot be acquired, and the safety of the target uplink data is further improved. Specifically, encryption algorithm parameters corresponding to the target uplink data can be obtained, and a specific strategy for encrypting the target uplink data is determined according to the encryption algorithm parameters, so that the target uplink data is encrypted. The encryption algorithm parameter may be preset, or may be sent by the user or an associated program when the user or the associated program sends the target uplink data for storage, which is not limited herein.
In an optional embodiment of the present invention, the obtaining of the encryption algorithm parameter corresponding to the target uplink data may include: determining a target type encryption algorithm according to the encryption setting operation of the user on the target uplink data; acquiring a user key parameter matched with the target type encryption algorithm; the encrypting the target uplink data according to the encryption algorithm parameter includes: and according to the user key parameter, carrying out encryption processing on the target uplink data by adopting the target type encryption algorithm.
The encryption setting operation may be an operation for setting the type of encryption algorithm used for the target uplink data by the user. The target type encryption algorithm may be an encryption algorithm of a type set by a user through an encryption setting operation. The user key parameter may be a key that needs to be provided by the user when performing encryption processing using the target-type encryption algorithm.
Correspondingly, the user can set a target type encryption algorithm used for encrypting the target uplink data through encryption setting operation, and the user key parameter provided by the user required for encryption processing can be determined according to the target type encryption algorithm. Different target type encryption algorithms may be matched with different types or formats of user key parameters. The user key parameter may be preset by the user, may be sent together with the target uplink data, or may be provided when performing an encryption setting operation, which is not limited herein.
Further, after the target type encryption algorithm and the matched user key parameter are determined, the target type encryption algorithm can be used for encrypting the target uplink data according to the user key parameter, the encrypted target uplink data is stored in the first storage system, and after the encrypted target uplink data is retrieved in the first storage system according to the stored identification data, corresponding decryption processing needs to be performed according to the user key parameter, so that the real content of the target uplink data can be obtained.
Optionally, the target type encryption algorithm may include at least one of a symmetric encryption algorithm, an asymmetric encryption algorithm, and an encryption packing compression algorithm; correspondingly, the user key parameter matched with the symmetric encryption algorithm can be a key with a specified length, the user key parameter matched with the asymmetric encryption algorithm can comprise a public key and a private key, and the user key parameter matched with the encryption packing compression algorithm can be a character string with a user-defined length.
The symmetric Encryption algorithm may include, for example, AES (Advanced Encryption Standard) and SM4 cryptographic algorithms, and the symmetric Encryption algorithm uses the same key in Encryption and decryption, so that the key needs to be submitted in both storing data and querying data. Asymmetric encryption algorithms, which may include, for example, RSA (Rivest-Shamir-Adleman, li witter-samell-aldman) algorithm and SM2 cryptographic algorithm, are not the same key used for encryption and decryption, and need to be submitted separately; when data is stored, a public key needs to be specified in the parameter, and when data is acquired, a private key needs to be specified in the parameter. The encryption and packaging compression algorithm can utilize the tar and openssl commands of the server and attach-k parameters to encrypt and package and compress submitted data, the encryption and decryption use the same key, and the key needs to be submitted when the data is stored and inquired.
And S240, storing the storage identification data into each block chain node of the target block chain network.
In an optional embodiment of the present invention, the storing the storage identification data in each blockchain node of the target blockchain network may include: acquiring data attribute parameters of the target uplink data; and correspondingly storing the data attribute parameters and the storage identification data into each block chain node of the target block chain network.
The data attribute parameter may be a parameter describing any attribute of the target uplink data.
Accordingly, any data attribute may be extracted for the target uplink data, such as the data type and data source of the target uplink data, and the data attribute parameters of the target uplink data may be obtained. When the storage identification data of the target uplink data is stored in the block chain link node, the data attribute parameters of the storage identification data can be correspondingly stored, and the storage data identification stored in the block chain link node can be uniquely represented according to the data attribute parameters of the target uplink data.
And S250, storing the target uplink data into each block chain node of the target block chain network.
Correspondingly, if the stored data volume of the target uplink data is less than or equal to the data volume threshold, it may be indicated that the storage space occupied by the target uplink data is small, and the storage space of any blockchain node may directly store the target uplink data, and may store the target uplink data into each blockchain node of the target blockchain network.
S260, receiving a data retrieval request sent by a user for retrieving the target retrieval data.
The target retrieval data may be data that a user needs to obtain in the target blockchain network. The data retrieval request may be data for retrieving and acquiring target retrieval data.
Correspondingly, when a user needs to acquire any data stored based on the blockchain network, a data retrieval request can be sent to retrieve and acquire the required target retrieval data. The data retrieval request may include any data that may uniquely represent the target retrieval data in the target block chain network, and may be determined according to a method for distinguishing and marking different data stored in the block chain node, which is not limited herein.
S270, determining target storage identification data of the target retrieval data according to the data retrieval request.
The target storage identification data may be storage identification data matched with the data retrieval request, which is determined from all storage identification data stored in the block chain node according to the data retrieval request.
Correspondingly, according to the description of the data retrieval request, retrieval can be performed in the target block chain network, so that the target storage identification data described by the target retrieval data is determined according to the distinguishing marks of all the storage identification data stored in the target block chain network.
In an optional embodiment of the present invention, the determining target storage identification data of the target retrieval data according to the data retrieval request may include: acquiring retrieval request parameters in the data retrieval request; acquiring a target data attribute parameter consistent with the retrieval request parameter from all the data attribute parameters in the block chain nodes; and acquiring the target storage identification data corresponding to the target data attribute parameters in the block chain nodes.
The retrieval request parameter may be data describing an attribute of the target retrieval data, and may uniquely represent the target retrieval data in the target blockchain network. The target data attribute parameter may be a data attribute parameter that is consistent with the search request parameter among all data attribute parameters in the blockchain nodes, and is stored in each blockchain node of the target blockchain network in correspondence with the target storage identification data.
Correspondingly, if the data attribute parameters of the target uplink data are correspondingly stored when the block link points of the target block chain network store the storage identification data of the target uplink data, the data retrieval request sent by the user may include a retrieval request parameter, so as to obtain the target data attribute parameter consistent with the retrieval request parameter in the target block chain network according to the retrieval request parameter, thereby obtaining the target storage identification data stored in the target block chain network corresponding to the target data attribute parameter, where the target storage identification data is the storage identification data corresponding to the storage condition of the target retrieval data in the first storage system.
S280, searching the target uplink data corresponding to the target storage identifier data in the first storage system storage, and determining the searched target uplink data as the target search data to be fed back to the user.
Correspondingly, the target storage identification data can uniquely represent the target retrieval data in the first storage system, and then the target uplink data corresponding to the target storage identification data is queried in the first storage system according to the target storage identification data, namely the target retrieval data is the target retrieval data, and the queried target retrieval data is fed back to the user so as to respond to the data query request of the user.
In an optional embodiment of the present invention, after receiving a data retrieval request sent by a user to retrieve target retrieval data, the method may further include: and acquiring the target retrieval data from all the target uplink data stored in the target block chain network according to the data retrieval request.
Correspondingly, the target retrieval data acquired by the user may also be stored data volume that is less than or equal to the data volume threshold, so as to be directly stored in each blockchain node of the target blockchain network, and then the target retrieval data may be directly acquired in all target uplink data stored in the target blockchain network according to the data retrieval request.
It should be noted that, in the embodiment of the present invention, the execution sequence between S260 to S280 and S210 to S250 is not limited, S260 to S280 may be executed in any case where a user needs to search for data stored based on the blockchain network, S210 to S250 may be executed in any case where a user needs to store data based on the blockchain network, and the relationship between the execution processes of S260 to S280 and S210 to S250 is not limited.
Fig. 3 is a schematic flowchart of a data processing method based on a blockchain according to a second embodiment of the present invention. In a specific example, as shown in fig. 3, the data processing method based on the block chain according to the embodiment of the present invention may be executed by a background server. The method comprises the following steps that (1) the method is optional in advance, a user can select an encryption mode, and if the symmetric encryption mode is selected, a secret key with a specified length is submitted to a background server; if the asymmetric encryption mode is selected, submitting two parameters of a public key and a private key to a background server; if the encryption and packaging compression mode is selected, the character string with the self-defined length is submitted to a background server. Optionally, the user may also dynamically set the data amount threshold.
When a user needs to store a file based on the block chain, the file is submitted to a background server. The background server can calculate the size of the data volume, compare the data volume with a set threshold value, and if a file with the size lower than the threshold value is received, directly uplink the file; if the file higher than the threshold value is received, encrypting the file according to an encryption algorithm selected by a user in advance, storing the encrypted file data into an IPFS (Internet protocol file system), returning a Hash value to the IPFS, and storing the received Hash value into a block chain by the background server.
When a user needs to query a file stored based on the block chain, a query request is sent to a background server, and the background server can obtain a data Hash value from the block chain system and obtain encrypted data from an IPFS according to the Hash. The background server side can decrypt the acquired data according to the encryption algorithm selected by the user and return the decryption result to the user.
In the process of storing or querying data by the user, the user does not need to be aware of the existence of the first storage system IPFS, and the actual storage location of the data does not need to be known by the user, so that the security of storing the data in the first storage system is further ensured.
The embodiment of the invention provides a data processing method based on a block chain, which comprises the steps of receiving target uplink data needing to be stored by a target block chain network and obtaining the stored data volume of the target uplink data, in the case that the data storage amount is determined to be larger than the data amount threshold value, storing the target uplink data to the first storage system, and obtaining the storage identification data of the target uplink data according to the storage result of the first storage system to the target uplink data, therefore, the storage identification data is stored in each block chain node of the target block chain network, the problems of storage resource consumption and overlarge carrying burden of node equipment caused by the fact that the data are redundantly stored in each block chain node in the prior art are solved, the data occupying a large storage space is safely stored, the storage resource of the block chain system is greatly saved, and the utilization efficiency of the block chain system is improved; furthermore, the storage identification data of the target retrieval data is determined according to the data retrieval request of the user, so that the target retrieval data is automatically acquired in the first storage system according to the storage identification data and fed back to the user, the actual storage position of the data hidden by the user accessing the data is realized, and the safety of data storage is further improved.
EXAMPLE III
Fig. 4 is a schematic structural diagram of a data processing apparatus based on a block chain according to a third embodiment of the present invention, as shown in fig. 4, the apparatus includes: a data receiving module 310, a data storing module 320 and an IDLE module 330.
The data receiving module 310 is configured to receive target uplink data and obtain a data amount of the target uplink data.
A data storing module 320, configured to store the target uplink data in a first storage system and obtain the storage identifier data of the target uplink data according to the storage result of the target uplink data in the first storage system when it is determined that the stored data amount is greater than the data amount threshold.
An id uplink module 330, configured to store the stored id data in each blockchain node of the target blockchain network.
In an optional implementation of the embodiment of the present invention, the apparatus further comprises: the retrieval request module is used for receiving a data retrieval request sent by a user for retrieving target retrieval data; the identification retrieval module is used for determining target storage identification data of the target retrieval data according to the data retrieval request; and the data retrieval module is used for inquiring the target uplink data corresponding to the target storage identification data in the first storage system storage, and determining the inquired target uplink data as the target retrieval data to be fed back to the user.
In an optional implementation manner of the embodiment of the present invention, the ul identifier module 330 may be specifically configured to: acquiring data attribute parameters of the target uplink data; and correspondingly storing the data attribute parameters and the storage identification data into each block chain node of the target block chain network.
In an optional implementation manner of the embodiment of the present invention, the identifier retrieving module may be specifically configured to: acquiring retrieval request parameters in the data retrieval request; acquiring a target data attribute parameter consistent with the retrieval request parameter from all the data attribute parameters in the block chain nodes; and acquiring the target storage identification data corresponding to the target data attribute parameters in the block chain nodes.
In an optional implementation manner of the embodiment of the present invention, the data storage module 320 may be further configured to, before the storing the target uplink data in the first storage system, obtain an encryption algorithm parameter corresponding to the target uplink data; and encrypting the target uplink data according to the encryption algorithm parameters.
In an optional implementation manner of the embodiment of the present invention, the data storage module 320 may be specifically configured to: determining a target type encryption algorithm according to the encryption setting operation of the user on the target uplink data; acquiring a user key parameter matched with the target type encryption algorithm; and according to the user key parameter, carrying out encryption processing on the target uplink data by adopting the target type encryption algorithm.
In an optional implementation manner of the embodiment of the present invention, the data storage module 320 may be specifically configured to: carrying out fragmentation processing on the target uplink data according to the stored data volume to obtain target fragmentation data; storing each target fragment data to the first storage system, so that the first storage system performs distributed storage on the target fragment data and generates fragment identification data of each target fragment data respectively; and acquiring all the fragment identification data, and generating the storage identification data of the target uplink data according to all the fragment identification data.
The device can execute the data processing method based on the block chain provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects for executing the method.
The embodiment of the invention provides a data processing device based on a block chain, which receives target uplink data needing to be stored by a target block chain network and obtains the stored data volume of the target uplink data, in the case that the data storage amount is determined to be larger than the data amount threshold value, storing the target uplink data to the first storage system, and obtaining the storage identification data of the target uplink data according to the storage result of the first storage system to the target uplink data, therefore, the storage identification data is stored in each block chain node of the target block chain network, the problems of storage resource consumption and overlarge carrying burden of node equipment caused by the fact that the data are redundantly stored in each block chain node in the prior art are solved, the data occupying a large storage space is safely stored, the storage resource of the block chain system is greatly saved, and the utilization efficiency of the block chain system is improved.
Example four
Fig. 5 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention. FIG. 5 illustrates a block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention. The computer device 12 shown in FIG. 5 is only an example and should not bring any limitations to the functionality or scope of use of embodiments of the present invention.
As shown in FIG. 5, computer device 12 is in the form of a general purpose computing device. The components of computer device 12 may include, but are not limited to: one or more processors 16, a memory 28, and a bus 18 that connects the various system components (including the memory 28 and the processors 16).
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Computer device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by computer device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. Computer device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 5, and commonly referred to as a "hard drive"). Although not shown in FIG. 5, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Computer device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with computer device 12, and/or with any devices (e.g., network card, modem, etc.) that enable computer device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, computer device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via network adapter 20. As shown, network adapter 20 communicates with the other modules of computer device 12 via bus 18. It should be appreciated that although not shown in FIG. 5, other hardware and/or software modules may be used in conjunction with computer device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processor 16 executes various functional applications and data processing by running programs stored in the memory 28, thereby implementing the method provided by the embodiment of the present invention: receiving target uplink data and acquiring the stored data volume of the target uplink data; under the condition that the stored data volume is determined to be larger than a data volume threshold value, storing the target uplink data to a first storage system, and acquiring the stored identification data of the target uplink data according to the storage result of the first storage system on the target uplink data; and storing the storage identification data into each block chain node of the target block chain network.
EXAMPLE five
Fifth embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where when the computer program is executed by a processor, the computer program implements a method provided in the fifth embodiment of the present invention: receiving target uplink data and acquiring the stored data volume of the target uplink data; under the condition that the stored data volume is determined to be larger than a data volume threshold value, storing the target uplink data to a first storage system, and acquiring the stored identification data of the target uplink data according to the storage result of the first storage system on the target uplink data; and storing the storage identification data into each block chain node of the target block chain network.
Any combination of one or more computer-readable media may be employed. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or computer device. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A data processing method based on a block chain is characterized by comprising the following steps:
receiving target uplink data and acquiring the stored data volume of the target uplink data;
under the condition that the stored data volume is determined to be larger than a data volume threshold value, storing the target uplink data to a first storage system, and acquiring the stored identification data of the target uplink data according to the storage result of the first storage system on the target uplink data;
and storing the storage identification data into each block chain node of the target block chain network.
2. The method of claim 1, further comprising:
receiving a data retrieval request sent by a user for retrieving target retrieval data;
determining target storage identification data of the target retrieval data according to the data retrieval request;
and searching the target uplink data corresponding to the target storage identification data in the first storage system storage, and determining the searched target uplink data as the target retrieval data to be fed back to the user.
3. The method of claim 2, wherein storing the storage identification data in each blockchain node of a target blockchain network comprises:
acquiring data attribute parameters of the target uplink data;
and correspondingly storing the data attribute parameters and the storage identification data into each block chain node of the target block chain network.
4. The method of claim 3, wherein determining target storage identification data for the target retrieval data according to the data retrieval request comprises:
acquiring retrieval request parameters in the data retrieval request;
acquiring a target data attribute parameter consistent with the retrieval request parameter from all the data attribute parameters in the block chain nodes;
and acquiring the target storage identification data corresponding to the target data attribute parameters in the block chain nodes.
5. The method of claim 1, further comprising, prior to said storing said target uplink data to a first storage system:
acquiring encryption algorithm parameters corresponding to the target uplink data;
and encrypting the target uplink data according to the encryption algorithm parameters.
6. The method of claim 5 wherein said obtaining encryption algorithm parameters corresponding to said target uplink data comprises:
determining a target type encryption algorithm according to the encryption setting operation of the user on the target uplink data;
acquiring a user key parameter matched with the target type encryption algorithm;
the encrypting the target uplink data according to the encryption algorithm parameter includes:
and according to the user key parameter, carrying out encryption processing on the target uplink data by adopting the target type encryption algorithm.
7. The method of claim 1 wherein said storing said target uplink data in a first storage system and obtaining stored identification data of said target uplink data based on a result of said storing said target uplink data in said first storage system comprises:
carrying out fragmentation processing on the target uplink data according to the stored data volume to obtain target fragmentation data;
storing each target fragment data to the first storage system, so that the first storage system performs distributed storage on the target fragment data and generates fragment identification data of each target fragment data respectively;
and acquiring all the fragment identification data, and generating the storage identification data of the target uplink data according to all the fragment identification data.
8. A blockchain-based data processing apparatus, comprising:
a data receiving module, configured to receive target uplink data and obtain a data amount stored in the target uplink data;
a data storage module, configured to store the target uplink data in a first storage system and obtain storage identifier data of the target uplink data according to a storage result of the target uplink data by the first storage system, when it is determined that the stored data amount is greater than a data amount threshold;
and the identification uplink module is used for storing the storage identification data into each block chain node of the target block chain network.
9. A computer device, characterized in that the computer device comprises:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the blockchain-based data processing method of any one of claims 1-7.
10. A computer storage medium on which a computer program is stored which, when being executed by a processor, carries out a method for blockchain-based data processing according to any one of claims 1 to 7.
CN202111360986.XA 2021-11-17 2021-11-17 Data processing method, device and equipment based on block chain and storage medium Pending CN114116710A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111360986.XA CN114116710A (en) 2021-11-17 2021-11-17 Data processing method, device and equipment based on block chain and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111360986.XA CN114116710A (en) 2021-11-17 2021-11-17 Data processing method, device and equipment based on block chain and storage medium

Publications (1)

Publication Number Publication Date
CN114116710A true CN114116710A (en) 2022-03-01

Family

ID=80396225

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111360986.XA Pending CN114116710A (en) 2021-11-17 2021-11-17 Data processing method, device and equipment based on block chain and storage medium

Country Status (1)

Country Link
CN (1) CN114116710A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115544170A (en) * 2022-11-22 2022-12-30 中国信息通信研究院 Data hosting method and device based on block chain, electronic equipment and medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115544170A (en) * 2022-11-22 2022-12-30 中国信息通信研究院 Data hosting method and device based on block chain, electronic equipment and medium
CN115544170B (en) * 2022-11-22 2023-03-14 中国信息通信研究院 Data hosting method and device based on block chain, electronic equipment and medium

Similar Documents

Publication Publication Date Title
US10439804B2 (en) Data encrypting system with encryption service module and supporting infrastructure for transparently providing encryption services to encryption service consumer processes across encryption service state changes
US10235539B2 (en) Server device, recording medium, and concealed search system
CN108133008B (en) Method, device, equipment and storage medium for processing service data in database
US9811678B2 (en) Method and system for transferring data and instructions through a host file system
CN106971121B (en) Data processing method, device, server and storage medium
CN107948152B (en) Information storage method, information acquisition method, information storage device, information acquisition device and information acquisition equipment
US11546348B2 (en) Data service system
US10242221B1 (en) System and method for automatically securing sensitive data in public cloud using a serverless architecture
US11068446B2 (en) Multi-cloud bi-directional storage replication system and techniques
CN111897786B (en) Log reading method, device, computer equipment and storage medium
CN110457945A (en) Method, inquiry method, apparatus, service method, apparatus and the storage medium of list inquiry
CN103259762A (en) File encryption and decryption method and system based on cloud storage
CN108764902B (en) Method, node and blockchain system for storing data
CN111597567A (en) Data processing method, data processing device, node equipment and storage medium
CN108881261B (en) Service authentication method and system based on block chain technology in container environment
CN111783140A (en) Request response method and device, electronic equipment and computer readable storage medium
CN111507706B (en) Method, device, computer equipment and storage medium for browsing and storing data
CN114116710A (en) Data processing method, device and equipment based on block chain and storage medium
US20230081189A1 (en) Container management for cryptanalysis attack protection
CN116192395A (en) Trusted system for distributed data storage
CN112416526A (en) Direct storage access method, device and related equipment
CN114860390B (en) Container data management method, device, program product, medium and electronic equipment
AU2015292266B2 (en) System and method for simultaneous forensic acquisition, examination and analysis of a computer readable medium at wire speed
US11829498B2 (en) Real-time dynamic blockchain securitization platform
CN112579255B (en) Compression protection method for virtual machine migration, migration-in migration-out accelerator module and SOC chip

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