Data sharing method, device, equipment and medium

By using encryption and proxy server forwarding methods in the blockchain data sharing platform, the problem of low efficiency and security when querying and obtaining data by the blockchain data sharing platform is solved, and more efficient and secure data sharing is achieved.

CN115459928BActive Publication Date: 2025-03-18CHINA CONSTRUCTION BANK +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211082183.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-06
Publication Date
2025-03-18
Estimated Expiration
2042-09-06

AI Technical Summary

Technical Problem

The blockchain data sharing platform is less efficient and secure when querying and obtaining data, mainly due to the network blockage between the query node and the data providing node and data security issues.

Method used

The query node uses the public key of the shared node to which the data proof information belongs to encrypt the data proof information, and forwards it to the shared node through the proxy server. After the shared node uses the private key to decrypt it, it encrypts the target data and forwards it to the query node through the proxy server, and the query node then decrypts the target data.

Benefits of technology

This method forwards data through a proxy server, avoiding the situation where the query node and the shared node network are blocked, improving the efficiency of data sharing, and improving the security of data through dual encryption protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115459928B_ABST
    Figure CN115459928B_ABST
Patent Text Reader

Abstract

The present application relates to the field of data processing, and to a data sharing method, device, equipment and medium, which are used to solve the problem of low efficiency and security of data sharing. It includes: responding to a data acquisition instruction triggered by a user, obtaining data proof information from at least one shared node in the blockchain using a data index determined based on the data acquisition instruction, wherein the data proof information is a hash value after the data is hashed and encrypted; for any data proof information, encrypt the data proof information using the public key of the shared node to which the data proof information belongs, and forward the encrypted data proof information to the shared node through a proxy server, so that the shared node uses its own private key to decrypt the encrypted data proof information, and uses the public key of the query node to encrypt the target data matching the data proof information and forward it through the proxy server; decrypt the encrypted target data using its own private key to obtain the target data.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] Blockchain is a chain of blocks. Each block stores certain information, and they are connected into a chain in the order of their generation. This chain is stored in all servers. As long as there is one server in the entire system that can work, the entire blockchain is safe. These servers are called nodes in the blockchain system, and they provide storage space and computing power support for the entire blockchain system. If you want to modify the information in the blockchain, you must obtain the consent of more than half of the nodes and modify the information in all nodes. These nodes are usually in the hands of different entities, so it is extremely difficult to tamper with the information in the blockchain. Compared with traditional networks, blockchain has two core characteristics: one is that data is difficult to tamper with, and the other is decentralization. Based on these two characteristics, the information recorded in the blockchain is more authentic and reliable, which can help solve the problem of people's distrust.

[0003] At present, what is uploaded to the contract on the blockchain data sharing platform is data proof information, and the specific data is stored in the local node of the shared data. When querying, the data corresponding to the same identification factor may be stored in multiple nodes. To obtain this data, it is necessary to call the node that provides the data to obtain it. The query node may not be connected to the network of each data provider, and there are also data security issues, which leads to low efficiency and security of data sharing. Summary of the invention

[0004] In an exemplary embodiment of the present application, a data sharing method is provided to improve the efficiency of data sharing and the security of data.

[0005] The first aspect of the present application provides a data sharing method, which is applied to a query node in a blockchain, and the method comprises:

[0006] In response to a data acquisition instruction triggered by a user, determining a data index based on the data acquisition instruction;

[0007] Using the data index, obtaining data proof information from at least one shared node in the blockchain, wherein the data proof information is a hash value after hashing the data;

[0008] For any piece of data certification information, encrypt the data certification information using the public key of the shared node to which the data certification information belongs to obtain the encrypted data certification information; and,

[0009] Forwarding the encrypted data proof information to the shared node through the proxy server, so that the shared node uses its own private key to decrypt the encrypted data proof information, and uses the public key of the query node to encrypt the target data matching the data proof information, and then forwards it to the query node through the proxy server;

[0010] The received encrypted target data is decrypted using its own private key to obtain the target data.

[0011] In this embodiment, the query node uses the public key of the shared node to which the data proof information belongs to encrypt the data proof information and then forwards it to the shared node through the proxy server, so that the shared node uses its own private key to decrypt the encrypted data proof information, and then uses the public key of the query node to encrypt the target data matching the data proof information and send it to the query node, and then the query node uses its own private key to decrypt the received encrypted target data to obtain the target data. Therefore, in this embodiment, the proxy server is used to forward data, which avoids the situation where the query node and the shared node network are different, and improves the efficiency of data sharing. In addition, in this embodiment, both the data proof information and the target data are encrypted, which improves the security of the data.

[0012] In one embodiment, before forwarding the encrypted data certification information to the shared node via the proxy server, the method further includes:

[0013] Using its own private key to sign the shared node identifier to obtain the signed shared node identifier;

[0014] The step of forwarding the encrypted data certification information to the shared node via a proxy server further includes:

[0015] The signed shared node identifier is forwarded to the shared node through the proxy server, so that the shared node uses its own private key to decrypt the encrypted data certification information after successfully verifying the signed shared node identifier using the public key of the query node.

[0016] In this embodiment, before the encrypted data certification information is forwarded to the shared node through the proxy server, the shared node identifier needs to be signed with its own private key, and the shared node identifier after signing needs to be forwarded to the shared node through the proxy server, so that the shared node uses its own private key to verify the shared node identifier after signing with the public key of the query node. Thus, the security of the data is further improved.

[0017] In one embodiment, the step of signing the shared node identifier using its own private key to obtain the signed shared node identifier includes:

[0018] The shared node identifier is signed based on the private key of the shared node using the SM2 collaborative signature algorithm to obtain the shared node identifier after signing.

[0019] In this embodiment, the shared node identifier is signed based on the private key of the shared node using the SM2 collaborative signature algorithm to obtain the shared node identifier after signing, thereby ensuring the accuracy of the signature.

[0020] In one embodiment, encrypting the data certification information using the public key of the shared node to which the data certification information belongs to obtain the encrypted data certification information includes:

[0021] Encrypting the data certification information based on the public key of the shared node using the SM2 encryption algorithm to obtain the encrypted data certification information;

[0022] The method of decrypting the encrypted target data using its own private key to obtain the target data includes:

[0023] The encrypted target data is decrypted using the SM2 decryption algorithm based on its own private key to obtain the target data.

[0024] In this embodiment, the data proof information is encrypted by the SM2 encryption algorithm, and the decrypted target data is decrypted by the SM2 decryption algorithm. Thus, encryption and decryption are performed respectively using symmetric encryption and decryption algorithms, thereby ensuring the accuracy of encryption and decryption.

[0025] A second aspect of the present application provides a data sharing method, which is applied to a shared node in a blockchain, and the method comprises:

[0026] Receiving the encrypted data proof information forwarded by the query node through the proxy server, decrypting the encrypted data proof information using the public key of the query node to obtain the data proof information, wherein the data proof information is a hash value after the data is hashed;

[0027] Determine the target data corresponding to the data proof information by using the preset corresponding relationship between the data proof information and the data;

[0028] The target data is encrypted based on the public key of the query node to obtain the encrypted target data, and the encrypted target data is forwarded to the query node through a proxy server.

[0029] In this embodiment, the encrypted data certification information forwarded by the query node through the proxy server is received by the shared node, and the encrypted data certification information is decrypted using the public key of the query node, and the target data is determined based on the decrypted data certification information, and finally the target data is encrypted based on the public key of the query node, and the encrypted target data is forwarded to the query node through the proxy server. Therefore, in this embodiment, the data is forwarded through the proxy server, which avoids the situation where the query node and the shared node network are different, and the efficiency of data sharing is improved. In addition, in this embodiment, both the data certification information and the data are encrypted, which improves the security of data sharing.

[0030] In one embodiment, before decrypting the encrypted data proof information using the public key of the query node to obtain the data proof information, the method further includes:

[0031] Receiving the signed shared node identifier forwarded by the query node through the proxy server, and verifying the signed shared node identifier;

[0032] If it is determined that the signature verification is successful, then the step of using the public key of the query node to decrypt the encrypted data proof information to obtain the data proof information is determined to be executed.

[0033] In this embodiment, the shared node identification after signing is received by the query node through the proxy server, and the shared node identification after signing is verified. If the verification is successful, the encrypted data certification information is decrypted, thereby further improving the security of data sharing.

[0034] In one embodiment, verifying the signature of the shared node identifier after signing includes:

[0035] The SM2 collaborative signature algorithm is used to verify the identity of the signed shared node.

[0036] In this embodiment, the SM2 collaborative signature algorithm is used to verify the identity of the shared node after the signature, thereby further ensuring the security of data sharing.

[0037] In one embodiment, decrypting the encrypted data certification information using the public key of the query node to obtain the data certification information includes:

[0038] Decrypting the encrypted data proof information based on the public key of the query node using the SM2 decryption algorithm to obtain the data proof information;

[0039] The encrypting the target data based on the public key of the query node to obtain the encrypted target data includes:

[0040] The target data is encrypted based on the public key of the query node using the SM2 encryption algorithm to obtain the encrypted target data.

[0041] In this embodiment, the data proof information is encrypted by the SM2 encryption algorithm, and the decrypted target data is decrypted by the SM2 decryption algorithm. Thus, encryption and decryption are performed respectively using symmetric encryption and decryption algorithms, thereby ensuring the accuracy of encryption and decryption.

[0042] A third aspect of the present application provides a data sharing device, the device comprising:

[0043] A data index determination module, configured to respond to a data acquisition instruction triggered by a user and determine a data index based on the data acquisition instruction;

[0044] An acquisition module, configured to acquire data proof information from at least one shared node in the blockchain using the data index, wherein the data proof information is a hash value after hashing the data;

[0045] A data proof information encryption module, used for encrypting any piece of data proof information using a public key of a shared node to which the data proof information belongs, to obtain the encrypted data proof information; and

[0046] a forwarding module, configured to forward the encrypted data proof information to the shared node through a proxy server, so that the shared node decrypts the encrypted data proof information using its own private key, and encrypts the target data matching the data proof information using the public key of the query node, and then forwards it to the query node through the proxy server;

[0047] The target data decryption module is used to decrypt the received encrypted target data using its own private key to obtain the target data.

[0048] In one embodiment, the apparatus further comprises:

[0049] A signature module, used for signing the shared node identifier with its own private key before forwarding the encrypted data certification information to the shared node through the proxy server to obtain the shared node identifier after signing;

[0050] The forwarding module is further used for:

[0051] The signed shared node identifier is forwarded to the shared node through the proxy server, so that the shared node uses its own private key to decrypt the encrypted data certification information after successfully verifying the signed shared node identifier using the public key of the query node.

[0052] In one embodiment, the signature module is specifically used to:

[0053] The shared node identifier is signed based on the private key of the shared node using the SM2 collaborative signature algorithm to obtain the shared node identifier after signing.

[0054] In one embodiment, the data proof information encryption module is specifically used to:

[0055] Encrypting the data certification information based on the public key of the shared node using the SM2 encryption algorithm to obtain the encrypted data certification information;

[0056] The target data decryption module is specifically used for:

[0057] The encrypted target data is decrypted using the SM2 decryption algorithm based on its own private key to obtain the target data.

[0058] A fourth aspect of the present application provides another data sharing device, the device comprising:

[0059] A data proof information decryption module is used to receive the encrypted data proof information forwarded by the query node through the proxy server, and decrypt the encrypted data proof information using the public key of the query node to obtain the data proof information, wherein the data proof information is a hash value after the data is hashed;

[0060] A target data determination module, used to determine target data corresponding to the data certification information by using a preset correspondence relationship between the data certification information and the data;

[0061] The target data encryption module is used to encrypt the target data based on the public key of the query node to obtain the encrypted target data, and forward the encrypted target data to the query node through a proxy server.

[0062] In one embodiment, the apparatus further comprises:

[0063] A signature verification module, used for decrypting the encrypted data proof information using the public key of the query node, receiving the identity of the shared node after signing forwarded by the query node through the proxy server before obtaining the data proof information, and verifying the identity of the shared node after signing;

[0064] The signature verification success module is used to determine the step of decrypting the encrypted data proof information using the public key of the query node to obtain the data proof information if the signature verification is successful.

[0065] In one embodiment, the signature verification module is specifically used to:

[0066] The SM2 collaborative signature algorithm is used to verify the identity of the signed shared node.

[0067] In one embodiment, the data proof information decryption module is specifically used to:

[0068] Decrypting the encrypted data proof information based on the public key of the query node using the SM2 decryption algorithm to obtain the data proof information;

[0069] The target data encryption module is specifically used for:

[0070] The target data is encrypted based on the public key of the query node using the SM2 encryption algorithm to obtain the encrypted target data.

[0071] A fifth aspect of the present application provides an electronic device, including:

[0072] A memory for storing program instructions;

[0073] The processor is used to call the program instructions stored in the memory, and execute the steps included in the method of any one of the first aspect and / or the second aspect according to the obtained program instructions.

[0074] A sixth aspect of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes any one of the methods in the first aspect and / or the second aspect.

[0075] A seventh aspect of the present application provides a computer program product, which includes: a computer program code, which, when executed on a computer, enables the computer to execute any one of the methods in the first aspect and / or the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0077] Figure 1 This is a schematic diagram of an application scenario in an embodiment of the present application;

[0078] Figure 2 This is one of the flowcharts of the data sharing method in one embodiment of the present application;

[0079] Figure 3 This is a second flow chart of a data sharing method according to an embodiment of the present application;

[0080] Figure 4 This is one of the structural schematic diagrams of a data sharing device according to an embodiment of the present application;

[0081] Figure 5 The second structural diagram of a data sharing device according to an embodiment of the present application;

[0082] Figure 6 A schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0083] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be arbitrarily combined with each other. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.

[0084] The terms "first" and "second" in the specification and claims of the present application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of their variations are intended to cover non-exclusive protection. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. "Multiple" in the present application can mean at least two, for example, two, three or more, and the embodiments of the present application are not limited.

[0085] In the technical solution of this application, the collection, dissemination, and use of data are in compliance with the requirements of relevant national laws and regulations.

[0086] Before introducing the data sharing method provided in the embodiment of the present application, in order to facilitate understanding, the technical background of the embodiment of the present application is first introduced in detail below.

[0087] In the prior art, what is uploaded to the contract by the blockchain data sharing platform is data proof information, and the specific data is stored in the local node of the shared data. When querying, the data corresponding to the same identification factor may be stored in multiple nodes. To obtain this data, it is necessary to call the node that provides the data to obtain it. The query node may not be connected to the network of each data provider, and there are also data security issues, which leads to low efficiency and security of data sharing.

[0088] Therefore, the present application provides a data sharing method, in which the query node uses the public key of the shared node to which the data proof information belongs to encrypt the data proof information and then forwards it to the shared node through a proxy server, so that the shared node uses its own private key to decrypt the encrypted data proof information, and then uses the public key of the query node to encrypt the target data matching the data proof information and send it to the query node, and then the query node uses its own private key to decrypt the received encrypted target data to obtain the target data. Therefore, in this embodiment, data is forwarded through a proxy server, thereby avoiding the situation where the query node and the shared node network are different, improving the efficiency of data sharing, and in this embodiment, both the data proof information and the target data are encrypted, that is, the data is doubly encrypted, improving the security of the data. Below, the data sharing method of the present application is described in detail in conjunction with the accompanying drawings.

[0089] like Figure 1, which is a schematic diagram of an application scenario of the data sharing method provided in an embodiment of the present application. The application scenario includes multiple shared servers 110, query servers 120 and proxy servers 130, wherein the shared servers 110 and query servers are nodes in the blockchain.

[0090] In a possible application scenario, the query server 120 responds to a data acquisition instruction triggered by a user, determines a data index based on the data acquisition instruction, and uses the data index to obtain data proof information from at least one shared server 110 in the blockchain, wherein the data proof information is a hash value after hashing the data. Then, the query server 120 encrypts any data proof information using the public key of the shared node to which the data proof information belongs to obtain the encrypted data proof information; and forwards the encrypted data proof information to the shared server 110 through the proxy server 130, so that the shared server 110 uses its own private key to decrypt the encrypted data proof information, and uses the public key of the query server 120 to encrypt the target data matching the data proof information, and then forwards it to the query server 120 through the proxy server 130, and then the query server 120 uses its own private key to decrypt the received encrypted target data to obtain the target data.

[0091] Among them, the description in this application only details three shared servers 110, a single query server 120 and a single proxy server 130, but those skilled in the art should understand that the shared servers 110, query servers 120 and proxy servers 130 shown are intended to represent the operations of the shared servers 110, query servers 120 and proxy servers 130 involved in the technical solution of this application. It does not imply that there is a limitation on the number, type or location of the shared servers 110, query servers 120 and proxy servers 130. It should be noted that if additional modules are added to the illustrated environment or individual modules are removed therefrom, the underlying concepts of the exemplary embodiments of this application will not be changed.

[0092] It should be noted that the data sharing method proposed in this application is not only applicable to Figure 1 The application scenario shown is also applicable to any device with data sharing.

[0093] The following describes the data sharing method of the exemplary implementation of the present application in combination with the application scenarios described above and with reference to the accompanying drawings. It should be noted that the above application scenarios are only shown to facilitate understanding of the methods and principles of the present application, and the implementation of the present application is not limited in this respect.

[0094] like Figure 2FIG. 1 is a flow chart of the data sharing method of the present disclosure, which may include the following steps:

[0095] Step 201: A query node in the blockchain responds to a data acquisition instruction triggered by a user and determines a data index based on the data acquisition instruction;

[0096] The data acquisition instruction includes the data index. For example, if a user queries his / her own loan information, the data index may be the identity information input by the user, and the loan information acquisition instruction triggered by the user includes the identity information input by the user.

[0097] Step 202: The query node uses the data index to obtain data proof information from at least one shared node in the blockchain, wherein the data proof information is a hash value after the data is hashed and encrypted;

[0098] Among them, the corresponding relationship between data index and data proof information is pre-stored in the blockchain, and the data proof information corresponding to the data index in the data acquisition instruction can be directly determined based on the corresponding relationship. And each piece of data proof information is uploaded by each shared node, so it is necessary to obtain the data proof information corresponding to the data index in the data acquisition instruction from the corresponding shared node.

[0099] For example, data proof information includes: data proof information 1, data proof information 2, data proof information 3, and data proof information 4. Among them, data proof information 1 and data proof information 2 are uploaded to the blockchain by shared node A. Data proof information 3 is uploaded to the blockchain by shared node B. Data proof information 4 is uploaded to the blockchain by shared node C. If the query node needs to obtain data proof information 3, it obtains data proof information 3 from shared node B. If the query node needs to obtain data proof information 1 and data proof information 4, it obtains data proof information 1 from shared node A, and obtains data proof information 4 from shared node C.

[0100] Step 203: the query node encrypts any piece of data proof information using the public key of the shared node to which the data proof information belongs, to obtain the encrypted data proof information;

[0101] In one embodiment, step 203 may be implemented as follows: using the SM2 encryption algorithm to encrypt the data certification information based on the public key of the shared node to obtain the encrypted data certification information.

[0102] It should be noted that the SM2 encryption algorithm in this embodiment is only used for illustration, and the specific encryption algorithm can be set according to actual conditions. This embodiment does not limit the encryption algorithm.

[0103] Step 204: The query node sends the encrypted data certification information to the proxy server;

[0104] Step 205: The proxy server forwards the encrypted data proof information to the shared node in the blockchain;

[0105] In order to further ensure the accuracy of data sharing, in one embodiment, before executing step 205, the identifier of the shared node is signed using its own private key to obtain the signed identifier of the shared node, and the signed identifier of the shared node is forwarded to the shared node through the proxy server.

[0106] In one embodiment, the shared node identifier is signed based on the own private key using the SM2 collaborative signature algorithm to obtain the signed shared node identifier.

[0107] It should be noted that the SM2 collaborative signature algorithm in this embodiment is only used for illustration, but does not limit the signature method used. The signature method in this embodiment can be set according to actual conditions.

[0108] Step 206: The shared node receives the encrypted data certification information forwarded by the query node through the proxy server, and decrypts the encrypted data certification information using the public key of the query node to obtain the data certification information;

[0109] In order to further ensure the accuracy of data sharing, in one embodiment, the encrypted data proof information is decrypted using the public key of the query node. Before obtaining the data proof information, the signed shared node identifier forwarded by the query node through the proxy server is received, and the signed shared node identifier is verified; if it is determined that the verification is successful, then the step of decrypting the encrypted data proof information using the public key of the query node to obtain the data proof information is determined.

[0110] In one embodiment, the specific signature verification method in this embodiment is: using the SM2 collaborative signature algorithm to verify the identity of the shared node after the signature.

[0111] It should be noted that the method of verifying signatures using the SM2 collaborative signature algorithm in this embodiment is only used as an example. The specific method of verifying signatures can be set according to actual conditions. This embodiment does not limit the specific method of verifying signatures.

[0112] In one embodiment, step 206 may be implemented as follows: using the SM2 decryption algorithm to decrypt the encrypted data certification information based on the public key of the query node to obtain the data certification information.

[0113] Step 207: The shared node determines the target data corresponding to the data proof information by using the preset correspondence between the data proof information and the data; wherein Table 1 is the correspondence between the data proof information and the data:

[0114] Data proof information data Data Proof Information A Data 1 Data proof information B Data 2 Data Proof Information C Data 3 … …

[0115] Table 1

[0116] For example, as shown in Table 1, if the data certification information is determined to be data certification information B, then the target data is determined to be data 2.

[0117] Step 208: The sharing node encrypts the target data based on the public key of the query node to obtain the encrypted target data;

[0118] In one embodiment, step 208 may be implemented as follows: using the SM2 encryption algorithm to encrypt the target data based on the public key of the query node to obtain the encrypted target data.

[0119] It should be noted that: the SM2 encryption algorithm in this embodiment is used to encrypt the target data only for illustration and does not limit the encryption method. The specific encryption method can be set according to actual conditions.

[0120] Step 209: Send the encrypted target data to the proxy server;

[0121] Step 210: The proxy server sends the target data to the query node;

[0122] Step 211: The query node receives the encrypted target data, and uses its own private key to decrypt the received encrypted target data to obtain the target data.

[0123] In one embodiment, step 211 may be implemented as follows: using the SM2 decryption algorithm to decrypt the encrypted target data based on its own private key to obtain the target data.

[0124] It should be noted that: the SM2 decryption algorithm in this embodiment decrypts the encrypted target data only for illustration and does not limit the specific decryption method. The specific decryption method can be set according to actual conditions.

[0125] In order to further understand the technical solution of this application, Figure 3A detailed description of the data sharing method in this application may include the following steps:

[0126] Step 301: the query node responds to a data acquisition instruction triggered by a user and determines a data index based on the data acquisition instruction;

[0127] Step 302: The query node uses the data index to obtain data proof information from at least one shared node in the blockchain, wherein the data proof information is a hash value after the data is hashed and encrypted;

[0128] Step 303: the query node encrypts any piece of data proof information using the public key of the shared node to which the data proof information belongs, to obtain the encrypted data proof information;

[0129] Step 304: the query node signs the shared node identifier using its own private key to obtain the signed shared node identifier;

[0130] Step 305: The query node sends the encrypted data certification information and the signed shared node identifier to the proxy server;

[0131] Step 306: The proxy server sends the encrypted data certification information and the signed shared node identifier to the shared node;

[0132] Step 307: The shared node receives the encrypted data certification information and the signed shared node identifier forwarded by the proxy server;

[0133] Step 308: The shared node verifies the shared node's identity after signing to determine whether the verification is successful. If so, execute step 309; if not, end the process.

[0134] Step 309: The shared node decrypts the encrypted data certification information using the public key of the query node to obtain the data certification information;

[0135] Step 310: The sharing node determines the target data corresponding to the data certification information by using the preset correspondence between the data certification information and the data;

[0136] Step 311: The sharing node encrypts the target data based on the public key of the query node to obtain the encrypted target data;

[0137] Step 312: The shared node sends the encrypted target data to the proxy server;

[0138] Step 313: The proxy server sends the encrypted target data to the query node;

[0139] Step 314: The query node receives the encrypted target data, and uses its own private key to decrypt the received encrypted target data to obtain the target data.

[0140] Based on the same inventive concept, the data sharing method described above in the present application can also be implemented by a data sharing device. The effect of the data sharing device is similar to that of the above method, and will not be described in detail here.

[0141] Figure 4 It is a structural diagram of a data sharing device according to an embodiment of the present application.

[0142] like Figure 4 As shown, the data sharing device 400 of the present application may include a data index determination module 410 , an acquisition module 420 , a data proof information encryption module 430 , a forwarding module 440 and a target data decryption module 450 .

[0143] A data index determination module 410, configured to respond to a data acquisition instruction triggered by a user and determine a data index based on the data acquisition instruction;

[0144] An acquisition module 420 is used to acquire data proof information from at least one shared node in the blockchain using the data index, wherein the data proof information is a hash value after hashing the data;

[0145] The data proof information encryption module 430 is used to encrypt any piece of data proof information using the public key of the shared node to which the data proof information belongs, to obtain the encrypted data proof information;

[0146] The forwarding module 440 is used to forward the encrypted data proof information to the shared node through the proxy server, so that the shared node uses its own private key to decrypt the encrypted data proof information, and uses the public key of the query node to encrypt the target data matching the data proof information, and then forward it to the query node through the proxy server;

[0147] The target data decryption module 450 is used to decrypt the received encrypted target data using its own private key to obtain the target data.

[0148] In one embodiment, the apparatus further comprises:

[0149] The signature module 460 is used to sign the shared node identifier using its own private key before forwarding the encrypted data certification information to the shared node through the proxy server to obtain the shared node identifier after signing;

[0150] The forwarding module 440 is further configured to:

[0151] The signed shared node identifier is forwarded to the shared node through the proxy server, so that the shared node uses its own private key to decrypt the encrypted data certification information after successfully verifying the signed shared node identifier using the public key of the query node.

[0152] In one embodiment, the signature module 460 is specifically used to:

[0153] The shared node identifier is signed based on the private key of the shared node using the SM2 collaborative signature algorithm to obtain the shared node identifier after signing.

[0154] In one embodiment, the data proof information encryption module 430 is specifically used to:

[0155] Encrypting the data certification information based on the public key of the shared node using the SM2 encryption algorithm to obtain the encrypted data certification information;

[0156] The target data decryption module 450 is specifically used for:

[0157] The encrypted target data is decrypted using the SM2 decryption algorithm based on its own private key to obtain the target data.

[0158] Figure 5 FIG. 4 is another structural diagram of a data sharing device according to an embodiment of the present application.

[0159] like Figure 5 As shown, the data sharing device 500 of the present application may include a data certification information decryption module 510 , a target data determination module 520 and a target data encryption module 530 .

[0160] The data proof information decryption module 510 is used to receive the encrypted data proof information forwarded by the query node through the proxy server, and decrypt the encrypted data proof information using the public key of the query node to obtain the data proof information, wherein the data proof information is a hash value after the data is hashed;

[0161] The target data determination module 520 is used to determine the target data corresponding to the data certification information by using the preset correspondence relationship between the data certification information and the data;

[0162] The target data encryption module 530 is used to encrypt the target data based on the public key of the query node to obtain the encrypted target data, and forward the encrypted target data to the query node through a proxy server.

[0163] In one embodiment, the apparatus further comprises:

[0164] The signature verification module 540 is used to decrypt the encrypted data proof information using the public key of the query node, receive the shared node identifier after signing forwarded by the query node through the proxy server before obtaining the data proof information, and verify the shared node identifier after signing;

[0165] The signature verification success module 550 is used to determine the step of decrypting the encrypted data proof information using the public key of the query node to obtain the data proof information if the signature verification is successful.

[0166] In one embodiment, the signature verification module 540 is specifically configured to:

[0167] The SM2 collaborative signature algorithm is used to verify the identity of the signed shared node.

[0168] In one embodiment, the data proof information decryption module 510 is specifically used to:

[0169] Decrypting the encrypted data proof information based on the public key of the query node using the SM2 decryption algorithm to obtain the data proof information;

[0170] The target data encryption module 530 is specifically used for:

[0171] The target data is encrypted based on the public key of the query node using the SM2 encryption algorithm to obtain the encrypted target data.

[0172] After introducing a data sharing method and device according to an exemplary embodiment of the present application, next, an electronic device according to another exemplary embodiment of the present application is introduced.

[0173] Those skilled in the art will appreciate that various aspects of the present application may be implemented as a system, method or program product. Therefore, various aspects of the present application may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to as "circuit", "module" or "system" herein.

[0174] In some possible implementations, the electronic device according to the present application may include at least one processor and at least one computer storage medium. The computer storage medium stores program code, and when the program code is executed by the processor, the processor executes the steps of the data sharing method according to various exemplary implementations of the present application described above in this specification. For example, the processor may execute the following steps: Figure 2 Steps 201-211 shown in .

[0175] Refer to the following Figure 6 The electronic device 600 according to this embodiment of the present application is described. Figure 6 The electronic device 600 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0176] like Figure 6 As shown, the electronic device 600 is in the form of a general electronic device. The components of the electronic device 600 may include but are not limited to: at least one processor 601, at least one computer storage medium 602, and a bus 603 connecting different system components (including the computer storage medium 602 and the processor 601).

[0177] Bus 603 represents one or more of several types of bus structures, including a computer storage media bus or computer storage media controller, a peripheral bus, a processor, or a local bus using any of a variety of bus architectures.

[0178] The computer storage media 602 may include readable media in the form of volatile computer storage media, such as random access computer storage media (RAM) 621 and / or cache storage media 622 , and may further include read-only computer storage media (ROM) 623 .

[0179] The computer storage medium 602 may also include a program / utility 625 having a set (at least one) of program modules 624, such program modules 624 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0180] The electronic device 600 may also communicate with one or more external devices 604 (e.g., keyboards, pointing devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 600, and / or may communicate with any device that enables the electronic device 600 to communicate with one or more other electronic devices (e.g., routers, modems, etc.). This communication may be performed via an input / output (I / O) interface 605. In addition, the electronic device 600 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 606. As shown, the network adapter 606 communicates with other modules for the electronic device 600 via a bus 603. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0181] In some possible implementations, various aspects of a data sharing method provided by the present application may also be implemented in the form of a program product, which includes program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute the steps of the data sharing method according to various exemplary implementations of the present application described above in this specification.

[0182] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access computer storage medium (RAM), a read-only computer storage medium (ROM), an erasable programmable read-only computer storage medium (EPROM or flash memory), an optical fiber, a portable compact disk read-only computer storage medium (CD-ROM), an optical computer storage medium, a magnetic computer storage medium, or any suitable combination of the above.

[0183] The data sharing program product of the embodiment of the present application can adopt a portable compact disk read-only computer storage medium (CD-ROM) and include program code, and can be run on an electronic device. However, the program product of the present application is not limited to this. In this document, the readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, device or device.

[0184] The readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein the readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0185] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0186] The program code for performing the operation of the present application can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and also conventional procedural programming languages ​​such as "C" language or similar programming languages. The program code can be executed entirely on the user electronic device, partially on the user device, as an independent software package, partially on the user electronic device and partially on the remote electronic device, or completely on the remote electronic device or server. In the case of involving a remote electronic device, the remote electronic device can be connected to the user electronic device through any type of network including a local area network (LAN) or a wide area network (WAN), or can be connected to an external electronic device (for example, using an Internet service provider to connect through the Internet).

[0187] It should be noted that, although several modules of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules described above can be embodied in one module. Conversely, the features and functions of one module described above can be further divided into multiple modules to be embodied.

[0188] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0189] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk computer storage media, CD-ROM, optical computer storage media, etc.) that contain computer-usable program code.

[0190] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0191] These computer program instructions may also be stored in a computer-readable computer storage medium that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable computer storage medium produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0192] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0193] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A data sharing method, characterized in that: Applied to a query node in a blockchain, the method comprises: In response to a data acquisition instruction triggered by a user, determining a data index based on the data acquisition instruction; Using the data index, obtaining data proof information from at least one shared node in the blockchain, wherein the data proof information is a hash value after hashing the data; For any piece of data certification information, encrypt the data certification information using the public key of the shared node to which the data certification information belongs to obtain the encrypted data certification information; and, Forwarding the encrypted data proof information to the shared node through the proxy server, so that the shared node uses its own private key to decrypt the encrypted data proof information, and uses the public key of the query node to encrypt the target data matching the data proof information, and then forwards it to the query node through the proxy server; The received encrypted target data is decrypted using its own private key to obtain the target data.

2. The method according to claim 1, characterized in that Before forwarding the encrypted data certification information to the shared node via the proxy server, the method further includes: Using its own private key to sign the shared node identifier to obtain the signed shared node identifier; The step of forwarding the encrypted data certification information to the shared node via a proxy server further includes: The signed shared node identifier is forwarded to the shared node through the proxy server, so that the shared node uses its own private key to decrypt the encrypted data certification information after successfully verifying the signed shared node identifier using the public key of the query node.

3. The method according to claim 2, characterized in that The step of signing the shared node identifier by using the own private key to obtain the shared node identifier after signing includes: The shared node identifier is signed based on the private key of the shared node using the SM2 collaborative signature algorithm to obtain the shared node identifier after signing.

4. The method according to claim 1, characterized in that The step of encrypting the data certification information by using the public key of the shared node to which the data certification information belongs to obtain the encrypted data certification information comprises: Encrypting the data certification information based on the public key of the shared node using the SM2 encryption algorithm to obtain the encrypted data certification information; The method of decrypting the encrypted target data using its own private key to obtain the target data includes: The encrypted target data is decrypted using the SM2 decryption algorithm based on its own private key to obtain the target data.

5. A data sharing method, characterized in that: Applied to a shared node in a blockchain, the method comprises: Receiving the encrypted data proof information forwarded by the query node through the proxy server, decrypting the encrypted data proof information using the public key of the query node to obtain the data proof information, wherein the data proof information is a hash value after the data is hashed; Determine the target data corresponding to the data proof information by using the preset corresponding relationship between the data proof information and the data; The target data is encrypted based on the public key of the query node to obtain the encrypted target data, and the encrypted target data is forwarded to the query node through a proxy server.

6. The method according to claim 5, characterized in that Before decrypting the encrypted data proof information using the public key of the query node to obtain the data proof information, the method further includes: Receiving the signed shared node identifier forwarded by the query node through the proxy server, and verifying the signed shared node identifier; If it is determined that the signature verification is successful, then the step of using the public key of the query node to decrypt the encrypted data proof information to obtain the data proof information is determined to be executed.

7. The method according to claim 6, characterized in that The verifying the signature of the shared node identifier after the signature includes: The SM2 collaborative signature algorithm is used to verify the identity of the signed shared node.

8. The method according to claim 5, characterized in that The decrypting the encrypted data certification information by using the public key of the query node to obtain the data certification information includes: Decrypting the encrypted data proof information based on the public key of the query node using the SM2 decryption algorithm to obtain the data proof information; The encrypting the target data based on the public key of the query node to obtain the encrypted target data includes: The target data is encrypted based on the public key of the query node using the SM2 encryption algorithm to obtain the encrypted target data.

9. A data sharing device, characterized in that: Applied to a query node in a blockchain, the device comprises: A data index determination module, configured to respond to a data acquisition instruction triggered by a user and determine a data index based on the data acquisition instruction; An acquisition module, configured to acquire data proof information from at least one shared node in the blockchain using the data index, wherein the data proof information is a hash value after hashing the data; A data proof information encryption module, used for encrypting any piece of data proof information using a public key of a shared node to which the data proof information belongs, to obtain the encrypted data proof information; and a forwarding module, configured to forward the encrypted data proof information to the shared node through a proxy server, so that the shared node decrypts the encrypted data proof information using its own private key, and encrypts the target data matching the data proof information using the public key of the query node, and then forwards it to the query node through the proxy server; The target data decryption module is used to decrypt the received encrypted target data using its own private key to obtain the target data.

10. The device according to claim 9, characterized in that The device also includes: A signature module, used for signing the shared node identifier with its own private key before forwarding the encrypted data certification information to the shared node through the proxy server to obtain the shared node identifier after signing; The forwarding module is further used for: The signed shared node identifier is forwarded to the shared node through the proxy server, so that the shared node uses its own private key to decrypt the encrypted data certification information after successfully verifying the signed shared node identifier using the public key of the query node.

11. The device according to claim 10, characterized in that The signature module is specifically used for: The shared node identifier is signed based on the private key of the shared node using the SM2 collaborative signature algorithm to obtain the shared node identifier after signing.

12. The device according to claim 9, characterized in that The data proof information encryption module is specifically used for: Encrypting the data certification information based on the public key of the shared node using the SM2 encryption algorithm to obtain the encrypted data certification information; The target data decryption module is specifically used for: The encrypted target data is decrypted using the SM2 decryption algorithm based on its own private key to obtain the target data.

13. A data sharing device, characterized in that: The device comprises: A data proof information decryption module is used to receive the encrypted data proof information forwarded by the query node through the proxy server, and use the public key of the query node to decrypt the encrypted data proof information to obtain the data proof information, wherein the data proof information is a hash value after the data is hashed; A target data determination module, used to determine target data corresponding to the data certification information by using a preset correspondence relationship between the data certification information and the data; The target data encryption module is used to encrypt the target data based on the public key of the query node to obtain the encrypted target data, and forward the encrypted target data to the query node through a proxy server.

14. The device according to claim 13, characterized in that The device also includes: A signature verification module, used for decrypting the encrypted data proof information using the public key of the query node, receiving the identity of the shared node after signing forwarded by the query node through the proxy server before obtaining the data proof information, and verifying the identity of the shared node after signing; The signature verification success module is used to determine the step of decrypting the encrypted data proof information using the public key of the query node to obtain the data proof information if the signature verification is successful.

15. The device according to claim 14, characterized in that The signature verification module is specifically used for: The SM2 collaborative signature algorithm is used to verify the identity of the signed shared node.

16. The device according to claim 13, characterized in that The data proof information decryption module is specifically used for: Decrypting the encrypted data proof information based on the public key of the query node using the SM2 decryption algorithm to obtain the data proof information; The target data encryption module is specifically used for: The target data is encrypted based on the public key of the query node using the SM2 encryption algorithm to obtain the encrypted target data.

17. An electronic device, characterized in that: include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute the steps included in the method of any one of claims 1-4 and 5-8 according to the obtained program instructions.

18. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the method according to any one of claims 1 to 4 and 5 to 8.

19. A computer program product, characterized in that The computer program product comprises: a computer program code, and when the computer program code is run on a computer, the computer is caused to perform the method according to any one of claims 1 to 4 and 5 to 8.

Citation Information

Patent Citations

  • Data security sharing method and device based on block chain, and medium

    CN111224786A

  • Digital identity signing and issuing method and device based on block chain and medium

    CN111935075A