CN111339206B - Block chain-based data sharing method and device - Google Patents

Block chain-based data sharing method and device Download PDF

Info

Publication number
CN111339206B
CN111339206B CN202010168034.7A CN202010168034A CN111339206B CN 111339206 B CN111339206 B CN 111339206B CN 202010168034 A CN202010168034 A CN 202010168034A CN 111339206 B CN111339206 B CN 111339206B
Authority
CN
China
Prior art keywords
information
service node
user
blockchain
hash value
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.)
Active
Application number
CN202010168034.7A
Other languages
Chinese (zh)
Other versions
CN111339206A (en
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.)
CCB Finetech Co Ltd
Original Assignee
CCB Finetech 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 CCB Finetech Co Ltd filed Critical CCB Finetech Co Ltd
Priority to CN202010168034.7A priority Critical patent/CN111339206B/en
Publication of CN111339206A publication Critical patent/CN111339206A/en
Application granted granted Critical
Publication of CN111339206B publication Critical patent/CN111339206B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • 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
    • G06F16/2219Large Object storage; Management thereof
    • 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/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computational Linguistics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Mathematical Physics (AREA)
  • Fuzzy Systems (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a data sharing method and device based on a block chain, and relates to the technical field of computers. One embodiment of the method comprises the following steps: receiving a data uploading request of a first service node, wherein the data uploading request indicates information of a first user served by the first service node; extracting first abstract information corresponding to the information of the first user from the information of the first user; generating a first hash value corresponding to the first summary information; and correspondingly uploading the first summary information, the first hash value and the first service node identifier to a blockchain, and storing the information of the first user to a local database. The embodiment not only reduces the data quantity stored on the block chain, but also further ensures the safety of the data while realizing data sharing.

Description

Block chain-based data sharing method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for sharing data based on a blockchain.
Background
The blockchain has the advantages of decentralization, non-falsification and the like, and is widely applied to the aspect of data sharing and storage. Currently, various blockchain data sharing modes are that all data are encrypted and then put on a blockchain, and each blockchain data node stores copies of all data of other nodes.
In the process of implementing the present invention, the inventor finds that at least the following problems exist in the prior art: the data uploaded to the blockchain is encrypted, but once one data node is attacked or invaded, all the data are leaked because the data of each data node are consistent, and certain leakage risk still exists for some data with higher confidentiality requirements; in addition, as the amount of data uploaded to the blockchain increases, the data storage space increases, and the efficiency of querying the blockchain for data decreases significantly.
Disclosure of Invention
Therefore, the implementation of the invention provides a data sharing method and device based on the block chain, which not only reduces the data quantity stored on the block chain, but also further ensures the safety of the data while realizing data sharing.
To achieve the above object, according to one aspect of the embodiments of the present invention, there is provided a blockchain-based data sharing method including:
receiving a data uploading request of a first service node, wherein the data uploading request indicates information of a first user served by the first service node;
extracting first abstract information corresponding to the information of the first user from the information of the first user;
Generating a first hash value corresponding to the first summary information;
and correspondingly uploading the first summary information, the first hash value and the first service node identifier to a blockchain, and storing the information of the first user to a local database.
Optionally, the method further comprises:
before the first digest information, the first hash value and a first service node identifier are correspondingly uploaded to a blockchain, judging whether the first hash value exists on the blockchain or not;
if not, correspondingly uploading the first abstract information, the first hash value and the first service node identifier to a blockchain;
if yes, continuing to judge whether the service node identifier corresponding to the first hash value stored on the blockchain is consistent with the first service node identifier, and if not, uploading the first abstract information, the first hash value and the first service node identifier to the blockchain correspondingly.
Optionally, the method further comprises:
adding a first rewarding value to the rewarding value corresponding to the first service node under the condition that the first hash value does not exist on the blockchain;
and when the first hash value exists on the blockchain, but the service node identifier corresponding to the stored first hash value is inconsistent with the first service node identifier, adding a second rewarding value to the rewarding value corresponding to the first service node, wherein the second rewarding value is smaller than the first rewarding value.
Optionally, the method further comprises:
under the condition that a second service node requests to acquire the information of the first user, acquiring a public key of the second service node and the first abstract information from the blockchain;
searching information of the first user corresponding to the first abstract information from a local database according to the first abstract information;
encrypting the information of the first user by using the public key of the second service node;
uploading the encrypted information of the first user to the blockchain so that the second service node can acquire the information of the first user from the blockchain.
Optionally, the method further comprises:
receiving a data acquisition request sent by a first service node, wherein the data acquisition request indicates second abstract information corresponding to information of a second user to be acquired and a public key of the first service node;
acquiring one or more service node identifiers corresponding to the second hash value from the blockchain according to the second hash value corresponding to the second abstract information;
selecting one or more service node identifiers from the service node identifiers;
and acquiring information of the second user encrypted by using the public key of the first service node from the blockchain according to the selected service node identifier, the second hash value and the public key of the first service node.
Optionally, the method further comprises:
after obtaining the information of the second user encrypted by using the public key of the first service node from the blockchain, decrypting the information of the second user by using the private key corresponding to the public key of the first service node.
Optionally, the method further comprises:
after decrypting the information of the second user by using the private key corresponding to the public key of the first service node, extracting third abstract information corresponding to the information of the second user from the information of the second user;
generating a third hash value corresponding to the third summary information;
and judging whether the third hash value is consistent with the second hash value, if so, displaying the information of the second user to the first service node, and if not, complaining to the block chain according to the decrypted information of the second user.
Optionally, the method further comprises:
notifying the first service node that the data acquisition request fails under the condition that the block chain complaint is successful;
and under the condition that the block chain complaint fails, displaying the decrypted information of the second user to the first service node.
Optionally, the method further comprises:
After the decrypted information of the second user is displayed to the first service node, the information of the second user, the second abstract information, the selected service node identification and the second hash value are correspondingly stored in a local database.
Alternatively, the process may be carried out in a single-stage,
and deducting a third rewarding value from the rewarding value corresponding to the first service node when the information of the second user encrypted by using the public key of the first service node is obtained from the blockchain according to the selected service node identifier, the second hash value and the public key of the first service node.
To achieve the above object, according to another aspect of an embodiment of the present invention, there is provided a blockchain-based data sharing apparatus including: the device comprises an uploading request receiving module, a summary information extracting module, a hash value generating module and a data uploading module; wherein,,
the uploading request receiving module is used for receiving a data uploading request of a first service node, wherein the data uploading request indicates information of a first user served by the first service node;
the abstract information extraction module is used for extracting first abstract information corresponding to the information of the first user from the information of the first user;
The hash value generation module is used for generating a first hash value corresponding to the first abstract information;
and the data uploading module is used for uploading the first abstract information, the first hash value and the first service node identifier to a blockchain correspondingly, and storing the information of the first user to a local database.
Optionally, the data uploading module is further configured to,
before the first digest information, the first hash value and a first service node identifier are correspondingly uploaded to a blockchain, judging whether the first hash value exists on the blockchain or not;
if not, correspondingly uploading the first abstract information, the first hash value and the first service node identifier to a blockchain;
if yes, continuing to judge whether the service node identifier corresponding to the first hash value stored on the blockchain is consistent with the first service node identifier, and if not, uploading the first abstract information, the first hash value and the first service node identifier to the blockchain correspondingly.
Optionally, the data uploading module is further configured to,
adding a first rewarding value to the rewarding value corresponding to the first service node under the condition that the first hash value does not exist on the blockchain;
And when the first hash value exists on the blockchain, but the service node identifier corresponding to the stored first hash value is inconsistent with the first service node identifier, adding a second rewarding value to the rewarding value corresponding to the first service node, wherein the second rewarding value is smaller than the first rewarding value.
Optionally, the data uploading module is further configured to,
under the condition that a second service node requests to acquire the information of the first user, acquiring a public key of the second service node and the first abstract information from the blockchain;
searching information of the first user corresponding to the first abstract information from a local database according to the first abstract information;
encrypting the information of the first user by using the public key of the second service node;
uploading the encrypted information of the first user to the blockchain so that the second service node can acquire the information of the first user from the blockchain.
Optionally, the method further comprises: a data acquisition module; the data acquisition module is used for acquiring the data of the data storage device,
receiving a data acquisition request sent by a first service node, wherein the data acquisition request indicates second abstract information corresponding to information of a second user to be acquired and a public key of the first service node;
Acquiring one or more service node identifiers corresponding to the second hash value from the blockchain according to the second hash value corresponding to the second abstract information;
selecting one or more service node identifiers from the service node identifiers;
and acquiring information of the second user encrypted by using the public key of the first service node from the blockchain according to the selected service node identifier, the second hash value and the public key of the first service node.
Optionally, the data acquisition module is further configured to,
after obtaining the information of the second user encrypted by using the public key of the first service node from the blockchain, decrypting the information of the second user by using the private key corresponding to the public key of the first service node.
Optionally, the data acquisition module is further configured to,
after decrypting the information of the second user by using the private key corresponding to the public key of the first service node, extracting third abstract information corresponding to the information of the second user from the information of the second user;
generating a third hash value corresponding to the third summary information;
and judging whether the third hash value is consistent with the second hash value, if so, displaying the information of the second user to the first service node, and if not, complaining to the block chain according to the decrypted information of the second user.
Optionally, the data acquisition module is further configured to,
notifying the first service node that the data acquisition request fails under the condition that the block chain complaint is successful;
and under the condition that the block chain complaint fails, displaying the decrypted information of the second user to the first service node.
Optionally, the data acquisition module is further configured to,
after the decrypted information of the second user is displayed to the first service node, the information of the second user, the second abstract information, the selected service node identification and the second hash value are correspondingly stored in a local database.
Optionally, the data acquisition module is further configured to,
and deducting a third rewarding value from the rewarding value corresponding to the first service node when the information of the second user encrypted by using the public key of the first service node is obtained from the blockchain according to the selected service node identifier, the second hash value and the public key of the first service node.
To achieve the above object, according to still another aspect of an embodiment of the present invention, there is provided an electronic device for data sharing, including:
One or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement any of the methods of blockchain-based data sharing methods described above.
To achieve the above object, according to still another aspect of the embodiments of the present invention, there is provided a computer readable medium having stored thereon a computer program, wherein the program, when executed by a processor, implements any of the methods of blockchain-based data sharing as described above.
The invention has the following advantages or beneficial effects: by uploading only summary information of the user's information and corresponding hash values to the blockchain, the amount of data stored on the blockchain is reduced; meanwhile, through the abstract information and the corresponding hash value of the user information stored in the block chain, the service node can quickly inquire the information of the acquired user, and the inquiring efficiency is improved; if and only if the information of the user is requested to be acquired, the public key of the service node requesting to acquire the information of the user is used for encrypting the data and then uploading the encrypted data to the blockchain, so that the service node with the requested information can decrypt the corresponding user information only by using the private key corresponding to the public key, and the information safety is improved.
Further effects of the above-described non-conventional alternatives are described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of a main flow of a blockchain-based data sharing method according to an embodiment of the invention;
FIG. 2 is a schematic diagram of the main flow of another blockchain-based data sharing method according to an embodiment of the invention;
FIG. 3 is a schematic diagram of the main flow of yet another blockchain-based data sharing method according to an embodiment of the invention;
FIG. 4 is a schematic diagram of the main flow of a blockchain-based data acquisition method in accordance with an embodiment of the invention;
FIG. 5 is a schematic diagram of the main modules of a blockchain-based data sharing device according to an embodiment of the invention;
FIG. 6 is a schematic diagram of the main architecture of a blockchain-based data sharing system in accordance with an embodiment of the invention;
FIG. 7 is a schematic diagram of the main flow of a data acquisition method applied to a blockchain-based data sharing system in accordance with an embodiment of the present invention;
FIG. 8 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
Fig. 9 is a schematic diagram of a computer system suitable for use in implementing an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of a main flow of a data sharing method based on a blockchain according to an embodiment of the present invention, and as shown in fig. 1, the data sharing method may specifically include the following steps:
step S101, a data upload request of a first service node is received, where the data upload request indicates information of a first user served by the first service node. That is, the data upload request indicates information of a first user that the first service node wants to upload to the blockchain to enable sharing with other service nodes, including but not limited to: user blacklist information, user whitelists, user credit records, and the like. The first service node is a service system, such as a banking system, a bank credit system, etc., that can generate information of the first user and upload the information of the user to the blockchain, and query and acquire information of other users from the blockchain.
Step S102, first abstract information corresponding to the information of the first user is extracted from the information of the first user. Specifically, information of a first user is taken as user blacklist information for example, and the user blacklist information records one or more users which are blacklisted and specific details of the users which are blacklisted; if the first user is a natural person, the corresponding first summary information may include one or more of the following: user name, user credential type, user credential number; if the first user is an enterprise, the first summary information may include one or more of the following: business name, business organization code, tax payer identification number, etc. In addition, the first user may be an organization such as a social group, a fund organization, or the like.
Step S103, generating a first hash value corresponding to the first summary information. By Hash, it is meant that an arbitrary length input (also called pre-mapped pre-image) is transformed by a hashing algorithm into a fixed length output, which is the Hash value generated by the hashing algorithm. The first hash values and the first abstract information have a one-to-one correspondence, the first hash values corresponding to different first abstract information are necessarily different, and the first hash values corresponding to the same first abstract information are necessarily the same, have a fixed length, and are convenient to store and query.
Step S104, the first summary information, the first hash value and the first service node identification are correspondingly uploaded to a block chain, and the information of the first user is stored in a local database. Specifically, the first summary information, the first hash value, and the first service node identifier may be stored on a user information table on the blockchain, and the first hash value corresponding to the first summary information and the first service node storage and use of one row or the same column are agreed, so as to locate the corresponding first summary information or first service node identifier according to the first hash value. The first service node identifier refers to a number, an ID, a name, etc. for distinguishing different service nodes.
In an alternative embodiment, before uploading the first digest information, the first hash value, and a first service node identifier to a blockchain, determining whether the first hash value is already present on the blockchain; if not, correspondingly uploading the first abstract information, the first hash value and the first service node identifier to a blockchain; if yes, continuing to judge whether the service node identifier corresponding to the first hash value stored on the blockchain is consistent with the first service node identifier, and if not, uploading the first abstract information, the first hash value and the first service node identifier to the blockchain correspondingly.
That is, before the first summary information, the first hash value and the first service node identifier are uploaded to the blockchain correspondingly, whether the first summary information exists on the blockchain or not is judged through the first hash value, if so, whether the service node uploading the first summary information is consistent with the current first service node or not is judged based on the first service node identifier, if not, the uploading is continued, and if not, the uploading is not carried out, so that the situation that the same service node repeatedly uploads information of the same user is avoided, and resources are maliciously wasted. It may also be noted that the same first summary information (such as a blacklist user name, an id card number, etc.) may not be the same in information details (specific matters of the blacklist) of the corresponding first user in different service nodes, so as to allow one or more service nodes to upload the first summary information, the first hash value, and the first service node to the blockchain respectively. Based on the above, other service nodes can select the source of the first summary information according to the first service node identifier according to the actual requirement so as to obtain the information of the first user corresponding to the first summary information.
In an alternative embodiment, in the case that the first hash value does not exist on the blockchain, adding a first bonus value to the bonus value corresponding to the first service node; and when the first hash value exists on the blockchain, but the service node identifier corresponding to the stored first hash value is inconsistent with the first service node identifier, adding a second rewarding value to the rewarding value corresponding to the first service node, wherein the second rewarding value is smaller than the first rewarding value. Therefore, the first service node can be stimulated to upload more different first abstract information and information of the first user based on the reward value management mechanism, so that information sharing of the first user is realized. The first prize value and the second prize value may be set according to actual requirements, for example, the first prize value is 10, and the second prize value is half (i.e. 5) of the first prize value. It should be noted that the purpose of the prize value management mechanism is to stimulate the first service node to upload more first summary information or information of the first user, but at the same time avoid repeating the same first summary information or information of the first user as much as possible. Thus, in case the first summary information to be uploaded by the first service node is that other service nodes have been uploaded onto the blockchain, the prize value given to the first service node is suitably reduced, i.e. less than the second prize value needs to be less than the first prize value, to direct the first service node to upload a different first summary information without reducing the aggressiveness of the first service node.
In an alternative embodiment, in a case that a second service node requests to obtain information of the first user, a public key of the second service node and the first summary information are obtained from the blockchain; searching information of the first user corresponding to the first abstract information from a local database according to the first abstract information; encrypting the information of the first user by using the public key of the second service node; uploading the encrypted information of the first user to the blockchain so that the second service node can acquire the information of the first user from the blockchain.
It will be appreciated that the first service node may learn on the blockchain that the second service node, i.e. the other service node, requests to obtain the information of the first user, or may learn that the second service node requests to obtain the information of the first user through other communication channels (e.g. mail, etc.) established with the second service node. When the first summary information, the first hash value and the first service node identifier corresponding to the information of the first user are uploaded to the blockchain, the information of the first user is stored in the local database, so that the corresponding information of the first user can be searched from the local database according to the first summary information corresponding to the information of the first user, which is requested to be acquired by the second service node. On the basis, the security and privacy of the information of the first user are ensured by encrypting the information of the first user by using the public key of the second service node and uploading the information to be a blockchain, and only the second service node with the corresponding private key can acquire and decrypt the information of the first user. Thus, the safety of the information of the first user is ensured.
Therefore, when the first service node requests uploading, only the first abstract information, the first hash value and the first service node identifier corresponding to the information of the first user are uploaded to the blockchain correspondingly, so that the storage space occupied by storing more and more information of the first user in the blockchain is reduced; meanwhile, the query efficiency of querying corresponding first abstract information and first service node identifiers on the blockchain is improved through the first hash value; furthermore, only when the second service data requests to acquire the information of the first user, the public key of the second service node is used for encrypting the information of the first user and uploading the information to the blockchain, so that the second service node can acquire and decrypt the information of the first user from the blockchain, thereby realizing the sharing of the information of the first user, ensuring the safety of the information of the first user and avoiding the leakage of the information of the first user.
In an optional implementation manner, a data acquisition request sent by a first service node is received, wherein the data acquisition request indicates second abstract information corresponding to information of a second user to be acquired and a public key of the first service node; acquiring one or more service node identifiers corresponding to the second hash value from the blockchain according to the second hash value corresponding to the second abstract information; selecting one or more service node identifiers from the service node identifiers; and acquiring information of the second user encrypted by using the public key of the first service node from the blockchain according to the selected service node identifier, the second hash value and the public key of the first service node.
It can be understood that in the data sharing method implemented through the blockchain, the first service node itself not only can upload the information of the first user and the information of the first abstract to the blockchain, but also can obtain the information of the second user corresponding to the second abstract information uploaded by other service nodes from the blockchain according to actual requirements. In addition, since different service nodes may upload the same second summary information, there may be multiple sources of the second summary information queried from the blockchain according to the second hash value, that is, there may be multiple corresponding second service node identifiers, so one or more second service node identifiers may be selected according to actual requirements to obtain information of the second user uploaded by the corresponding second service node.
In an alternative embodiment, after obtaining the information of the second user encrypted using the public key of the first service node from the blockchain, the information of the second user is decrypted using the private key corresponding to the public key of the first service node. It can be understood that, in order to ensure the security of the acquired information of the second user, the public key of the first service node is used to encrypt the information of the second user, so that only the private key corresponding to the public key is adopted by the first service node to decrypt the information of the second user, thereby ensuring the security of the data.
On the basis, after decrypting the information of the second user by using a private key corresponding to the public key of the first service node, extracting third abstract information corresponding to the information of the second user from the information of the second user; generating a third hash value corresponding to the third summary information; and judging whether the third hash value is consistent with the second hash value, if so, displaying the information of the second user to the first service node, and if not, complaining to the block chain according to the decrypted information of the second user.
That is, after decrypting the information plaintext of the second user acquired from the blockchain by using the private key corresponding to the public key of the first service node, the information plaintext of the second user is further verified, so as to ensure that the acquired information plaintext of the first user is actually the information of the second user which is actually wanted to be acquired. If not, complaints can be made to the contract layer of the blockchain according to the information plaintext of the second user, the corresponding second abstract information and the like.
Further, notifying the first service node that the data acquisition request fails in the case of successful complaints to the blockchain; and under the condition that the block chain complaint fails, displaying the decrypted information of the second user to the first service node.
In an alternative embodiment, after the decrypted information of the second user is displayed to the first service node, the information of the second user, the second digest information, the selected service node identifier, and the second hash value are correspondingly stored in a local database. Therefore, the method can be used repeatedly in a local mode according to the fact that the method is obtained once and repeatedly, and resource waste caused by the fact that information of a second user is obtained from a block chain repeatedly is avoided.
In an alternative embodiment, when information of the second user encrypted by using the public key of the first service node is obtained from the blockchain according to the selected service node identifier, the second hash value and the public key of the first service node, a third reward value is deducted from the reward value corresponding to the first service node. That is, the first service node can obtain more rewards by uploading different information of the first user, and meanwhile, a certain rewards need to be deducted to obtain information of the second user uploaded by other service nodes from the blockchain, so that the information of the user uploaded by the service node is stimulated, and the service node can be prevented from misusing the information of the second user obtained from the blockchain.
Based on the above embodiment, by uploading only summary information of the user's information and the corresponding hash value onto the blockchain, the amount of data stored on the blockchain is reduced; meanwhile, through the abstract information and the corresponding hash value of the user information stored in the block chain, the service node can quickly inquire the information of the acquired user, and the inquiring efficiency is improved; if and only if the information of the user is requested to be acquired, the public key of the service node requesting to acquire the information of the user is used for encrypting the data and then uploading the encrypted data to the blockchain, so that the service node with the requested information can decrypt the corresponding user information only by using the private key corresponding to the public key, and the information safety is improved.
Referring to fig. 2, based on the above embodiment, the embodiment of the present invention provides another blockchain-based data sharing method, which specifically may include the following steps:
step S201, a data upload request of a first service node is received, where the data upload request indicates information of a first user served by the first service node.
Step S202, extracting first summary information corresponding to the information of the first user from the information of the first user.
Step S203, generating a first hash value corresponding to the first summary information.
Step S204, judging whether the first hash value exists on the block chain; if so, the following step S205 is continued, and if not, the following step S206 is continued.
Step S205, continuing to judge whether the service node identifier corresponding to the first hash value stored on the blockchain is consistent with the first service node identifier; if so, the first digest information, the first hash value, and the first service node identifier are not uploaded, and if not, the following step S206 is continued.
Step S206, the first abstract information, the first hash value and the first service node identifier are correspondingly uploaded to a block chain, the first abstract information, the first hash value and the first service node identifier are correspondingly uploaded to the block chain, and the information of the first user is stored in a local database.
On the basis, under the condition that a second service node requests to acquire the information of the first user, acquiring a public key of the second service node and the first abstract information from the blockchain; searching information of the first user corresponding to the first abstract information from a local database according to the first abstract information; encrypting the information of the first user by using the public key of the second service node; uploading the encrypted information of the first user to the blockchain so that the second service node can acquire the information of the first user from the blockchain.
In addition, a data acquisition request sent by the first service node can be received, wherein the data acquisition request indicates second abstract information corresponding to information of a second user to be acquired and a public key of the first service node; acquiring one or more service node identifiers corresponding to the second hash value from the blockchain according to the second hash value corresponding to the second abstract information; selecting one or more service node identifiers from the service node identifiers; and acquiring information of the second user encrypted by using the public key of the first service node from the blockchain according to the selected service node identifier, the second hash value and the public key of the first service node.
On this basis, after obtaining the information of the second user encrypted using the public key of the first service node from the blockchain, the information of the second user is decrypted using the private key corresponding to the public key of the first service node.
Further, after decrypting the information of the second user by using the private key corresponding to the public key of the first service node, extracting third summary information corresponding to the information of the second user from the information of the second user; generating a third hash value corresponding to the third summary information; and judging whether the third hash value is consistent with the second hash value, if so, displaying the information of the second user to the first service node, and if not, complaining to the block chain according to the decrypted information of the second user. Based on the request, notifying the first service node that the data acquisition request fails under the condition that the block chain complaint is successful; and under the condition that the block chain complaint fails, displaying the decrypted information of the second user to the first service node.
In addition, after the decrypted information of the second user is displayed to the first service node, the information of the second user, the second summary information, the selected service node identifier and the second hash value are correspondingly stored in a local database.
Notably, to encourage the first service node to upload more different first digest information, adding a first bonus value to the bonus value corresponding to the first service node in the case that the first hash value does not exist on the blockchain; and when the first hash value exists on the blockchain, but the service node identifier corresponding to the stored first hash value is inconsistent with the first service node identifier, adding a second rewarding value to the rewarding value corresponding to the first service node, wherein the second rewarding value is smaller than the first rewarding value.
Correspondingly, in order to avoid misuse of the information of the second user acquired from the blockchain by the first service node, when the information of the second user encrypted by using the public key of the first service node is acquired from the blockchain according to the selected service node identifier, the second hash value and the public key of the first service node, a third rewarding value is deducted from the rewarding value corresponding to the first service node.
Referring to fig. 3, based on the above embodiment, another data sharing method based on a blockchain is provided in the embodiment of the present invention, and the method specifically may include the following steps:
step S301, receiving a data uploading request of a first service node, wherein the data uploading request indicates information of a first user served by the first service node
Step S302, extracting first abstract information corresponding to the information of the first user from the information of the first user
Step S303, generating a first hash value corresponding to the first summary information.
Step S304, the first summary information, the first hash value and the first service node identification are correspondingly uploaded to a block chain, and the information of the first user is stored in a local database.
In addition, before the first digest information, the first hash value and the first service node identifier are correspondingly uploaded to a blockchain, judging whether the first hash value exists on the blockchain or not;
if not, correspondingly uploading the first abstract information, the first hash value and the first service node identifier to a blockchain;
if yes, continuing to judge whether the service node identifier corresponding to the first hash value stored on the blockchain is consistent with the first service node identifier, and if not, uploading the first abstract information, the first hash value and the first service node identifier to the blockchain correspondingly.
Step S305, when the second service node requests to obtain the information of the first user, the public key of the second service node and the first summary information are obtained from the blockchain.
Step S306, searching the information of the first user corresponding to the first abstract information from a local database according to the first abstract information.
Step S307, encrypting the information of the first user by using the public key of the second service node.
Step S308, uploading the encrypted information of the first user to the blockchain, so that the second service node obtains the information of the first user from the blockchain.
Notably, to encourage the first service node to upload more different first digest information, adding a first bonus value to the bonus value corresponding to the first service node in the case that the first hash value does not exist on the blockchain; and when the first hash value exists on the blockchain, but the service node identifier corresponding to the stored first hash value is inconsistent with the first service node identifier, adding a second rewarding value to the rewarding value corresponding to the first service node, wherein the second rewarding value is smaller than the first rewarding value.
Correspondingly, in order to avoid misuse of the information of the second user acquired from the blockchain by the first service node, when the information of the second user encrypted by using the public key of the first service node is acquired from the blockchain according to the selected service node identifier, the second hash value and the public key of the first service node, a third rewarding value is deducted from the rewarding value corresponding to the first service node.
Referring to fig. 4, based on the above embodiment, the embodiment of the present invention provides a data acquisition method based on a blockchain, which specifically may include the following steps:
step S401, receiving a data acquisition request sent by a first service node, where the data acquisition request indicates second summary information corresponding to information of a second user to be acquired, and a public key of the first service node.
Step S402, according to the second hash value corresponding to the second summary information, one or more service node identifiers corresponding to the second hash value are obtained from the blockchain.
Step S403, selecting one or more service node identifiers from the service node identifiers.
It can be understood that in the data sharing method implemented through the blockchain, the first service node itself not only can upload the information of the first user and the information of the first abstract to the blockchain, but also can obtain the information of the second user corresponding to the second abstract information uploaded by other service nodes from the blockchain according to actual requirements. In addition, since different service nodes may upload the same second summary information, there may be multiple sources of the second summary information queried from the blockchain according to the second hash value, that is, there may be multiple corresponding second service node identifiers, so one or more second service node identifiers may be selected according to actual requirements to obtain information of the second user uploaded by the corresponding second service node.
Step S404, according to the selected service node identifier, the second hash value, and the public key of the first service node, obtaining information of the second user encrypted by using the public key of the first service node from the blockchain.
Step S405, decrypting the information of the second user by using the private key corresponding to the public key of the first service node. It can be understood that, in order to ensure the security of the acquired information of the second user, the public key of the first service node is used to encrypt the information of the second user, so that only the private key corresponding to the public key is adopted by the first service node to decrypt the information of the second user, thereby ensuring the security of the data.
Step S406, extracting third summary information corresponding to the information of the second user from the information of the second user.
Step S407, generating a third hash value corresponding to the third summary information.
Step S408, determining whether the third hash value is consistent with the second hash value, if so, continuing to execute step S409, and if not, continuing to execute step S410. That is, after decrypting the information plaintext of the second user acquired from the blockchain by using the private key corresponding to the public key of the first service node, the information plaintext of the second user is further verified, so as to ensure that the acquired information plaintext of the first user is actually the information of the second user which is actually wanted to be acquired. If not, complaints can be made to the contract layer of the blockchain according to the information plaintext of the second user, the corresponding second abstract information and the like.
Step S409, displaying the information of the second user to the first service node.
Step S410, complaint is conducted to the block chain according to the decrypted information of the second user.
Further, notifying the first service node that the data acquisition request fails in the case of successful complaints to the blockchain; and under the condition that the block chain complaint fails, displaying the decrypted information of the second user to the first service node.
Referring to fig. 5, based on the above embodiment, an embodiment of the present invention provides a blockchain-based data sharing device 500, including: an uploading request receiving module 501, a summary information extracting module 502, a hash value generating module 503 and a data uploading module 504; wherein,,
the upload request receiving module 501 is configured to receive a data upload request of a first service node, where the data upload request indicates information of a first user served by the first service node;
the summary information extraction module 502 is configured to extract first summary information corresponding to the information of the first user from the information of the first user;
the hash value generating module 503 is configured to generate a first hash value corresponding to the first digest information;
The data uploading module 504 is configured to upload the first digest information, the first hash value, and the first service node identifier to a blockchain correspondingly, and store the information of the first user to a local database.
Optionally, the data uploading module 504 is further configured to,
before the first digest information, the first hash value and a first service node identifier are correspondingly uploaded to a blockchain, judging whether the first hash value exists on the blockchain or not;
if not, correspondingly uploading the first abstract information, the first hash value and the first service node identifier to a blockchain;
if yes, continuing to judge whether the service node identifier corresponding to the first hash value stored on the blockchain is consistent with the first service node identifier, and if not, uploading the first abstract information, the first hash value and the first service node identifier to the blockchain correspondingly.
Optionally, the data uploading module 504 is further configured to,
adding a first rewarding value to the rewarding value corresponding to the first service node under the condition that the first hash value does not exist on the blockchain;
And when the first hash value exists on the blockchain, but the service node identifier corresponding to the stored first hash value is inconsistent with the first service node identifier, adding a second rewarding value to the rewarding value corresponding to the first service node, wherein the second rewarding value is smaller than the first rewarding value.
Optionally, the data uploading module 504 is further configured to,
under the condition that a second service node requests to acquire the information of the first user, acquiring a public key of the second service node and the first abstract information from the blockchain;
searching information of the first user corresponding to the first abstract information from a local database according to the first abstract information;
encrypting the information of the first user by using the public key of the second service node;
uploading the encrypted information of the first user to the blockchain so that the second service node can acquire the information of the first user from the blockchain.
Optionally, the method further comprises: a data acquisition module 505; the data acquisition module 505 is configured to, in response to a request from a user,
receiving a data acquisition request sent by a first service node, wherein the data acquisition request indicates second abstract information corresponding to information of a second user to be acquired and a public key of the first service node;
Acquiring one or more service node identifiers corresponding to the second hash value from the blockchain according to the second hash value corresponding to the second abstract information;
selecting one or more service node identifiers from the service node identifiers;
and acquiring information of the second user encrypted by using the public key of the first service node from the blockchain according to the selected service node identifier, the second hash value and the public key of the first service node.
Optionally, the data acquisition module 504 is further configured to,
after obtaining the information of the second user encrypted by using the public key of the first service node from the blockchain, decrypting the information of the second user by using the private key corresponding to the public key of the first service node.
Optionally, the data acquisition module 504 is further configured to,
after decrypting the information of the second user by using the private key corresponding to the public key of the first service node, extracting third abstract information corresponding to the information of the second user from the information of the second user;
generating a third hash value corresponding to the third summary information;
and judging whether the third hash value is consistent with the second hash value, if so, displaying the information of the second user to the first service node, and if not, complaining to the block chain according to the decrypted information of the second user.
Optionally, the data acquisition module 504 is further configured to,
notifying the first service node that the data acquisition request fails under the condition that the block chain complaint is successful;
and under the condition that the block chain complaint fails, displaying the decrypted information of the second user to the first service node.
Optionally, the data acquisition module 504 is further configured to,
after the decrypted information of the second user is displayed to the first service node, the information of the second user, the second abstract information, the selected service node identification and the second hash value are correspondingly stored in a local database.
Optionally, the data acquisition module 504 is further configured to,
and deducting a third rewarding value from the rewarding value corresponding to the first service node when the information of the second user encrypted by using the public key of the first service node is obtained from the blockchain according to the selected service node identifier, the second hash value and the public key of the first service node.
Referring to fig. 6, based on the above embodiment, an embodiment of the present invention provides a blockchain-based data sharing system, which specifically includes: a blockchain, one or more blockchain-based data sharing devices, and corresponding service nodes. It can be understood that in this embodiment, only the blockchain-based data sharing device 1 and the blockchain-based data sharing device 2 are taken as examples, and the corresponding service nodes are the first service node and the second service node, respectively, and in the actual execution process, the number of the blockchain-based data sharing devices or the service nodes can be changed according to the actual requirement.
Referring to fig. 7, based on the above embodiment, the embodiment of the present invention provides a data acquisition method applied to a data sharing system based on a blockchain, where the method specifically includes the following steps:
in step S701, the blockchain-based data sharing device 1 receives a data upload request of the first service node, where the data upload request indicates information of the first user served by the first service node.
In step S702, the blockchain-based data sharing device 1 extracts first summary information corresponding to the information of the first user from the information of the first user.
In step S703, the data sharing apparatus 1 based on the blockchain generates a first hash value corresponding to the first digest information.
Step S704, uploading the first summary information, the first hash value, and the first service node identifier to a blockchain correspondingly, and storing the information of the first user in a local database.
In an alternative embodiment, before uploading the first digest information, the first hash value, and a first service node identifier to a blockchain, determining whether the first hash value is already present on the blockchain; if not, correspondingly uploading the first abstract information, the first hash value and the first service node identifier to a blockchain; if yes, continuing to judge whether the service node identifier corresponding to the first hash value stored on the blockchain is consistent with the first service node identifier, and if not, uploading the first abstract information, the first hash value and the first service node identifier to the blockchain correspondingly.
In an alternative embodiment, in the case that the first hash value does not exist on the blockchain, adding a first bonus value to the bonus value corresponding to the first service node; and when the first hash value exists on the blockchain, but the service node identifier corresponding to the stored first hash value is inconsistent with the first service node identifier, adding a second rewarding value to the rewarding value corresponding to the first service node, wherein the second rewarding value is smaller than the first rewarding value.
In step S705, the blockchain-based data sharing device 2 receives an information acquisition request of the first user of the second service node, where the acquisition request indicates the public key of the second service node, and the first digest of the information of the first user.
In step S706, the data sharing device 2 based on the blockchain obtains one or more service node identifiers corresponding to the first hash value from the blockchain according to the first hash value corresponding to the first digest information.
In step S707, the blockchain-based data sharing device 2 selects a first service node identifier, that is, selects and obtains information of a first user corresponding to the first summary information uploaded by the first service node. It may be understood that this embodiment is only described by taking the selection of the first service node identifier as an example, and in the actual execution process, one or more service node identifiers may be selected according to actual requirements.
In step S708, the blockchain-based data sharing device 2 obtains the information of the first user according to the first summary information, the first service node identifier, and the public key request of the second service node, that is, uploads the first summary information, the first service node identifier, and the public key request of the second service node to the blockchain to request to obtain the information of the first user.
In step S709, the blockchain-based data sharing device 2 obtains the first summary information, the first service node identifier, and the response identifier corresponding to the public key of the second service node from the blockchain, so as to obtain the information of the first user from the blockchain according to the response identifier. Specifically, when receiving the response identifier, starting a message receiving process to wait for a notification that the first service node encrypts the information of the first user according to the square public key of the second service node and then uploads the information to the chain, and after the data arrives at the chain to receive the message notification, deblocking the chain to inquire the data according to the request response ID. The response identification is randomly generated and corresponds to each data acquisition request one by one.
In step S710, the blockchain-based data sharing device 1 returns the first digest information and the public key of the second service node from the blockchain.
In step S711, the blockchain-based data sharing device 1 searches the local database for the information of the first user according to the first summary information.
In step S712, the blockchain-based data sharing device 1 encrypts the information of the first user according to the public key of the second service node.
In step S713, the blockchain-based data sharing device 1 uploads the information of the first user encrypted with the public key of the second service node to the blockchain.
In step S714, the blockchain-based data sharing device 2 obtains the encrypted information of the first user from the blockchain according to the corresponding identifier.
In step S715, the blockchain-based data sharing device 2 decrypts the information of the first user using the private key corresponding to the public key of the second service node.
Step S716, extracting fourth summary information from the decrypted information of the first user.
In step S717, a fourth hash value of the fourth digest information is generated.
Step S718, judging whether the first hash value is consistent with the fourth hash value; if so, the following step S719 is continued, and if not, the following step S720 is continued.
In step S719, the decrypted information of the first user is displayed to the second service node, if the first hash value is consistent with the fourth hash value.
In step S720, if the first hash value does not match the fourth hash value, a block chain complaint is issued. Further, notifying the first service node that the data acquisition request fails in the case of successful complaints to the blockchain; and under the condition that the block chain complaint fails, displaying the decrypted information of the second user to the first service node.
Notably, to encourage the first service node to upload more different first digest information, adding a first bonus value to the bonus value corresponding to the first service node in the case that the first hash value does not exist on the blockchain; and when the first hash value exists on the blockchain, but the service node identifier corresponding to the stored first hash value is inconsistent with the first service node identifier, adding a second rewarding value to the rewarding value corresponding to the first service node, wherein the second rewarding value is smaller than the first rewarding value.
Correspondingly, in order to avoid misuse of the information of the second user acquired from the blockchain by the first service node, when the information of the second user encrypted by using the public key of the first service node is acquired from the blockchain according to the selected service node identifier, the second hash value and the public key of the first service node, a third rewarding value is deducted from the rewarding value corresponding to the first service node.
Fig. 8 illustrates an exemplary system architecture 800 to which the blockchain-based data sharing method or blockchain-based data sharing device of embodiments of the present invention may be applied.
As shown in fig. 8, a system architecture 800 may include terminal devices 801, 802, 803, a network 804, and a server 805. The network 804 serves as a medium for providing communication links between the terminal devices 801, 802, 803 and the server 805. The network 804 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the server 805 through the network 804 using the terminal devices 801, 802, 803 to receive or send messages or the like. Various communication client applications, such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, etc., may be installed on the terminal devices 801, 802, 803.
The terminal devices 801, 802, 803 may be a variety of electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 805 may be a server providing various services, such as a background management server providing support for shopping-type websites browsed by the user using the terminal devices 801, 802, 803. The background management server can analyze and other data of the received product information inquiry request and feed back the processing result to the terminal equipment.
It should be noted that, the blockchain-based data sharing method provided by the embodiment of the present invention is generally executed by the server 805, and accordingly, the blockchain-based data sharing device is generally disposed in the server 805.
It should be understood that the number of terminal devices, networks and servers in fig. 8 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 9, there is illustrated a schematic diagram of a computer system 900 suitable for use in implementing an embodiment of the present invention. The terminal device shown in fig. 9 is only an example, and should not impose any limitation on the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 9, the computer system 900 includes a Central Processing Unit (CPU) 901, which can execute various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 902 or a program loaded from a storage section 908 into a Random Access Memory (RAM) 903. In the RAM 903, various programs and data necessary for the operation of the system 900 are also stored. The CPU 901, ROM 902, and RAM 903 are connected to each other through a bus 904. An input/output (I/O) interface 905 is also connected to the bus 904.
The following components are connected to the I/O interface 905: an input section 906 including a keyboard, a mouse, and the like; an output portion 907 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage portion 908 including a hard disk or the like; and a communication section 909 including a network interface card such as a LAN card, a modem, or the like. The communication section 909 performs communication processing via a network such as the internet. The drive 910 is also connected to the I/O interface 905 as needed. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed as needed on the drive 910 so that a computer program read out therefrom is installed into the storage section 908 as needed.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from the network via the communication portion 909 and/or installed from the removable medium 911. The above-described functions defined in the system of the present invention are performed when the computer program is executed by a Central Processing Unit (CPU) 901.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: 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. In the present invention, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. 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, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules involved in the embodiments of the present invention may be implemented in software or in hardware. The described modules may also be provided in a processor, for example, as: a processor comprises an uploading request receiving module, a summary information extracting module, a hash value generating module and a data uploading module. The names of these modules do not constitute a limitation on the module itself in some cases, and for example, the hash value generation module may also be described as "a module for generating a first hash value corresponding to the first digest information".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to include: receiving a data uploading request of a first service node, wherein the data uploading request indicates information of a first user served by the first service node; extracting first abstract information corresponding to the information of the first user from the information of the first user; generating a first hash value corresponding to the first summary information; and correspondingly uploading the first summary information, the first hash value and the first service node identifier to a blockchain, and storing the information of the first user to a local database.
According to the technical scheme provided by the embodiment of the invention, the following steps are adopted: by uploading only summary information of the user's information and corresponding hash values to the blockchain, the amount of data stored on the blockchain is reduced; meanwhile, through the abstract information and the corresponding hash value of the user information stored in the block chain, the service node can quickly inquire the information of the acquired user, and the inquiring efficiency is improved; if and only if the information of the user is requested to be acquired, the public key of the service node requesting to acquire the information of the user is used for encrypting the data and then uploading the encrypted data to the blockchain, so that the service node with the requested information can decrypt the corresponding user information only by using the private key corresponding to the public key, and the information safety is improved.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (14)

1. A blockchain-based data sharing method, comprising:
receiving a data uploading request of a first service node, wherein the data uploading request indicates information of a first user served by the first service node;
extracting first abstract information corresponding to the information of the first user from the information of the first user;
generating a first hash value corresponding to the first summary information;
determining whether the first hash value already exists on the blockchain; if not, correspondingly uploading the first abstract information, the first hash value and the first service node identifier to a blockchain; adding a first rewarding value to the rewarding value corresponding to the first service node; if yes, continuing to judge whether the service node identifier corresponding to the first hash value stored on the blockchain is consistent with the first service node identifier, and if not, uploading the first abstract information, the first hash value and the first service node identifier to the blockchain correspondingly; adding a second rewarding value to the rewarding value corresponding to the first service node, wherein the second rewarding value is smaller than the first rewarding value;
Storing the information of the first user to a local database; further comprises:
under the condition that a second service node requests to acquire the information of the first user, acquiring a public key of the second service node and the first abstract information from the blockchain;
searching information of the first user corresponding to the first abstract information from a local database according to the first abstract information;
encrypting the information of the first user by using the public key of the second service node;
uploading the encrypted information of the first user to the blockchain so that the second service node can acquire the information of the first user from the blockchain;
receiving a data acquisition request sent by a first service node, wherein the data acquisition request indicates second abstract information corresponding to information of a second user to be acquired and a public key of the first service node;
acquiring one or more service node identifiers corresponding to the second hash value from the blockchain according to the second hash value corresponding to the second abstract information;
selecting one or more service node identifiers from the service node identifiers;
and acquiring information of the second user encrypted by using the public key of the first service node from the blockchain according to the selected service node identifier, the second hash value and the public key of the first service node.
2. The blockchain-based data sharing method of claim 1, further comprising:
after obtaining the information of the second user encrypted by using the public key of the first service node from the blockchain, decrypting the information of the second user by using the private key corresponding to the public key of the first service node.
3. The blockchain-based data sharing method of claim 2, further comprising:
after decrypting the information of the second user by using the private key corresponding to the public key of the first service node, extracting third abstract information corresponding to the information of the second user from the information of the second user;
generating a third hash value corresponding to the third summary information;
and judging whether the third hash value is consistent with the second hash value, if so, displaying the information of the second user to the first service node, and if not, complaining to the block chain according to the decrypted information of the second user.
4. The blockchain-based data sharing method of claim 3, further comprising:
notifying the first service node that the data acquisition request fails in the case that the blockchain complaint is successful;
And under the condition that the block chain complaint fails, displaying the decrypted information of the second user to the first service node.
5. The blockchain-based data sharing method of claim 4, further comprising:
after the decrypted information of the second user is displayed to the first service node, the information of the second user, the second abstract information, the selected service node identification and the second hash value are correspondingly stored in a local database.
6. The method for blockchain-based data sharing of claim 1, wherein,
and deducting a third rewarding value from the rewarding value corresponding to the first service node when the information of the second user encrypted by using the public key of the first service node is obtained from the blockchain according to the selected service node identifier, the second hash value and the public key of the first service node.
7. A blockchain-based data sharing apparatus, comprising: the device comprises an uploading request receiving module, a summary information extracting module, a hash value generating module, a data uploading module and a data obtaining module; wherein,,
The uploading request receiving module is used for receiving a data uploading request of a first service node, wherein the data uploading request indicates information of a first user served by the first service node;
the abstract information extraction module is used for extracting first abstract information corresponding to the information of the first user from the information of the first user;
the hash value generation module is used for generating a first hash value corresponding to the first abstract information;
the data uploading module is used for judging whether the first hash value exists on the blockchain or not; if not, correspondingly uploading the first abstract information, the first hash value and the first service node identifier to a blockchain; adding a first rewarding value to the rewarding value corresponding to the first service node; if yes, continuing to judge whether the service node identifier corresponding to the first hash value stored on the blockchain is consistent with the first service node identifier, and if not, uploading the first abstract information, the first hash value and the first service node identifier to the blockchain correspondingly; adding a second rewarding value to the rewarding value corresponding to the first service node, wherein the second rewarding value is smaller than the first rewarding value; storing the information of the first user to a local database; the method is also used for acquiring the public key of the second service node and the first summary information from the blockchain under the condition that the second service node requests to acquire the information of the first user; searching information of the first user corresponding to the first abstract information from a local database according to the first abstract information; encrypting the information of the first user by using the public key of the second service node; uploading the encrypted information of the first user to the blockchain so that the second service node can acquire the information of the first user from the blockchain;
The data acquisition module is used for receiving a data acquisition request sent by a first service node, wherein the data acquisition request indicates second abstract information corresponding to information of a second user to be acquired and a public key of the first service node; acquiring one or more service node identifiers corresponding to the second hash value from the blockchain according to the second hash value corresponding to the second abstract information; selecting one or more service node identifiers from the service node identifiers; and acquiring information of the second user encrypted by using the public key of the first service node from the blockchain according to the selected service node identifier, the second hash value and the public key of the first service node.
8. The blockchain-based data sharing device of claim 7, wherein the data acquisition module is further configured to,
after obtaining the information of the second user encrypted by using the public key of the first service node from the blockchain, decrypting the information of the second user by using the private key corresponding to the public key of the first service node.
9. The blockchain-based data sharing device of claim 8, wherein the data acquisition module is further configured to,
After decrypting the information of the second user by using the private key corresponding to the public key of the first service node, extracting third abstract information corresponding to the information of the second user from the information of the second user;
generating a third hash value corresponding to the third summary information;
and judging whether the third hash value is consistent with the second hash value, if so, displaying the information of the second user to the first service node, and if not, complaining to the block chain according to the decrypted information of the second user.
10. The blockchain-based data sharing device of claim 9, wherein the data acquisition module is further configured to,
notifying the first service node that the data acquisition request fails under the condition that the block chain complaint is successful;
and under the condition that the block chain complaint fails, displaying the decrypted information of the second user to the first service node.
11. The blockchain-based data sharing device of claim 10, wherein the data acquisition module is further configured to,
after the decrypted information of the second user is displayed to the first service node, the information of the second user, the second abstract information, the selected service node identification and the second hash value are correspondingly stored in a local database.
12. The blockchain-based data sharing device of claim 8, wherein the data acquisition module is further configured to,
and deducting a third rewarding value from the rewarding value corresponding to the first service node when the information of the second user encrypted by using the public key of the first service node is obtained from the blockchain according to the selected service node identifier, the second hash value and the public key of the first service node.
13. An electronic device for data sharing, comprising:
one or more processors;
storage means for storing one or more programs,
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-6.
14. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-6.
CN202010168034.7A 2020-03-11 2020-03-11 Block chain-based data sharing method and device Active CN111339206B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010168034.7A CN111339206B (en) 2020-03-11 2020-03-11 Block chain-based data sharing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010168034.7A CN111339206B (en) 2020-03-11 2020-03-11 Block chain-based data sharing method and device

Publications (2)

Publication Number Publication Date
CN111339206A CN111339206A (en) 2020-06-26
CN111339206B true CN111339206B (en) 2023-07-18

Family

ID=71182226

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010168034.7A Active CN111339206B (en) 2020-03-11 2020-03-11 Block chain-based data sharing method and device

Country Status (1)

Country Link
CN (1) CN111339206B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113129017B (en) * 2020-08-31 2022-06-24 支付宝(杭州)信息技术有限公司 Information sharing method, device and equipment
CN113486393A (en) * 2021-06-16 2021-10-08 中国联合网络通信集团有限公司 Block chain-based personal information sharing method, node, device and storage medium
CN113392144A (en) * 2021-08-18 2021-09-14 北京邮电大学 Museum service data storage and query method and system based on block chain

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018012872A1 (en) * 2016-07-14 2018-01-18 주식회사 코인플러그 Method for providing recording and verification service for data received and transmitted by messenger service, and server using method
CN108063752A (en) * 2017-11-02 2018-05-22 暨南大学 A kind of credible genetic test and data sharing method based on block chain and proxy re-encryption technology
CN108768700A (en) * 2018-05-11 2018-11-06 北京奇虎科技有限公司 Reward distribution method, apparatus and system in a kind of block chain
CN108880784A (en) * 2018-05-28 2018-11-23 江苏众享金联科技有限公司 User privacy information shared system under a kind of different trust domain of solution based on block chain
CN109040012A (en) * 2018-06-19 2018-12-18 西安电子科技大学 A kind of data security protecting and sharing method based on block chain and system and application
CN109389485A (en) * 2018-09-30 2019-02-26 深圳市有情矿技术有限公司 Block chain dynamic exciting method under autonomous domain model based on information sharing contribution margin
CN109462588A (en) * 2018-11-13 2019-03-12 上海物融智能科技有限公司 A kind of decentralization data trade method and system based on block chain
CN109669986A (en) * 2018-12-12 2019-04-23 深圳乐信软件技术有限公司 Blacklist sharing method, device, equipment and storage medium based on block chain
CN109831501A (en) * 2019-01-30 2019-05-31 京东数字科技控股有限公司 Information dispensing method and system based on block chain
US10417219B1 (en) * 2018-03-28 2019-09-17 Macrogen, Inc. Data sharing method based on plurality of blockchains
CN110349056A (en) * 2019-06-03 2019-10-18 阿里巴巴集团控股有限公司 Transaction processing system and method based on block chain
CN110460590A (en) * 2018-12-07 2019-11-15 深圳市智税链科技有限公司 Data managing method, device, medium and the electronic equipment of block catenary system
CN110601853A (en) * 2019-09-17 2019-12-20 腾讯科技(深圳)有限公司 Block chain private key generation method and equipment
CN110611657A (en) * 2019-08-16 2019-12-24 中国人民银行数字货币研究所 File stream processing method, device and system based on block chain
CN110839015A (en) * 2019-10-12 2020-02-25 深圳壹账通智能科技有限公司 Log storage and reading method, device, equipment and medium based on block chain

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018012872A1 (en) * 2016-07-14 2018-01-18 주식회사 코인플러그 Method for providing recording and verification service for data received and transmitted by messenger service, and server using method
CN108063752A (en) * 2017-11-02 2018-05-22 暨南大学 A kind of credible genetic test and data sharing method based on block chain and proxy re-encryption technology
US10417219B1 (en) * 2018-03-28 2019-09-17 Macrogen, Inc. Data sharing method based on plurality of blockchains
CN108768700A (en) * 2018-05-11 2018-11-06 北京奇虎科技有限公司 Reward distribution method, apparatus and system in a kind of block chain
CN108880784A (en) * 2018-05-28 2018-11-23 江苏众享金联科技有限公司 User privacy information shared system under a kind of different trust domain of solution based on block chain
CN109040012A (en) * 2018-06-19 2018-12-18 西安电子科技大学 A kind of data security protecting and sharing method based on block chain and system and application
CN109389485A (en) * 2018-09-30 2019-02-26 深圳市有情矿技术有限公司 Block chain dynamic exciting method under autonomous domain model based on information sharing contribution margin
CN109462588A (en) * 2018-11-13 2019-03-12 上海物融智能科技有限公司 A kind of decentralization data trade method and system based on block chain
CN110460590A (en) * 2018-12-07 2019-11-15 深圳市智税链科技有限公司 Data managing method, device, medium and the electronic equipment of block catenary system
CN109669986A (en) * 2018-12-12 2019-04-23 深圳乐信软件技术有限公司 Blacklist sharing method, device, equipment and storage medium based on block chain
CN109831501A (en) * 2019-01-30 2019-05-31 京东数字科技控股有限公司 Information dispensing method and system based on block chain
CN110349056A (en) * 2019-06-03 2019-10-18 阿里巴巴集团控股有限公司 Transaction processing system and method based on block chain
CN110611657A (en) * 2019-08-16 2019-12-24 中国人民银行数字货币研究所 File stream processing method, device and system based on block chain
CN110601853A (en) * 2019-09-17 2019-12-20 腾讯科技(深圳)有限公司 Block chain private key generation method and equipment
CN110839015A (en) * 2019-10-12 2020-02-25 深圳壹账通智能科技有限公司 Log storage and reading method, device, equipment and medium based on block chain

Also Published As

Publication number Publication date
CN111339206A (en) 2020-06-26

Similar Documents

Publication Publication Date Title
CN110266480B (en) Data transmission method, device and storage medium
CN108123800B (en) Key management method, key management device, computer equipment and storage medium
CN111339206B (en) Block chain-based data sharing method and device
CN108777685B (en) Method and apparatus for processing information
CN113364795B (en) Data transmission method and proxy server
CN113536327A (en) Data processing method, device and system
CN116303608A (en) Data processing method and device for application service
CN111984615B (en) File sharing method, device and system
CN112905990A (en) Access method, client, server and access system
WO2024060630A1 (en) Data transmission management method, and data processing method and apparatus
CN112488577A (en) Information generation method and device, electronic equipment and computer readable medium
CN107707528B (en) Method and device for isolating user information
CN111931204A (en) Encryption and de-duplication storage method and terminal equipment for distributed system
CN116346486A (en) Combined login method, device, equipment and storage medium
CN111984613B (en) Method, device and system for sharing files
CN102833076A (en) Account information encryption method and system
CN113761566A (en) Data processing method and device
CN109657481B (en) Data management method and device
CN111737218A (en) File sharing method and device
CN113420331B (en) Method and device for managing file downloading permission
CN111814440B (en) Cloud document processing method, device and system
CN110602074B (en) Service identity using method, device and system based on master-slave association
CN113297605B (en) Copy data management method, apparatus, electronic device, and computer readable medium
CN111786874B (en) Caller identification method and device
CN111783044B (en) Method and device for sharing login state

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
TA01 Transfer of patent application right

Effective date of registration: 20220926

Address after: 12 / F, 15 / F, 99 Yincheng Road, China (Shanghai) pilot Free Trade Zone, Pudong New Area, Shanghai, 200120

Applicant after: Jianxin Financial Science and Technology Co.,Ltd.

Address before: 25 Financial Street, Xicheng District, Beijing 100033

Applicant before: CHINA CONSTRUCTION BANK Corp.

Applicant before: Jianxin Financial Science and Technology Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant