Big data sharing method, device and big data sharing system
By using index information retrieval and coding matrices for data slicing in the blockchain, combined with the Byzantine fault-tolerant algorithm, the problem of excessive redundant information in the blockchain is solved, efficient data sharing and low-redundant storage are achieved, and the efficiency is improved Performance and data synergy efficiency of energy blockchain.
Patent Information
- Application Number
- CN202111434664.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-29
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2041-11-29
AI Technical Summary
The excessive amount of redundant information in the blockchain leads to low performance and low data storage efficiency. Especially in the energy blockchain, there are many types of transactions and high frequency, which leads to low data collaboration efficiency.
By receiving data requests from the data demander, the index information is used to retrieve the local memory of the data provider, only necessary data blocks are saved, random storage and coding matrices are used for data slicing, and Byzantine fault-tolerant algorithms are combined for data repair to reduce redundant storage and Repair costs.
It achieves high efficiency and low redundant storage of big data sharing, reduces data transmission bandwidth and repair costs, and improves the performance of the blockchain and data collaboration efficiency.
Smart Images

Figure CN114244853B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of big data sharing, and in particular to a big data sharing method, device, computer-readable storage medium, processor, and big data sharing system. Background Art
[0002] As the energy revolution advances, energy is transforming towards clean and distributed energy, the proportion of renewable energy in the energy system is gradually increasing, and the large-scale application of distributed energy supply has gradually formed an energy supply pattern in which centralized and distributed energy sources participate. The blockchain-based new energy cloud platform can horizontally aggregate industry resources such as suppliers, power grid companies, and energy users, and vertically serve users in business links such as site building consultation, construction plan evaluation, equipment procurement, operation and maintenance, settlement subsidies, and grid connection. It can also upload business demand data to the chain throughout the entire process, realize trusted data sharing, break down data barriers, and improve the efficiency of multi-party collaboration.
[0003] At present, data sharing adopts the method of secure multi-party computing, which allows multiple data owners to perform collaborative computing without trusting each other, output the computing results, and ensure that no party can obtain any other redundant information except the computing results. Data sharing applications under blockchain can be divided into two modes: (1) Resource sharing service mode: supports data sharing between two or more business departments, synchronizes data of each node in real time through the decentralized characteristics, and realizes the authorized sharing of internal data resources in a record-based manner under the rules through transparency and smart contract characteristics. (2) Business collaboration service mode: utilizes the trigger generation and automatic operation characteristics of smart contracts on the blockchain to realize the safe and reliable flow of online data between multiple departments and units through conditional judgment.
[0004] At present, there are two main problems with blockchain technology: on the one hand, the data is not scalable enough, and the throughput of shared transactions is insufficient, resulting in poor performance. For energy blockchains, there are many types of energy transactions, increasing frequency, and concentrated participants, which leads to low data coordination efficiency. A scalable middle-layer data processing method is urgently needed. On the other hand, energy big data is large in volume and widely distributed, while the storage space of the blockchain itself is limited, so distributed storage came into being, but storage nodes are becoming more and more common as the scale of data continues to expand. To solve this problem, erasure code encoding and decoding are more widely used in blockchain storage. In the existing technology, the most common ones are multi-copy mechanism and MDS code. The multi-copy mechanism introduces simple redundancy, but the storage efficiency is very low. The traditional MDS code has relatively low storage cost, but has higher repair cost and access delay.
[0005] There are three main problems with the existing technology:
[0006] 1) Too much redundant information in the blockchain: Since any node in the blockchain network backs up all on-chain transaction information, the increase in the amount of data carried by transactions seriously affects the efficiency of the consensus mechanism and causes unnecessary waste of storage and computing resources;
[0007] 2) Weak data source scalability: Since centralized databases are difficult to meet and adapt to various data storage needs, user-defined data sources are used. However, the standards of such data sources are not unified and highly heterogeneous, and an extensible middle layer is urgently needed for information connection. Distributed file systems connect computer networks to nodes. Users do not need to pay attention to specific storage locations. They can play the roles of client and server by joining the network, upload and obtain information files, and can perfectly adapt to file sharing in such distributed scenarios;
[0008] 3) Data storage node repair: Distributed storage has the problem of unreliable nodes. Based on error-correcting codes, redundant data is introduced to improve fault tolerance. Compared with traditional MDS codes, a random slicing storage method for energy blockchain is proposed in combination with the piggybacking framework. Without changing the distribution and storage of the original system, the transmission bandwidth and repair cost of data repair are reduced.
[0009] The above information disclosed in the background technology section is only used to enhance the understanding of the background technology of the technology described in this article. Therefore, the background technology may contain certain information that does not form the prior art known in this country for those skilled in the art. Summary of the invention
[0010] The main purpose of this application is to provide a big data sharing method, device, computer-readable storage medium, processor and big data sharing system to solve the problem of excessive redundant information in the blockchain used in big data sharing in the prior art.
[0011] According to one aspect of an embodiment of the present invention, a big data sharing method is provided, comprising: receiving a data request sent by a data demander via a blockchain, the data request comprising index information of the data, the index information comprising storage location information of the data; retrieving data in a local storage of a data provider according to the index information to obtain target data; and sending the target data to the data demander via the blockchain.
[0012] Optionally, the data in the local storage of the data provider is retrieved according to the index information to obtain the target data, including: determining the storage node where the corresponding data block is located according to the storage location information, the data in the local storage includes multiple data blocks, the data blocks correspond one-to-one to the storage nodes, and the index information also includes data block information of the target data and storage location information of the data blocks of the target data; reading the data blocks stored in the storage node to obtain the target data.
[0013] Optionally, the storage node of the local memory includes a data node and a check node, the data node is used to store the target data, and the data node is used to store the check data corresponding to the target data. Before reading the data block stored in the storage node to obtain the target data, the method further includes: in the event that the data node corresponding to the target data fails, obtaining the target data by calculation based on the check data; in the event that the check node corresponding to the target data fails, obtaining the check data by calculation based on the target data.
[0014] Optionally, in the event of failure of the data node or the check node, a Byzantine fault-tolerant algorithm is used to repair the data.
[0015] Optionally, the nodes of the blockchain communicate via a P2P network.
[0016] Optionally, the index information is encrypted and stored on the blockchain.
[0017] According to another aspect of an embodiment of the present invention, a big data sharing device is provided, comprising: a receiving unit, used to receive a data request sent by a data demander through a blockchain, the data request including index information of the data, the index information including storage location information of the data; an acquiring unit, used to retrieve data in a local storage of a data provider according to the index information to obtain target data; and a sending unit, used to send the target data to the data demander through the blockchain.
[0018] According to another aspect of the embodiments of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein the program executes any one of the methods described.
[0019] According to another aspect of an embodiment of the present invention, a processor is provided, wherein the processor is used to run a program, wherein the program executes any one of the methods when running.
[0020] According to another aspect of an embodiment of the present invention, a big data sharing system is provided, comprising a blockchain, a local memory of a blockchain node, and a big data sharing device, wherein the big data sharing device includes a device for executing any one of the methods described.
[0021] In an embodiment of the present invention, in the above-mentioned big data sharing method, first, the data demander receives a data request through the blockchain, the data request includes the index information of the data, and the index information includes the storage location information of the data; then, the data in the local storage of the data provider is retrieved according to the index information to obtain the target data; finally, the target data is sent to the data demander through the blockchain. The data owner of this method randomly stores the data in the local storage under the chain, and each independent data index is encrypted and uploaded to the blockchain consensus node. When data transaction sharing is required, the data demander sends a data request to the data owner through the blockchain. After verification, the local encoded data is retrieved and decoded to obtain the complete data. It can be seen that only the local storage of the consensus node of the blockchain saves all block data, which can realize big data sharing. There is no need for all nodes to back up all block data, which solves the problem of excessive redundant information in the blockchain used in big data sharing in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The drawings constituting part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0023] Figure 1 A flowchart of a big data sharing method according to an embodiment of the present application is shown;
[0024] Figure 2 A schematic diagram of blockchain local data storage according to an embodiment of the present application is shown;
[0025] Figure 3 A schematic diagram of a blockchain big data sharing model according to an embodiment of the present application is shown;
[0026] Figure 4 A schematic diagram of a data random storage model according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0027] It should be noted that the following detailed descriptions are illustrative and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present application belongs.
[0028] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0029] It should be understood that when an element (such as a layer, film, region, or substrate) is described as being "on" another element, the element may be directly on the other element, or there may be intermediate elements. Moreover, in the specification and claims, when an element is described as being "connected" to another element, the element may be "directly connected" to the other element, or "connected" to the other element through a third element.
[0030] As mentioned in the background technology, the blockchain used in the existing big data sharing technology has the problem of too much redundant information. In order to solve the above problem, in a typical implementation of the present application, a big data sharing method, device, computer-readable storage medium, processor and big data sharing system are provided.
[0031] According to an embodiment of the present application, a big data sharing method is provided.
[0032] Figure 1 is a flow chart of a big data sharing method according to an embodiment of the present application. Figure 1 As shown, the method comprises the following steps:
[0033] Step S101, receiving a data request sent by a data demander through a blockchain, wherein the data request includes index information of the data, and the index information includes storage location information of the data;
[0034] Step S102, searching the data in the local storage of the data provider according to the above index information to obtain the target data;
[0035] Step S103: Send the target data to the data demander via the blockchain.
[0036] In the above-mentioned big data sharing method, first, the data demander sends a data request through the blockchain. The data request includes the index information of the data, and the index information includes the storage location information of the data; then, the data in the local storage of the data provider is retrieved according to the index information to obtain the target data; finally, the target data is sent to the data demander through the blockchain. The data owner of this method randomly stores the data in the local storage under the chain, and each index information is encrypted and uploaded to the blockchain. When data transaction sharing is required, the data demander sends a data request to the data owner through the blockchain. After verification, the local encoded data is retrieved and decoded to obtain the complete data. It can be seen that only the local storage of the consensus node of the blockchain saves all block data, which can realize big data sharing. There is no need for all nodes to back up all block data, which solves the problem of excessive redundant information in the blockchain used in big data sharing in the prior art.
[0037] In one embodiment of the present application, data in a local storage of a data provider is retrieved according to the above-mentioned index information to obtain target data, including: determining a storage node where a corresponding data block is located according to the above-mentioned storage location information, the data in the above-mentioned local storage includes multiple data blocks, the above-mentioned data blocks correspond one-to-one to the above-mentioned storage nodes, and the above-mentioned index information also includes data block information of the above-mentioned target data and storage location information of the data blocks of the above-mentioned target data; reading the above-mentioned data blocks stored in the above-mentioned storage nodes to obtain the above-mentioned target data.
[0038] Specifically, Figure 2 As shown, the data block N is sliced into multiple sub-blocks to form multiple sub-strips, and a coding matrix B is set. The coding matrix is used to perform independent multiplication operations with each sub-strip of the block matrix N to obtain a basic coding matrix, that is, in, The local checksum of a checksum in the previous sub-strip is piggybacked on the checksum data of the next sub-strip. The data block is k items, and the generated check items are r items. Divide f1(a) into (r-1) groups of local checks, and piggyback p groups of data to the second sub-strip to form a new checksum, that is, Where p = (k / (r-1)) represents the number of data carried in each group, and the data owner has the sliced data X1, X2...X k+r Random address allocation, original data X1, X2...X kStored in the data nodes under the chain, the verification data Xk+1, Xk+2…Xx+r are stored in the verification nodes under the chain. Hash functions are used to generate indexes for different nodes of the data under the chain. Each index information contains the slice information, storage location information, etc. of the data. The private key of the data provider is generated by a random function, and then the public key is generated. The hash operation is then performed on the public key to obtain the hash value, and the verification code is added to ensure its existence. The account address is obtained by base58 encoding. The index information is encrypted by the public key of the data provider and stored on the blockchain. The target data can be obtained according to the index information.
[0039] In one embodiment of the present application, Figure 2 As shown, the storage node of the above-mentioned local storage includes a data node and a check node, the above-mentioned data node is used to store the above-mentioned target data, and the above-mentioned data node is used to store the verification data corresponding to the above-mentioned target data. Before reading the above-mentioned data block stored in the above-mentioned storage node to obtain the above-mentioned target data, the above-mentioned method also includes: in the case that the data node corresponding to the above-mentioned target data fails, the above-mentioned target data is calculated according to the above-mentioned verification data; in the case that the check node corresponding to the above-mentioned target data fails, the above-mentioned verification data is calculated according to the above-mentioned target data.
[0040] Specifically, when data needs to be reconstructed, a request is submitted through the blockchain to obtain enough coded slices, and the node can reconstruct the block data through decoding operations. Taking the (14, 10)-MDS code as an example, Cut the data N into 20 sub-blocks and 2 sub-strips (A, B), set the encoding matrix B, and perform matrix multiplication with each independent sub-strip for encoding to obtain the matrix. According to p = (k / (r-1)) (k = 10), the number of data carried in each group is 3. At this time, the group cannot be divided evenly. q = k mod (r-1) can be obtained. The number of data carried in the last group is p + q, which is 4. 10 data blocks can form a complete original data without decoding. If the check node X 11 Failed, can connect X1-X 10 These 10 nodes, according to {f1(a), f1(b)} can be reconstructed. If data node X1 fails, first use the MDS property to connect X2-X 11 Download {b2,...,b 10 ,f1(b)}, the product of the inverse matrix of the coding matrix and the coding slice can be used to obtain b1, that is, When connecting X2, X3 and X 12Download {a2, a3, f2(b)+a1+a2+a3}, and you can get f2(b) through formula 2, and then get a1, which will form a complete original data. The total number of data blocks downloaded is 11, which is at least 20 blocks compared to directly using MSD code to decode the encoded data, which obviously saves network bandwidth.
[0041] In one embodiment of the present application, in the event of failure of the above-mentioned data node or the above-mentioned check node, a Byzantine fault-tolerant algorithm is used to repair data. Specifically, the process of the Byzantine fault-tolerant algorithm PBFT is mainly divided into three stages: pre-preparation, preparation, and submission. The PBFT algorithm can tolerate less than 1 / 3 invalid or malicious nodes, and the algorithm can reach the final result faster, but requires a small number of nodes.
[0042] In one embodiment of the present application, the nodes of the above-mentioned blockchain communicate through a P2P network. Specifically, a P2P network architecture is used, which is usually constructed using a gossip transmission protocol, and the network layer may contain different protocols based on different requirements. The computers connected to each other are in an equal position, and can send requests as a server and respond as a workstation, thereby achieving decentralization without the need for a central link. When the data demander needs complete information, based on the P2P network of the blockchain, the data demander sends a request to the data owner. After receiving the request, the data owner responds after retrieving the locally stored data. The node with the corresponding slice establishes a connection with the requesting node and transmits the data to the data demander.
[0043] In one embodiment of the present application, the above index information is encrypted and stored on the above blockchain. Specifically, the nodes of the above blockchain can be divided into consensus nodes and ordinary nodes. The consensus node is a node participating in the consensus in the alliance chain, and the node locally stores all local block data. The ordinary node is a node in the alliance chain that normally performs data sharing functions. The above index information is encrypted and uploaded to the consensus node of the blockchain.
[0044] It should be noted that if Figure 3As shown in the figure, the architecture of the blockchain big data sharing model can be divided into the data layer, blockchain layer, consensus layer, contract layer and application layer. The data layer is based on erasure code encoding and decoding, combined with the piggybacking framework, to achieve the optimization of data slice distributed storage without changing the nodes and functions of the blockchain, and can also achieve data reconstruction and repair; the network layer is the basis of blockchain information interaction, carrying the consensus process between nodes, and realizing transparent data transmission between two end systems. The consensus layer selects the Byzantine fault tolerance algorithm PBFT as the consensus algorithm for further improvement, providing high throughput and low latency characteristics; the contract layer includes various codes and algorithm mechanisms, etc., encapsulating smart contracts. Smart contracts are essentially digital protocols composed of computer programs. When the conditions written in the source code are met, each node will automatically trade according to the contract content without intermediate operations. With the immutability of the blockchain, smart contracts can ensure that all participants jointly handle things, execute codes and maintain the consistency of status and resources. This method starts to execute the smart contract after the data request is verified. According to the access constraints set by the node, the script is locked, and the shared data is decrypted according to the provided key. The public key of the access node is used to encrypt the output result. When the transaction sharing time has passed, the data slice address information is randomly changed, and the latest information is fed back to the data owner. Before obtaining authorization again, the data requester cannot view the data; the application layer mainly includes the query, sharing, modification of energy big data, and the entry of new data into the chain, which must be implemented through a client. The client includes the administrator client and the user client. The administrator client can add new energy data to the chain, and data sharing can be realized if authorized. The user client can query the data if authorized.
[0045] The embodiment of the present application also provides a big data sharing device. It should be noted that the big data sharing device of the embodiment of the present application can be used to execute the big data sharing method provided in the embodiment of the present application. The big data sharing device provided in the embodiment of the present application is introduced below.
[0046] Figure 4 Schematic diagram of a big data sharing device according to an embodiment of the present application. Figure 4 As shown, the device comprises:
[0047] A receiving unit 10 is used to receive a data request sent by a data demander through a blockchain, wherein the data request includes index information of the data, and the index information includes storage location information of the data;
[0048] The acquisition unit 20 is used to retrieve the data in the local storage of the data provider according to the above index information to obtain the target data;
[0049] The sending unit 30 is used to send the target data to the data demander through the blockchain.
[0050] In the above-mentioned big data sharing device, the receiving unit receives the data request sent by the data demander through the blockchain, and the data request includes the index information of the data, and the index information includes the storage location information of the data; the acquisition unit retrieves the data in the local storage of the data provider according to the index information to obtain the target data; the sending unit sends the target data to the data demander through the blockchain. The data owner of the device randomly stores the data in the local storage under the chain, and each index information is encrypted and uploaded to the blockchain. When data transaction sharing is required, the data demander sends a data request to the data owner through the blockchain. After verification, the local encoded data is retrieved and decoded to obtain the complete data. It can be seen that only the local storage of the consensus node of the blockchain saves all block data, which can realize big data sharing, without the need for all nodes to back up all block data, solving the problem of excessive redundant information in the blockchain used in big data sharing in the prior art.
[0051] In one embodiment of the present application, the acquisition unit includes a determination module and a reading module, wherein the determination module is used to determine the storage node where the corresponding data block is located according to the storage location information, the data in the local storage device includes multiple data blocks, the data blocks correspond one-to-one to the storage nodes, and the index information also includes data block information of the target data and storage location information of the data blocks of the target data; the reading module is used to read the data blocks stored in the storage node to obtain the target data.
[0052] Specifically, Figure 2 As shown, the data block N is sliced into multiple sub-blocks to form multiple sub-strips, and a coding matrix B is set. The coding matrix is used to perform independent multiplication operations with each sub-strip of the block matrix N to obtain a basic coding matrix, that is, in, The local checksum of a checksum in the previous sub-strip is piggybacked on the checksum data of the next sub-strip. The data block is k items, and the generated check items are r items. Divide f1(a) into (r-1) groups of local checks, and piggyback p groups of data to the second sub-strip to form a new checksum, that is, Where p = (k / (r-1)) represents the number of data carried in each group, and the data owner has the sliced data X1, X2...X k+r Random address allocation, original data X1, X2...X kStored in the data nodes under the chain, the verification data Xk+1, Xk+2…Xx+r are stored in the verification nodes under the chain. Hash functions are used to generate indexes for different nodes of the data under the chain. Each index information contains the slice information, storage location information, etc. of the data. The private key of the data provider is generated by a random function, and then the public key is generated. The hash operation is then performed on the public key to obtain the hash value, and the verification code is added to ensure its existence. The account address is obtained by base58 encoding. The index information is encrypted by the public key of the data provider and stored on the blockchain. The target data can be obtained according to the index information.
[0053] In one embodiment of the present application, Figure 2 As shown, the storage node of the above-mentioned local storage includes a data node and a check node, the above-mentioned data node is used to store the above-mentioned target data, and the above-mentioned data node is used to store the check data corresponding to the above-mentioned target data. The above-mentioned device also includes a computing unit, and the above-mentioned computing unit includes a first computing module and a second computing module, wherein the above-mentioned first computing module is used to calculate the above-mentioned target data according to the above-mentioned check data before reading the above-mentioned data block stored in the above-mentioned storage node to obtain the above-mentioned target data when the data node corresponding to the above-mentioned target data fails; the above-mentioned second computing module is used to calculate the above-mentioned check data according to the above-mentioned target data before reading the above-mentioned data block stored in the above-mentioned storage node to obtain the above-mentioned target data when the check node corresponding to the above-mentioned target data fails.
[0054] Specifically, when data needs to be reconstructed, a request is submitted through the blockchain to obtain enough coded slices, and the node can reconstruct the block data through decoding operations. Taking the (14, 10)-MDS code as an example, Cut the data N into 20 sub-blocks and 2 sub-strips (A, B), set the encoding matrix B, and perform matrix multiplication with each independent sub-strip for encoding to obtain the matrix. According to p = (k / (r-1)) (k = 10), the number of data carried in each group is 3. At this time, the group cannot be divided evenly. q = k mod (r-1) can be obtained. The number of data carried in the last group is p + q, which is 4. 10 data blocks can form a complete original data without decoding. If the check node X 11 Failed, can connect X1-X 10 These 10 nodes, according to {f1(a), f1(b)} can be reconstructed. If data node X1 fails, first use the MDS property to connect X2-X 11 Download {b2,...,b 10 ,f1(b)}, the product of the inverse matrix of the coding matrix and the coding slice can be used to obtain b1, that is, When connecting X2, X3 and X12 Download {a2, a3, f2(b)+a1+a2+a3}, and you can get f2(b) through formula 2, and then get a1, which will form a complete original data. The total number of data blocks downloaded is 11, which is at least 20 blocks compared to directly using MSD code to decode the encoded data, which obviously saves network bandwidth.
[0055] In one embodiment of the present application, in the event of failure of the above-mentioned data node or the above-mentioned check node, a Byzantine fault-tolerant algorithm is used to repair data. Specifically, the process of the Byzantine fault-tolerant algorithm PBFT is mainly divided into three stages: pre-preparation, preparation, and submission. The PBFT algorithm can tolerate less than 1 / 3 invalid or malicious nodes, and the algorithm can reach the final result faster, but requires a small number of nodes.
[0056] In one embodiment of the present application, the nodes of the above-mentioned blockchain communicate through a P2P network. Specifically, a P2P network architecture is used, which is usually constructed using a gossip transmission protocol, and the network layer may contain different protocols based on different requirements. The computers connected to each other are in an equal position, and can send requests as a server and respond as a workstation, thereby achieving decentralization without the need for a central link. When the data demander needs complete information, based on the P2P network of the blockchain, the data demander sends a request to the data owner. After receiving the request, the data owner responds after retrieving the locally stored data. The node with the corresponding slice establishes a connection with the requesting node and transmits the data to the data demander.
[0057] In one embodiment of the present application, the above index information is encrypted and stored on the above blockchain. Specifically, the nodes of the above blockchain can be divided into consensus nodes and ordinary nodes. The consensus node is a node participating in the consensus in the alliance chain, and the node locally stores all local block data. The ordinary node is a node in the alliance chain that normally performs data sharing functions. The above index information is encrypted and uploaded to the consensus node of the blockchain.
[0058] It should be noted that if Figure 3As shown in the figure, the architecture of the blockchain big data sharing model can be divided into the data layer, blockchain layer, consensus layer, contract layer and application layer. The data layer is based on erasure code encoding and decoding, combined with the piggybacking framework, to achieve the optimization of data slice distributed storage without changing the nodes and functions of the blockchain, and can also achieve data reconstruction and repair; the network layer is the basis of blockchain information interaction, carrying the consensus process between nodes, and realizing transparent data transmission between two end systems. The consensus layer selects the Byzantine fault tolerance algorithm PBFT as the consensus algorithm for further improvement, providing high throughput and low latency characteristics; the contract layer includes various codes and algorithm mechanisms, etc., encapsulating smart contracts. Smart contracts are essentially digital protocols composed of computer programs. When the conditions written in the source code are met, each node will automatically trade according to the contract content without intermediate operations. With the immutability of the blockchain, smart contracts can ensure that all participants jointly handle things, execute codes and maintain the consistency of status and resources. This method starts to execute the smart contract after the data request is verified. According to the access constraints set by the node, the script is locked, and the shared data is decrypted according to the provided key. The public key of the access node is used to encrypt the output result. When the transaction sharing time has passed, the data slice address information is randomly changed, and the latest information is fed back to the data owner. Before obtaining authorization again, the data requester cannot view the data; the application layer mainly includes the query, sharing, modification of energy big data, and the entry of new data into the chain, which must be implemented through a client. The client includes the administrator client and the user client. The administrator client can add new energy data to the chain, and data sharing can be realized if authorized. The user client can query the data if authorized.
[0059] An embodiment of the present application also provides a big data sharing system, including a blockchain, a local memory of a blockchain node, and a big data sharing device, wherein the big data sharing device includes a device for executing any one of the above methods.
[0060] The above-mentioned big data sharing system includes a blockchain, a local memory of a blockchain node, and the above-mentioned big data sharing device. The receiving unit receives a data request sent by a data demander through a blockchain. The above-mentioned data request includes the index information of the data, and the above-mentioned index information includes the storage location information of the above-mentioned data; the obtaining unit retrieves the data in the local memory of the data provider according to the above-mentioned index information to obtain the target data; and the sending unit sends the above-mentioned target data to the above-mentioned data demander through the above-mentioned blockchain. The data owner of the device randomly stores the data in the local memory under the chain, and each index information is encrypted and uploaded to the blockchain. When data transaction sharing is required, the data demander sends a data request to the data owner through the blockchain. After verification, the local encoded data is retrieved and decoded to obtain the complete data. It can be seen that only the local memory of the consensus node of the blockchain saves all block data, which can realize big data sharing, and there is no need for all nodes to back up all block data, which solves the problem of excessive redundant information in the blockchain used in big data sharing in the prior art.
[0061] The above-mentioned big data sharing device includes a processor and a memory. The above-mentioned receiving unit, acquisition unit and sending unit are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.
[0062] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set to solve the problem of excessive redundant information in the blockchain used in big data sharing in the prior art by adjusting the kernel parameters.
[0063] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0064] An embodiment of the present invention provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the above method is implemented.
[0065] An embodiment of the present invention provides a processor, and the processor is used to run a program, wherein the method is executed when the program is run.
[0066] An embodiment of the present invention provides a device, the device comprising a processor, a memory, and a program stored in the memory and executable on the processor, and when the processor executes the program, at least the following steps are implemented:
[0067] Step S101, receiving a data request sent by a data demander through a blockchain, the data request including index information of the data, and the index information including storage location information of the data;
[0068] Step S102, searching the data in the local storage of the data provider according to the index information to obtain the target data;
[0069] Step S103: Send the target data to the data demander via blockchain.
[0070] The devices in this article can be servers, PCs, PADs, mobile phones, etc.
[0071] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program for initializing at least the following method steps:
[0072] Step S101, receiving a data request sent by a data demander through a blockchain, the data request including index information of the data, and the index information including storage location information of the data;
[0073] Step S102, searching the data in the local storage of the data provider according to the index information to obtain the target data;
[0074] Step S103: Send the target data to the data demander via blockchain.
[0075] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0076] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the above-mentioned units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0077] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0078] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0079] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a computer-readable storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the above-mentioned methods of each embodiment of the present invention. The aforementioned computer-readable storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0080] From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:
[0081] 1) In the big data sharing method of the present application, the data demander receives a data request through the blockchain, the data request includes the index information of the data, and the index information includes the storage location information of the data; the data in the local storage of the data provider is retrieved according to the index information to obtain the target data; the target data is sent to the data demander through the blockchain. The data owner of this method randomly stores the data in the local storage under the chain, and each index information is encrypted and uploaded to the blockchain. When data transaction sharing is required, the data demander sends a data request to the data owner through the blockchain. After verification, the local encoded data is retrieved and decoded to obtain the complete data. It can be seen that only the local storage of the consensus node of the blockchain saves all block data, which can realize big data sharing. There is no need for all nodes to back up all block data, which solves the problem of excessive redundant information in the blockchain used in big data sharing in the prior art.
[0082] 2) In the big data sharing device of the present application, the receiving unit receives a data request sent by the data demander through the blockchain, and the data request includes the index information of the data, and the index information includes the storage location information of the data; the acquiring unit retrieves the data in the local storage of the data provider according to the index information to obtain the target data; the sending unit sends the target data to the data demander through the blockchain. The data owner of the device randomly stores the data in the local storage under the chain, and each index information is encrypted and uploaded to the blockchain. When data transaction sharing is required, the data demander sends a data request to the data owner through the blockchain. After verification, the local encoded data is retrieved and decoded to obtain the complete data. It can be seen that only the local storage of the consensus node of the blockchain saves all block data, which can realize big data sharing. There is no need for all nodes to back up all block data, which solves the problem of excessive redundant information in the blockchain used in big data sharing in the prior art.
[0083] 3) The big data sharing system of the present application includes a blockchain, a local memory of a blockchain node and the above-mentioned big data sharing device. The receiving unit receives a data request sent by a data demander through a blockchain. The above-mentioned data request includes the index information of the data, and the above-mentioned index information includes the storage location information of the above-mentioned data; the acquiring unit retrieves the data in the local memory of the data provider according to the above-mentioned index information to obtain the target data; the sending unit sends the above-mentioned target data to the above-mentioned data demander through the above-mentioned blockchain. The data owner of the device randomly stores the data in the local memory under the chain, and each index information is encrypted and uploaded to the blockchain. When data transaction sharing is required, the data demander sends a data request to the data owner through the blockchain. After verification, the local encoded data is retrieved and decoded to obtain the complete data. It can be seen that only the local memory of the consensus node of the blockchain saves all block data, which can realize big data sharing. There is no need for all nodes to back up all block data, which solves the problem of excessive redundant information in the blockchain used in big data sharing in the prior art.
[0084] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A big data sharing method, characterized in that: include: A data request is sent by a data demander through a blockchain, wherein the data request includes index information of the data, and the index information includes storage location information of the data; Retrieving data in the local storage of the data provider according to the index information to obtain target data; The target data is sent to the data demander through the blockchain, and the data in the local storage of the data provider is retrieved according to the index information to obtain the target data, including: determining the storage node where the corresponding data block is located according to the storage location information, the data in the local storage includes multiple data blocks, and the data blocks correspond to the storage nodes one by one. The index information also includes the data block information of the target data and the storage location information of the data blocks of the target data; reading the data blocks stored in the storage node to obtain the target data, the storage nodes of the local storage include data nodes and check nodes, the data nodes are used to store the target data, and the check nodes are used to store the target data. The corresponding verification data, before reading the data block stored in the storage node to obtain the target data, also includes: when the data node corresponding to the target data fails, the target data is calculated according to the verification data; when the verification node corresponding to the target data fails, the verification data is calculated according to the target data. The index information is encrypted and stored on the blockchain. The nodes of the blockchain can be divided into consensus nodes and ordinary nodes. The consensus node is a node participating in the consensus in the alliance chain. The node locally stores all local block data. The ordinary node is a node in the alliance chain that normally performs data sharing functions. The index information is encrypted and uploaded to the consensus node of the blockchain.
2. The method according to claim 1, characterized in that In the event that the data node fails or the check node fails, a Byzantine fault-tolerant algorithm is used to repair the data.
3. The method according to claim 1, characterized in that The nodes of the blockchain communicate through a P2P network.
4. A big data sharing device, characterized in that: include: A receiving unit, configured to receive a data request sent by a data demander through a blockchain, wherein the data request includes index information of the data, and the index information includes storage location information of the data; An acquisition unit, configured to retrieve data in a local storage of a data provider according to the index information to obtain target data; A sending unit is used to send the target data to the data demander through the blockchain, the acquisition unit includes a determination module and a reading module, wherein the determination module is used to determine the storage node where the corresponding data block is located according to the storage location information, the data in the local memory includes multiple data blocks, and the data blocks correspond to the storage nodes one by one, and the index information also includes the data block information of the target data and the storage location information of the data blocks of the target data; the reading module is used to read the data blocks stored in the storage node to obtain the target data, the storage nodes of the local memory include data nodes and check nodes, the data nodes are used to store the target data, and the data nodes are used to store the check data corresponding to the target data, and also includes a calculation unit, the calculation unit includes a first calculation module and a second calculation module Block, wherein the first calculation module is used to obtain the target data according to the verification data before reading the data block stored in the storage node to obtain the target data when the data node corresponding to the target data fails; the second calculation module is used to obtain the verification data according to the target data before reading the data block stored in the storage node to obtain the target data when the verification node corresponding to the target data fails. The index information is encrypted and stored on the blockchain. The nodes of the blockchain can be divided into consensus nodes and ordinary nodes. The consensus node is a node participating in the consensus in the alliance chain. The node locally stores all local block data. The ordinary node is a node in the alliance chain that normally performs data sharing functions. The index information is encrypted and uploaded to the consensus node of the blockchain.
5. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method of any one of claims 1 to 3.
6. A processor, characterized in that: The processor is used to run a program, wherein the program executes the method according to any one of claims 1 to 3 when running.
7. A big data sharing system, comprising a blockchain, a local storage of a blockchain node and a big data sharing device, characterized in that: The big data sharing device includes a method for executing any one of claims 1 to 3.
