A data storage method, device, equipment and storage medium
By using storage keys to encrypt data in a system that manages data in a decentralized data management system and uploading it to an off-chain storage network, combined with blockchain storage associated information, the problems of low storage efficiency and high cost in the existing technology are solved, and efficient and secure data storage is achieved.
Patent Information
- Application Number
- CN201910874810.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-09-17
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2039-09-17
AI Technical Summary
When decentralized management of data, the existing technology has low storage efficiency and high cost, and it is impossible to effectively store large files such as pictures and videos.
When a data storage instruction is detected, the storage key is used to encrypt the stored data, and the encrypted data is uploaded to the off-chain storage network to obtain the off-chain storage identifier. The storage key is encrypted based on the account information of the data provider to generate a query key. Then, based on the off-chain storage identifier, the account information of the data provider and the query key, a data storage transaction request is generated and transmitted to the blockchain network for data on-chain storage.
Decentralized storage of data is realized, storage efficiency is improved, storage costs are reduced, and the home ownership rights of data are clarified through the combination of storage keys and blockchain accounts, and the security of data storage is improved.
Smart Images

Figure CN110610101B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to computer technology, and in particular to the field of blockchain technology. Background Art
[0002] Decentralized management technology meets the needs of a more secure, reliable and controllable storage in a more decentralized network environment.
[0003] In the prior art, open blockchains such as Ethereum are usually used to store management data as additional data of transactions in blocks. However, the above method has low storage efficiency and is very expensive, and cannot store large files such as pictures and videos. Summary of the invention
[0004] The embodiments of the present application provide a data storage method, apparatus, device and storage medium to improve storage efficiency while reducing storage costs and improving the security of data storage in the process of decentralized data management.
[0005] In a first aspect, the present application provides a data storage method, which is applied to a client and includes:
[0006] When a data storage instruction triggered by a data provider is detected, the data to be stored is encrypted using a storage key, and the encrypted data to be stored is uploaded to an off-chain storage network to obtain an off-chain storage identifier for the data to be stored;
[0007] Encrypting the storage key based on the account information of the data provider to generate a query key;
[0008] Based on the off-chain storage identifier, the account information of the data provider and the query key, a data storage transaction request is generated and transmitted to the blockchain network, so that the blockchain node processes the data storage transaction request and stores the data in the data storage transaction request on the chain.
[0009] When the data storage instruction triggered by the data provider is detected, the embodiment of the present application uses a storage key to encrypt the data to be stored, and uploads the encrypted data to be stored to the off-chain storage network to obtain the off-chain storage identifier of the storage data; encrypts the storage key based on the account information of the data provider to generate a query key; generates a data storage transaction request based on the off-chain storage identifier, the account information of the data provider and the query key and transmits it to the blockchain network, so that the blockchain node processes the data storage transaction request and stores the data in the data storage transaction request on the chain. The above technical solution realizes the decentralized storage of data by storing the data subject of the data to be stored through the off-chain storage network and combining the blockchain storage of related information, thereby improving storage efficiency and reducing storage costs; at the same time, through the storage method combining the storage key and the blockchain account, the ownership of the stored data is clarified, and the security of data storage is improved.
[0010] Optionally, the method further includes:
[0011] When a data authorization instruction is detected to be triggered by a data provider, the account information of the party applying for authorization of the data to be authorized is obtained;
[0012] A data authorization transaction request is generated based on the account information of the authorization applicant and transmitted to the blockchain network, so that the blockchain node executes the data authorization transaction request and associates the data in the data authorization transaction request with the data to be authorized and stores them in the blockchain.
[0013] An optional implementation in the above application obtains the account information of the authorized applicant of the data to be authorized when a data authorization instruction triggered by the data provider is detected, and generates a data authorization transaction request based on the account information of the authorized applicant and transmits it to the blockchain network, so that the blockchain node executes the data authorization transaction request, and associates the data in the data authorization transaction request with the data to be authorized and stores it in the blockchain, thereby granting the authorized applicant the right to use the data to be authorized, thereby achieving the purpose of data sharing. At the same time, by migrating the authorization process to the blockchain network, it facilitates the unified management of off-chain stored data.
[0014] Optionally, before generating a data authorization transaction request based on the account information of the authorization applicant and transmitting the request to the blockchain network, the method further includes:
[0015] Obtaining a query key for the data to be authorized from the blockchain, and decrypting the query key for the data to be authorized based on the account private key of the data provider to obtain a storage key for the data to be authorized;
[0016] Based on the account information of the authorization applicant, the storage key of the data to be authorized is re-encrypted;
[0017] Accordingly, a data authorization transaction request is generated based on the account information of the authorization applicant and transmitted to the blockchain network, including:
[0018] Based on the re-encrypted storage key and the account information of the authorization applicant, a data authorization transaction request is generated and transmitted to the blockchain network.
[0019] An optional implementation in the above application is to obtain a query key for the data to be authorized from the blockchain before generating a data authorization transaction request based on the account information of the authorization applicant and transmitting it to the blockchain network, and decrypt the query key based on the account private key of the data provider to obtain the storage key, and at the same time, re-encrypt the storage key based on the account information of the authorization applicant, and generate a data authorization transaction request with the re-encrypted storage key and the account information of the authorization applicant, so as to directly associate the account information of the authorization applicant with the encrypted information of the data to be authorized, so as to facilitate the subsequent direct processing of the authorization applicant on the data to be authorized.
[0020] Optionally, before generating a data storage transaction request based on the off-chain storage identifier, the account information of the data provider and the query key, the method further includes:
[0021] Extracting fingerprint information of the data to be stored to obtain fingerprint data;
[0022] Accordingly, based on the off-chain storage identifier and the account information of the data provider, a data storage transaction request is generated, including:
[0023] A data storage transaction request is generated based on the off-chain storage identifier, the account information of the data provider and the fingerprint data.
[0024] An optional implementation in the above application is to extract fingerprint data of the data to be stored and reflect the fingerprint data in the data storage transaction request, thereby laying a foundation for subsequent verification of the correctness of the data to be stored based on the fingerprint data.
[0025] Optionally, the method further includes:
[0026] When a request for authorization instruction triggered by an authorization applicant is detected, an authorization application transaction request is generated based on the account information of the authorization applicant and the account information of the data provider of the data to be authorized and transmitted to the blockchain network, so that the blockchain node processes the authorization application transaction request and sends the account information of the authorization applicant to the data provider of the data to be authorized.
[0027] An optional implementation in the above application generates an authorization application transaction request based on the account information of the authorization applicant and the account information of the data provider of the data to be authorized when detecting the authorization request instruction triggered by the authorization applicant, so as to request the data provider to provide the account information of the authorization applicant with the help of blockchain, thereby laying the foundation for the data provider to grant the authorization applicant the right to use the data to be authorized, and by migrating the account information sending process to the blockchain network, it provides convenience for the unified management of off-chain stored data.
[0028] Optionally, before generating an authorization application transaction request based on the account information of the authorization applicant and the account information of the data provider of the data to be authorized and transmitting the request to the blockchain network, the method further includes:
[0029] When a data query request generated by an authorization applicant is detected, a data query transaction request is generated based on the query identifier of the data to be authorized and transmitted to the blockchain network, so that the blockchain node processes the data query transaction request, obtains the account information of the data provider of the data to be authorized, and feeds it back to the authorization applicant.
[0030] An optional implementation in the above application is to add an operation to obtain the account information of the data provider before generating an authorization application transaction request based on the account information of the authorization applicant and the account information of the data provider, thereby realizing on-chain acquisition of the account information of the data provider. By migrating the account information query process to the blockchain network, it provides convenience for the unified management of off-chain stored data.
[0031] Optionally, generating a data query transaction request based on the data to be authorized and transmitting it to the blockchain network also includes:
[0032] Generate a data query transaction request based on the data to be authorized and transmit it to the blockchain network, so that the blockchain node processes the data query transaction request, obtains and feeds back storage-related information of the data to be authorized; wherein the storage-related information includes an off-chain storage identifier of the data to be authorized and a query key corresponding to the account to be authorized provided by the data provider;
[0033] Searching for the data to be authorized in an off-chain storage network based on the off-chain storage identifier of the data to be authorized;
[0034] Decrypt the obtained query key using the account private key of the authorization applicant to obtain the storage key of the data to be authorized;
[0035] The acquired data to be authorized is decrypted based on the obtained storage key.
[0036] An optional implementation in the above application can also obtain storage-related information of the data to be authorized while acquiring the account information of the data provider when generating a data query transaction request, thereby acquiring and decrypting the data to be authorized from an off-chain storage network through the storage-related information, thereby achieving the acquisition of the data to be authorized and the verification of the existence of the data to be authorized, thereby improving the verification mechanism for the data to be authorized, and providing convenience for the unified management of off-chain storage data by adding relevant data for existence verification to the blockchain network.
[0037] Optionally, the storage association information also includes fingerprint data of the data to be authorized;
[0038] Correspondingly, after decrypting the acquired data to be authorized based on the obtained storage key, the method further includes:
[0039] Extracting fingerprint data of the data to be authorized, and verifying the correctness of the data to be authorized based on the extracted fingerprint data and the acquired fingerprint data.
[0040] An optional implementation in the above application further improves the verification mechanism for the data to be authorized by acquiring fingerprint data of the data to be authorized and verifying the correctness of the data to be authorized based on the acquired fingerprint data of the data to be authorized. By adding the data required for the correctness verification process to the blockchain network, it facilitates the unified management of off-chain stored data.
[0041] In a second aspect, the embodiment of the present application further provides a data storage method, which is applied to a blockchain node, including:
[0042] Receiving a data storage transaction request sent by a data provider; the data storage transaction request includes an off-chain storage identifier corresponding to the data to be stored in the off-chain storage network, the account information of the data provider, and a query key corresponding to the data to be stored;
[0043] Process the data storage transaction request, and store the data in the data storage transaction request on the chain;
[0044] The query key is generated by encrypting a storage key based on the account information of the data provider, and the storage key is used to encrypt the data to be stored in the off-chain storage network.
[0045] The embodiment of the present application receives a data storage transaction request sent by a data provider, which includes an off-chain storage identifier corresponding to the data to be stored in the off-chain storage network, the account information of the data provider, and a query key obtained by encrypting the storage key with the account information of the data provider, and processes the data storage transaction request, and then stores the above-mentioned associated information of the data to be stored on the chain, thereby achieving the effect of storing the data subject off-chain and storing the associated information on the chain, thereby realizing decentralized storage of data, improving data storage efficiency, and reducing data storage costs; at the same time, through the storage method that combines storage keys and blockchain accounts, the ownership of the stored data is clarified, and the security of data storage is improved.
[0046] Optionally, the method further includes:
[0047] Receiving a data authorization transaction request sent by a data provider; the data authorization transaction request includes account information of an authorization applicant;
[0048] Process the data authorization transaction request, and associate the data in the data authorization transaction request with the data to be authorized and store them in the blockchain.
[0049] An optional implementation in the above application, by receiving and processing a data authorization transaction request including the account information of the authorization applicant, realizes the management and storage of the account information of the authorization applicant and the data to be authorized in the blockchain, thereby granting the authorization applicant the right to use the data to be authorized with the help of the blockchain network, thereby achieving the purpose of data sharing, and at the same time, by migrating the authorization process to the blockchain network, it facilitates the unified management of off-chain stored data.
[0050] Optionally, the data authorization transaction request also includes a storage key provided by the data provider that is encrypted based on the account information of the authorization applicant.
[0051] An optional implementation in the above application is to add a storage key encrypted with the account information of the authorized applicant provided by the data provider in the data grant transaction request, so that the authorized applicant can directly obtain the authorized data from the off-chain storage network based on its own account private key, thereby facilitating the management of the authorized data by the authorized applicant.
[0052] Optionally, the data storage transaction request also includes fingerprint data of the data to be stored, and the fingerprint data is obtained by extracting fingerprint information of the data to be stored by a data provider.
[0053] An optional implementation in the above application is to add fingerprint data of the data to be stored extracted by the data provider in the data storage transaction request, thereby laying a foundation for subsequent verification of the correctness of the data to be stored based on the fingerprint data.
[0054] Optionally, the method further includes:
[0055] Receiving an authorization application transaction request sent by an authorization applicant, wherein the authorization application transaction request includes account information of the authorization applicant and account information of the data provider;
[0056] The authorization application transaction request is processed to send the account information of the authorization applicant to the data provider corresponding to the data to be authorized.
[0057] An optional implementation in the above application is to receive and process the authorization application transaction request including the account information of the authorization applicant and the account information of the data provider, and request the data provider to provide the account information of the authorization applicant with the help of blockchain, so that the data provider can grant the authorization applicant the right to use the data to be authorized. By migrating the account information sending process to the blockchain network, the unified management of off-chain stored data is facilitated.
[0058] Optionally, before receiving the authorization application transaction request sent by the authorization applicant, the method further includes:
[0059] Receiving a data query transaction request sent by an authorization applicant, wherein the data query transaction request includes a query identifier of the data to be authorized;
[0060] The data query transaction request is processed to obtain and feed back account information of a data provider corresponding to the data to be authorized according to a query identifier of the data to be authorized.
[0061] An optional implementation in the above application, by receiving and processing a data query transaction request including a query identifier with authorization data before receiving the authorization application transaction request sent by the authorization applicant, the account information of the data provider is queried with the help of the blockchain network, laying the foundation for the data provider to grant the authorization applicant the right to use the data to be authorized, and by migrating the account query process to the blockchain network, it provides convenience for the unified management of off-chain stored data.
[0062] Optionally, processing the data query transaction request further includes:
[0063] Processing the data query transaction request to obtain storage-related information of the data to be authorized; wherein the storage-related information includes an off-chain storage identifier and a storage key encrypted based on the account information of the authorization applicant;
[0064] The storage association information of the data to be authorized is fed back to the authorization applicant, so that the authorization applicant searches for the encrypted data to be authorized in the off-chain storage network based on the off-chain storage identifier, and decrypts the acquired data to be authorized based on the storage key in the storage association information.
[0065] An optional implementation in the above application obtains the associated information of the data to be authorized while obtaining the account information of the data provider when processing a data query transaction request, thereby obtaining and decrypting the data to be authorized from an off-chain storage network by storing the associated information, thereby achieving the acquisition of the data to be authorized and verifying the existence of the data to be authorized, thereby improving the verification mechanism for the data to be authorized, and providing convenience for the unified management of off-chain storage data by adding relevant data for existence verification to the blockchain network.
[0066] Optionally, the storage association information also includes fingerprint data of the data to be authorized;
[0067] Accordingly, feeding back the storage association information of the data to be authorized to the authorization applicant also includes:
[0068] The fingerprint data is fed back to the authorization applicant so that the authorization applicant extracts the fingerprint data of the data to be authorized and verifies the correctness of the data to be authorized based on the fingerprint data of the data to be authorized and the fingerprint data in the storage association information.
[0069] An optional implementation in the above application further improves the verification mechanism for the authorized data by adding fingerprint information of the data to be authorized in the storage-related information and verifying the correctness of the data to be authorized based on the acquired fingerprint data of the data to be authorized. By adding the data required for the correctness verification process to the blockchain network, it facilitates the unified management of off-chain storage data.
[0070] In a third aspect, the embodiment of the present application further provides a data evidence storage device, which is configured on a client and includes:
[0071] The off-chain storage module is used to encrypt the data to be stored using the storage key when a data storage instruction triggered by the data provider is detected, and upload the encrypted data to be stored to the off-chain storage network to obtain the off-chain storage identifier of the data to be stored;
[0072] A query key generation module, used to encrypt the storage key based on the account information of the data provider to generate a query key;
[0073] A data storage request generation module is used to generate a data storage transaction request based on the off-chain storage identifier, the account information of the data provider and the query key, and transmit it to the blockchain network, so that the blockchain node processes the data storage transaction request and stores the data in the data storage transaction request on the chain.
[0074] In a fourth aspect, the embodiment of the present application further provides a data evidence storage device, which is configured in a blockchain node and includes:
[0075] A data storage request receiving module, used to receive a data storage transaction request sent by a data provider; the data storage transaction request includes an off-chain storage identifier corresponding to the data to be stored in the off-chain storage network, the account information of the data provider, and a query key corresponding to the data to be stored;
[0076] A data storage request processing module, used to process the data storage transaction request and store the data in the data storage transaction request on the chain;
[0077] The query key is generated by encrypting a storage key based on the account information of the data provider, and the storage key is used to encrypt the data to be stored in the off-chain storage network.
[0078] In a fifth aspect, an embodiment of the present application further provides an electronic device, including:
[0079] at least one processor; and
[0080] a memory communicatively connected to the at least one processor; wherein,
[0081] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a data storage method provided in the first aspect embodiment.
[0082] In a sixth aspect, an embodiment of the present application further provides an electronic device, including:
[0083] at least one processor; and
[0084] a memory communicatively connected to the at least one processor; wherein,
[0085] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a data storage method provided in the second aspect embodiment.
[0086] In the seventh aspect, an embodiment of the present application further provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute a data storage method as provided in the embodiment of the first aspect.
[0087] In an eighth aspect, an embodiment of the present application further provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute a data storage method as provided in an embodiment of the second aspect.
[0088] Other effects of the above optional manner will be described below in conjunction with specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0089] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present application.
[0090] Figure 1A It is a schematic diagram of a system architecture involved in an embodiment of the present application;
[0091] Figure 1B This is a flow chart of a data evidence storage method in Embodiment 1 of the present application;
[0092] Figure 2 This is a flow chart of a data evidence storage method in Embodiment 2 of the present application;
[0093] Figure 3 This is a flow chart of a data evidence storage method in Embodiment 3 of the present application;
[0094] Figure 4 This is a flow chart of a data evidence storage method in Embodiment 4 of the present application;
[0095] Figure 5 This is a flow chart of a data evidence storage method in Embodiment 5 of the present application;
[0096] Figure 6 This is a flow chart of a data evidence storage method in Embodiment 6 of the present application;
[0097] Figure 7 This is a flow chart of a data evidence storage method in Embodiment 7 of the present application;
[0098] Figure 8 This is a flow chart of a data evidence storage method in Embodiment 8 of the present application;
[0099] Fig. 9 It is a structural diagram of a data evidence storage device in Embodiment 9 of the present application;
[0100] Fig.10 It is a structural diagram of a data evidence storage device in the tenth embodiment of the present application;
[0101] Fig.11 It is a block diagram of an electronic device used to implement the data storage method of an embodiment of the present application. DETAILED DESCRIPTION
[0102] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0103] In order to clearly introduce the technical solutions of the various embodiments of the present application, the system framework involved in the present application is first exemplified.
[0104] See also Figure 1A A system framework diagram shown includes a client 10, an off-chain storage network 20 and a blockchain network 30.
[0105] The client 10 is used for users to trigger operations, such as triggering management operations such as data storage, acquisition and verification, generating corresponding transaction requests, and sending the transaction requests to the blockchain network for processing. The client can participate in the blockchain network by deploying DAPP, or indirectly participate in the blockchain network by accessing other centralized blockchain nodes to send transaction requests.
[0106] The off-chain storage network 20 is used to store data outside the blockchain network.
[0107] The blockchain network 30 is used to receive each transaction request sent by the client 10, and complete the corresponding business by processing the transaction request, so as to migrate the data management business to the blockchain network, which is convenient for unified management of data.
[0108] Embodiment 1
[0109] Figure 1B This is a flow chart of a data storage method in Embodiment 1 of the present application. The embodiment of the present application is applicable to the case where data to be stored is stored. The method is executed by a data storage device, which is implemented by software and / or hardware and is specifically configured in a client.
[0110] like Figure 1B A data notarization method shown is applied to a client, comprising:
[0111] S101. When a data storage instruction triggered by a data provider is detected, a storage key is used to encrypt the data to be stored, and the encrypted data to be stored is uploaded to an off-chain storage network to obtain an off-chain storage identifier of the data to be stored.
[0112] The storage key may be a symmetric key or an asymmetric key, which is randomly generated by a key generation algorithm.
[0113] The off-chain storage network can be a cloud device that provides storage services, such as IPFS (InterPlanetary File System). The off-chain storage identifier is used to represent the storage location of the data to be stored in the off-chain storage network, so as to facilitate the subsequent search for the stored data in the off-chain storage network.
[0114] For example, when it is detected that the data provider triggers the data storage instruction generated by the setting method in the setting area of the client, the storage key will be used to encrypt the data to be stored, and the encrypted data to be stored will be uploaded to the off-chain storage network for storage, and the storage address of the data to be stored in the off-chain storage network will be obtained as the off-chain storage identifier. Among them, the setting area and / or setting method that triggers the generation of the data storage instruction can be set by the client developer according to the development requirements, or the client user can set it according to the usage requirements.
[0115] It should be noted that when the storage key is a symmetric key, the storage key is used to encrypt the data to be stored, and the storage key can be directly used to encrypt the data to be stored; when the storage key is an asymmetric key, the public key in the asymmetric key is used to encrypt the data to be stored.
[0116] It should be noted that the data to be stored can be imported by the data provider into the client before triggering the data storage instruction, and then by the client; or the access address of the data subject can be imported into the client, and when the data is stored in the off-chain storage system, the data subject can be obtained and transferred through the access address.
[0117] Exemplarily, the storage key may be pre-generated by the client itself before encrypting the data to be stored; or may be pre-generated by other electronic devices that are in communication with the client, and the storage key may be obtained from the electronic device when needed.
[0118] S102: Encrypt the storage key based on the account information of the data provider to generate a query key.
[0119] Among them, the account information of the data provider can be the account address of the data provider in the blockchain network.
[0120] The query key is used to decrypt the stored data obtained from the off-chain storage network. It should be noted that when the storage key is a symmetric key, the storage key is encrypted by the account information of the data provider to generate the query key; when the storage key is an asymmetric key, the private key of the storage key is encrypted by the account information of the data provider to generate the query key.
[0121] S103. Based on the off-chain storage identifier, the account information of the data provider and the query key, a data storage transaction request is generated and transmitted to the blockchain network, so that the blockchain node processes the data storage transaction request and stores the data in the data storage transaction request on the chain.
[0122] In this step, based on the off-chain storage identifier, the account information of the data provider and the query key, as the storage association information of the data to be stored, a data storage transaction request is generated, and the data storage transaction request is transmitted to the blockchain network. Correspondingly, the blockchain node receives and processes the data storage transaction request to store the data contained in the data storage transaction request to the blockchain network.
[0123] It is understandable that when the data to be stored is large-capacity data such as pictures and videos, the data body of the data to be stored is stored in an off-chain storage network outside the blockchain network, and the off-chain storage identifier of the data to be stored in the off-chain storage network is stored in the decentralized blockchain network. Through the storage method of combining on-chain and off-chain, the decentralized storage requirements are met. In addition, since the amount of data stored in the blockchain network is much smaller than the size of the data to be stored, the data storage cost in the blockchain network is reduced, and the amount of data transmission between the client and the blockchain network is greatly reduced, which improves the data storage efficiency.
[0124] In addition, the data to be stored is encrypted by using a storage key, and the storage key is encrypted by using the account information of the data provider to generate a query key, so that the stored data can be decrypted using the query key combined with the account private key corresponding to the account information of the data provider, which clarifies the ownership of the stored data and further improves the security of data storage.
[0125] When the data storage instruction triggered by the data provider is detected, the embodiment of the present application uses a storage key to encrypt the data to be stored, and uploads the encrypted data to be stored to the off-chain storage network to obtain the off-chain storage identifier of the storage data; encrypts the storage key based on the account information of the data provider to generate a query key; generates a data storage transaction request based on the off-chain storage identifier, the account information of the data provider and the query key and transmits it to the blockchain network, so that the blockchain node processes the data storage transaction request and stores the data in the data storage transaction request on the chain. The above technical solution realizes the decentralized storage of data by storing the data subject of the data to be stored through the off-chain storage network and combining the blockchain storage of related information, thereby improving storage efficiency and reducing storage costs; at the same time, through the storage method combining the storage key and the blockchain account, the ownership of the stored data is clarified, and the security of data storage is improved.
[0126] Embodiment 2
[0127] Figure 2 It is a flow chart of a data storage method in Example 2 of the present application. The embodiment of the present application is optimized and improved based on the technical solutions of the above embodiments.
[0128] Furthermore, the following operation is added to the data notarization method: "When a request for authorization instruction triggered by an authorization applicant is detected, an authorization application transaction request is generated based on the account information of the authorization applicant and the account information of the data provider of the data to be authorized and transmitted to the blockchain network, so that the blockchain node processes the authorization application transaction request and sends the account information of the authorization applicant to the data provider of the data to be authorized" to enable the authorization applicant to request data authorization from the data provider.
[0129] like Figure 2 A data notarization method shown includes:
[0130] S201. When a data storage instruction triggered by a data provider is detected, the data to be stored is encrypted using a storage key, and the encrypted data to be stored is uploaded to an off-chain storage network to obtain an off-chain storage identifier of the data to be stored.
[0131] S202: Encrypt the storage key based on the account information of the data provider to generate a query key.
[0132] S203: Based on the off-chain storage identifier, the account information of the data provider and the query key, a data storage transaction request is generated and transmitted to the blockchain network, so that the blockchain node processes the data storage transaction request and stores the data in the data storage transaction request on the chain.
[0133] S204: When a request for authorization instruction triggered by an authorization applicant is detected, an authorization application transaction request is generated based on the account information of the authorization applicant and the account information of the data provider of the data to be authorized and transmitted to the blockchain network, so that the blockchain node processes the authorization application transaction request and sends the account information of the authorization applicant to the data provider of the data to be authorized.
[0134] When it is detected that the authorization applicant triggers the setting area in the client in a setting manner to generate a request for authorization instruction, an authorization application transaction request will be generated based on the account information of the authorization applicant and the account information of the data provider of the data to be authorized, and the authorization application transaction request will be transmitted to the blockchain network. Correspondingly, the blockchain node receives and processes the authorization application transaction request to send the account information of the authorization applicant to the data provider of the data to be authorized, so that the data provider can grant the authorization applicant data usage rights. Among them, the setting area and / or setting method that triggers the generation of the request for authorization instruction can be set by the client developer according to development requirements, or can be set by the client user according to usage requirements.
[0135] It should be noted that the authorization applicant can search for the data to be authorized by collecting information offline; or, search and obtain the data to be authorized on the blockchain network based on the summary information, description information or other relevant attribute information of the required data.
[0136] Exemplarily, searching and acquiring data to be authorized through a blockchain network may be performed by generating a data search transaction request from at least one of the description information, summary information, and other related attribute information of the required data, and transmitting the data search transaction request to the blockchain network, so that the blockchain node receives and processes the data search transaction request, searches for data to be authorized that meets the user's needs in the block, and feeds back a query identifier for the data to be authorized. The query identifier may be a block identifier and / or a transaction data identifier. The block identifier is used to represent the block storing the storage-related information of the data to be authorized; the transaction data identifier is used to represent the transaction data stored when processing a data storage transaction request for the data to be authorized.
[0137] It can be understood that by migrating the query process of the data to be authorized to the blockchain network, the openness and transparency of the queried data are improved, laying the foundation for data sharing of stored data, and at the same time improving the convenience of managing relevant information of the stored data.
[0138] It should be noted that the account information of the data provider can be obtained offline by the authorization applicant user, and can also be obtained by searching for the account information of the data provider of the data to be authorized on the blockchain network.
[0139] Exemplarily, the account information of the data provider of the data to be authorized is searched and obtained through the blockchain network. When a data query request generated by the authorization applicant is detected, a data query transaction request is generated based on the query identifier of the data to be authorized and transmitted to the blockchain network, so that the blockchain node processes the data query transaction request, obtains the account information of the data provider of the data to be authorized, and feeds back to the authorization applicant.
[0140] It can be understood that by migrating the process of searching for the data provider's account information to the blockchain network, the accuracy and security of the acquired data provider's account information is improved, laying the foundation for data sharing of stored data, while improving the convenience of managing relevant information of the stored data.
[0141] The embodiment of the present application generates an authorization application transaction request based on the account information of the authorization applicant and the account information of the data provider of the data to be authorized when detecting the authorization request instruction triggered by the authorization applicant, so as to request the data provider to provide the account information of the authorization applicant with the help of blockchain, thereby laying the foundation for the data provider to grant the authorization applicant the right to use the data to be authorized, and facilitates the unified management of off-chain stored data by migrating the account information sending process to the blockchain network.
[0142] Embodiment 3
[0143] Figure 3 It is a flow chart of a data storage method in Example 3 of the present application. This example of the present application provides a preferred implementation method based on the technical solutions of the above-mentioned examples.
[0144] Furthermore, the following steps are added to the data notarization method: "When a data authorization instruction triggered by a data provider is detected, the account information of the authorization applicant of the data to be authorized is obtained; a data authorization transaction request is generated based on the account information of the authorization applicant and transmitted to the blockchain network, so that the blockchain node executes the data authorization transaction request, and the data in the data authorization transaction request is associated with the data to be authorized and stored in the blockchain", so as to enable the data provider to grant the authorization applicant the right to use the data to be authorized.
[0145] like Figure 3 A data notarization method shown includes:
[0146] S301. When a data storage instruction triggered by a data provider is detected, the data to be stored is encrypted using a storage key, and the encrypted data to be stored is uploaded to an off-chain storage network to obtain an off-chain storage identifier of the data to be stored.
[0147] S302: Encrypt the storage key based on the account information of the data provider to generate a query key.
[0148] S303: Based on the off-chain storage identifier, the account information of the data provider and the query key, a data storage transaction request is generated and transmitted to the blockchain network, so that the blockchain node processes the data storage transaction request and stores the data in the data storage transaction request on the chain.
[0149] S304: When a data authorization instruction triggered by a data provider is detected, the account information of the party applying for authorization of the data to be authorized is obtained.
[0150] For example, when the data provider receives the relevant information that the authorization applicant needs to authorize the data to be authorized, it will trigger the setting area in the client in a setting manner to generate a data authorization instruction; and when generating the data authorization instruction, it will obtain the account information of the authorization applicant of the data to be authorized. Among them, the setting area and / or setting method that triggers the generation of the data authorization instruction can be set by the client developer according to development requirements, or set by the client user according to usage requirements.
[0151] Among them, the data provider receives the relevant information that the authorization applicant needs to request authorization for the authorized data, which can be achieved through offline communication, and can also send relevant information based on blockchain as involved in the aforementioned embodiment.
[0152] Exemplarily, to obtain the account information of the authorization applicant for the data to be authorized, the account information of the authorization applicant for the data to be authorized can be pre-stored locally on the client of the data provider, or in other electronic devices or the cloud that communicate with the client, and the account information of the authorization applicant can be directly obtained when needed.
[0153] Among them, the acquisition of the account information of the data applicant can also be achieved through the blockchain node processing the authorization application transaction request generated by the client of the authorization applicant. For details, please refer to the above embodiment and will not be repeated here.
[0154] S305. Generate a data authorization transaction request based on the account information of the authorization applicant and transmit it to the blockchain network, so that the blockchain node processes the data authorization transaction request and associates the data in the data authorization transaction request with the data to be authorized and stores them in the blockchain.
[0155] Exemplarily, a data authorization transaction request is generated based on the account information of the authorization applicant, and the data authorization transaction request is transmitted to the blockchain network. Accordingly, the blockchain node receives and processes the data authorization transaction request to associate the data in the data authorization transaction request with the data to be authorized and store it in the blockchain network.
[0156] It can be understood that since the data authorization transaction request includes the account information of the authorization applicant, the account information of the authorization applicant can be stored in association with the off-chain storage identifier of the data to be authorized, the account information of the data provider, and the query key associated with the data provider's account in the block. By storing the account information of the authorization applicant in association, the account information of the authorized user is stored in the blockchain, which is convenient for verification by the data provider and the authorization applicant.
[0157] It is understandable that although the account information of authorized users is stored in the blockchain, the query key stored in the blockchain needs to be decrypted by the data provider's account private key to obtain the storage key used to decrypt the stored data in the off-chain storage network. Therefore, authorized users still need to obtain authorized data through the data provider.
[0158] In order to facilitate authorized users to bypass the data provider and directly use the authorized data, and to improve the convenience of obtaining the authorized data, during the data provider's data authorization process for the authorization applicant, before generating a data authorization transaction request based on the account information of the authorization applicant and transmitting it to the blockchain network, the query key of the data to be authorized can be obtained from the blockchain, and the query key of the data to be authorized can be decrypted based on the account private key of the data provider to obtain the storage key of the data to be authorized; based on the account information of the authorization applicant, the storage key of the data to be authorized can be encrypted again. Accordingly, generating a data authorization transaction request based on the account information of the authorization applicant and transmitting it to the blockchain network includes: generating a data authorization transaction request based on the re-encrypted storage key and the account information of the authorization applicant and transmitting it to the blockchain network.
[0159] The data provider obtains the query key of the data to be authorized from the blockchain according to the query identifier of the data to be authorized; wherein the query identifier can be at least one of the description information of the data to be authorized, the block identifier, and the transaction data identifier.
[0160] The data provider uses the account private key corresponding to its own account information to decrypt the query key and obtain the key used to decrypt the data stored in the off-chain storage network. When the storage key is a symmetric key, the query key is decrypted by the data provider's account private key to obtain the storage key itself; when the storage key is an asymmetric key, the query key is decrypted by the data provider's account private key to obtain the private key corresponding to the storage key. This application is exemplified by using the storage key as a symmetric key.
[0161] The data provider uses the account information of the authorized applicant to encrypt the storage key obtained after decryption again, and stores the encrypted storage key and the account information of the authorized applicant in the blockchain. Since the account information of the authorized applicant and the storage key encrypted by the account information of the authorized applicant are stored in the blockchain during the authorization process, when the authorized applicant needs to use the authorized data, it directly obtains the storage key encrypted by the account information of the authorized applicant, and after decrypting it with its own account private key, it can obtain the storage key for decrypting the authorized data; at the same time, after using the storage key to decrypt the data corresponding to the off-chain storage identifier in the off-chain storage network, it is possible to obtain the authorized data without going through the data provider, which improves the convenience of authorized users to obtain authorized data.
[0162] The embodiment of the present application obtains the account information of the authorized applicant of the data to be authorized when a data authorization instruction triggered by the data provider is detected, and generates a data authorization transaction request based on the account information of the authorized applicant and transmits it to the blockchain network, so that the blockchain node executes the data authorization transaction request, and associates the data in the data authorization transaction request with the data to be authorized and stores them in the blockchain, thereby granting the authorized applicant the right to use the data to be authorized, thereby achieving the purpose of data sharing. At the same time, by migrating the authorization process to the blockchain network, it facilitates the unified management of data stored outside the chain.
[0163] Embodiment 4
[0164] Figure 4 It is a flow chart of a data storage method in Example 4 of the present application. The embodiment of the present application is optimized and improved based on the technical solutions of the above embodiments.
[0165] Furthermore, the data notarization method is supplemented with “generating a data query transaction request based on the query data of the data to be authorized and transmitting it to the blockchain network, so that the blockchain node processes the data query transaction request, obtains and feeds back storage-related information of the data to be authorized; wherein the storage-related information includes the off-chain storage identifier of the data to be authorized and the query key corresponding to the authorization applicant provided by the data provider; searching for the data to be authorized in the off-chain storage network based on the off-chain storage identifier of the data to be authorized; using the account private key of the authorization applicant to decrypt the obtained query key to obtain the storage key of the data to be authorized; decrypting the obtained data to be authorized based on the obtained storage key” to verify the existence of the data to be authorized.
[0166] like Figure 4 A data notarization method shown includes:
[0167] S401. When a data storage instruction triggered by a data provider is detected, the data to be stored is encrypted using a storage key, and the encrypted data to be stored is uploaded to an off-chain storage network to obtain an off-chain storage identifier of the data to be stored.
[0168] S402: Encrypt the storage key based on the account information of the data provider to generate a query key.
[0169] S403: Based on the off-chain storage identifier, the account information of the data provider and the query key, a data storage transaction request is generated and transmitted to the blockchain network, so that the blockchain node processes the data storage transaction request and stores the data in the data storage transaction request on the chain.
[0170] S404. When a data query request generated by an authorization applicant is detected, a data query transaction request is generated based on the query identifier of the data to be authorized and transmitted to the blockchain network, so that the blockchain node processes the data query transaction request, obtains and feeds back storage-related information of the data to be authorized; wherein the storage-related information includes the off-chain storage identifier of the data to be authorized and the query key corresponding to the authorization applicant provided by the data provider.
[0171] When it is detected that the authorization applicant triggers a data query request generated in a set manner in the set area of the client, a data query transaction request is generated based on the query identifier of the data to be authorized, and the data query transaction request is transmitted to the blockchain network. Correspondingly, the blockchain node receives the data query transaction request, obtains the storage-related information of the data to be authorized in the blockchain based on the query identifier of the data to be queried, and feeds back the storage-related information to the authorization applicant. Among them, the set area and / or setting method that triggers the generation of the data query request can be set by the client developer according to development requirements, or the client user can set it according to usage requirements.
[0172] S405: Searching for the data to be authorized in an off-chain storage network based on the off-chain storage identifier of the data to be authorized.
[0173] Since the storage association information includes the off-chain storage identifier of the data to be authorized, the authorization applicant can obtain the data to be authorized in the off-chain storage network according to the obtained off-chain storage identifier.
[0174] S406: Decrypt the obtained query key using the account private key of the authorization applicant to obtain the storage key of the data to be authorized.
[0175] Since the storage association information includes the storage key encrypted by the account information of the authorization applicant, the obtained key can be decrypted by the account private key of the authorization applicant to obtain the storage key of the data to be authorized.
[0176] S407: Decrypt the acquired data to be authorized based on the obtained storage key.
[0177] The obtained data to be authorized is decrypted by using the storage key to obtain the data to be authorized. When the data to be authorized is obtained after decryption, it indicates that the required data to be authorized exists; when the data to be authorized cannot be obtained after decryption, it indicates that the required data to be authorized does not exist. Therefore, before the authorization applicant applies for authorization from the data provider, the existence of the data to be authorized is verified by querying the data to be authorized itself, thereby improving the security of data transactions.
[0178] Of course, in order to protect the rights and interests of the data provider, before authorizing the authorization applicant, the data provided to the authorization applicant can be in read-only mode or only part of the data can be displayed to prevent the data from being stolen by illegal authorization applicants.
[0179] The embodiment of the present application can obtain the storage-related information of the data to be authorized while obtaining the account information of the data provider when generating a data query transaction request, thereby obtaining and decrypting the data to be authorized from an off-chain storage network through the storage-related information, thereby achieving the acquisition of the data to be authorized and the verification of the existence of the data to be authorized, thereby improving the verification mechanism for the data to be authorized, and providing convenience for the unified management of off-chain storage data by adding relevant data for existence verification to the blockchain network.
[0180] In order to verify the correctness of the acquired data, in the technical solutions of the above-mentioned embodiments, before generating a data storage transaction request based on the off-chain storage identifier, the account information of the data provider and the query key, the fingerprint information of the data to be stored can also be extracted to obtain the fingerprint data. Accordingly, generating a data storage transaction request based on the off-chain storage identifier and the account information of the data provider can be generating a data storage transaction request based on the off-chain storage identifier, the account information of the data provider and the fingerprint data.
[0181] Then, when the blockchain node processes a data storage transaction request, the fingerprint data of the data to be authorized will also be stored in the transaction data of the blockchain. Correspondingly, the storage association information of the data to be authorized obtained by processing the data query transaction request will also include the fingerprint data of the data to be authorized. When the storage association information also includes the fingerprint data of the data to be authorized, after decrypting the obtained data to be authorized based on the obtained storage key, the fingerprint data of the data to be authorized can also be extracted, and the correctness of the data to be authorized can be verified based on the extracted fingerprint data and the obtained fingerprint data.
[0182] Specifically, when the extracted fingerprint data is the same as the fingerprint data in the acquired storage-related information, it indicates that the data to be authorized obtained from the off-chain storage network is correct; if the extracted fingerprint data is different from the fingerprint data in the acquired storage-related information, it indicates that the data to be authorized obtained from the off-chain storage network is incorrect, thereby realizing the verification of the correctness of the data to be authorized.
[0183] Embodiment 5
[0184] Figure 5 This is a flow chart of a data storage method in Example 5 of the present application. The embodiment of the present application is applicable to the situation where data to be stored is stored through a blockchain network. The method is executed by a data storage device, which is implemented by software and / or hardware and is specifically configured in an electronic device that carries a blockchain node.
[0185] like Figure 5 A data notarization method shown is applied to a blockchain node, including:
[0186] S501. Receive a data storage transaction request sent by a data provider; the data storage transaction request includes an off-chain storage identifier corresponding to the data to be stored in the off-chain storage network, the account information of the data provider, and a query key corresponding to the data to be stored.
[0187] The query key is generated by encrypting a storage key based on the account information of the data provider, and the storage key is used to encrypt the data to be stored in the off-chain storage network.
[0188] The storage key may be a symmetric key or an asymmetric key, which is randomly generated by a key generation algorithm. It should be noted that when the storage key is a symmetric key, the storage key is used to encrypt the data to be stored, and the storage key may be directly used to encrypt the data to be stored; when the storage key is an asymmetric key, the public key in the asymmetric key is used to encrypt the data to be stored.
[0189] The off-chain storage network can be a cloud device that provides storage services, such as IPFS. The off-chain storage identifier is used to represent the storage location of the data to be stored in the off-chain storage network, which facilitates the subsequent search for the stored data in the off-chain storage network.
[0190] When the data provider triggers the setting area in the client by setting a method and generates a data storage instruction, the storage key will be used to encrypt the data to be stored, and the encrypted data to be stored will be uploaded to the off-chain storage network for storage, and the storage address of the data to be stored in the off-chain storage network will be obtained as the off-chain storage identifier. The client of the data provider encrypts the storage key based on the account information of the data provider, generates a query key, and generates a data storage transaction request based on the off-chain storage identifier, the account information of the data provider and the query key, and transmits it to the blockchain network. Correspondingly, the blockchain node receives the data storage transaction request. Among them, the setting area and / or setting method that triggers the generation of the data storage instruction can be set by the client developer according to the development requirements, or the client user can set it according to the usage requirements.
[0191] S502: Process the data storage transaction request, and store the data in the data storage transaction request on-chain.
[0192] The blockchain node processes the data storage transaction request to store the data in the data storage transaction request, such as the off-chain storage identifier corresponding to the data to be stored in the off-chain storage network included in the data storage transaction request, the account information of the data provider, and the query key corresponding to the data to be stored, in the blockchain. Exemplarily, the processing of the data storage transaction request can be implemented by calling a data storage smart contract.
[0193] It is understandable that when the data to be stored is large-capacity data such as pictures and videos, the data body of the data to be stored is stored in an off-chain storage network outside the blockchain network, and the off-chain storage identifier of the data to be stored in the off-chain storage network is stored in the decentralized blockchain network. Through the storage method of combining on-chain and off-chain, the decentralized storage requirements are met. In addition, since the amount of data stored in the blockchain network is much smaller than the size of the data to be stored, the data storage cost in the blockchain network is reduced, and the amount of data transmission between the client and the blockchain network is greatly reduced, which improves the data storage efficiency.
[0194] In addition, the data to be stored is encrypted by using a storage key, and the storage key is encrypted by using the account information of the data provider to generate a query key, so that the stored data can be decrypted using the query key combined with the account private key corresponding to the account information of the data provider, which clarifies the ownership of the stored data and further improves the security of data storage.
[0195] The embodiment of the present application receives a data storage transaction request sent by a data provider, which includes an off-chain storage identifier corresponding to the data to be stored in the off-chain storage network, the account information of the data provider, and a query key obtained by encrypting the storage key with the account information of the data provider, and processes the data storage transaction request, and then stores the above-mentioned associated information of the data to be stored on the chain, thereby achieving the effect of storing the data subject off-chain and storing the associated information on the chain, thereby realizing decentralized storage of data, improving data storage efficiency, and reducing data storage costs; at the same time, through the storage method that combines storage keys and blockchain accounts, the ownership of the stored data is clarified, and the security of data storage is improved.
[0196] Embodiment 6
[0197] Figure 6 It is a flow chart of a data storage method in Example 6 of the present application. The embodiment of the present application is optimized and improved based on the technical solutions of the above embodiments.
[0198] Furthermore, the data notarization method is supplemented with “receiving an authorization application transaction request sent by an authorization applicant, wherein the authorization application transaction request includes the account information of the authorization applicant and the account information of the data provider; processing the authorization application transaction request to send the account information of the authorization applicant to the data provider corresponding to the data to be authorized”, so as to migrate the account query process of the data provider to the authorization applicant to the blockchain network.
[0199] like Figure 6 A data notarization method shown includes:
[0200] S601. Receive a data storage transaction request sent by a data provider; the data storage transaction request includes an off-chain storage identifier corresponding to the data to be stored in the off-chain storage network, the account information of the data provider, and a query key corresponding to the data to be stored.
[0201] The query key is generated by encrypting a storage key based on the account information of the data provider, and the storage key is used to encrypt the data to be stored in the off-chain storage network.
[0202] S602: Process the data storage transaction request, and store the data in the data storage transaction request on-chain.
[0203] S603: Receive an authorization application transaction request sent by the authorization applicant, wherein the authorization application transaction request includes the account information of the authorization applicant and the account information of the data provider.
[0204] When it is detected that the authorization applicant triggers the setting area in the client in a setting manner to generate a request for authorization instruction, an authorization application transaction request will be generated based on the account information of the authorization applicant and the account information of the data provider of the data to be authorized, and the authorization application transaction request will be transmitted to the blockchain network. Among them, the setting area and / or setting method that triggers the generation of the request for authorization instruction can be set by the client developer according to development requirements, or by the client user according to usage requirements.
[0205] It should be noted that the authorization applicant can search for the data to be authorized by collecting information offline; or, search and obtain the data to be authorized on the blockchain network based on the summary information, description information or other relevant attribute information of the required data.
[0206] Exemplarily, searching and acquiring data to be authorized through a blockchain network may be performed by generating a data search transaction request from at least one of the description information, summary information, and other relevant attribute information of the required data, and transmitting the data search transaction request to the blockchain network; the blockchain node receives and processes the data search transaction request, searches the block for data to be authorized that meets the user's needs, and feeds back a query identifier of the data to be authorized. Exemplarily, the processing of the data search transaction request may be implemented by calling a data search smart contract.
[0207] The query identifier may be a block identifier and / or a transaction data identifier. The block identifier is used to identify the block storing the storage-related information of the data to be authorized; the transaction data identifier is used to identify the transaction data stored when processing a data storage transaction request for the data to be authorized.
[0208] It can be understood that by migrating the query process of the data to be authorized to the blockchain network, the openness and transparency of the queried data are improved, laying the foundation for data sharing of stored data, and at the same time improving the convenience of managing relevant information of the stored data.
[0209] It should be noted that the account information of the data provider can be obtained offline by the authorization applicant user, and can also be obtained by searching for the account information of the data provider of the data to be authorized on the blockchain network.
[0210] Exemplarily, the search and acquisition of the account information of the data provider of the data to be authorized through the blockchain network can be that when a data query request generated by the authorization applicant is detected, a data query transaction request is generated based on the query identifier of the data to be authorized and transmitted to the blockchain network. The blockchain node receives the data query transaction request sent by the authorization applicant, and the data query transaction request includes the query identifier of the data to be authorized; processes the data query transaction request to obtain and feedback the account information of the data provider corresponding to the data to be authorized according to the query identifier of the data to be authorized. Exemplarily, the processing of the data query transaction request can be implemented by calling a data query smart contract.
[0211] It can be understood that by migrating the process of searching for the data provider's account information to the blockchain network, the accuracy and security of the acquired data provider's account information is improved, laying the foundation for data sharing of stored data, while improving the convenience of managing relevant information of the stored data.
[0212] S604: Process the authorization application transaction request to send the account information of the authorization applicant to the data provider corresponding to the data to be authorized.
[0213] The blockchain node processes the authorization application transaction request to send the account information of the authorization applicant to the data provider of the data to be authorized, so that the data provider can grant the authorization applicant data usage rights. Exemplarily, the processing of the authorization application transaction request can be implemented by calling the authorization application smart contract.
[0214] The embodiment of the present application receives and processes an authorization application transaction request including the account information of the authorization applicant and the account information of the data provider, and requests the data provider to provide the account information of the authorization applicant with the help of blockchain, so that the data provider can grant the authorization applicant the right to use the data to be authorized. By migrating the account information sending process to the blockchain network, the unified management of off-chain stored data is facilitated.
[0215] Embodiment 7
[0216] Figure 7 It is a flow chart of a data storage method in Example 7 of the present application. The embodiment of the present application is optimized and improved based on the technical solutions of the above embodiments.
[0217] Furthermore, the data notarization method is supplemented with “receiving a data authorization transaction request sent by a data provider; the data authorization transaction request includes the account information of the authorization applicant; processing the data authorization transaction request, and storing the data in the data authorization transaction request in association with the data to be authorized in the blockchain”, so as to migrate the authorization process of the data provider to the authorization applicant for the data to be authorized to the blockchain network.
[0218] like Figure 7 A data notarization method shown includes:
[0219] S701. Receive a data storage transaction request sent by a data provider; the data storage transaction request includes an off-chain storage identifier corresponding to the data to be stored in the off-chain storage network, the account information of the data provider, and a query key corresponding to the data to be stored.
[0220] The query key is generated by encrypting a storage key based on the account information of the data provider, and the storage key is used to encrypt the data to be stored in the off-chain storage network.
[0221] S702: Process the data storage transaction request, and store the data in the data storage transaction request on-chain.
[0222] S703: Receive a data authorization transaction request sent by a data provider; the data authorization transaction request includes account information of an authorization applicant.
[0223] Exemplarily, when the data provider receives relevant information that the authorization applicant needs to authorize the data request to be authorized, it will trigger the set area in the client in a set manner to generate a data authorization instruction; and when generating the data authorization instruction, obtain the account information of the authorization applicant of the data to be authorized; generate a data authorization transaction request based on the account information of the authorization applicant, and transmit the generated data authorization transaction request to the blockchain network.
[0224] Among them, the setting area and / or setting method for triggering the generation of the data authorization instruction can be set by the client developer according to development requirements, or set by the client user according to usage requirements.
[0225] Among them, the data provider receives the relevant information that the authorization applicant needs to request authorization for the authorized data, which can be achieved through offline communication, and can also send relevant information based on blockchain as involved in the aforementioned embodiment.
[0226] Exemplarily, to obtain the account information of the authorization applicant for the data to be authorized, the account information of the authorization applicant for the data to be authorized can be pre-stored locally on the client of the data provider, or in other electronic devices or the cloud that communicate with the client, and the account information of the authorization applicant can be directly obtained when needed.
[0227] Among them, the acquisition of the account information of the data applicant can also be achieved through the blockchain node processing the authorization application transaction request generated by the client of the authorization applicant. For details, please refer to the above embodiment and will not be repeated here.
[0228] S704: Process the data authorization transaction request, and associate the data in the data authorization transaction request with the data to be authorized and store them in the blockchain.
[0229] The blockchain node processes the received data authorization transaction request to associate the data in the data authorization transaction request with the data to be authorized and store them in the blockchain.
[0230] It can be understood that, since the data authorization transaction request includes the account information of the authorization applicant, the account information of the authorization applicant can be associated with the off-chain storage identifier of the data to be authorized, the account information of the data provider, and the query key associated with the data provider's account and other storage-related information in the block. By storing the account information of the authorization applicant in an associated manner, the account information of the authorized user is stored in the blockchain, which is convenient for verification by the data provider and the authorization applicant.
[0231] It is understandable that although the account information of authorized users is stored in the blockchain, the query key stored in the blockchain needs to be decrypted by the data provider's account private key to obtain the storage key used to decrypt the stored data in the off-chain storage network. Therefore, authorized users still need to obtain authorized data through the data provider.
[0232] In order to facilitate authorized users to bypass the data provider and directly use the authorized data, and to improve the convenience of obtaining the authorized data, a storage key encrypted based on the account information of the authorized applicant provided by the data provider may also be added to the data authorization transaction request.
[0233] Exemplarily, the data provider adds a storage key encrypted based on the account information of the authorization applicant provided by the data provider in the data authorization transaction request, which may be: during the process of the data provider performing data authorization on the authorization applicant, before generating a data authorization transaction request based on the account information of the authorization applicant and transmitting it to the blockchain network, the data provider obtains a query key of the data to be authorized from the blockchain, and decrypts the query key of the data to be authorized based on the account private key of the data provider to obtain the storage key of the data to be authorized; based on the account information of the authorization applicant, the storage key of the data to be authorized is encrypted again; based on the account information of the authorization applicant, a data authorization transaction request is generated based on the re-encrypted storage key and the account information of the authorization applicant.
[0234] The detailed scheme of the data provider re-encrypting the storage key based on the account information of the authorization applicant can be found in the above embodiment and will not be repeated here.
[0235] It is understandable that since the encrypted storage key of the authorized applicant's account information is added to the data authorization transaction request, after the blockchain node processes the data authorization transaction request, the authorized applicant's account information and the encrypted storage key of the authorized applicant's account information will be stored in the blockchain. Then, when the authorized applicant needs to use the authorized data, it directly obtains the encrypted storage key and the off-chain storage identifier of the authorized applicant's account information, and after decrypting it with its own account private key, it can obtain the storage key for decrypting the authorized data. At the same time, after using the storage key to decrypt the data corresponding to the off-chain storage identifier in the off-chain storage network, it is possible to obtain the authorized data without going through the data provider, which improves the convenience of authorized users to obtain authorized data.
[0236] The embodiment of the present application realizes the management and storage of the account information of the authorization applicant and the data to be authorized in the blockchain by receiving and processing the data authorization transaction request including the account information of the authorization applicant, thereby granting the authorization applicant the right to use the data to be authorized with the help of the blockchain network, thereby achieving the purpose of data sharing. At the same time, by migrating the authorization process to the blockchain network, the unified management of off-chain stored data is facilitated.
[0237] Embodiment 8
[0238] Figure 8 It is a flow chart of a data storage method in Example 8 of the present application. The embodiment of the present application is optimized and improved based on the technical solutions of the above embodiments.
[0239] Furthermore, the data notarization method is supplemented with “processing the data query transaction request to obtain storage-related information of the data to be authorized; wherein the storage-related information includes an off-chain storage identifier and a storage key encrypted based on the account information of the authorization applicant; the storage-related information of the data to be authorized is fed back to the authorization applicant, so that the authorization applicant searches for the encrypted data to be authorized in the off-chain storage network based on the off-chain storage identifier, and decrypts the acquired data to be authorized based on the storage key in the storage-related information”, so as to migrate the data verification process to the blockchain network.
[0240] like Figure 8 A data notarization method shown includes:
[0241] S801. Receive a data storage transaction request sent by a data provider; the data storage transaction request includes an off-chain storage identifier corresponding to the data to be stored in the off-chain storage network, the account information of the data provider, and a query key corresponding to the data to be stored.
[0242] The query key is generated by encrypting a storage key based on the account information of the data provider, and the storage key is used to encrypt the data to be stored in the off-chain storage network.
[0243] S802: Process the data storage transaction request, and store the data in the data storage transaction request on-chain.
[0244] S803: Receive a data query transaction request sent by the authorization applicant, where the data query transaction request includes a query identifier for the data to be authorized.
[0245] When it is detected that the authorization applicant triggers a data query request in a set manner in the set area of the client, a data query transaction request is generated based on the query identifier of the data to be authorized, and the data query transaction request is transmitted to the blockchain network.
[0246] S804. Process the data query transaction request to obtain storage-related information of the data to be authorized; wherein the storage-related information includes an off-chain storage identifier and a storage key encrypted based on the account information of the authorization applicant.
[0247] The blockchain node receives and processes the transaction request for querying the data to be queried, so as to obtain storage-related information of the data to be authorized in the blockchain based on the query identifier of the data to be queried.
[0248] S805. Feedback the storage association information of the data to be authorized to the authorization applicant, so that the authorization applicant searches for the encrypted data to be authorized in the off-chain storage network based on the off-chain storage identifier, and decrypts the obtained data to be authorized based on the storage key in the storage association information.
[0249] The blockchain node feeds back the storage association information of the data to be authorized to the authorization applicant. Since the storage association information includes the off-chain storage identifier of the data to be authorized, the authorization applicant can obtain the data to be authorized in the off-chain storage network based on the obtained off-chain storage identifier.
[0250] Since the storage association information includes the storage key encrypted by the account information of the authorization applicant, the obtained key can be decrypted by the account private key of the authorization applicant to obtain the storage key of the data to be authorized.
[0251] The obtained data to be authorized is decrypted by the obtained storage key to obtain the data to be authorized itself. When the data to be authorized is obtained after decryption, it indicates that the required data to be authorized exists; when the data to be authorized cannot be obtained after decryption, it indicates that the required data to be authorized does not exist. Therefore, before the authorization applicant applies for authorization from the data provider, the existence of the data to be authorized is verified by querying the data to be authorized itself, thereby improving the security of data transactions.
[0252] Of course, in order to protect the rights and interests of the data provider, before authorizing the authorization applicant, the data provided to the authorization applicant can be in read-only mode or only part of the data can be displayed to prevent the data from being stolen by illegal authorization applicants.
[0253] The embodiment of the present application obtains the associated information of the data to be authorized while obtaining the account information of the data provider while processing the data query transaction request, thereby obtaining and decrypting the data to be authorized from the off-chain storage network by storing the associated information, thereby achieving the acquisition of the data to be authorized and verifying the existence of the data to be authorized, thereby improving the verification mechanism for the data to be authorized, and providing convenience for the unified management of off-chain storage data by adding relevant data for existence verification to the blockchain network.
[0254] In order to verify the correctness of the acquired data, based on the technical solutions of the above embodiments, fingerprint data of the data to be stored may be added to the data storage transaction request, and the fingerprint data is obtained by extracting fingerprint information of the data to be stored by the data provider.
[0255] Then, when the blockchain node processes a data storage transaction request, the fingerprint data of the data to be authorized will also be stored in the transaction data of the blockchain. Correspondingly, the fingerprint data of the data to be authorized will also be included in the storage association information of the data to be authorized obtained by processing the data query transaction request. When the storage association information also includes the fingerprint data of the data to be authorized, the storage association information of the data to be authorized is fed back to the authorization applicant, and it also includes: feeding back the fingerprint data to the authorization applicant so that the authorization applicant extracts the fingerprint data of the data to be authorized, and verifies the correctness of the data to be authorized based on the fingerprint data of the data to be authorized and the fingerprint data in the storage association information.
[0256] Specifically, when the extracted fingerprint data is the same as the fingerprint data in the acquired storage-related information, it indicates that the data to be authorized obtained from the off-chain storage network is correct; if the extracted fingerprint data is different from the fingerprint data in the acquired storage-related information, it indicates that the data to be authorized obtained from the off-chain storage network is incorrect, thereby realizing the verification of the correctness of the data to be authorized.
[0257] Embodiment 9
[0258] Fig. 9 This is a structural diagram of a data evidence storage device in Embodiment 9 of the present application. The embodiment of the present application is applicable to the case where data to be stored is stored. The device is implemented by software and / or hardware and is specifically configured in the client.
[0259] like Fig. 9 A data evidence storage device 900 shown includes: an off-chain storage module 901, a query key generation module 902 and a data storage request generation module 903.
[0260] The off-chain storage module 901 is used to encrypt the data to be stored using the storage key when a data storage instruction triggered by the data provider is detected, and upload the encrypted data to be stored to the off-chain storage network to obtain the off-chain storage identifier of the data to be stored;
[0261] A query key generation module 902, configured to encrypt the storage key based on the account information of the data provider to generate a query key;
[0262] The data storage request generation module 903 is used to generate a data storage transaction request based on the off-chain storage identifier, the account information of the data provider and the query key, and transmit it to the blockchain network, so that the blockchain node processes the data storage transaction request and stores the data in the data storage transaction request on the chain.
[0263] When the data storage instruction triggered by the data provider is detected, the embodiment of the present application uses the storage key to encrypt the data to be stored through the off-chain storage module, and uploads the encrypted data to be stored to the off-chain storage network, and obtains the off-chain storage identifier of the storage data through the query key generation module; the storage key is encrypted based on the account information of the data provider to generate a query key; the data storage request generation module generates a data storage transaction request based on the off-chain storage identifier, the account information of the data provider and the query key and transmits it to the blockchain network, so that the blockchain node processes the data storage transaction request and stores the data in the data storage transaction request on the chain. The above technical solution realizes the decentralized storage of data by storing the data subject of the data to be stored through the off-chain storage network and combining the blockchain storage of related information, thereby improving storage efficiency and reducing storage costs; at the same time, through the storage method combining the storage key and the blockchain account, the ownership of the stored data is clarified, and the security of data storage is improved.
[0264] Furthermore, the device also includes
[0265] The applicant account acquisition module is used to obtain the account information of the authorized applicant of the data to be authorized when a data authorization instruction triggered by the data provider is detected;
[0266] A data authorization request generation module is used to generate a data authorization transaction request based on the account information of the authorization applicant and transmit it to the blockchain network, so that the blockchain node executes the data authorization transaction request and associates the data in the data authorization transaction request with the data to be authorized and stores them in the blockchain.
[0267] Furthermore, the device also includes:
[0268] A storage key acquisition module, used to obtain a query key of the data to be authorized from the blockchain before generating a data authorization transaction request based on the account information of the authorization applicant and transmitting it to the blockchain network, and decrypt the query key of the data to be authorized based on the account private key of the data provider to obtain the storage key of the data to be authorized;
[0269] A storage key encryption module, used to re-encrypt the storage key of the data to be authorized based on the account information of the authorization applicant;
[0270] Accordingly, the data authorization request generation module, when executing the generation of a data authorization transaction request based on the account information of the authorization applicant and transmitting it to the blockchain network, is specifically used to:
[0271] Based on the re-encrypted storage key and the account information of the authorization applicant, a data authorization transaction request is generated and transmitted to the blockchain network.
[0272] Furthermore, the device also includes:
[0273] A fingerprint data extraction module, used to extract the fingerprint information of the data to be stored to obtain fingerprint data before generating a data storage transaction request based on the off-chain storage identifier, the account information of the data provider and the query key;
[0274] Accordingly, the data storage request generation module 903, when generating a data storage transaction request based on the off-chain storage identifier and the account information of the data provider, is specifically used to:
[0275] A data storage transaction request is generated based on the off-chain storage identifier, the account information of the data provider and the fingerprint data.
[0276] Furthermore, the device also includes:
[0277] The authorization application request generation module is used to generate an authorization application transaction request based on the account information of the authorization applicant and the account information of the data provider of the data to be authorized, and transmit it to the blockchain network when detecting the authorization request instruction triggered by the authorization applicant, so that the blockchain node processes the authorization application transaction request and sends the account information of the authorization applicant to the data provider of the data to be authorized.
[0278] Furthermore, the device also includes an authorization application request generation module, which is used to:
[0279] Before generating an authorization application transaction request based on the account information of the authorization applicant and the account information of the data provider of the data to be authorized and transmitting it to the blockchain network, when a data query request generated by the authorization applicant is detected, a data query transaction request is generated based on the query identifier of the data to be authorized and transmitted to the blockchain network, so that the blockchain node processes the data query transaction request, obtains the account information of the data provider of the data to be authorized, and feeds it back to the authorization applicant.
[0280] Furthermore, the authorization application request generation module is also used to:
[0281] Generate a data query transaction request based on the query identifier of the data to be authorized and transmit it to the blockchain network, so that the blockchain node processes the data query transaction request, obtains and feeds back the storage-related information of the data to be authorized; wherein the storage-related information includes the off-chain storage identifier of the data to be authorized and the query key corresponding to the authorization applicant provided by the data provider;
[0282] Searching for the data to be authorized in an off-chain storage network based on the off-chain storage identifier of the data to be authorized;
[0283] Decrypt the obtained query key using the account private key of the authorization applicant to obtain the storage key of the data to be authorized;
[0284] The acquired data to be authorized is decrypted based on the obtained storage key.
[0285] Furthermore, the storage association information also includes fingerprint data of the data to be authorized;
[0286] Accordingly, the device further comprises a correct verification module, which is used to:
[0287] After the acquired data to be authorized is decrypted based on the obtained storage key, fingerprint data of the data to be authorized is extracted, and the correctness of the data to be authorized is verified based on the extracted fingerprint data and the acquired fingerprint data.
[0288] The above-mentioned data storage device can execute the data storage method provided by any embodiment of the present application, and has the corresponding functional modules and beneficial effects for executing the data storage method.
[0289] Embodiment 10
[0290] Fig.10 This is a structural diagram of a data storage device in Example 10 of the present application. The embodiment of the present application is applicable to the situation where data to be stored is stored through a blockchain network. The device is implemented through software and / or hardware and is specifically configured in an electronic device that carries a blockchain node.
[0291] like Fig.10 The data storage device 1000 shown in the figure includes: a data storage request receiving module 1001 and a data storage request processing module 1002.
[0292] The data storage request receiving module 1001 is used to receive a data storage transaction request sent by a data provider; the data storage transaction request includes an off-chain storage identifier corresponding to the data to be stored in the off-chain storage network, the account information of the data provider, and a query key corresponding to the data to be stored;
[0293] The data storage request processing module 1002 is used to process the data storage transaction request and store the data in the data storage transaction request on the chain;
[0294] The query key is generated by encrypting a storage key based on the account information of the data provider, and the storage key is used to encrypt the data to be stored in the off-chain storage network.
[0295] In the embodiment of the present application, a data storage transaction request is received by a data provider through a data storage request receiving module, and the request includes an off-chain storage identifier corresponding to the data to be stored in the off-chain storage network, the account information of the data provider, and a query key obtained by encrypting the storage key through the account information of the data provider. The data storage transaction request is processed by a data storage request processing module, and the above-mentioned associated information of the data to be stored is stored on the chain, so as to achieve the effect of storing the data subject off-chain and storing the associated information on the chain, thereby realizing decentralized storage of data, improving data storage efficiency, and reducing data storage costs. At the same time, through the storage method combining storage keys and blockchain accounts, the ownership of the stored data is clarified, and the security of data storage is improved.
[0296] Furthermore, the device also includes:
[0297] A data authorization request receiving module, used to receive a data authorization transaction request sent by a data provider; the data authorization transaction request includes the account information of the authorization applicant;
[0298] The data authorization request processing module is used to process the data authorization transaction request and associate the data in the data authorization transaction request with the data to be authorized and store them in the blockchain.
[0299] Furthermore, the data authorization transaction request also includes a storage key provided by the data provider that is encrypted based on the account information of the authorization applicant.
[0300] Furthermore, the data storage transaction request also includes fingerprint data of the data to be stored, and the fingerprint data is obtained by extracting fingerprint information of the data to be stored by the data provider.
[0301] Furthermore, the device also includes:
[0302] An authorization application request receiving module is used to receive an authorization application transaction request sent by an authorization applicant, wherein the authorization application transaction request includes the account information of the authorization applicant and the account information of the data provider;
[0303] The authorization application request processing module is used to process the authorization application transaction request to send the account information of the authorization applicant to the data provider corresponding to the data to be authorized.
[0304] Furthermore, the device also includes:
[0305] A data query request receiving module, used for receiving a data query transaction request sent by the authorization applicant before receiving the authorization application transaction request sent by the authorization applicant, wherein the data query transaction request includes a query identifier of the data to be authorized;
[0306] The data query request processing module is used to process the data query transaction request to obtain and feedback the account information of the data provider corresponding to the data to be authorized according to the query identifier of the data to be authorized.
[0307] Furthermore, the data query request processing module is also used to:
[0308] Processing the data query transaction request to obtain storage-related information of the data to be authorized; wherein the storage-related information includes an off-chain storage identifier and a storage key encrypted based on the account information of the authorization applicant;
[0309] The storage association information of the data to be authorized is fed back to the authorization applicant, so that the authorization applicant searches for the encrypted data to be authorized in the off-chain storage network based on the off-chain storage identifier, and decrypts the acquired data to be authorized based on the storage key in the storage association information.
[0310] Furthermore, the storage association information also includes fingerprint data of the data to be authorized;
[0311] Correspondingly, the data query request processing module is also used to:
[0312] The fingerprint data is fed back to the authorization applicant so that the authorization applicant extracts the fingerprint data of the data to be authorized and verifies the correctness of the data to be authorized based on the fingerprint data of the data to be authorized and the fingerprint data in the storage association information.
[0313] The above-mentioned data storage device can execute the data storage method provided by any embodiment of the present application, and has the corresponding functional modules and beneficial effects for executing the data storage method.
[0314] Embodiment 11
[0315] According to an embodiment of the present application, the present application also provides an electronic device and a readable storage medium.
[0316] like Fig.11 , is a block diagram of an electronic device for executing the data evidence storage method of an embodiment of the present application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.
[0317] like Fig.11 As shown, the electronic device includes: one or more processors 1101, a memory 1102, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In other embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig.11 A processor 1101 is taken as an example.
[0318] The memory 1102 is a non-transitory computer-readable storage medium provided in the present application. The memory stores instructions executable by at least one processor to enable the at least one processor to perform the data storage method provided in the present application. The non-transitory computer-readable storage medium of the present application stores computer instructions, which are used to enable a computer to perform the data storage method provided in the present application.
[0319] The memory 1102, as a non-transient computer-readable storage medium, can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions / modules corresponding to the method of data management in the embodiments of the present application (for example, a data storage device 900 including an off-chain storage module 901, a query key generation module 902, and a data storage request generation module 903, or a data storage device 1000 including a data storage request receiving module 1001 and a data storage request processing module 1002). The processor 1101 executes various functional applications and data processing of the server by running the non-transient software programs, instructions, and modules stored in the memory 1102, that is, implements the data storage method in the above method embodiments.
[0320] The memory 1102 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function; the data storage area may store data created according to the use of the electronic device that executes the data storage method, etc. In addition, the memory 1102 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 1102 may optionally include a memory remotely arranged relative to the processor 1101, and these remote memories may be connected to the electronic device that executes the data storage method via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0321] The electronic device executing the data evidence storage method may further include: an input device 1103 and an output device 1104. The processor 1101, the memory 1102, the input device 1103 and the output device 1104 may be connected via a bus or other means. Fig.11 The example of connecting through bus is taken in the following.
[0322] The input device 1103 can receive input digital or character information, and generate key signal input related to user settings and function control of the electronic device that executes the data storage method, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator rod, one or more mouse buttons, a trackball, a joystick and other input devices. The output device 1104 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display and a plasma display. In some embodiments, the display device may be a touch screen.
[0323] Various implementations of the systems and techniques described herein can be realized in digital electronic circuit systems, integrated circuit systems, dedicated ASICs (application specific integrated circuits), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0324] These computer programs (also referred to as programs, software, software applications, or code) include machine instructions for programmable processors and can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or means (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.
[0325] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0326] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0327] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.
[0328] According to the technical solution of the embodiment of the present application, when a data storage instruction triggered by a data provider is detected, a storage key is used to encrypt the data to be stored, and the encrypted data to be stored is uploaded to an off-chain storage network to obtain an off-chain storage identifier for the stored data; the storage key is encrypted based on the account information of the data provider to generate a query key; a data storage transaction request is generated based on the off-chain storage identifier, the account information of the data provider and the query key and transmitted to the blockchain network, so that the blockchain node processes the data storage transaction request and stores the data in the data storage transaction request on the chain. The above technical solution realizes decentralized storage of data by storing the data subject of the data to be stored through an off-chain storage network and combining the method of storing related information in the blockchain, thereby improving storage efficiency and reducing storage costs; at the same time, through the storage method combining the storage key and the blockchain account, the ownership of the stored data is clarified, and the security of data storage is improved.
[0329] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution disclosed in this application can be achieved, and this document is not limited here.
[0330] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.
Claims
1. A data evidence storage method, applied to a client, characterized in that: include: When a data storage instruction triggered by a data provider is detected, the data to be stored is encrypted using a storage key, and the encrypted data to be stored is uploaded to an off-chain storage network to obtain an off-chain storage identifier for the data to be stored; Encrypting the storage key based on the account information of the data provider to generate a query key; Based on the off-chain storage identifier, the account information of the data provider and the query key, a data storage transaction request is generated and transmitted to the blockchain network, so that the blockchain node processes the data storage transaction request and stores the data in the data storage transaction request on the blockchain; When a data authorization instruction triggered by the data provider is detected, the account information of the authorization applicant of the data to be authorized is obtained; Obtaining a query key for the data to be authorized from the blockchain, and decrypting the query key for the data to be authorized based on the account private key of the data provider to obtain a storage key for the data to be authorized; Based on the account information of the authorization applicant, the storage key of the data to be authorized is re-encrypted; Based on the re-encrypted storage key and the account information of the authorization applicant, a data authorization transaction request is generated and transmitted to the blockchain network, so that the blockchain node processes the data authorization transaction request and associates the data in the data authorization transaction request with the data to be authorized and stores them in the blockchain.
2. The method according to claim 1, characterized in that Before generating a data storage transaction request based on the off-chain storage identifier, the account information of the data provider and the query key, the method further includes: Extracting fingerprint information of the data to be stored to obtain fingerprint data; Accordingly, based on the off-chain storage identifier and the account information of the data provider, a data storage transaction request is generated, including: A data storage transaction request is generated based on the off-chain storage identifier, the account information of the data provider and the fingerprint data.
3. The method according to any one of claims 1 to 2, characterized in that: The method further comprises: When the authorization request instruction triggered by the authorization applicant is detected, an authorization application transaction request is generated based on the account information of the authorization applicant and the account information of the data provider of the data to be authorized and transmitted to the blockchain network, so that the blockchain node processes the authorization application transaction request and sends the account information of the authorization applicant to the data provider of the data to be authorized.
4. The method according to claim 3, characterized in that Before generating an authorization application transaction request based on the account information of the authorization applicant and the account information of the data provider of the data to be authorized and transmitting it to the blockchain network, the method further includes: When a data query request generated by the authorization applicant is detected, a data query transaction request is generated based on the query identifier of the data to be authorized and transmitted to the blockchain network, so that the blockchain node processes the data query transaction request, obtains the account information of the data provider of the data to be authorized, and feeds back to the authorization applicant.
5. The method according to claim 4, characterized in that Generate a data query transaction request based on the query identifier of the data to be authorized and transmit it to the blockchain network, and also include: Generate a data query transaction request based on the query identifier of the data to be authorized and transmit it to the blockchain network, so that the blockchain node processes the data query transaction request, obtains and feeds back the storage-related information of the data to be authorized; wherein the storage-related information includes the off-chain storage identifier of the data to be authorized and the query key corresponding to the authorization applicant provided by the data provider; Searching for the data to be authorized in an off-chain storage network based on the off-chain storage identifier of the data to be authorized; Decrypt the obtained query key using the account private key of the authorization applicant to obtain the storage key of the data to be authorized; The acquired data to be authorized is decrypted based on the obtained storage key.
6. The method according to claim 5, characterized in that The storage association information also includes fingerprint data of the data to be authorized; Correspondingly, after decrypting the acquired data to be authorized based on the obtained storage key, the method further includes: Extracting fingerprint data of the data to be authorized, and verifying the correctness of the data to be authorized based on the extracted fingerprint data and the acquired fingerprint data.
7. A data evidence storage method, applied to a blockchain node, characterized in that: include: Receive a data storage transaction request sent by a data provider; The data storage transaction request includes an off-chain storage identifier corresponding to the data to be stored in the off-chain storage network, the account information of the data provider, and a query key corresponding to the data to be stored; Process the data storage transaction request, and store the data in the data storage transaction request on the chain; The query key is generated by encrypting a storage key based on the account information of the data provider, and the storage key is used to encrypt the data to be stored in the off-chain storage network; Receiving a data authorization transaction request sent by the data provider; the data authorization transaction request includes the account information of the authorization applicant and a storage key provided by the data provider and encrypted based on the account information of the authorization applicant; Process the data authorization transaction request, and associate the data in the data authorization transaction request with the data to be authorized and store them in the blockchain.
8. The method according to claim 7, characterized in that The data storage transaction request also includes fingerprint data of the data to be stored, and the fingerprint data is obtained by the data provider extracting fingerprint information of the data to be stored.
9. The method according to any one of claims 7-8, characterized in that: The method further comprises: Receiving an authorization application transaction request sent by the authorization applicant, wherein the authorization application transaction request includes the account information of the authorization applicant and the account information of the data provider; The authorization application transaction request is processed to send the account information of the authorization applicant to the data provider corresponding to the data to be authorized.
10. The method according to claim 9, characterized in that Before receiving the authorization application transaction request sent by the authorization applicant, the method further includes: Receiving a data query transaction request sent by the authorization applicant, wherein the data query transaction request includes a query identifier of the data to be authorized; The data query transaction request is processed to obtain and feed back account information of a data provider corresponding to the data to be authorized according to a query identifier of the data to be authorized.
11. The method according to claim 10, characterized in that Processing the data query transaction request also includes: Processing the data query transaction request to obtain storage-related information of the data to be authorized; wherein the storage-related information includes the off-chain storage identifier and a storage key encrypted based on the account information of the authorization applicant; The storage association information of the data to be authorized is fed back to the authorization applicant, so that the authorization applicant searches for the encrypted data to be authorized in the off-chain storage network based on the off-chain storage identifier, and decrypts the acquired data to be authorized based on the storage key in the storage association information.
12. The method according to claim 11, characterized in that The storage association information also includes fingerprint data of the data to be authorized; Correspondingly, feeding back the storage association information of the data to be authorized to the authorization applicant also includes: The fingerprint data is fed back to the authorization applicant so that the authorization applicant extracts the fingerprint data of the data to be authorized, and verifies the correctness of the data to be authorized based on the fingerprint data of the data to be authorized and the fingerprint data in the storage association information.
13. A data evidence storage device, configured at a client, characterized in that: include: The off-chain storage module is used to encrypt the data to be stored using the storage key when a data storage instruction triggered by the data provider is detected, and upload the encrypted data to be stored to the off-chain storage network to obtain the off-chain storage identifier of the data to be stored; A query key generation module, used to encrypt the storage key based on the account information of the data provider to generate a query key; A data storage request generation module, used to generate a data storage transaction request based on the off-chain storage identifier, the account information of the data provider and the query key, and transmit it to the blockchain network, so that the blockchain node processes the data storage transaction request and stores the data in the data storage transaction request on the blockchain; An applicant account acquisition module is used to acquire the account information of the authorization applicant of the data to be authorized when a data authorization instruction triggered by the data provider is detected; A storage key acquisition module is used to obtain a query key of the data to be authorized from the blockchain, and decrypt the query key of the data to be authorized based on the account private key of the data provider to obtain the storage key of the data to be authorized; A storage key encryption module, used to re-encrypt the storage key of the data to be authorized based on the account information of the authorization applicant; The data authorization request generation module is used to generate a data authorization transaction request based on the re-encrypted storage key and the account information of the authorization applicant and transmit it to the blockchain network, so that the blockchain node processes the data authorization transaction request and associates the data in the data authorization transaction request with the data to be authorized and stores them in the blockchain.
14. A data evidence storage device, configured in a blockchain node, characterized in that: include: A data storage request receiving module, used to receive a data storage transaction request sent by a data provider; The data storage transaction request includes an off-chain storage identifier corresponding to the data to be stored in the off-chain storage network, the account information of the data provider, and a query key corresponding to the data to be stored; A data storage request processing module, used to process the data storage transaction request and store the data in the data storage transaction request on the chain; The query key is generated by encrypting a storage key based on the account information of the data provider, and the storage key is used to encrypt the data to be stored in the off-chain storage network; A data authorization request receiving module, configured to receive a data authorization transaction request sent by the data provider; the data authorization transaction request includes the account information of the authorization applicant and a storage key provided by the data provider and encrypted based on the account information of the authorization applicant; The data authorization request processing module is used to process the data authorization transaction request and associate the data in the data authorization transaction request with the data to be authorized and store them in the blockchain.
15. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions to be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a data storage method as described in any one of claims 1-6.
16. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions to be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a data storage method as described in any one of claims 7-12.
17. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to enable the computer to execute a data storage method as described in any one of claims 1-6.
18. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to enable the computer to execute a data storage method as described in any one of claims 7-12.
Citation Information
Patent Citations
Data access method, system and device
CN106991334A
Block chain based key storage, updating method, apparatus, apparatus and medium
CN109345242A